Add booleanLiteralExpression To Make Compiling Easier

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-03-06 08:01:41 -05:00
parent f778ee384e
commit 8ca03cdca5
3 changed files with 20 additions and 7 deletions
+2 -1
View File
@@ -88,7 +88,8 @@ export default grammar({
parserTransitionStatement: $ => seq($.transition, $.transitionSelectionExpression, $._semicolon),
// Expressions
expression: $ => choice($.identifier, $.integer, $.true, $.false, $.string_literal), // Very limited.
expression: $ => choice($.identifier, $.integer, $.booleanLiteralExpression, $.string_literal), // Very limited.
booleanLiteralExpression: $ => choice($.true, $.false),
selectExpression: $ => seq($.select, '(', $.expression, ')', '{', $.selectBody, '}'), // TODO: Should be expression list and not just a single expression
transitionSelectionExpression: $ => choice($.identifier, $.selectExpression),
keysetExpression: $ => $.expression,
+10
View File
@@ -26,8 +26,10 @@ parser simple() {
(conditionalStatement
(if)
(expression
(booleanLiteralExpression
(true)
)
)
(statement
(blockStatement)
)
@@ -75,8 +77,10 @@ parser simple() {
(conditionalStatement
(if)
(expression
(booleanLiteralExpression
(true)
)
)
(statement
(blockStatement)
)
@@ -197,10 +201,12 @@ parser simple() {
(identifier)
(assignment)
(expression
(booleanLiteralExpression
(true)
)
)
)
)
(parserStatement
(conditionalStatement
(if)
@@ -217,6 +223,7 @@ parser simple() {
)
(assignment)
(expression
(booleanLiteralExpression
(false)
)
)
@@ -227,6 +234,7 @@ parser simple() {
)
)
)
)
(parserTransitionStatement
(transition)
(transitionSelectionExpression
@@ -278,10 +286,12 @@ parser simple() {
(identifier)
(assignment)
(expression
(booleanLiteralExpression
(true)
)
)
)
)
(parserStatement
(variableDeclaration
(typeRef
@@ -66,9 +66,11 @@ parser simple() {
(selectCase
(keysetExpression
(expression
(booleanLiteralExpression
(true)
)
)
)
(colon)
(identifier)
)