[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/raku-mode cc28223bb7 182/253: add new name categories and
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/raku-mode cc28223bb7 182/253: add new name categories and other improvements |
Date: |
Sat, 29 Jan 2022 08:28:56 -0500 (EST) |
branch: elpa/raku-mode
commit cc28223bb72fad9ee9bcff8bc9910d5ac26749e2
Author: Tom Browder <tom.browder@gmail.com>
Commit: Tom Browder <tom.browder@gmail.com>
add new name categories and other improvements
+ add regex, token, rule, and grammar categories for Perl 6
+ allow '::' in identifiers in certain positions
+ add appropriate regexes for the new categories
+ add new categories to the menu list
+ add new categories to the Perl 6 test file
---
perl6-imenu.el | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++--
test/test-imenu.p6 | 10 ++++++++-
2 files changed, 66 insertions(+), 3 deletions(-)
diff --git a/perl6-imenu.el b/perl6-imenu.el
index 122c57016b..a48a729dbb 100644
--- a/perl6-imenu.el
+++ b/perl6-imenu.el
@@ -17,8 +17,11 @@
;; Regex definitions:
(defvar perl6-name-regex
(concat
- "[_[:alpha:]]" ; mandatory leading character
- "\\(?:[-']?[[:alpha:]]\\|[_[:alnum:]]\\)*" ; rest of the name allowing
embedded hyphens or single quotes
+ "[_[:alpha:]]" ; mandatory leading character
+ "\\(?:[-']?[[:alpha:]]" ; rest of the name allowing embedded hyphens or
single quotes or '::'
+ "\\|[_[:alnum:]]"
+ "\\|\\:\\:[_[:alnum:]]"
+ "\\)*"
))
(defvar nqp-name-regex
@@ -68,9 +71,61 @@
"\\)" ; end of capture group 1
))
+(defvar perl6-regexes-regex
+ (concat
+ "^\\s-*" ; leading ws allowed
+ ; must have an identifier followed by at least one space:
+ "regex\\s-+"
+ "\\(" ; start capture group 1 of the regex name
+ perl6-name-regex
+ "\\|"
+ nqp-name-regex
+ "\\)" ; end of capture group 1
+ ))
+
+(defvar perl6-tokens-regex
+ (concat
+ "^\\s-*" ; leading ws allowed
+ ; must have an identifier followed by at least one space:
+ "token\\s-+"
+ "\\(" ; start capture group 1 of the regex name
+ perl6-name-regex
+ "\\|"
+ nqp-name-regex
+ "\\)" ; end of capture group 1
+ ))
+
+(defvar perl6-rules-regex
+ (concat
+ "^\\s-*" ; leading ws allowed
+ ; must have an identifier followed by at least one space:
+ "rule\\s-+"
+ "\\(" ; start capture group 1 of the regex name
+ perl6-name-regex
+ "\\|"
+ nqp-name-regex
+ "\\)" ; end of capture group 1
+ ))
+
+(defvar perl6-grammars-regex
+ (concat
+ "^\\s-*" ; leading ws allowed
+ ; must have an identifier followed by at least one space:
+ "grammar\\s-+"
+ "\\(" ; start capture group 1 of the regex name
+ perl6-name-regex
+ "\\|"
+ nqp-name-regex
+ "\\)" ; end of capture group 1
+ ))
+
(defvar perl6-imenu-generic-expression
`(
;; the names are in reverse desired order since they are evaluated here
last first
+ ("Rules" ,perl6-rules-regex 1)
+ ("Tokens" ,perl6-tokens-regex 1)
+ ("Regexes" ,perl6-regexes-regex 1)
+ ("Grammars" ,perl6-grammars-regex 1)
("Classes" ,perl6-classes-regex 1)
("Variables" ,perl6-vars-regex 1)
("Subs/Methods" ,perl6-subs-regex 1)
diff --git a/test/test-imenu.p6 b/test/test-imenu.p6
index 3073db891f..6268250e4d 100644
--- a/test/test-imenu.p6
+++ b/test/test-imenu.p6
@@ -1,6 +1,7 @@
# file: test-imenu.p6
-# Perl 6 syntax file for testing perl6-mode with imenu support, which is
located at:
+# Perl 6 syntax file for testing perl6-mode with imenu support, which
+# is located at:
#
# https://github.com/tbrowder/perl6-mode [branch: "my-branch"]
@@ -20,6 +21,13 @@ multi c() {}
proto xx() {}
multi method !z-private() {}
+my $F::B;
+
class My-class1 {}
class My-class2{
class doit () {}
+
+ token one {}
+ regex two {}
+ rule three {}
+ grammar G::T {}
- [nongnu] elpa/raku-mode bb9f553d91 079/253: Highlight solitary colon (:) operator, (continued)
- [nongnu] elpa/raku-mode bb9f553d91 079/253: Highlight solitary colon (:) operator, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode f3690a05d5 122/253: Fix highlighting of empty comment lines, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode e11d5b76fe 104/253: Remove superfluous space from syntax descriptor, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 456d718152 116/253: Add comments to perl6-font-lock-keywords, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 564cbfa7a2 119/253: Remove unnecessary 'let', ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode b6410f9d4c 126/253: Fix highlighting of ::foo, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 60966ea875 133/253: Highlight function composition operator, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 601f37ef15 136/253: Bool type was added., ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 72f21d4a91 171/253: Just forcing reload to use change in cask, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode e5ab8b0589 175/253: Reverting to original cask, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode cc28223bb7 182/253: add new name categories and other improvements,
ELPA Syncer <=
- [nongnu] elpa/raku-mode 748d07ab7c 188/253: Add repl to perl6 major mode, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode bf687c66a9 195/253: Update README, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode e79cb9067d 210/253: Merge pull request #27 from tmtvl/repl-syntax-highlighting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 385ed1d54a 155/253: pull regexes up into documents variables, add index of classes, update regexes a bit (no longer show sub signatures), ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 759b21553f 189/253: Fix keybinds and menu, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 588dc4417b 166/253: add new files, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 26fc7115b5 215/253: Add information about the auto-insert skeletons to the README., ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 44529c097f 221/253: Merge pull request #32 from widefox/master, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode ac967de8a4 222/253: Fix #33: missed interpreter & mode autoloads, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 02bf289149 242/253: Merge pull request #45 from sumanstats/master, ELPA Syncer, 2022/01/29