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

The syntax highlighting incorrectly highlights a as a regbank when it is actually a hexadecimal constant #6

Open
FlatAssembler opened this issue Jul 13, 2023 · 4 comments

Comments

@FlatAssembler
Copy link
Owner

The assembly code:

address 0
load s0, 0
load s0, a
regbank a

It is highlighted as follows:
slika
But it shouldn't be. The a in load s0, a is a hexadecimal constant, and it should be highlighted the same way 0 is.
Right now, I have no idea how to solve that.

@FlatAssembler
Copy link
Owner Author

I have started a StackExchange thread about this.

@FlatAssembler
Copy link
Owner Author

Here is the code that is always highlighting a as a flag:

if (/^N?[CZAB]$/i.test(

@FlatAssembler
Copy link
Owner Author

FlatAssembler commented Jul 17, 2023

There is a simple work-around for now: simply, when a is a hexadecimal constant, write 0a instead.

@FlatAssembler
Copy link
Owner Author

Perhaps I can add a global variable lastHighlightedToken and only highlight a and b as flags if lastHighlightedToken is equal to regbank. But that would not help me highlight c correctly, as in jump c the c is a hexadecimal constant, whereas in jump c, abort it is a flag. Whether c is a hexadecimal constant or a flag depends not only on what precedes it, but also what follows it.

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

1 participant