Grammar
→ HeaderDecl* Declaration* EOF
→ ImportDecl | ExportDecl
Used by Program
→ "import" ImportPath ";"
Used by HeaderDecl
→ "export" ImportPath ";"
Used by HeaderDecl
→ PathRoot "::" ImportTree
Used by ImportDeclExportDecl
→ "root" | "std" | "self" | "super" | IDENTIFIER
Used by ImportPath
Used by ImportPath
→ IDENTIFIER ( "as" IDENTIFIER )?
Used by ImportTree
→ "let" IDENTIFIER ( ":" Type )? "=" Expression ";"
Used by Declaration
→ "var" IDENTIFIER ( ":" Type )? "=" Expression ";"
Used by DeclarationForInit
→ NativeBinding? "public"? "fun" IDENTIFIER GenericParams? "(" Params? ")" ( "->" Type )? WhereClause? ( Block | ";" )
Used by DeclarationExtendBlock
→ "native" "(" "@" IDENTIFIER ( "." IDENTIFIER )* ")"
Used by FunDeclaration
→ "public"? "struct" IDENTIFIER GenericParams? WhereClause? "{" StructFields "}"
Used by Declaration
→ "public"? "enum" IDENTIFIER GenericParams? WhereClause? "{" EnumVariants "}"
Used by Declaration
→ "extend" GenericParams? Type ( ":" ExtendAspectList )? WhereClause? ( "{" ( FunDeclaration | AssocTypeDef )* "}" | ";" )
Used by Declaration
→ "public"? "aspect" IDENTIFIER GenericParams? ( "{" ( AssocTypeDecl | AspectMethod )* "}" | ";" )
Used by Declaration
Used by AspectDeclaration
Used by ExtendBlock
→ "type" IDENTIFIER ( "=" Type )? ";"
Used by ExtendBlock
→ "type" IDENTIFIER ( ":" BoundList )? ";"
Used by AspectDeclaration
→ "self" | "&self" | "&var self" | IDENTIFIER ( ":" Type )?
Used by Params
→ StructField ( "," StructField )* ","?
Used by StructDeclarationEnumVariant
→ "public"? IDENTIFIER ":" Type
Used by StructFields
→ EnumVariant ( "," EnumVariant )* ","?
Used by EnumDeclaration
→ IDENTIFIER ( "{" StructFields "}" )?
Used by EnumVariants
→ "<" GenericParam ( "," GenericParam )* ">"
→ IDENTIFIER ( ":" BoundList )?
Used by GenericParams
→ "!"? BoundHead
Used by ExtendAspectListBoundList
Used by Bound
→ "where" WhereConstraint ( "," WhereConstraint )*
→ IDENTIFIER ":" BoundList
Used by WhereClause
→ ExpressionStatement| Block| IfStatement| WhileStatement| ForStatement| LoopStatement| ReturnStatement| BreakStatement| ContinueStatement
Used by Declaration
→ Expression ";"
→ "{" Declaration* "}"
→ "if" "(" Expression ")" Block ( "else" ( IfStatement | Block ) )?
Used by Statement
→ "while" "(" Expression ")" Block
Used by Statement
→ "for" "(" ForInit Expression? ";" Expression? ")" Block| "for" "(" "let" IDENTIFIER "in" Expression ")" Block| "for" "(" "var" IDENTIFIER "in" Expression ")" Block
Used by Statement
→ VarDeclaration | ExpressionStatement | ";"
Used by ForStatement
→ "loop" Block
Used by Statement
→ "return" Expression? ";"
Used by Statement
→ "break" Expression? ";"
Used by Statement
→ "continue" ";"
Used by Statement
Used by Expression
→ IDENTIFIER | CallExpression "." IDENTIFIER | CallExpression "[" Expression "]"
Used by AssignmentExpression
→ "=" | "+=" | "-=" | "*=" | "/=" | "%="
Used by AssignmentExpression
→ LogicalAndExpression ( "||" LogicalAndExpression )*
Used by AssignmentExpression
→ ComparisonExpression ( "&&" ComparisonExpression )*
Used by LogicalOrExpression
→ TermExpression ( ( ">" | ">=" | "<" | "<=" | "!=" | "==" ) TermExpression )?
Used by LogicalAndExpression
→ FactorExpression ( ( "+" | "-" ) FactorExpression )*
Used by ComparisonExpression
→ CastExpression ( ( "*" | "/" | "%" ) CastExpression )*
Used by TermExpression
→ AscribeExpression ( "as" Type )*
Used by FactorExpression
→ UnaryExpression ( ":" Type )?
Used by CastExpression
→ ( "!" | "-" | "*" | "&" | "&var" ) UnaryExpression | PostfixExpression
Used by AscribeExpression
→ PrimaryExpression ( "(" Arguments? ")" | "." IDENTIFIER | "[" Expression "]" | "?" )*
Used by UnaryExpression
→ Expression ( "," Expression )* ","?
Used by PostfixExpression
→ INT | FLOAT | STRING | "true" | "false" | "None" | "()"| "(" Expression ( "," Expression )+ ")"| "(" Expression ")"| "[" ( Expression ( "," Expression )* ","? )? "]"| "[" Expression ";" INT "]"| Path| StructLiteral| MatchExpression| IfExpression| LoopExpression| ClosureExpression
Used by PostfixExpression
→ ( "root" | "std" | "self" | "super" | IDENTIFIER ) ( "::" IDENTIFIER )*
Used by PrimaryExpressionStructLiteral
Used by PrimaryExpression
→ IDENTIFIER ( ":" Expression )?
Used by StructLiteral
→ "match" Expression "{" MatchArm ( "," MatchArm )* ","? "}"
Used by PrimaryExpression
→ Pattern ( "if" Expression )? "=>" Expression
Used by MatchExpression
→ "if" "(" Expression ")" Block "else" Block
Used by PrimaryExpression
→ "loop" Block
Used by PrimaryExpression
Used by PrimaryExpression
→ "_"| "None"| IDENTIFIER| "(" Pattern ( "," Pattern )* ")"| IDENTIFIER "::" IDENTIFIER ( "{" PatternFields "}" )?| INT | FLOAT | STRING | "true" | "false"
Used by MatchArm
→ IDENTIFIER ( "," IDENTIFIER )*
Used by Pattern