]> git.eshelyaron.com Git - emacs.git/commitdiff
Support all perl variable declarators and prefixes (Bug#27613)
authorJefferson Carpenter <jeffersoncarpenter2@gmail.com>
Fri, 7 Jul 2017 22:08:52 +0000 (17:08 -0500)
committerNoam Postavsky <npostavs@gmail.com>
Sat, 26 Aug 2017 02:50:15 +0000 (22:50 -0400)
* lisp/progmodes/perl-mode.el (perl-imenu-generic-expression)
(perl-font-lock-keywords-2): Match declators 'anon', 'argument', 'has',
'local', 'state', 'supersede', 'let', and 'temp'.

Copyright-paperwork-exempt: yes

lisp/progmodes/perl-mode.el

index 6197a53ee66db9650a7776b1ba71193f03788688..5e199fb0c3373901e4fba205ff710d0faf285008 100644 (file)
   '(;; Functions
     (nil "^[ \t]*sub\\s-+\\([-[:alnum:]+_:]+\\)" 1)
     ;;Variables
-    ("Variables" "^\\(?:my\\|our\\)\\s-+\\([$@%][-[:alnum:]+_:]+\\)\\s-*=" 1)
+    ("Variables" "^[ \t]*\\(?:anon\\|argument\\|has\\|local\\|my\\|our\\|state\\|supersede\\)\\s-+\\([$@%][-[:alnum:]+_:]+\\)\\s-*=" 1)
     ("Packages" "^[ \t]*package\\s-+\\([-[:alnum:]+_:]+\\);" 1)
     ("Doc sections" "^=head[0-9][ \t]+\\(.*\\)" 1))
   "Imenu generic expression for Perl mode.  See `imenu-generic-expression'.")
                             "BEGIN" "END" "return" "exec" "eval") t)
               "\\>")
      ;;
-     ;; Fontify local and my keywords as types.
-     ("\\<\\(local\\|my\\)\\>" . font-lock-type-face)
+     ;; Fontify declarators and prefixes as types.
+     ("\\<\\(anon\\|argument\\|has\\|local\\|my\\|our\\|state\\|supersede\\)\\>" . font-lock-type-face) ; declarators
+     ("\\<\\(let\\|temp\\)\\>" . font-lock-type-face) ; prefixes
      ;;
      ;; Fontify function, variable and file name references.
      ("&\\(\\sw+\\(::\\sw+\\)*\\)" 1 font-lock-function-name-face)