syntax: asm: highlight C-like comments#3696
Merged
JoeKar merged 1 commit intomicro-editor:masterfrom Mar 15, 2025
Merged
Conversation
Member
|
Then we should remove the following line too, or? Because these comments aren't any longer NASM compliant. |
Collaborator
Author
|
Indeed. Haven't noticed this comment. Although... this comment is about the overall syntax, not just about comments? |
Different assemblers have different syntaxes for comments: ";", "#", "!", "|", "@", "*" and finally C-like comments "//" and "/* ... */". Micro currently highlights only ";". This is causing various problems with broken highlighting with other types of comments (i.e. those not recognized by micro as comments), when the text in those comments contains special characters, causing wrong highlighting of text after them. On the other hand, highlighting comments like "#", "|" etc would cause conflicts with other syntax elements, e.g. constants in ARM assembly, preprocessor directives, arithmetic expressions etc. So let's highlight at least C-like comments. They are quite commonly used and they are not so likely to cause conflicts with other syntax elements.
f712cda to
ca81a2f
Compare
Member
Yep, it's about the overall rules inside this definition. |
JoeKar
approved these changes
Mar 15, 2025
theredcmdcraft
pushed a commit
to theredcmdcraft/micro
that referenced
this pull request
May 27, 2025
Different assemblers have different syntaxes for comments: ";", "#", "!", "|", "@", "*" and finally C-like comments "//" and "/* ... */". Micro currently highlights only ";". This is causing various problems with broken highlighting with other types of comments (i.e. those not recognized by micro as comments), when the text in those comments contains special characters, causing wrong highlighting of text after them. On the other hand, highlighting comments like "#", "|" etc would cause conflicts with other syntax elements, e.g. constants in ARM assembly, preprocessor directives, arithmetic expressions etc. So let's highlight at least C-like comments. They are quite commonly used and they are not so likely to cause conflicts with other syntax elements.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Different assemblers have different syntaxes for comments:
;,#,!,|,@,*and finally C-like comments//and/* ... */.Micro currently highlights only
;. This is causing various problems with broken highlighting with other types of comments (i.e. those not recognized by micro as comments), when the text in those comments contains special characters, causing wrong highlighting of text after them.On the other hand, highlighting comments like
#,|etc would cause conflicts with other syntax elements, e.g. constants in ARM assembly, preprocessor directives, arithmetic expressions etc.So let's highlight at least C-like comments. They are quite commonly used and they are not so likely to cause conflicts with other syntax elements.
See also discussion in #3694.