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

Outputted code results in unintended keyword #1

Open
TommyROM opened this issue Jan 10, 2023 · 0 comments
Open

Outputted code results in unintended keyword #1

TommyROM opened this issue Jan 10, 2023 · 0 comments
Labels
bug Something isn't working new New report, not classified yet

Comments

@TommyROM
Copy link

Test Environment (required)

  • Eleven Version: 0.5.0

  • MEGA65 Platform: MEGA65

  • ROM Release: 920377

  • Core Commit: 93d55f0

Describe the bug
I'm having trouble with Eleven creating syntax errors in the outputted BASIC.
In Eleven the line looks like this:
'''if (x>w or x<1 or y>h or y<1) then x=w/2'''
However, Eleven is outputting the line with a syntax error that I couldn't figure out. This is the line:
'''if(n>gorn<1oro>horo<1)thenn=g/2
?syntax error in line 3'''
However, if in the outputted BASIC code (not within Eleven) I go in an add spaces between keywords and expressions it runs without any errors:
'''if (n>g or n<1 or o>h or o<1) then n=g/2'''
What I found was that BASIC was tokenizing the "go" in "n>gorn<1" creating the syntax error. To eliminate the error I had to (in Eleven) enclose each comparator (is that the right word?) with a < or > in parentheses so that the "go" would not be tokenized.

To be clear, the fix in Eleven was to change n>gorn<1 to (n>g)or(n<1)

To Reproduce
See above.

Expected behavior
I expected Eleven's output to not create a keyword where none is in the source code. It should not combine a variable (e.g., g) with an "or" statement resulting in a new "go" keyword where it wasn't intended.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
I posted this on Discord on 9-Jan-2023.

@TommyROM TommyROM added the new New report, not classified yet label Jan 10, 2023
@gurcei gurcei added the bug Something isn't working label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new New report, not classified yet
Projects
None yet
Development

No branches or pull requests

2 participants