stdlib/lang/bolt.bolt: Mock a macro that generates the Bolt AST

This commit is contained in:
Sam Vervaeck 2020-05-25 22:46:22 +02:00
parent d72301fa07
commit 3a7c65025f

View file

@ -19,31 +19,35 @@ mod Bolt::Lang {
end: Pos,
}
pub struct Identifier {
define_nodes! {
Identifier : Symbol {
text: String,
span: Option<Span>,
orig_node: Option<Node>,
parent: Option<Node>,
}
},
pub type Token
= Identifier
Statement,
pub struct ConditionalCase {
ReturnStatement : Statement {
expression: Option<Expression>,
},
ConditionalCase {
test: Option<Expression>,
result: Vec<FunctionBodyElement>,
}
},
pub struct ConditionalStatement {
ConditionalStatement : Statement {
cases: Vec<ConditionalCase>,
},
Expression,
ReferenceExpression : Expression {
modulePath: Option<ModulePath>,
name: Symbol,
}
pub type Statement
= ReturnStatement
| ConditionalStatement
pub type Expression
= ReferenceExpression
}
pub type Transformer = fn (node: Node) -> Node;