Grammar
→ ( ImportDecl | ExportDecl )* Declaration* "EOF"
→ "import" ImportPath ";"
Used by Program
→ "export" ImportPath ";"
Used by Program
→ PathRoot "::" ImportTree
Used by ImportDeclExportDecl
→ "root"| "std"| "self"| "super"| IDENTIFIER
→ IDENTIFIER "as" IDENTIFIER| IDENTIFIER "::" ImportTree| "{" ImportItem ( "," ImportItem )* ","? "}"| "*"| IDENTIFIER
Used by ImportPath
→ IDENTIFIER ( "as" IDENTIFIER )?
Used by ImportTree
→ "public"? "type" IDENTIFIER GenericParams? ":=" Type ";"
Used by Declaration
→ "let" !"var" IDENTIFIER ( ":" Type )? ":=" Expression ";"
Used by DeclarationForInit
→ ( "let" "var" | "var" ) IDENTIFIER ( ":" Type )? ":=" Expression ";"
Used by DeclarationForInit
→ NativeBinding? "public"? "fun" IDENTIFIER GenericParams? "(" Params? ")" ( "->" Type )? WhereClause? ( Block | ";" )
Used by DeclarationExtendBlock
→ "native" "(" "@" NATIVE_PATH ")"
Used by FunDeclaration
→ "public"? "struct" IDENTIFIER GenericParams? WhereClause? "{" StructFields "}"
Used by Declaration
→ ( StructField "," )* StructField?
Used by StructDeclarationEnumVariant
→ "public"? IDENTIFIER ":" Type
Used by StructFields
→ "public"? "enum" IDENTIFIER GenericParams? WhereClause? "{" EnumVariants "}"
Used by Declaration
→ ( EnumVariant "," )* EnumVariant?
Used by EnumDeclaration
→ IDENTIFIER ( "{" StructFields "}" )?
Used by EnumVariants
→ "extend" GenericParams? Type ( ":" ExtendAspect ( "," ExtendAspect )* WhereClause? ";" | ( ":" ExtendAspect )? WhereClause? "{" ( AssocTypeDef | FunDeclaration )* "}" )
Used by Declaration
→ "!"? NamedType
Used by ExtendBlock
→ "type" IDENTIFIER ":=" Type ";"
Used by ExtendBlock
→ "public"? "aspect" IDENTIFIER GenericParams? ( ";" | "{" ( AssocTypeDecl | AspectMethod )* "}" )
Used by Declaration
→ "fun" IDENTIFIER GenericParams? "(" Params? ")" ( "->" Type )? ( Block | ";" )
Used by AspectDeclaration
→ "type" IDENTIFIER ( ":" BoundList )? ";"
Used by AspectDeclaration
Used by Params
→ "<" GenericParam ( "," GenericParam )* ">"
→ "record"? IDENTIFIER ( ":" BoundList )?
Used by GenericParams
→ "!"? BoundHead
Used by BoundList
Used by Bound
Used by BoundHead
→ IDENTIFIER ( ":" Type )?
Used by RowBound
→ AssocBinding| Type
Used by BoundHead
→ IDENTIFIER "=" Type
Used by BoundArg
→ "where" WhereConstraint ( "," WhereConstraint )*
→ "record"? IDENTIFIER ":" BoundList
Used by WhereClause
Used by Declaration
→ "{" BlockItem* Expression? "}"
Used by Block
→ ( IfExpression | MatchExpression | LoopExpression ) ";"? !"}"
Used by BlockItem
→ Expression ";"
→ "while" "(" Expression ")" Block
Used by Statement
→ "for" "(" ForInit Expression? ";" Expression? ")" Block
Used by Statement
Used by ForStatement
→ "for" "(" ( "let" "var"? | "var" )? IDENTIFIER "in" Expression ")" Block
Used by Statement
Used by Expression
→ "+="| "-="| "*="| "/="| "%="| ":="
Used by AssignmentExpression
→ LogicalAndExpression ( "||" LogicalAndExpression )*
Used by AssignmentExpression
→ ComparisonExpression ( "&&" ComparisonExpression )*
Used by LogicalOrExpression
→ RangeExpression ( ( "==" | "!=" | "<=" | ">=" | "<" | ">" ) RangeExpression )?
Used by LogicalAndExpression
→ TermExpression ( ( "..=" | ".." ) TermExpression )?
Used by ComparisonExpression
→ FactorExpression ( ( "+" | "-" ) FactorExpression )*
Used by RangeExpression
→ CastExpression ( ( "*" | "/" | "%" ) CastExpression )*
Used by TermExpression
→ AscribeExpression ( "as" Type )*
Used by FactorExpression
→ UnaryExpression ( ":" Type )?
Used by CastExpression
→ ( "!" | "-" | "*" | "&" "var"? ) UnaryExpression| PostfixExpression
→ PrimaryExpression ( "::<" TypeArgs ">" "(" Arguments? ")" | "(" Arguments? ")" | "." INT | "." IDENTIFIER "::<" TypeArgs ">" "(" Arguments? ")" | "." IDENTIFIER "(" Arguments? ")" | "." IDENTIFIER | "[" Expression "]" | "?" )*
Used by UnaryExpression
→ Expression ( "," Expression )* ","?
Used by PostfixExpression
→ SUFFIXED_FLOAT| FLOAT| SUFFIXED_INT| INT| STRING| CHAR| "true"| "false"| ClosureExpression| "()"| TupleOrParen| RepeatArray| ArrayLiteral| MatchExpression| IfExpression| LoopExpression| ReturnExpression| BreakExpression| ContinueExpression| RecordProjectionExpr| RecordLiteral| StructLiteral| PathExpr
Used by PostfixExpression
→ "return" Expression?
Used by PrimaryExpression
→ "break" Expression?
Used by PrimaryExpression
→ "continue"
Used by PrimaryExpression
→ "(" Expression ( "," Expression )+ ")"| "(" Expression ")"
Used by PrimaryExpressionMatchExpression
→ "[" Expression ";" INT "]"
Used by PrimaryExpression
→ "[" ( Expression ( "," Expression )* ","? )? "]"
Used by PrimaryExpression
→ "match" ( "()" | TupleOrParen ) "{" ( MatchArm ( "," MatchArm )* ","? )? "}"
Used by BlockExprStmtPrimaryExpression
→ Pattern ( "if" Expression )? "=>" ( Block | Expression )
Used by MatchExpression
→ "if" "(" Expression ")" ( Block | Expression ) ( "else" ( IfExpression | Block | Expression ) )?
Used by BlockExprStmtPrimaryExpression
→ "loop" Block
Used by BlockExprStmtPrimaryExpression
→ CaptureList? "once"? "var"? "|" Params? "|" ( "->" Type )? Block
Used by PrimaryExpression
→ "[" ( CaptureItem ( "," CaptureItem )* ","? )? "]"
Used by ClosureExpression
→ "&" "var" IDENTIFIER| "&" IDENTIFIER| IDENTIFIER "." "clone" "(" ")"| IDENTIFIER
Used by CaptureList
Used by PrimaryExpression
Used by PrimaryExpression
→ TypePath ".{" IDENTIFIER ( "," IDENTIFIER )* ","? "}"
Used by PrimaryExpression
→ IDENTIFIER ( "=" Expression )?
Used by StructLiteralRecordLiteral
→ PathRoot ( "::" IDENTIFIER )*
Used by PrimaryExpression
→ PathRoot ( "::" IDENTIFIER )*
Used by Pattern
→ "[" ArrayPatternBody "]"
Used by Pattern
→ ( Pattern ( "," Pattern )* ( "," RestPattern )? | RestPattern )?
Used by ArrayPattern
→ ".." IDENTIFIER
Used by ArrayPatternBody
→ ".."
Used by FieldPatternList
→ IDENTIFIER ( "," IDENTIFIER )* ( "," RecordRest )? ","?| RecordRest
Used by RecordPatternEnumPattern
→ "{" FieldPatternList "}"
Used by Pattern
→ IDENTIFIER "::" IDENTIFIER ( "{" FieldPatternList "}" )?| IDENTIFIER "{" FieldPatternList "}"
Used by Pattern
→ SUFFIXED_FLOAT| FLOAT| SUFFIXED_INT| INT| STRING| CHAR| "true"| "false"
Used by Pattern
→ FunType| MutReferenceType| ReferenceType| SizedArrayType| ArrayType| "()"| TupleType| RecordProjectionType| RecordType| ExtendsType| DynType| "!"| NamedType
→ "extends" NamedType
→ "dyn" NamedType
→ "{" ( RecordTypeField ( "," RecordTypeField )* ","? )? "}"
→ IDENTIFIER ":" Type
Used by RecordType
→ TypePath ".{" IDENTIFIER ( "," IDENTIFIER )* ","? "}"
→ FunTypeQualifier* "|" TypeList? "|" "->" Type
Used by Type
→ "once"| "var"
Used by FunType
→ "&" Type
Used by Type
→ "&" "var" Type
Used by Type
→ "[" Type ";" INT "]"
Used by Type
→ ( "()" | TupleType | RecordProjectionType | RecordType | ExtendsType | DynType | NamedType ) "[]"
Used by Type
Used by PostfixExpressionNamedType
Used by FunType