-
Notifications
You must be signed in to change notification settings - Fork 20
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
[IDE] - Highlighting is broken #28
Comments
Yeah this issue is very annoying. I've tried fixing it once and was unable to come up with a solution without breaking the language flex. It has something to do with the |
For the record, the file is in |
These issues are ironically not issues with any of the java code, they are issues with my lexical generator and language rules - _NASMLexer.flex and NASM.bnf respectively. These two files are used to generate the lexer and parser for the language, which is what intellij uses to organize symbols and highlight code. I am quite incompetent when it comes to writing JFlex and BNF rules, so any help from someone with a better brain than mine would be appreciated! |
Ah I see. I did some stuff with lexical analysis in the past. Let me see what I can figure out. |
I really appreciate it! I have updated much of the bnf a jflex today. Your |
This might be interesting to have a look at: rouge-ruby/rouge#1428 |
As far as I can see, the following in the
We need to consider whether we should write a more complicated flex that will define the followed register type that is allowed (e.g. We should decide whether we want the token type checking to be done in a wrapper class or in the flex file. Both bring advantages, but I feel like it might be easier if we write a wrapper class, as it could reduce the amount of duplicate code when adding autocomplete. This would also make the macro problem in the aforementioned less of a pain as we can just get the defined macros or write a separate pre-processor for the macros which generates a list of possible names. This then in turn could be shared for autocomplete. |
Ignoring case is something I partially do in the regular expression tokens, completely ignoring case shouldn't be too hard to complete. Yes there are still a handful of instructions that I have not currently defined which I need to eventually add. I have sort of just been adding instruction sets as I use them in my own personal projects. The biggest problem I have had so far is writing this plugin so that macro calls can be identified by the lexer so that we can highlight said macros, otherwise everything can just be treated as plain identifier. I sort of already follow the approach that rouge-ruby and chroma take by allowing plain identifiers to be used in place of instructions that aren't already matched as a |
Okay, found this other link with all instructions currently supported by nasm, could be interesting as well: https://www.nasm.us/xdoc/2.14rc3/nasmdoc.pdf |
The highlighting of logical blocks seems a bit weird, take a look at the attached screenshot:
The text was updated successfully, but these errors were encountered: