[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode acd0c55 354/468: Revert to using group-n in lua--
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode acd0c55 354/468: Revert to using group-n in lua--left-shifter-regexp |
Date: |
Thu, 5 Aug 2021 04:59:08 -0400 (EDT) |
branch: elpa/lua-mode
commit acd0c5541928e40e1cd9a715b97f5a4ec42f4367
Author: Reuben Thomas <rrt@sc3d.org>
Commit: Reuben Thomas <rrt@sc3d.org>
Revert to using group-n in lua--left-shifter-regexp
Resurrect code from commit 8d283426 now we require Emacs >= 24.3. There are
other places where group-n could be used, but no past code to simply
reapply, so more care and thought would be required for those cases!
---
lua-mode.el | 26 ++++++++++----------------
1 file changed, 10 insertions(+), 16 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index a7b4b27..ebe6ea2 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -1447,25 +1447,19 @@ one."
;; This regexp should answer the following questions:
;; 1. is there a left shifter regexp on that line?
;; 2. where does block-open token of that left shifter reside?
- ;;
- ;; NOTE: couldn't use `group-n' keyword of `rx' macro, because it was
- ;; introduced in Emacs 24.2 only, so for the sake of code clarity the
named
- ;; groups don't really match anything, they just report the position of
the
- ;; match.
- (or (seq (regexp "\\_<local[ \t]+") (regexp "\\(?1:\\)function\\_>"))
- (seq (eval lua--function-name-rx) (* blank) (regexp "\\(?1:\\)[{(]"))
- (seq (or
- ;; assignment statement prefix
- (seq (* nonl) (not (any "<=>~")) "=" (* blank))
- ;; return statement prefix
- (seq word-start "return" word-end (* blank)))
- (regexp "\\(?1:\\)")
+ (or (seq (group-n 1 symbol-start "local" (+ blank)) "function" symbol-end)
+
+ (seq (group-n 1 (eval lua--function-name-rx) (* blank)) (any "{("))
+ (seq (group-n 1 (or
+ ;; assignment statement prefix
+ (seq (* nonl) (not (any "<=>~")) "=" (* blank))
+ ;; return statement prefix
+ (seq word-start "return" word-end (* blank))))
;; right hand side
(or "{"
"function"
- (seq
- (eval lua--function-name-rx) (* blank)
- (regexp "\\(?1:\\)") (any "({")))))))
+ (seq (group-n 1 (eval lua--function-name-rx) (* blank))
+ (any "({")))))))
"Regular expression that matches left-shifter expression.
- [nongnu] elpa/lua-mode b043ca4 451/468: lua-is-continuing-statement-p-1: fix missing save-excursion on branch, (continued)
- [nongnu] elpa/lua-mode b043ca4 451/468: lua-is-continuing-statement-p-1: fix missing save-excursion on branch, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6a837f7 458/468: with-lua-buffer: ensure font-lock is activated, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 08d83fc 443/468: Merge pull request #180 from nbfalcon/bugfix/lua-start-process-hangs, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 56af490 446/468: lua-find-regexp: escape string/comment after a match is ignored, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 93da584 449/468: Bump indentation tests, add missing function-call-arguments suite, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0018e95 452/468: make-indentation-pair: don't calculate full indentation on every closer, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode d2ff304 456/468: Copy cl-signum into lua--signum for backward compat, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 3688bf7 347/468: Merge pull request #136 from EdwardBetts/spelling, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6c69183 351/468: Merge pull request #139 from rrthomas/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode eacf137 349/468: Spell “Lua” consistently and its “process” (not “subprocess”), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode acd0c55 354/468: Revert to using group-n in lua--left-shifter-regexp,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode 3ba5ecc 360/468: Minor simplification of lua-get-create-process, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c6e053e 361/468: Spell “Lua” consistently and its “process” (not “subprocess”), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7909513 363/468: Merge pull request #141 from rrthomas/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a260cf9 368/468: Travis: enable testing on 26.1, 26.2 and git snapshot, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode c9635fb 369/468: travis.yml: print emacs version, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 494a5de 371/468: Fix some linter complaints about docstrings, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode ceb575b 374/468: tests: break down function header tests into separate cases, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 99c7431 375/468: travis: mark "git-snapshot" as allowed failure, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 770a83d 376/468: Merge pull request #152 from immerrr/fix-compat-with-new-rx-package, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 171b99c 382/468: Merge pull request #159 from tarsiiformes/typos, Philip Kaludercic, 2021/08/05