branch: elpa/raku-mode
commit 1872efb95a44b51a9ba82151889ce0e828302806
Author: Hinrik Örn Sigurðsson <[email protected]>
Commit: Hinrik Örn Sigurðsson <[email protected]>
Highlight hyper operators
---
perl6-font-lock.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/perl6-font-lock.el b/perl6-font-lock.el
index f5722f2a34..71610aa2c5 100644
--- a/perl6-font-lock.el
+++ b/perl6-font-lock.el
@@ -143,6 +143,15 @@
(regex ,rx-metaoperator)
(opt "\)")
(1+ "\]"))))
+ (hyper-operator
+ . ,(rx-to-string
+ `(or (and "«" (regex ,rx-metaoperator) (char "«»"))
+ (and "»" (regex ,rx-metaoperator) (opt (char "«»")))
+ (and "<<" (regex ,rx-metaoperator) (or "<<" ">>"))
+ (and ">>" (regex ,rx-metaoperator) (opt (or "<<" ">>")))
+ (and (regex "[^[:digit:]\[\{\('\",:[:space:]]")
+ (0+ (regex "[^\[\{\('\",:[:space:]]"))
+ (or "«" "<<")))))
(routine
. ,(rx (or "macro" "sub" "submethod" "method" "multi" "proto" "only"
"category")))
@@ -420,7 +429,7 @@ Takes arguments START and END which delimit the region to
propertize."
((rx "#" (0+ not-newline))
(0 (ignore)))
;; metaoperators like (-), R=>, [*], X~
- ((perl6-rx (or set-operator rsxz-operator reduce-operator))
+ ((perl6-rx (or set-operator rsxz-operator reduce-operator
hyper-operator))
(0 (ignore (perl6-add-font-lock-hint 'perl6-metaoperator 0))))
;; angle-bracketed quoting construct
((rx (1+ (char "<«")))