Skip to content

Commit

Permalink
Fix #439 heredoc syntax probrem
Browse files Browse the repository at this point in the history
  • Loading branch information
zonuexe committed Mar 9, 2018
1 parent 3b85b17 commit b67b34c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions php-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -934,13 +934,13 @@ this ^ lineup"

(eval-and-compile
(defconst php-heredoc-start-re
"<<<\\(?:\\w+\\|'\\w+'\\)$"
"<<<\\(?:\\_<.+?\\_>\\|'\\_<.+?\\_>'\\|\"\\_<.+?\\_>\"\\)$"
"Regular expression for the start of a PHP heredoc."))

(defun php-heredoc-end-re (heredoc-start)
"Build a regular expression for the end of a heredoc started by the string HEREDOC-START."
;; Extract just the identifier without <<< and quotes.
(string-match "\\w+" heredoc-start)
(string-match "\\_<.+?\\_>" heredoc-start)
(concat "^\\(" (match-string 0 heredoc-start) "\\)\\W"))

(defun php-syntax-propertize-function (start end)
Expand Down

0 comments on commit b67b34c

Please sign in to comment.