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

Erroneous ~ not highlighted #46

Open
ojwb opened this issue Dec 3, 2020 · 2 comments
Open

Erroneous ~ not highlighted #46

ojwb opened this issue Dec 3, 2020 · 2 comments
Labels

Comments

@ojwb
Copy link
Collaborator

ojwb commented Dec 3, 2020

Following on from #20...

The current state is better than before the fix for #20, but ~ now seems to be treated as an operator like +, etc but really it's more like ' as it can't be used in most expressions. I think it only works in PRINT and as the next token after STR$ (so A$=STR$~(12) and B$=STR$~12 work, but C$=STR$(~12) doesn't.)

Admittedly a minor issue, but ideally A=~B should show ~ in red.

@ojwb
Copy link
Collaborator Author

ojwb commented Jan 25, 2025

Similarly these are also currently treated as operators or symbols but aren't valid in general and it would be nicer to show them in red when misused:

  • ' is only valid in INPUT and PRINT.
  • # is only valid right after certain tokens - BGET#, BPUT#, CLOSE#, EOF#, EXT#, INPUT#, PRINT#, PTR#,
  • ; is only valid in INPUT, PRINT and VDU

ojwb added a commit that referenced this issue Jan 28, 2025
It's only valid in inline assembler (where it means immediate
addressing) and after a few keywords where it means file I/O.

See #46
@ojwb
Copy link
Collaborator Author

ojwb commented Jan 28, 2025

  • # is only valid right after certain tokens - BGET#, BPUT#, CLOSE#, EOF#, EXT#, INPUT#, PRINT#, PTR#,

I've pushed a fix for # handling so it's now coloured as a syntax error in places where it isn't valid.

We don't currently take account of the more restricted syntax of INPUT# and PRINT# but we don't try to handle the exact syntax of most BASIC commands either. Also INPUT# and PRINT# are relatively obscure and aren't likely to be useful with the bot because there's no disk or tape to read from/write to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants