Fix some errors in AST specification
This commit is contained in:
parent
02e7cb5664
commit
0df11bdcc8
1 changed files with 12 additions and 7 deletions
|
@ -7,7 +7,7 @@ node ReturnStatement;
|
||||||
|
|
||||||
// Bolt language AST definitions
|
// Bolt language AST definitions
|
||||||
|
|
||||||
node BoltSyntax;
|
interface BoltSyntax;
|
||||||
|
|
||||||
node BoltToken > Token, BoltSyntax;
|
node BoltToken > Token, BoltSyntax;
|
||||||
|
|
||||||
|
@ -239,6 +239,10 @@ node BoltExpressionStatement > BoltStatement {
|
||||||
expression: BoltExpression,
|
expression: BoltExpression,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
node BoltLoopStatement > BoltStatement {
|
||||||
|
elements: Vec<BoltFunctionBodyElement>,
|
||||||
|
}
|
||||||
|
|
||||||
node BoltParameter > BoltSyntax {
|
node BoltParameter > BoltSyntax {
|
||||||
index: usize,
|
index: usize,
|
||||||
bindings: BoltPattern,
|
bindings: BoltPattern,
|
||||||
|
@ -289,7 +293,7 @@ node BoltPlainImportSymbol > BoltImportSymbol {
|
||||||
local: BoltSymbol,
|
local: BoltSymbol,
|
||||||
}
|
}
|
||||||
|
|
||||||
node BoltImportDirective > BoltSourceElement {
|
node BoltImportDirective > BoltSyntax, BoltSourceElement {
|
||||||
modifiers: BoltModifiers,
|
modifiers: BoltModifiers,
|
||||||
file: BoltStringLiteral,
|
file: BoltStringLiteral,
|
||||||
symbols: Option<Vec<BoltImportSymbol>>,
|
symbols: Option<Vec<BoltImportSymbol>>,
|
||||||
|
@ -297,7 +301,7 @@ node BoltImportDirective > BoltSourceElement {
|
||||||
|
|
||||||
node BoltExportSymbol > BoltSyntax;
|
node BoltExportSymbol > BoltSyntax;
|
||||||
|
|
||||||
node BoltPlainExportSymbol {
|
node BoltPlainExportSymbol > BoltExportSymbol {
|
||||||
local: BoltQualName,
|
local: BoltQualName,
|
||||||
remote: BoltSymbol,
|
remote: BoltSymbol,
|
||||||
}
|
}
|
||||||
|
@ -314,7 +318,7 @@ node BoltTraitDeclaration > BoltDeclarationLike, BoltTypeDeclaration {
|
||||||
typeParams: Option<Vec<BoltTypeParameter>>,
|
typeParams: Option<Vec<BoltTypeParameter>>,
|
||||||
name: BoltIdentifier,
|
name: BoltIdentifier,
|
||||||
typeBoundExpr: Option<BoltTypeExpression>,
|
typeBoundExpr: Option<BoltTypeExpression>,
|
||||||
elements: Option<Vec<BoltDeclaration>>,
|
elements: Option<Vec<BoltTraitOrImplElement>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
node BoltImplDeclaration > BoltTypeDeclaration, BoltDeclarationLike {
|
node BoltImplDeclaration > BoltTypeDeclaration, BoltDeclarationLike {
|
||||||
|
@ -322,7 +326,7 @@ node BoltImplDeclaration > BoltTypeDeclaration, BoltDeclarationLike {
|
||||||
typeParams: Option<Vec<BoltTypeParameter>>,
|
typeParams: Option<Vec<BoltTypeParameter>>,
|
||||||
name: BoltIdentifier,
|
name: BoltIdentifier,
|
||||||
traitTypeExpr: Option<BoltTypeExpression>,
|
traitTypeExpr: Option<BoltTypeExpression>,
|
||||||
elements: Vec<BoltDeclaration>,
|
elements: Vec<BoltTraitOrImplElement>,
|
||||||
}
|
}
|
||||||
|
|
||||||
node BoltTypeAliasDeclaration > BoltDeclarationLike, BoltTypeDeclaration, BoltTraitOrImplElement {
|
node BoltTypeAliasDeclaration > BoltDeclarationLike, BoltTypeDeclaration, BoltTraitOrImplElement {
|
||||||
|
@ -480,7 +484,7 @@ node JSCatchBlock > JSSyntax {
|
||||||
elements: Vec<JSSourceElement>,
|
elements: Vec<JSSourceElement>,
|
||||||
}
|
}
|
||||||
|
|
||||||
node JSTryCatchStatement > JSSyntax {
|
node JSTryCatchStatement > JSStatement {
|
||||||
tryBlock: Vec<JSSourceElement>,
|
tryBlock: Vec<JSSourceElement>,
|
||||||
catchBlock: Option<JSCatchBlock>,
|
catchBlock: Option<JSCatchBlock>,
|
||||||
finalBlock: Option<Vec<JSSourceElement>>,
|
finalBlock: Option<Vec<JSSourceElement>>,
|
||||||
|
@ -526,7 +530,8 @@ node JSImportAsBinding > JSImportBinding {
|
||||||
local: Option<JSIdentifier>,
|
local: Option<JSIdentifier>,
|
||||||
}
|
}
|
||||||
|
|
||||||
node JSImportDeclaration > JSDeclaration {
|
// By exception, we alloww 'import ..'-statements to appear in foreign function bodies
|
||||||
|
node JSImportDeclaration > JSDeclaration, JSFunctionBodyElement {
|
||||||
bindings: Vec<JSImportBinding>,
|
bindings: Vec<JSImportBinding>,
|
||||||
filename: JSString,
|
filename: JSString,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue