emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/raku-mode 623b5b559a 018/253: Syntaxify double colons arou


From: ELPA Syncer
Subject: [nongnu] elpa/raku-mode 623b5b559a 018/253: Syntaxify double colons around identifiers as symbol chars
Date: Sat, 29 Jan 2022 08:28:35 -0500 (EST)

branch: elpa/raku-mode
commit 623b5b559ab923c9e3b68f95fad17e911f1c9055
Author: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
Commit: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>

    Syntaxify double colons around identifiers as symbol chars
    
    This will help with thing-at-point in the future.
---
 perl6-font-lock.el      | 4 ++++
 test/perl6-mode-test.el | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/perl6-font-lock.el b/perl6-font-lock.el
index fc7d979ffc..3383e77b04 100644
--- a/perl6-font-lock.el
+++ b/perl6-font-lock.el
@@ -235,6 +235,10 @@ Takes arguments START and END which delimit the region to 
propertize."
       ;; [-'] between identifiers are symbol chars
       ((rx (any "A-Za-z") (group (any "-'")) (any "A-Za-z"))
        (1 "_"))
+      ;; same for "::" around identifiers
+      ((rx (or (and "::" symbol-start)
+               (and symbol-end "::")))
+       (0 "_"))
       ; multiline comments
       ((rx "#`")
        (0 (ignore (perl6-syntax-propertize-embedded-comment)))))
diff --git a/test/perl6-mode-test.el b/test/perl6-mode-test.el
index b8fc39be6f..2c9a268bc2 100644
--- a/test/perl6-mode-test.el
+++ b/test/perl6-mode-test.el
@@ -52,6 +52,11 @@ POS."
 
 
 ;;;; Font locking
+(ert-deftest perl6-syntax-propertize/colons-identifier ()
+  :tags '(syntax-table syntax-properties)
+  (perl6-test-with-temp-buffer "class Foo::Bar"
+                                (should (eq (perl6-test-syntax-at 10) 'symbol))
+                                (should (eq (perl6-test-syntax-at 11) 
'symbol))))
 
 (ert-deftest perl6-mode-syntax-table/fontify-dq-string ()
   :tags '(fontification syntax-table)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]