Merge pull request #882 from quantified-uncertainty/issue-872

fixes #872
This commit is contained in:
Ozzie Gooen 2022-07-25 12:10:36 -07:00 committed by GitHub
commit fb0aa72aac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,11 +46,11 @@ voidStatement
return h.nodeLetStatement(variable, value); } return h.nodeLetStatement(variable, value); }
letStatement letStatement
= variable:identifier _ assignmentOp _nl value:zeroOMoreArgumentsBlockOrExpression = variable:variable _ assignmentOp _nl value:zeroOMoreArgumentsBlockOrExpression
{ return h.nodeLetStatement(variable, value) } { return h.nodeLetStatement(variable, value) }
defunStatement defunStatement
= variable:identifier '(' _nl args:array_parameters _nl ')' _ assignmentOp _nl body:innerBlockOrExpression = variable:variable '(' _nl args:array_parameters _nl ')' _ assignmentOp _nl body:innerBlockOrExpression
{ var value = h.nodeLambda(args, body) { var value = h.nodeLambda(args, body)
return h.nodeLetStatement(variable, value) } return h.nodeLetStatement(variable, value) }
@ -144,11 +144,11 @@ chainFunctionCall
}, head)} }, head)}
chainedFunction chainedFunction
= fn:dollarIdentifier '(' _nl args:array_functionArguments _nl ')' = fn:variable '(' _nl args:array_functionArguments _nl ')'
{ return {fnName: fn.value, args: args}} { return {fnName: fn.value, args: args}}
/ fn:dollarIdentifier '(' _nl ')' / fn:variable '(' _nl ')'
{ return {fnName: fn.value, args: []}} { return {fnName: fn.value, args: []}}
/ fn:dollarIdentifier / fn:variable
{ return {fnName: fn.value, args: []}} { return {fnName: fn.value, args: []}}
// end of binary operators // end of binary operators
@ -192,13 +192,14 @@ basicLiteral
= string = string
/ number / number
/ boolean / boolean
/ dollarIdentifierWithModule / variable
/ dollarIdentifier
/ voidLiteral / voidLiteral
voidLiteral 'void' voidLiteral 'void'
= "()" {return h.nodeVoid();} = "()" {return h.nodeVoid();}
variable = dollarIdentifierWithModule / dollarIdentifier
dollarIdentifierWithModule 'identifier' dollarIdentifierWithModule 'identifier'
= head:$moduleIdentifier = head:$moduleIdentifier
tail:('.' _nl @$moduleIdentifier)* '.' _nl tail:('.' _nl @$moduleIdentifier)* '.' _nl