examples/custom_type
Types
pub type AstNode {
NodeIgnoredCode(it: IgnoredCode)
NodeXCustomType(it: XCustomType)
}
Constructors
-
NodeIgnoredCode(it: IgnoredCode)
-
NodeXCustomType(it: XCustomType)
pub type IgnoredCode {
IgnoredCode(content: String)
}
Constructors
-
IgnoredCode(content: String)
pub type RecordConstructor {
RecordConstructor(
name: String,
arguments: List(RecordConstructorArg),
)
}
Constructors
-
RecordConstructor( name: String, arguments: List(RecordConstructorArg), )
pub type RecordConstructorArg {
RecordConstructorArg(label: String, ast: TypeAst)
}
Constructors
-
RecordConstructorArg(label: String, ast: TypeAst)
pub type TypeAst {
Constructor(
module: Option(String),
name: String,
arguments: List(TypeAst),
)
Fn(arguments: List(TypeAst), return_: TypeAst)
Var(name: String)
Tuple(elems: List(TypeAst))
Hole(name: String)
}
Constructors
-
Constructor( module: Option(String), name: String, arguments: List(TypeAst), )
-
Fn(arguments: List(TypeAst), return_: TypeAst)
-
Var(name: String)
-
Tuple(elems: List(TypeAst))
-
Hole(name: String)
pub type XCustomType {
XCustomType(
name: String,
constructors: List(RecordConstructor),
parameters: List(String),
)
}
Constructors
-
XCustomType( name: String, constructors: List(RecordConstructor), parameters: List(String), )
Functions
pub fn ast_parser() -> fn(Stream(String)) ->
Result(ParseSuccess(String, List(AstNode)), ParseError(String))
pub fn filter_custom_types(ast: List(AstNode)) -> List(
XCustomType,
)
pub fn record_constructor_argument_parser() -> fn(Stream(String)) ->
Result(
ParseSuccess(String, RecordConstructorArg),
ParseError(String),
)
pub fn record_constructor_parser() -> fn(Stream(String)) ->
Result(
ParseSuccess(String, RecordConstructor),
ParseError(String),
)