stdlib/lang/bolt.bolt: Mock a macro that generates the Bolt AST
This commit is contained in:
parent
d72301fa07
commit
3a7c65025f
1 changed files with 28 additions and 24 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue