diff --git a/include/bolt/CST.hpp b/include/bolt/CST.hpp index 1589eff1c..c01a9c96e 100644 --- a/include/bolt/CST.hpp +++ b/include/bolt/CST.hpp @@ -88,104 +88,134 @@ public: }; enum class NodeKind { - VBar, - Equals, + + // Plain tokens + Assignment, + At, Colon, Comma, + CustomOperator, + DoKeyword, Dot, DotDot, - Tilde, - At, - DoKeyword, - LParen, - RParen, - LBracket, - RBracket, + Equals, + Identifier, + IdentifierAlt, LBrace, - RBrace, + LBracket, + LParen, RArrow, RArrowAlt, + RBrace, + RBracket, + RParen, + Tilde, + VBar, + WrappedOperator, + + // Keywords + ClassKeyword, + ElifKeyword, + ElseKeyword, + EnumKeyword, + ForeignKeyword, + IfKeyword, + InstanceKeyword, LetKeyword, + MatchKeyword, + ModKeyword, MutKeyword, PubKeyword, - ForeignKeyword, - TypeKeyword, ReturnKeyword, - ModKeyword, StructKeyword, - EnumKeyword, - ClassKeyword, - InstanceKeyword, - ElifKeyword, - IfKeyword, - ElseKeyword, - MatchKeyword, - Invalid, - EndOfFile, + TypeKeyword, + + // Virtual tokens BlockStart, BlockEnd, LineFoldEnd, - CustomOperator, - Assignment, + EndOfFile, + Invalid, + + // Literal tokens StringLiteral, IntegerLiteral, - Identifier, - IdentifierAlt, - WrappedOperator, + + // Annotations ExpressionAnnotation, TypeAssertAnnotation, + + // Constraint expressions TypeclassConstraintExpression, EqualityConstraintExpression, - RecordTypeExpressionField, + RecordTypeExpression, - QualifiedTypeExpression, - ReferenceTypeExpression, - ArrowTypeExpression, + + // Type expressions AppTypeExpression, - VarTypeExpression, + ArrowTypeExpression, NestedTypeExpression, + QualifiedTypeExpression, + RecordTypeExpressionField, + ReferenceTypeExpression, TupleTypeExpression, - BindPattern, - LiteralPattern, + VarTypeExpression, + RecordPatternField, - RecordPattern, + + // Patterns + BindPattern, + ListPattern, + LiteralPattern, NamedRecordPattern, NamedTuplePattern, - TuplePattern, NestedPattern, - ListPattern, - ReferenceExpression, + RecordPattern, + TuplePattern, + MatchCase, - MatchExpression, - BlockExpression, - MemberExpression, - TupleExpression, - NestedExpression, - LiteralExpression, - CallExpression, - InfixExpression, - PrefixExpression, RecordExpressionField, - RecordExpression, - ReturnExpression, - IfExpression, IfExpressionPart, + + // Expressions + BlockExpression, + CallExpression, + IfExpression, + InfixExpression, + LiteralExpression, + MatchExpression, + MemberExpression, + NestedExpression, + PrefixExpression, + RecordExpression, + ReferenceExpression, + ReturnExpression, + TupleExpression, + TypeAssert, Parameter, + + // Bodies of a let-declaration or function declaration LetBlockBody, LetExprBody, + + // Function declarations PrefixFunctionDeclaration, InfixFunctionDeclaration, SuffixFunctionDeclaration, NamedFunctionDeclaration, - VariableDeclaration, + RecordDeclarationField, - RecordDeclaration, - VariantDeclaration, TupleVariantDeclarationMember, RecordVariantDeclarationMember, + + // Other declarations ClassDeclaration, InstanceDeclaration, + RecordDeclaration, + VariableDeclaration, + VariantDeclaration, + SourceFile, };