Skip to content

Commit 78f8339

Browse files
committed
Modify c-operators for PHP syntax
1 parent d45316c commit 78f8339

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

php-mode.el

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -445,23 +445,31 @@ In that case set to `NIL'."
445445
(prefix "\\" "::")))
446446

447447
(c-lang-defconst c-operators
448-
php `((prefix "#")
448+
php `((prefix "new" "clone")
449449
,@(c-lang-const c-identifier-ops)
450-
(left-assoc ".")
450+
(postfix "->")
451451
(postfix "++" "--" "[" "]" "(" ")")
452-
(prefix "++" "--" "+" "-" "!" "~" "new" "(" ")")
452+
(right-assoc "**")
453+
(prefix "++" "--" "+" "-" "~" "(" ")" "@")
454+
(prefix "instanceof")
455+
(prefix "!")
453456
(left-assoc "*" "/" "%")
454-
(left-assoc "+" "-")
455-
(left-assoc "<<" ">>" ">>>")
456-
(left-assoc "<" ">" "<=" ">=" "instanceof")
457-
(left-assoc "==" "!=")
457+
(left-assoc "+" "-" ".")
458+
(left-assoc "<<" ">>")
459+
(left-assoc "<" ">" "<=" ">=")
460+
(left-assoc "==" "!=" "===" "!==" "<>" "<=>")
458461
(left-assoc "&")
459462
(left-assoc "^")
460463
(left-assoc "|")
461464
(left-assoc "&&")
462465
(left-assoc "||")
466+
(right-assoc "??")
467+
(left-assoc "?:")
463468
(right-assoc-sequence "?" ":")
464469
(right-assoc ,@(c-lang-const c-assignment-operators))
470+
(left-assoc "and")
471+
(left-assoc "xor")
472+
(left-assoc "or")
465473
(left-assoc ",")))
466474

467475
;; Allow '\' when scanning from open brace back to defining

0 commit comments

Comments
 (0)