Skip to content

Commit e10b535

Browse files
authored
Merge pull request #536 from emacs-php/feature/expand-c-operators
Modify c-operators for PHP syntax
2 parents d047eb4 + 78f8339 commit e10b535

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

php-mode.el

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,32 @@ In that case set to `NIL'."
444444
(prefix "\\" "::")))
445445

446446
(c-lang-defconst c-operators
447-
php (delete '(postfix-if-paren "<" ">")
448-
(c-lang-const c-operators)))
447+
php `((prefix "new" "clone")
448+
,@(c-lang-const c-identifier-ops)
449+
(postfix "->")
450+
(postfix "++" "--" "[" "]" "(" ")")
451+
(right-assoc "**")
452+
(prefix "++" "--" "+" "-" "~" "(" ")" "@")
453+
(prefix "instanceof")
454+
(prefix "!")
455+
(left-assoc "*" "/" "%")
456+
(left-assoc "+" "-" ".")
457+
(left-assoc "<<" ">>")
458+
(left-assoc "<" ">" "<=" ">=")
459+
(left-assoc "==" "!=" "===" "!==" "<>" "<=>")
460+
(left-assoc "&")
461+
(left-assoc "^")
462+
(left-assoc "|")
463+
(left-assoc "&&")
464+
(left-assoc "||")
465+
(right-assoc "??")
466+
(left-assoc "?:")
467+
(right-assoc-sequence "?" ":")
468+
(right-assoc ,@(c-lang-const c-assignment-operators))
469+
(left-assoc "and")
470+
(left-assoc "xor")
471+
(left-assoc "or")
472+
(left-assoc ",")))
449473

450474
;; Allow '\' when scanning from open brace back to defining
451475
;; construct like class

0 commit comments

Comments
 (0)