derived/ast
Types
pub type FieldType {
NamedType(
name: String,
module: option.Option(String),
parameters: List(FieldType),
)
TupleType(elements: List(FieldType))
FunctionType(parameters: List(FieldType), return: FieldType)
VariableType(name: String)
}
Constructors
-
NamedType( name: String, module: option.Option(String), parameters: List(FieldType), )
-
TupleType(elements: List(FieldType))
-
-
VariableType(name: String)
pub type ParseError {
UnexpectedToken
IgnoredToken
}
Constructors
-
UnexpectedToken
Encountered an unexpected token while parsing a derived type
-
IgnoredToken
Encountered an unexpected token in a place where unknown tokens are expected (e.g. while parsing a function)
Values
pub fn parse(input: String) -> List(DerivedType)
Extract any custom types marked with !derived() from the input string including their docstrings.
All other syntaxes (including invalid syntaxes) are ignored