summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeng Li <fengli@gmail.com>2014-04-10 09:56:28 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2014-04-10 09:56:28 -0400
commit39764caa7f21822f8919e51b07394c00c2431b36 (patch)
treec000445a8d810470ebbc2ac7880989a54fdfec1e
parentbcbb83a92d3a65f0c724a043836a8c60aa09f57c (diff)
downloademacs-39764caa7f21822f8919e51b07394c00c2431b36.tar.gz
* lisp/progmodes/pascal.el (pascal-font-lock-keywords): Fix incorrect format
entry; use symbol boundaries to avoid mis-matches.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/pascal.el20
-rw-r--r--test/indent/pascal.pas1
3 files changed, 15 insertions, 11 deletions
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 <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)
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;