Macaulay2 / M2-emacs

Macaulay2 emacs files
GNU General Public License v3.0
5 stars 3 forks source link

Use syntactic fontification for comments and strings #31

Closed d-torrance closed 2 years ago

d-torrance commented 2 years ago

Instead of using regular expressions and font-lock-keywords for syntax highlighting strings and comments, we use syntactic fontification. Syntax tables are already set up for comments and "-delimited strings, so the only thing to add support for is ///-delimited strings.

Note: For now, this will break syntax highlighting inside doc and TEST.

This may help with https://github.com/Macaulay2/M2-emacs/issues/64.

d-torrance commented 2 years ago

In response to https://github.com/Macaulay2/M2-emacs/issues/64, I removed the commits dealing with the ///-delimited strings. font-lock-mode will correctly highlight comments and "-delimited strings since the syntax tables are already set up for them, no font-lock-keywords regular expressions required. And ///-delimited strings will just be treated like everything else, so syntax highlighting in doc and TEST strings will work as expected.