Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update grammar #39

Merged
merged 7 commits into from
Nov 1, 2023
Merged

Update grammar #39

merged 7 commits into from
Nov 1, 2023

Conversation

OsamaSBCrea
Copy link
Contributor

This PR updates the grammar to match the latest version of the ANTLR grammar in RAICode. The main reason to do it is to solve the issue of trailing commas/semicolons in expressions, for example

def output = {1, 2, }
def output = {1 ; 2 ; }

Here is a list of some introduced changes:

  • Remove OverrideExpression, RestrictExpression, LogicalExpression and SpecializeExpression, and define them implicitly within BasicExpression.
  • Rename LogicalParam to BasicParam
  • Rename FormalParam to Formal
  • Rename FormalParams to Formals
  • Rename FormalParamsBracket to FormalsBracket
  • Rename FormalParamsParen to FormalsParen
  • Rename JoinExpression to ProductExpression
  • Add IffXorExpression
  • Change UnionExpression and ProductExpression to handle trailing commas/semicolons

# Conflicts:
#	dist/index.cjs
#	dist/index.js
#	package-lock.json
#	package.json
#	src/parser.js
#	test/Identifiers.test.txt
@OsamaSBCrea OsamaSBCrea merged commit 9706a6f into main Nov 1, 2023
1 check passed
@OsamaSBCrea OsamaSBCrea deleted the of-update-grammar branch November 1, 2023 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants