File tree Expand file tree Collapse file tree 4 files changed +50
-1
lines changed Expand file tree Collapse file tree 4 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -1513,7 +1513,14 @@ a completion list."
15131513 ; ; Highlight static method calls as such. This is necessary for method
15141514 ; ; names which are identical to keywords to be highlighted correctly.
15151515 (" \\ sw+::\\ (\\ sw+\\ )(" 1 'php-static-method-call )
1516-
1516+ ; ; Multiple catch (FooException | BarException $e)
1517+ (,(rx symbol-start " catch" symbol-end
1518+ (* (syntax whitespace)) " (" (* (syntax whitespace))
1519+ (group (+ (or (syntax word) (syntax symbol)))))
1520+ (1 font-lock-type-face )
1521+ (,(rx (* (syntax whitespace)) " |" (* (syntax whitespace))
1522+ (group (+ (or (syntax word) (syntax symbol))) symbol-end))
1523+ nil nil (1 font-lock-type-face )))
15171524 ; ; While c-opt-cpp-* highlights the <?php opening tags, it is not
15181525 ; ; possible to make it highlight short open tags and closing tags
15191526 ; ; as well. So we force the correct face on all cases that
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ try {
4+ } catch (ErrorException | PDOException $ e ) {
5+ } catch (Foo | Bar | Buz | Fuga $ e ) {
6+ } catch (Throwable $ e ) {
7+ }
Original file line number Diff line number Diff line change 1+ ; ; -*- mode : emacs-lisp -*-
2+ ((" <?php" . php-php-tag)
3+ (" \n\n " )
4+ (" try" . php-keyword)
5+ (" {\n } " )
6+ (" catch" . php-keyword)
7+ (" (" )
8+ (" ErrorException" . font-lock-type-face )
9+ (" | " )
10+ (" PDOException" . font-lock-type-face )
11+ (" " )
12+ (" $" . php-variable-sigil)
13+ (" e" . php-variable-name)
14+ (" ) {\n } " )
15+ (" catch" . php-keyword)
16+ (" (" )
17+ (" Foo" . font-lock-type-face )
18+ (" | " )
19+ (" Bar" . font-lock-type-face )
20+ (" | " )
21+ (" Buz" . font-lock-type-face )
22+ (" | " )
23+ (" Fuga" . font-lock-type-face )
24+ (" " )
25+ (" $" . php-variable-sigil)
26+ (" e" . php-variable-name)
27+ (" ) {\n } " )
28+ (" catch" . php-keyword)
29+ (" (" )
30+ (" Throwable" . font-lock-type-face )
31+ (" " )
32+ (" $" . php-variable-sigil)
33+ (" e" . php-variable-name)
34+ (" ) {\n }\n " ))
Original file line number Diff line number Diff line change @@ -674,6 +674,7 @@ Meant for `php-mode-test-issue-503'."
674674 (t t ))))
675675 (with-php-mode-test (" doc-comment/return-type.php" :faces t ))
676676 (with-php-mode-test (" doc-comment/inheritdoc.php" :faces t ))
677+ (with-php-mode-test (" lang/try-cactch/multiple.php" :faces t ))
677678 (with-php-mode-test (" lang/types/cast.php" :faces t ))
678679 (with-php-mode-test (" lang/types/function.php" :faces t ))
679680 (with-php-mode-test (" lang/types/keywords.php" :faces t ))
You can’t perform that action at this time.
0 commit comments