diff --git a/stdlib/lang/bolt.bolt b/stdlib/lang/bolt.bolt index d96f8a48e..be19b5cc9 100644 --- a/stdlib/lang/bolt.bolt +++ b/stdlib/lang/bolt.bolt @@ -19,32 +19,36 @@ mod Bolt::Lang { end: Pos, } - pub struct Identifier { - text: String, - span: Option, - orig_node: Option, - parent: Option, + define_nodes! { + + Identifier : Symbol { + text: String, + }, + + Statement, + + ReturnStatement : Statement { + expression: Option, + }, + + ConditionalCase { + test: Option, + result: Vec, + }, + + ConditionalStatement : Statement { + cases: Vec, + }, + + Expression, + + ReferenceExpression : Expression { + modulePath: Option, + name: Symbol, + } + } - pub type Token - = Identifier - - pub struct ConditionalCase { - test: Option, - result: Vec, - } - - pub struct ConditionalStatement { - cases: Vec, - } - - pub type Statement - = ReturnStatement - | ConditionalStatement - - pub type Expression - = ReferenceExpression - pub type Transformer = fn (node: Node) -> Node; fn build_predicate_from_pattern(pattern: Pattern) -> Expression {