diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-12-27 03:07:50 +0100 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-12-27 03:19:25 +0100 |
commit | f522a064cf1ec8804fb938886b10bc82650e1a68 (patch) | |
tree | 72d0b8fa8242a3e3d8ede0455fd1552b2d060600 /lisp | |
parent | d9977018e045be002f2b48254215fda5f3a067fc (diff) | |
download | emacs-f522a064cf1ec8804fb938886b10bc82650e1a68.tar.gz emacs-f522a064cf1ec8804fb938886b10bc82650e1a68.tar.bz2 emacs-f522a064cf1ec8804fb938886b10bc82650e1a68.zip |
perl-mode: Recognize "when"/"given" keywords
* lisp/progmodes/perl-mode.el (perl-font-lock-keywords-2): Add
keywords "when", "given" and "default". (Bug#10560)
(perl--syntax-exp-intro-keywords): Add "printf".
* test/manual/indent/perl.perl: Add test for "when"/"given".
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/progmodes/perl-mode.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index 20834dd2e1e..d4e4f07b76b 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -191,7 +191,9 @@ ,(concat "\\<" (regexp-opt '("if" "until" "while" "elsif" "else" "unless" "do" "dump" "for" "foreach" "exit" "die" - "BEGIN" "END" "return" "exec" "eval") t) + "BEGIN" "END" "return" "exec" "eval" + "when" "given" "default") + t) "\\>") ;; ;; Fontify declarators and prefixes as types. @@ -212,7 +214,7 @@ (eval-and-compile (defconst perl--syntax-exp-intro-keywords - '("split" "if" "unless" "until" "while" "print" + '("split" "if" "unless" "until" "while" "print" "printf" "grep" "map" "not" "or" "and" "for" "foreach" "return")) (defconst perl--syntax-exp-intro-regexp |