summaryrefslogtreecommitdiff
path: root/lisp/progmodes/icon.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-06-08 20:20:56 +0000
committerRichard M. Stallman <rms@gnu.org>1997-06-08 20:20:56 +0000
commitcd63e73b03973ecaacc18f291c5775a89eb9a090 (patch)
treef5f5f6f3666db432089e5f5c977cc4b2b98becbd /lisp/progmodes/icon.el
parent29e2b496f036ee5456fc32f849974febf38b9765 (diff)
downloademacs-cd63e73b03973ecaacc18f291c5775a89eb9a090.tar.gz
(icon-font-lock-keywords-2): Use regexp-opt for the regexps.
Diffstat (limited to 'lisp/progmodes/icon.el')
-rw-r--r--lisp/progmodes/icon.el81
1 files changed, 57 insertions, 24 deletions
diff --git a/lisp/progmodes/icon.el b/lisp/progmodes/icon.el
index dd81cb42bf5..fa0b9266bc0 100644
--- a/lisp/progmodes/icon.el
+++ b/lisp/progmodes/icon.el
@@ -627,33 +627,66 @@ Returns nil if line starts inside a string, t if in a comment."
(eval-when-compile
(list
;; Fontify all type specifiers.
- ;;"null" "string" "co-expression" "table" "integer" "cset" "set" "real" "file" "list"
- (cons "\\<\\(c\\(o-expression\\|set\\)\\|file\\|integer\\|list\\|null\\|real\\|s\\(et\\|tring\\)\\|table\\)\\>"'font-lock-type-face)
+ (cons
+ (concat
+ "\\<" (regexp-opt '("null" "string" "co-expression" "table" "integer"
+ "cset" "set" "real" "file" "list") t)
+ "\\>")
+ 'font-lock-type-face)
;; Fontify all keywords.
- ;;"break" "do" "next" "repeat" "to" "by" "else" "if" "not" "return" "until" "case" "of" "while" "create" "every" "suspend" "default" "fail" "record" "then"
- (cons "\\<\\(b\\(reak\\|y\\)\\|c\\(ase\\|reate\\)\\|d\\(efault\\|o\\)\\|e\\(lse\\|very\\)\\|fail\\|if\\|n\\(ext\\|ot\\)\\|of\\|re\\(cord\\|peat\\|turn\\)\\|suspend\\|t\\(hen\\|o\\)\\|until\\|while\\)\\>" 'font-lock-keyword-face)
+ ;;
+ (cons
+ (concat
+ "\\<"
+ (regexp-opt
+ '("break" "do" "next" "repeat" "to" "by" "else" "if" "not" "return"
+ "until" "case" "of" "while" "create" "every" "suspend" "default"
+ "fail" "record" "then") t)
+ "\\>")
+ 'font-lock-keyword-face)
;; "end" "initial"
- (cons (concat "\\<\\(end\\|initial\\)\\>") 'font-lock-builtin-face)
+ (cons (concat "\\<" (regexp-opt '("end" "initial") t) "\\>")
+ 'font-lock-builtin-face)
;; Fontify all system variables.
- ;;"&allocated" "&ascii" "&clock" "&col" "&collections" "&column" "&control" "&cset" "&current" "&date" "&dateline" "&digits" "&dump" "&error" "&errornumber" "&errortext" "&errorvalue" "&errout" "&eventcode" "&eventsource" "&eventvalue" "&fail" "&features" "&file" "&host" "&input" "&interval" "&lcase" "&ldrag" "&letters" "&level" "&line" "&lpress" "&lrelease" "&main" "&mdrag" "&meta" "&mpress" "&mrelease" "&null" "&output" "&phi" "&pi" "&pos" "&progname" "&random" "&rdrag" "&regions" "&resize" "&row" "&rpress" "&rrelease" "&shift" "&source" "&storage" "&subject" "&time" "&trace" "&ucase" "&version" "&window" "&x" "&y"
- (cons (concat "\\(&\\(a\\(llocated\\|scii\\)\\|c\\(lock\\|o\\(l\\(\\|lections\\|umn\\)\\|ntrol\\)\\|set\\|urrent\\)\\|d\\(ate\\(\\|line\\)\\|igits\\|ump\\)\\|e\\(rro\\(r\\(\\|number\\|text\\|value\\)\\|ut\\)\\|vent\\(code\\|source\\|value\\)\\)\\|f\\(ail\\|eatures\\|ile\\)\\|host\\|in\\(put\\|terval\\)\\|l\\(case\\|drag\\|e\\(tters\\|vel\\)\\|ine\\|press\\|release\\)\\|m\\(ain\\|drag\\|eta\\|press\\|release\\)\\|null\\|output\\|p\\(hi\\|i\\|os\\|rogname\\)\\|r\\(andom\\|drag\\|e\\(gions\\|size\\)\\|ow\\|press\\|release\\)\\|s\\(hift\\|ource\\|torage\\|ubject\\)\\|t\\(ime\\|race\\)\\|ucase\\|version\\|window\\|[exy]\\)\\)") 'font-lock-reference-face)
- ;; global local static declarations and link files
- (cons "^[ \t]*\\(global\\|link\\|local\\|static\\)\\(\\sw+\\>\\)*"
- '((1 font-lock-builtin-face)
- (font-lock-match-c-style-declaration-item-and-skip-to-next
- (goto-char (or (match-beginning 2) (match-end 1))) nil
- (1 (if (match-beginning 2)
- font-lock-function-name-face
- font-lock-variable-name-face)))))
- ;; $define $elif $ifdef $ifdef $ifndef
- (cons "^\\(\\$\\(define\\|elif\\|if\\(\\|def\\|ndef\\)\\|undef\\)\\)[ \t]+\\([^ \t\n]+\\)"
- '((1 font-lock-builtin-face) (4 font-lock-variable-name-face nil t)))
- ;; $dump $endif $else $include
- (cons "^\\(\\$\\(dump\\|e\\(lse\\|ndif\\)\\|include\\)\\)\\>" 'font-lock-builtin-face)
- ;; $warning $error
- (cons "^\\(\\$\\(warning\\|error\\)\\)[ \t]+\\([^\n]+\\)"
- '((1 font-lock-builtin-face) (3 font-lock-warning-face nil t)))
- )))
+ (cons
+ (regexp-opt
+ '("&allocated" "&ascii" "&clock" "&col" "&collections" "&column"
+ "&control" "&cset" "&current" "&date" "&dateline" "&digits" "&dump"
+ "&e" "&error" "&errornumber" "&errortext" "&errorvalue" "&errout"
+ "&eventcode" "&eventsource" "&eventvalue" "&fail" "&features"
+ "&file" "&host" "&input" "&interval" "&lcase" "&ldrag" "&letters"
+ "&level" "&line" "&lpress" "&lrelease" "&main" "&mdrag" "&meta"
+ "&mpress" "&mrelease" "&null" "&output" "&phi" "&pi" "&pos"
+ "&progname" "&random" "&rdrag" "&regions" "&resize" "&row"
+ "&rpress" "&rrelease" "&shift" "&source" "&storage" "&subject"
+ "&time" "&trace" "&ucase" "&version" "&window" "&x" "&y") t)
+ 'font-lock-reference-face)
+ (cons ;; global local static declarations and link files
+ (concat
+ "^[ \t]*"
+ (regexp-opt '("global" "link" "local" "static") t)
+ "\\(\\sw+\\>\\)*")
+ '((1 font-lock-builtin-face)
+ (font-lock-match-c-style-declaration-item-and-skip-to-next
+ (goto-char (or (match-beginning 2) (match-end 1))) nil
+ (1 (if (match-beginning 2)
+ font-lock-function-name-face
+ font-lock-variable-name-face)))))
+
+ (cons ;; $define $elif $ifdef $ifdef $ifndef
+ (concat
+ "^"
+ (regexp-opt'("$define" "$elif" "$ifdef" "$ifdef" "$ifndef" "$undef") t)
+ "[ \t]+\\([^ \t\n]+\\)")
+ '((1 font-lock-builtin-face)
+ (4 font-lock-variable-name-face nil t)))
+ (cons ;; $dump $endif $else $include
+ (concat
+ "^" (regexp-opt'("$dump" "$endif" "$else" "$include") t) "\\>" )
+ 'font-lock-builtin-face)
+ (cons ;; $warning $error
+ (concat "^" (regexp-opt '("$warning" "$error") t) "[ \t]+\\([^\n]+\\)")
+ '((1 font-lock-builtin-face) (3 font-lock-warning-face nil t))))))
"Gaudy level highlighting for `icon-mode'.")
(defvar icon-font-lock-keywords icon-font-lock-keywords-1