diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-03-11 21:50:13 -0300 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2008-07-02 19:06:21 -0300 |
commit | 3468f9f2cb65294771e1095a14b7263ae0a6a043 (patch) | |
tree | 67614f274b68b36a9d5c1ee202211aac6941255c /lisp/modules/progmodes | |
parent | 371c42ab955357d586cf4501762f6e9cf1be53b8 (diff) |
Update syntax highlight table and some minor tweaks including:
o Don't cause an warning due to an unused variable after macro expansion
in some indentation tables.
o Properly handle c++ style comments in preprocessor lines. Also highlight
strings and character constants.
o Change color of "quote" property in lisp mode. This is mainly due to
an undesirable side effect of using the same XrmQuark in different
syntax highlight definitions, causing the first one to be used, and
later defined ones to be ignored.
Diffstat (limited to 'lisp/modules/progmodes')
-rw-r--r-- | lisp/modules/progmodes/c.lsp | 24 | ||||
-rw-r--r-- | lisp/modules/progmodes/lisp.lsp | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/lisp/modules/progmodes/c.lsp b/lisp/modules/progmodes/c.lsp index e49630e..fba6b99 100644 --- a/lisp/modules/progmodes/c.lsp +++ b/lisp/modules/progmodes/c.lsp @@ -1099,9 +1099,33 @@ ;; Preprocessor includes comments. (syntoken "/*" :nospec t :begin :comment :contained t) + ;; Ignore strings and constants in the same line and finishes table + ;; This is kind hackish, but must be done because the current parser + ;; will not flag eol. Maybe it could be extended to properly handle + ;; and have an internal flag to tell it to pass again if there + ;; is a regex that can match eol on an empty string. + ;; A test is already done (but at compile time) to not allow patterns + ;; that match an empty string (but allow patterns matching + ;; bol, eol or both on an empty string). + (syntoken "\"([^\\\"]|\\\\.)*\"$" :property *prop-string* :switch -1) + (syntoken "'([^']|\\\\.)*'$" :property *prop-constant* :switch -1) + + ;; Ignore strings and constants in the same line + (syntoken "\"([^\\\"]|\\\\.)*\"" :property *prop-string*) + (syntoken "'([^']|\\\\.)*'" :property *prop-constant*) + ;; Ignore lines finishing with a backslash. (syntoken "\\\\$") + ;; multiline strings + (syntoken "\"" :nospec t :begin :string) + + ;; multiline constants + (syntoken "'" :nospec t :begin :character) + + ;; C++ style comments + (syntoken "//.*$" :property *prop-comment* :switch -1) + ;; Return to previous state if end of line found. (syntoken ".?$" :switch -1) ) diff --git a/lisp/modules/progmodes/lisp.lsp b/lisp/modules/progmodes/lisp.lsp index c15352b..2472b72 100644 --- a/lisp/modules/progmodes/lisp.lsp +++ b/lisp/modules/progmodes/lisp.lsp @@ -43,7 +43,7 @@ (defsynprop *prop-quote* "quote" :font "*courier-bold-r*-12-*" - :foreground "Red3" + :foreground "Red4" ) (defsynprop *prop-package* |