]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/pascal.el (pascal-font-lock-keywords): Fix incorrect format
authorFeng Li <fengli@gmail.com>
Thu, 10 Apr 2014 13:56:28 +0000 (09:56 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 10 Apr 2014 13:56:28 +0000 (09:56 -0400)
entry; use symbol boundaries to avoid mis-matches.

lisp/ChangeLog
lisp/progmodes/pascal.el
test/indent/pascal.pas

index f37a67e583649658ca50c5186421f05ecdfbba78..ad27e2fc8b4212b1590a1eef1091aeaf0ef4c702 100644 (file)
@@ -1,3 +1,8 @@
+2014-04-10  Feng Li  <fengli@gmail.com>  (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  <michael.albinus@gmx.de>
 
        * net/tramp.el (tramp-file-name-handler)
index a6932953ab964974aa1eadfb5b788affb7cbeedc..cedc2986eda9f004b1b06eb8b7db9edfa13b8744 100644 (file)
      (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
index 4b3be7cf57c5a041a73eb1920e0260169d2e1a4b..0005b9561bf309ccee6fe5a326aace2c928f1b1b 100644 (file)
@@ -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;