Skip to content

Commit 4b03e9b

Browse files
monnierzonuexe
authored andcommitted
Use syntax-propertize-precompile-rules for php-syntax-propertize-function
1 parent 65b8db5 commit 4b03e9b

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

Diff for: lisp/php-mode.el

+13-14
Original file line numberDiff line numberDiff line change
@@ -995,20 +995,19 @@ HEREDOC-START."
995995

996996
(eval-and-compile
997997
(defconst php-syntax-propertize-rules
998-
`((php-heredoc-start-re
999-
(0 (ignore (php--syntax-propertize-heredoc
1000-
(match-beginning 0)
1001-
(or (match-string 1) (match-string 2) (match-string 3))
1002-
(null (match-string 3))))))
1003-
(,(rx "#[")
1004-
(0 (ignore (php--syntax-propertize-attributes (match-beginning 0)))))
1005-
(,(rx (or "'" "\"" ))
1006-
(0 (ignore (php--syntax-propertize-quotes-in-comment (match-beginning 0)))))))
1007-
1008-
(defmacro php-build-propertize-function ()
1009-
`(byte-compile (syntax-propertize-rules ,@php-syntax-propertize-rules)))
1010-
1011-
(defalias 'php-syntax-propertize-function (php-build-propertize-function)))
998+
(syntax-propertize-precompile-rules
999+
(php-heredoc-start-re
1000+
(0 (ignore (php--syntax-propertize-heredoc
1001+
(match-beginning 0)
1002+
(or (match-string 1) (match-string 2) (match-string 3))
1003+
(null (match-string 3))))))
1004+
((rx "#[")
1005+
(0 (ignore (php--syntax-propertize-attributes (match-beginning 0)))))
1006+
((rx (or "'" "\""))
1007+
(0 (ignore (php--syntax-propertize-quotes-in-comment (match-beginning 0))))))))
1008+
1009+
(defalias 'php-syntax-propertize-function
1010+
(syntax-propertize-rules php-syntax-propertize-rules))
10121011

10131012
(defun php--syntax-propertize-heredoc (start id _is-heredoc)
10141013
"Apply propertize Heredoc and Nowdoc from START, with ID and IS-HEREDOC."

0 commit comments

Comments
 (0)