Mercurial > emacs
comparison lisp/progmodes/cc-fonts.el @ 80158:4c9d1aa65d34
Set of changes so that "obtrusive" syntactic elements in a C/C++/ObjC
preprocessor line (e.g. an unbalanced string quote or unmatched paren)
don't interact syntactically with stuff outside the CPP line.
(c-cpp-matchers): Make it put regexp parens around "error\\|warning".
author | Alan Mackenzie <acm@muc.de> |
---|---|
date | Tue, 19 Feb 2008 22:10:17 +0000 |
parents | a1342e6e097a |
children | 7aad137aaf4e f991f10f15ec |
comparison
equal
deleted
inserted
replaced
80157:e67a400370f5 | 80158:4c9d1aa65d34 |
---|---|
392 (nsws-depth (c-lang-const c-nonempty-syntactic-ws-depth))) | 392 (nsws-depth (c-lang-const c-nonempty-syntactic-ws-depth))) |
393 | 393 |
394 `(;; The stuff after #error and #warning is a message, so | 394 `(;; The stuff after #error and #warning is a message, so |
395 ;; fontify it as a string. | 395 ;; fontify it as a string. |
396 ,@(when (c-lang-const c-cpp-message-directives) | 396 ,@(when (c-lang-const c-cpp-message-directives) |
397 (let* ((re (c-make-keywords-re nil | 397 (let* ((re (c-make-keywords-re 'appendable ; nil |
398 (c-lang-const c-cpp-message-directives))) | 398 (c-lang-const c-cpp-message-directives))) |
399 (re-depth (regexp-opt-depth re))) | 399 (re-depth (regexp-opt-depth re))) |
400 `((,(concat noncontinued-line-end | 400 `((,(concat noncontinued-line-end |
401 (c-lang-const c-opt-cpp-prefix) | 401 (c-lang-const c-opt-cpp-prefix) |
402 re | 402 re |
403 "\\s +\\(.*\\)$") | 403 "\\s +\\(.*\\)$") |
404 ,(+ ncle-depth re-depth 1) font-lock-string-face)))) | 404 ,(+ ncle-depth re-depth 1) font-lock-string-face t)))) |
405 | 405 |
406 ;; Fontify filenames in #include <...> as strings. | 406 ;; Fontify filenames in #include <...> as strings. |
407 ,@(when (c-lang-const c-cpp-include-directives) | 407 ,@(when (c-lang-const c-cpp-include-directives) |
408 (let* ((re (c-make-keywords-re nil | 408 (let* ((re (c-make-keywords-re nil |
409 (c-lang-const c-cpp-include-directives))) | 409 (c-lang-const c-cpp-include-directives))) |