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

[XJStatementOrBlock] Greater-Equal-Condition in for-Loop #122

Open
Babwenbiber opened this issue Jul 20, 2021 · 4 comments
Open

[XJStatementOrBlock] Greater-Equal-Condition in for-Loop #122

Babwenbiber opened this issue Jul 20, 2021 · 4 comments

Comments

@Babwenbiber
Copy link

I have a rule:

JavaStatement returns AbstractStatement:
	{JavaStatement}
	(statement+=XJStatementOrBlock)+
;

When I parse e.g.:

for (int i = 0; i < y; i++) {
   x+=i;
}

Everything works perfectly.
However, if I change the comparison-symbol to <= it won't compile.

for (int i = 0; i <= y; i++) {
   x+=i;
}

Is this an error in the rules of jbase or my bad?

@LorenzoBettini
Copy link
Owner

it won't compile with what error?

@Babwenbiber
Copy link
Author

Multiple markers at this line

  • extraneous input 'y' expecting ';'
  • no viable alternative at input '<='

@LorenzoBettini
Copy link
Owner

Have you solved the problem or is it still an issue?

@Babwenbiber
Copy link
Author

Still an issue.

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

No branches or pull requests

2 participants