diff options
| author | Richard M. Stallman | 1997-06-08 20:20:56 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-06-08 20:20:56 +0000 |
| commit | cd63e73b03973ecaacc18f291c5775a89eb9a090 (patch) | |
| tree | f5f5f6f3666db432089e5f5c977cc4b2b98becbd | |
| parent | 29e2b496f036ee5456fc32f849974febf38b9765 (diff) | |
| download | emacs-cd63e73b03973ecaacc18f291c5775a89eb9a090.tar.gz emacs-cd63e73b03973ecaacc18f291c5775a89eb9a090.zip | |
(icon-font-lock-keywords-2): Use regexp-opt for the regexps.
| -rw-r--r-- | lisp/progmodes/icon.el | 81 |
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." | |||
| 627 | (eval-when-compile | 627 | (eval-when-compile |
| 628 | (list | 628 | (list |
| 629 | ;; Fontify all type specifiers. | 629 | ;; Fontify all type specifiers. |
| 630 | ;;"null" "string" "co-expression" "table" "integer" "cset" "set" "real" "file" "list" | 630 | (cons |
| 631 | (cons "\\<\\(c\\(o-expression\\|set\\)\\|file\\|integer\\|list\\|null\\|real\\|s\\(et\\|tring\\)\\|table\\)\\>"'font-lock-type-face) | 631 | (concat |
| 632 | "\\<" (regexp-opt '("null" "string" "co-expression" "table" "integer" | ||
| 633 | "cset" "set" "real" "file" "list") t) | ||
| 634 | "\\>") | ||
| 635 | 'font-lock-type-face) | ||
| 632 | ;; Fontify all keywords. | 636 | ;; Fontify all keywords. |
| 633 | ;;"break" "do" "next" "repeat" "to" "by" "else" "if" "not" "return" "until" "case" "of" "while" "create" "every" "suspend" "default" "fail" "record" "then" | 637 | ;; |
| 634 | (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) | 638 | (cons |
| 639 | (concat | ||
| 640 | "\\<" | ||
| 641 | (regexp-opt | ||
| 642 | '("break" "do" "next" "repeat" "to" "by" "else" "if" "not" "return" | ||
| 643 | "until" "case" "of" "while" "create" "every" "suspend" "default" | ||
| 644 | "fail" "record" "then") t) | ||
| 645 | "\\>") | ||
| 646 | 'font-lock-keyword-face) | ||
| 635 | ;; "end" "initial" | 647 | ;; "end" "initial" |
| 636 | (cons (concat "\\<\\(end\\|initial\\)\\>") 'font-lock-builtin-face) | 648 | (cons (concat "\\<" (regexp-opt '("end" "initial") t) "\\>") |
| 649 | 'font-lock-builtin-face) | ||
| 637 | ;; Fontify all system variables. | 650 | ;; Fontify all system variables. |
| 638 | ;;"&allocated" "&ascii" "&clock" "&col" "&collections" "&column" "&control" "&cset" "¤t" "&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" "®ions" "&resize" "&row" "&rpress" "&rrelease" "&shift" "&source" "&storage" "&subject" "&time" "&trace" "&ucase" "&version" "&window" "&x" "&y" | 651 | (cons |
| 639 | (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) | 652 | (regexp-opt |
| 640 | ;; global local static declarations and link files | 653 | '("&allocated" "&ascii" "&clock" "&col" "&collections" "&column" |
| 641 | (cons "^[ \t]*\\(global\\|link\\|local\\|static\\)\\(\\sw+\\>\\)*" | 654 | "&control" "&cset" "¤t" "&date" "&dateline" "&digits" "&dump" |
| 642 | '((1 font-lock-builtin-face) | 655 | "&e" "&error" "&errornumber" "&errortext" "&errorvalue" "&errout" |
| 643 | (font-lock-match-c-style-declaration-item-and-skip-to-next | 656 | "&eventcode" "&eventsource" "&eventvalue" "&fail" "&features" |
| 644 | (goto-char (or (match-beginning 2) (match-end 1))) nil | 657 | "&file" "&host" "&input" "&interval" "&lcase" "&ldrag" "&letters" |
| 645 | (1 (if (match-beginning 2) | 658 | "&level" "&line" "&lpress" "&lrelease" "&main" "&mdrag" "&meta" |
| 646 | font-lock-function-name-face | 659 | "&mpress" "&mrelease" "&null" "&output" "&phi" "&pi" "&pos" |
| 647 | font-lock-variable-name-face))))) | 660 | "&progname" "&random" "&rdrag" "®ions" "&resize" "&row" |
| 648 | ;; $define $elif $ifdef $ifdef $ifndef | 661 | "&rpress" "&rrelease" "&shift" "&source" "&storage" "&subject" |
| 649 | (cons "^\\(\\$\\(define\\|elif\\|if\\(\\|def\\|ndef\\)\\|undef\\)\\)[ \t]+\\([^ \t\n]+\\)" | 662 | "&time" "&trace" "&ucase" "&version" "&window" "&x" "&y") t) |
| 650 | '((1 font-lock-builtin-face) (4 font-lock-variable-name-face nil t))) | 663 | 'font-lock-reference-face) |
| 651 | ;; $dump $endif $else $include | 664 | (cons ;; global local static declarations and link files |
| 652 | (cons "^\\(\\$\\(dump\\|e\\(lse\\|ndif\\)\\|include\\)\\)\\>" 'font-lock-builtin-face) | 665 | (concat |
| 653 | ;; $warning $error | 666 | "^[ \t]*" |
| 654 | (cons "^\\(\\$\\(warning\\|error\\)\\)[ \t]+\\([^\n]+\\)" | 667 | (regexp-opt '("global" "link" "local" "static") t) |
| 655 | '((1 font-lock-builtin-face) (3 font-lock-warning-face nil t))) | 668 | "\\(\\sw+\\>\\)*") |
| 656 | ))) | 669 | '((1 font-lock-builtin-face) |
| 670 | (font-lock-match-c-style-declaration-item-and-skip-to-next | ||
| 671 | (goto-char (or (match-beginning 2) (match-end 1))) nil | ||
| 672 | (1 (if (match-beginning 2) | ||
| 673 | font-lock-function-name-face | ||
| 674 | font-lock-variable-name-face))))) | ||
| 675 | |||
| 676 | (cons ;; $define $elif $ifdef $ifdef $ifndef | ||
| 677 | (concat | ||
| 678 | "^" | ||
| 679 | (regexp-opt'("$define" "$elif" "$ifdef" "$ifdef" "$ifndef" "$undef") t) | ||
| 680 | "[ \t]+\\([^ \t\n]+\\)") | ||
| 681 | '((1 font-lock-builtin-face) | ||
| 682 | (4 font-lock-variable-name-face nil t))) | ||
| 683 | (cons ;; $dump $endif $else $include | ||
| 684 | (concat | ||
| 685 | "^" (regexp-opt'("$dump" "$endif" "$else" "$include") t) "\\>" ) | ||
| 686 | 'font-lock-builtin-face) | ||
| 687 | (cons ;; $warning $error | ||
| 688 | (concat "^" (regexp-opt '("$warning" "$error") t) "[ \t]+\\([^\n]+\\)") | ||
| 689 | '((1 font-lock-builtin-face) (3 font-lock-warning-face nil t)))))) | ||
| 657 | "Gaudy level highlighting for `icon-mode'.") | 690 | "Gaudy level highlighting for `icon-mode'.") |
| 658 | 691 | ||
| 659 | (defvar icon-font-lock-keywords icon-font-lock-keywords-1 | 692 | (defvar icon-font-lock-keywords icon-font-lock-keywords-1 |