patchGNU nano - Patches: patch #10003, Improve asm syntax highlighting

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #10003: Improve asm syntax highlighting

Submitter:  easyaspi314 <easyaspi314>
Submitted:  Wed 16 Dec 2020 04:58:30 PM UTC
   
 
Priority:  3 - Low Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Release:  None

Sat 19 Dec 2020 04:06:06 PM UTC, comment #2: 

I found a few issues myself regarding CPP macros. I will try again at a later date.

And nothing is going to be perfect as there is no way to tell what assembly syntax this is.

This would be much easier with lookaheads.

easyaspi314 <easyaspi314>
Fri 18 Dec 2020 04:16:22 PM UTC, comment #1: 

Thanks for the patch.  But... the commit message is incomprehensible.  There seem to be two or three levels of bulleted lists.  If so, then please use different bullets for the different levels, and use a blank line between the top-evel items, because now I cannot make sense of it.  But maybe all these levels are just sloppy formatting?

Further, using 'white' as color is not a good idea -- what when the user has a light background?  I'm guessing you want to use 'normal' instead.

In /lib/firmware/usbdux/*.asm, I see that things like #REVCTL in "mov  dptr,#REVCTL" now get colored like a comment, which is not right.

Finally, the comments in asm.nanorc itself are too verbose.  They should be terse.

Benno Schulenberg <bens>
Group administrator
Wed 16 Dec 2020 04:58:30 PM UTC, original submission:  

- "Magic" comment detection detects most comment syntaxes while avoiding highlighting things where they shouldn't.
  - e.g. how # is a comment in x86 GAS but used before number literals in ARM assembly
  - The best we can do without knowing what syntax we are using (which is impossible without an IDE)
- Directives are highlighted better.
- Noisy metadata directives (debug, unwind info, etc) are cyan to separate them.
- Un-red commonly capitalized stuff like DWORD PTR or @PLT

This makes nano pretty damn good at highlighting GAS, and also decent at other syntaxes like RGBDS or NASM.

easyaspi314 <easyaspi314>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by easyaspi314 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-12-16 easyaspi314 Attached File- Added 0001-Improve-asm-syntax-highlighting.patch, #50490

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code