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

Add new LCGS parser with better parse errors #226

Merged
merged 18 commits into from
Oct 2, 2023
Merged

Conversation

NicEastvillage
Copy link
Contributor

This PR adds a new LCGS parser. Instead of using pom it is now a handmade lexer and recursive-descent parser. This PR is the second step towards #42, #104, and #190.

This PR includes:

  • AST nodes for LCGS programs
  • Adds parsing of LCGS to new AST nodes
  • Testing of new LCGS parser

This PR does NOT replace/remove the old LCGS parser. The old LCGS parser that uses pom is still in use for now as the semantic analysis of IntermediateLCGS (the symbol checking and relabeling) still uses the old AST. This will change in the next PR on this topic.

@NicEastvillage NicEastvillage added enhancement New feature or request refactoring Rewriting or restructuring of existing features labels Sep 26, 2023
Copy link
Member

@falkecarlsen falkecarlsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

When migrating to new parser we should be aware if we are backwards-compat. If we are, then only minor-version needs to be bumped, otherwise another major bump required.

cgaal-engine/src/parsing/parser.rs Show resolved Hide resolved
cgaal-engine/src/parsing/parser.rs Outdated Show resolved Hide resolved
Copy link
Member

@falkecarlsen falkecarlsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@falkecarlsen falkecarlsen merged commit 30eab54 into main Oct 2, 2023
10 checks passed
@falkecarlsen falkecarlsen deleted the lcgs-parser branch October 2, 2023 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactoring Rewriting or restructuring of existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants