[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fixing a bug in pascal-mode
From: |
Feng Li |
Subject: |
Re: Fixing a bug in pascal-mode |
Date: |
Sun, 06 Apr 2014 20:40:50 +1000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (windows-nt) |
Feng Li <address@hidden> writes:
> Hi Emacs devs,
>
> I just fixed a small bug in pascal-mode. Here's the diff
>
> diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
> index a693295..4058826 100644
> --- a/lisp/progmodes/pascal.el
> +++ b/lisp/progmodes/pascal.el
> @@ -168,7 +168,7 @@
> ;; "record" "array" "file")
> (,(concat "\\<\\(array\\|boolean\\|c\\(har\\|onst\\)\\|file\\|"
> "integer\\|re\\(al\\|cord\\)\\|type\\|var\\)\\>")
> - font-lock-type-face)
> + . 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"
Another one, this fixes pascal variables that contain keywords
surrounded by '_' chars (eg. do_this):
diff --git a/lisp/progmodes/pascal.el b/lisp/progmodes/pascal.el
index 4058826..10b7619 100644
--- a/lisp/progmodes/pascal.el
+++ b/lisp/progmodes/pascal.el
@@ -166,20 +166,20 @@
(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\\)\\>")
+ (,(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)
+ ("\\_<\\(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]+\\)?"
+ "\\)\\_>")
+ ("\\_<\\(goto\\)\\_>[ \t]*\\([0-9]+\\)?"
1 font-lock-keyword-face)
- ("\\<\\(goto\\)\\>[ \t]*\\([0-9]+\\)?"
+ ("\\_<\\(goto\\)\\_>[ \t]*\\([0-9]+\\)?"
2 font-lock-keyword-face t))
"Additional expressions to highlight in Pascal mode.")
--
Feng Li