@@ -879,38 +879,34 @@ reported, even if `c-report-syntactic-errors' is non-nil."
879
879
(funcall 'c-indent-line )))))
880
880
881
881
(defun php-c-at-vsemi-p (&optional pos )
882
- " Return t on html lines (including php region border) , otherwise nil .
882
+ " Return T on HTML lines (including php tag) or PHP8 Attribute , otherwise NIL .
883
883
POS is a position on the line in question.
884
884
885
885
This is was done due to the problem reported here:
886
886
887
887
URL `https://answers.launchpad.net/nxhtml/+question/43320' "
888
- (if (not php-template-compatibility)
889
- nil
890
- (setq pos (or pos (point )))
891
- (let ((here (point ))
892
- ret)
893
- (save-match-data
888
+ ; ; If this function could call c-beginning-of-statement-1, change php-c-vsemi-status-unknown-p.
889
+ (save-excursion
890
+ (if pos
894
891
(goto-char pos)
895
- (beginning-of-line )
896
- (setq ret (looking-at
897
- (rx
898
- (or (seq
899
- bol
900
- (0+ space)
901
- " <"
902
- (in " a-z\\ ?" ))
903
- (seq
904
- (0+ not-newline)
905
- (in " a-z\\ ?" )
906
- " >"
907
- (0+ space)
908
- eol))))))
909
- (goto-char here)
910
- ret)))
892
+ (setq pos (point )))
893
+ (unless (php-in-string-or-comment-p)
894
+ (or
895
+ ; ; Detect PHP8 attribute: <<Attribute()>>
896
+ (when (and (< 2 pos) (< 2 (- pos (c-point 'bol ))))
897
+ (backward-char 2 )
898
+ (looking-at-p " >>\\ s-*\\ (?:<<\\ |$\\ )" ))
899
+ ; ; Detect HTML/XML tag and PHP tag (<?php, <?=, ?>)
900
+ (when php-mode-template-compatibility
901
+ (beginning-of-line )
902
+ (looking-at-p
903
+ (eval-when-compile
904
+ (rx (or (: bol (0+ space) " <" (in " a-z\\ ?" ))
905
+ (: (0+ not-newline) (in " a-z\\ ?" ) " >" (0+ space) eol))))))))))
911
906
912
907
(defun php-c-vsemi-status-unknown-p ()
913
- " Always return NIL. See `php-c-at-vsemi-p' ."
908
+ " Always return NIL. See `c-vsemi-status-unknown-p' ."
909
+ ; ; Current implementation of php-c-at-vsemi-p never calls c-beginning-of-statement-1
914
910
nil )
915
911
916
912
(defun php-lineup-string-cont (langelem )
0 commit comments