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), parserTransitionStatement: $ => seq($.transition, $.transitionSelectionExpression, $._semicolon),
// Expressions // 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 selectExpression: $ => seq($.select, '(', $.expression, ')', '{', $.selectBody, '}'), // TODO: Should be expression list and not just a single expression
transitionSelectionExpression: $ => choice($.identifier, $.selectExpression), transitionSelectionExpression: $ => choice($.identifier, $.selectExpression),
keysetExpression: $ => $.expression, keysetExpression: $ => $.expression,
+15 -5
View File
@@ -26,7 +26,9 @@ parser simple() {
(conditionalStatement (conditionalStatement
(if) (if)
(expression (expression
(true) (booleanLiteralExpression
(true)
)
) )
(statement (statement
(blockStatement) (blockStatement)
@@ -75,7 +77,9 @@ parser simple() {
(conditionalStatement (conditionalStatement
(if) (if)
(expression (expression
(true) (booleanLiteralExpression
(true)
)
) )
(statement (statement
(blockStatement) (blockStatement)
@@ -197,7 +201,9 @@ parser simple() {
(identifier) (identifier)
(assignment) (assignment)
(expression (expression
(true) (booleanLiteralExpression
(true)
)
) )
) )
) )
@@ -217,7 +223,9 @@ parser simple() {
) )
(assignment) (assignment)
(expression (expression
(false) (booleanLiteralExpression
(false)
)
) )
) )
) )
@@ -278,7 +286,9 @@ parser simple() {
(identifier) (identifier)
(assignment) (assignment)
(expression (expression
(true) (booleanLiteralExpression
(true)
)
) )
) )
) )
+3 -1
View File
@@ -66,7 +66,9 @@ parser simple() {
(selectCase (selectCase
(keysetExpression (keysetExpression
(expression (expression
(true) (booleanLiteralExpression
(true)
)
) )
) )
(colon) (colon)