[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/raku-mode 385ed1d54a 155/253: pull regexes up into documen
From: |
ELPA Syncer |
Subject: |
[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) |
Date: |
Sat, 29 Jan 2022 08:28:52 -0500 (EST) |
branch: elpa/raku-mode
commit 385ed1d54ac6fe1cc75e163cefab271cb369d510
Author: Tom Browder <tom.browder@gmail.com>
Commit: Tom Browder <tom.browder@gmail.com>
pull regexes up into documents variables, add index of classes, update
regexes a bit (no longer show sub signatures)
---
perl6-imenu.el | 46 +++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 41 insertions(+), 5 deletions(-)
diff --git a/perl6-imenu.el b/perl6-imenu.el
index 55a9477afe..9681820e56 100644
--- a/perl6-imenu.el
+++ b/perl6-imenu.el
@@ -1,12 +1,48 @@
;;; perl6-imenu.el --- Imenu support Perl 6 -*- lexical-binding: t; -*-
;; Imenu functions and variables are defined here.
+
+;; TODO: tighten regexes to distinguish correct naming for Perl 6
+;; vs. NQP (make a minor mode?)
+
+;; Regex definitions:
+(defvar perl6-vars-regex
+ (concat
+ "^\\s-*" ; leading ws allowed
+ "\\(?:my\\|our\\)\\s-+" ; scope of var, followed by mandatory ws
+ "\\(" ; start capture group 1 for the var name
+ "\\(?:\\$\\|@\\|%\\)" ; sigil for type of var
+ "\\(?:[-_[:alnum:]]+\\)" ; the var name ends with ws
+ "\\)" ; end of capture group 1
+ ))
+
+(defvar perl6-subs-regex
+ (concat
+ "^\\s-*" ; leading ws allowed
+ "\\(?:my\\s-+\\|our\\s-+\\)?" ; optional specific scope followed by at
least one space
+ ; must have one of the five type identifiers followed by at least one
space:
+
"\\(?:multi\\s-+sub\\|multi\\s-+method\\|sub\\|method\\|multi\\|proto\\)\\s-+"
+ "\\([-_[:alnum:]]+\\)" ; the capture group of the sub name
+ ))
+
+(defvar perl6-classes-regex
+ (concat
+ "^\\s-*" ; leading ws allowed
+ ; must have one of the four type identifiers followed by at least one
space:
+ "class\\s-+"
+ "\\([-_[:alnum:]]+\\)" ; the capture group of the sub
name
+ ;"[\\n\\s\\-{]+" ; ended by whitespace or an opening curly
brace'
+ ))
+
(defvar perl6-imenu-generic-expression
- '(
- ;; the names are in reverse desired order since they are evaluated
here last first
- ("Variables"
"^\\s-*\\(?:my\\|our\\)\\s-+\\(\\(?:\\$\\|@\\|%\\)\\(?:[_[:alnum:]]+\\)\\)" 1)
- ("Subs/Methods"
"^\\s-*\\(?:my\\s-+\\|our\\s-+\\)?\\(?:multi\\s-+sub\\|multi\\s-+method\\|sub\\|method\\|multi\\)\\s-+\\(.+)\\)"
1)
- )
+ `(
+ ;; the names are in reverse desired order since they are evaluated here
last first
+ ;("Variables"
"^\\s-*\\(?:my\\|our\\)\\s-+\\(\\(?:\\$\\|@\\|%\\)\\(?:[_[:alnum:]]+\\)\\)" 1)
+ ("Classes" ,perl6-classes-regex 1)
+ ("Variables" ,perl6-vars-regex 1)
+ ;;("Subs/Methods"
"^\\s-*\\(?:my\\s-+\\|our\\s-+\\)?\\(?:multi\\s-+sub\\|multi\\s-+method\\|sub\\|method\\|multi\\)\\s-+\\(.+)\\)"
1)
+ ("Subs/Methods" ,perl6-subs-regex 1)
+ )
"Define interesting points in the Perl 6 buffer for `imenu'.
This is used to set `imenu-generic-expression' when Perl 6 mode is
- [nongnu] elpa/raku-mode 564cbfa7a2 119/253: Remove unnecessary 'let', (continued)
- [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, 2022/01/29
- [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 <=
- [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
- [nongnu] elpa/raku-mode 0fc63c3ce1 001/253: Initial import, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 623b5b559a 018/253: Syntaxify double colons around identifiers as symbol chars, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 142ff3e928 030/253: Highlight variable package differently from variable name, ELPA Syncer, 2022/01/29
- [nongnu] elpa/raku-mode 127b125ab1 034/253: Use a smaller heading, ELPA Syncer, 2022/01/29