Skip to content

Commit

Permalink
Merge pull request #681 from emacs-php/refactor/regexp-beginning-of-d…
Browse files Browse the repository at this point in the history
…efun

Refactor RegExp for beginning of defun
  • Loading branch information
zonuexe authored Aug 1, 2021
2 parents 55c59ea + b3a0445 commit 8cd3f5d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lisp/php.el
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,17 @@ it is the character that will terminate the string, or t if the string should be
(bound-and-true-p poly-php-html-mode))

(defconst php-beginning-of-defun-regexp
"^\\s-*\\(?:\\(?:abstract\\|final\\|private\\|protected\\|public\\|static\\)\\s-+\\)*function\\s-+&?\\(\\(\\sw\\|\\s_\\)+\\)\\s-*("
(eval-when-compile
(rx bol
(* (syntax whitespace))
(* (or "abstract" "final" "private" "protected" "public" "static")
(+ (syntax whitespace)))
"function"
(+ (syntax whitespace))
(? "&" (* (syntax whitespace)))
(group (+ (or (syntax word) (syntax symbol))))
(* (syntax whitespace))
"("))
"Regular expression for a PHP function.")

(eval-when-compile
Expand Down

0 comments on commit 8cd3f5d

Please sign in to comment.