summaryrefslogtreecommitdiff
path: root/test/manual
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-12-27 03:07:50 +0100
committerStefan Kangas <stefan@marxist.se>2021-12-27 03:19:25 +0100
commitf522a064cf1ec8804fb938886b10bc82650e1a68 (patch)
tree72d0b8fa8242a3e3d8ede0455fd1552b2d060600 /test/manual
parentd9977018e045be002f2b48254215fda5f3a067fc (diff)
downloademacs-f522a064cf1ec8804fb938886b10bc82650e1a68.tar.gz
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 'test/manual')
-rwxr-xr-xtest/manual/indent/perl.perl12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/manual/indent/perl.perl b/test/manual/indent/perl.perl
index 6ec04303b4f..db94552a928 100755
--- a/test/manual/indent/perl.perl
+++ b/test/manual/indent/perl.perl
@@ -95,3 +95,15 @@ s#ijk#lmn#g; # This is a regular expression sustitution.
s #lmn#opq#g; # FIXME: this should be a comment starting with "#lmn"
/lmn/rst/g; # and this is the actual regular expression
print; # prints "rstrst\n"
+
+given ($num) {
+ when ($num>10) {
+ printf "number is greater than 10\n";
+ }
+ when ($num<10) {
+ printf "number is less than 10\n";
+ }
+ default {
+ printf "number is equal to 10\n";
+ }
+}