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

Finish If Statement Parsing #2380

Open
wants to merge 9 commits into
base: AST-Generation-2024
Choose a base branch
from

Conversation

FaresAtef1
Copy link

@FaresAtef1 FaresAtef1 commented Mar 1, 2024

This PR finalizes the tasks initiated in #2375. It addresses the remaining semicolon issues and incorporates additional fixes to the parser.

Modified Expressions

  • Unary Prefix
  • Binary

Testing

  • Add new if statement tests.
  • Create a new type cast method AST::Node::As.
  • Create a new header file for all the matchers.

To be done

  • Fix the infinite loop error in the binary expression.
  • Modify the matchers for for loop.
  • Use AST cast routine instead of dynamic_cast.
  • Handle the following cases:
for(i=0;i<3;i++)

{k+;}

fn(i , j+2 ;)

fn(i , j ;)

CompilerSource/parsing/parser.cpp Show resolved Hide resolved
CommandLine/emake-tests/Parsing/parser-test.cpp Outdated Show resolved Hide resolved
CommandLine/emake-tests/Parsing/parser-test.cpp Outdated Show resolved Hide resolved
CommandLine/emake-tests/Parsing/parser-test.cpp Outdated Show resolved Hide resolved
@FaresAtef1 FaresAtef1 marked this pull request as draft May 21, 2024 12:52
@FaresAtef1 FaresAtef1 marked this pull request as ready for review May 27, 2024 22:08
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.

None yet

2 participants