non / uxntal-mode

emacs major mode for the uxntal assembly language
Apache License 2.0
23 stars 3 forks source link

Incorrect comment isn't reflected by syntax colouring #1

Closed drawkula closed 2 years ago

drawkula commented 2 years ago

20220227-133604

Is it possible to make the syntax colouring notice the bad comment ending? Having no space before the closing ) is one of my most frequent errors I overlook because the syntax colours look perfectly plausible while the assembler sees the rest of the file as comment.

non commented 2 years ago

@drawkula This is a good question.

It is possible to get the bad comment rejected, but that change ends up rejecting good comments such as: (<newline> ... ) or ( ... <newline>) or ( ) etc.

I think maybe I'll try to make this a configuration option so people can choose which behavior they prefer. (In my case I get more annoyed by valid comments being rejected than invalid ones being accepted.)

non commented 2 years ago

@drawkula Please try the current version -- I've defaulted the comment highlighting to be stricter, but added a tal-mode:strict-comments custom setting to enable people to disable this behavior if it's incorrectly highlighting their code.