branch: elpa/raku-mode
commit 9ca9a0caa7bd2363cb200c84c1546c2eda4b1664
Author: Hinrik Örn Sigurðsson <[email protected]>
Commit: Hinrik Örn Sigurðsson <[email protected]>
Highlight identifiers containing underscore
---
perl6-font-lock.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/perl6-font-lock.el b/perl6-font-lock.el
index 8c0c446517..0c77e320a2 100644
--- a/perl6-font-lock.el
+++ b/perl6-font-lock.el
@@ -177,7 +177,7 @@
(or (and (regex "[^[:digit:]@%$]")
(0+ (regex "[^\[\{\('\"[:space:]]")))
(and (any "@%$")
- (regex "[^.?^=[:alpha:]]")
+ (regex "[^.?^=_[:alpha:]]")
(0+ (regex "[^\[\{\('\"[:space:]]"))))
(opt "\)")
(1+ "\]")))
@@ -201,7 +201,10 @@
"AnyChar" "Positional" "Associative" "Ordering"
"KeyExtractor"
"Comparator" "OrderingPair" "IO" "KitchenSink" "Role" "Int"
"Rat" "Buf" "UInt" "Abstraction" "Numeric" "Real" "Nil"
"Mu")))
- (identifier . ,(rx alpha (0+ alnum) (0+ (any "-'") alpha (0+ alnum))))
+ (identifier . ,(rx (regex "[_[:alpha:]]")
+ (0+ (regex "[_[:alnum:]]"))
+ (0+ (any "-'")
+ (regex "[_[:alpha:]]") (0+ (regex
"[_[:alnum:]]")))))
(version . ,(rx "v" (1+ digit) (0+ "." (or "*" (1+ digit))) (opt "+")))
(number
. ,(rx
@@ -355,7 +358,7 @@ Takes arguments START and END which delimit the region to
propertize."
(funcall
(syntax-propertize-rules
;; [-'] between identifiers are symbol chars
- ((rx alnum (group (any "-'")) alpha)
+ ((rx (regex "[_[:alnum:]]") (group (any "-'")) (regex "[_[:alpha:]]"))
(1 "_"))
;; same for "::" around identifiers
((rx (or (and "::" symbol-start)