From: Feng Li Date: Thu, 10 Apr 2014 13:56:28 +0000 (-0400) Subject: * lisp/progmodes/pascal.el (pascal-font-lock-keywords): Fix incorrect format X-Git-Tag: emacs-24.3.90~18 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=39764caa7f21822f8919e51b07394c00c2431b36;p=emacs.git * lisp/progmodes/pascal.el (pascal-font-lock-keywords): Fix incorrect format entry; use symbol boundaries to avoid mis-matches. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f37a67e5836..ad27e2fc8b4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2014-04-10 Feng Li (tiny change) + + * progmodes/pascal.el (pascal-font-lock-keywords): Fix incorrect format + entry; use symbol boundaries to avoid mis-matches. + 2014-04-10 Michael Albinus * net/tramp.el (tramp-file-name-handler) diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el index a6932953ab9..cedc2986eda 100644 --- a/lisp/progmodes/pascal.el +++ b/lisp/progmodes/pascal.el @@ -166,21 +166,19 @@ (3 font-lock-function-name-face)) ;; ("type" "const" "real" "integer" "char" "boolean" "var" ;; "record" "array" "file") - (,(concat "\\<\\(array\\|boolean\\|c\\(har\\|onst\\)\\|file\\|" - "integer\\|re\\(al\\|cord\\)\\|type\\|var\\)\\>") - font-lock-type-face) - ("\\<\\(label\\|external\\|forward\\)\\>" . font-lock-constant-face) - ("\\<\\([0-9]+\\)[ \t]*:" 1 font-lock-function-name-face) + (,(concat "\\_<\\(array\\|boolean\\|c\\(har\\|onst\\)\\|file\\|" + "integer\\|re\\(al\\|cord\\)\\|type\\|var\\)\\_>") + . font-lock-type-face) + ("\\_<\\(label\\|external\\|forward\\)\\_>" . font-lock-constant-face) + ("\\_<\\([0-9]+\\)[ \t]*:" 1 font-lock-function-name-face) ;; ("of" "to" "for" "if" "then" "else" "case" "while" ;; "do" "until" "and" "or" "not" "in" "with" "repeat" "begin" "end") - ,(concat "\\<\\(" + ,(concat "\\_<\\(" "and\\|begin\\|case\\|do\\|e\\(lse\\|nd\\)\\|for\\|i[fn]\\|" "not\\|o[fr]\\|repeat\\|t\\(hen\\|o\\)\\|until\\|w\\(hile\\|ith\\)" - "\\)\\>") - ("\\<\\(goto\\)\\>[ \t]*\\([0-9]+\\)?" - 1 font-lock-keyword-face) - ("\\<\\(goto\\)\\>[ \t]*\\([0-9]+\\)?" - 2 font-lock-keyword-face t)) + "\\)\\_>") + ("\\_<\\(goto\\)\\_>[ \t]*\\([0-9]+\\)?" + (1 font-lock-keyword-face) (2 font-lock-keyword-face t))) "Additional expressions to highlight in Pascal mode.") (defconst pascal--syntax-propertize diff --git a/test/indent/pascal.pas b/test/indent/pascal.pas index 4b3be7cf57c..0005b9561bf 100644 --- a/test/indent/pascal.pas +++ b/test/indent/pascal.pas @@ -29,6 +29,7 @@ by the GNU General Public License. } // Free-pascal style comment. var x:Char = 12 /* 45; // This /* does not start a comment. var x:Char = (/ 4); // This (/ does not start a comment. +var a_to_b : integer; // 'to' should not be highlighted program CRTDemo;