Add booleanLiteralExpression To Make Compiling Easier
Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -26,8 +26,10 @@ parser simple() {
|
|||||||
(conditionalStatement
|
(conditionalStatement
|
||||||
(if)
|
(if)
|
||||||
(expression
|
(expression
|
||||||
|
(booleanLiteralExpression
|
||||||
(true)
|
(true)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
(statement
|
(statement
|
||||||
(blockStatement)
|
(blockStatement)
|
||||||
)
|
)
|
||||||
@@ -75,8 +77,10 @@ parser simple() {
|
|||||||
(conditionalStatement
|
(conditionalStatement
|
||||||
(if)
|
(if)
|
||||||
(expression
|
(expression
|
||||||
|
(booleanLiteralExpression
|
||||||
(true)
|
(true)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
(statement
|
(statement
|
||||||
(blockStatement)
|
(blockStatement)
|
||||||
)
|
)
|
||||||
@@ -197,10 +201,12 @@ parser simple() {
|
|||||||
(identifier)
|
(identifier)
|
||||||
(assignment)
|
(assignment)
|
||||||
(expression
|
(expression
|
||||||
|
(booleanLiteralExpression
|
||||||
(true)
|
(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
(parserStatement
|
(parserStatement
|
||||||
(conditionalStatement
|
(conditionalStatement
|
||||||
(if)
|
(if)
|
||||||
@@ -217,6 +223,7 @@ parser simple() {
|
|||||||
)
|
)
|
||||||
(assignment)
|
(assignment)
|
||||||
(expression
|
(expression
|
||||||
|
(booleanLiteralExpression
|
||||||
(false)
|
(false)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -227,6 +234,7 @@ parser simple() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
(parserTransitionStatement
|
(parserTransitionStatement
|
||||||
(transition)
|
(transition)
|
||||||
(transitionSelectionExpression
|
(transitionSelectionExpression
|
||||||
@@ -278,10 +286,12 @@ parser simple() {
|
|||||||
(identifier)
|
(identifier)
|
||||||
(assignment)
|
(assignment)
|
||||||
(expression
|
(expression
|
||||||
|
(booleanLiteralExpression
|
||||||
(true)
|
(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
(parserStatement
|
(parserStatement
|
||||||
(variableDeclaration
|
(variableDeclaration
|
||||||
(typeRef
|
(typeRef
|
||||||
|
|||||||
@@ -66,9 +66,11 @@ parser simple() {
|
|||||||
(selectCase
|
(selectCase
|
||||||
(keysetExpression
|
(keysetExpression
|
||||||
(expression
|
(expression
|
||||||
|
(booleanLiteralExpression
|
||||||
(true)
|
(true)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
)
|
||||||
(colon)
|
(colon)
|
||||||
(identifier)
|
(identifier)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user