[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 97ce427 198/468: Restore compatibility with Emacs
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 97ce427 198/468: Restore compatibility with Emacs23 broken by commit 8d28342 |
Date: |
Thu, 5 Aug 2021 04:58:35 -0400 (EDT) |
branch: elpa/lua-mode
commit 97ce427065ea630f171e8d0488ab016ad1c337ea
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
Restore compatibility with Emacs23 broken by commit 8d28342
`rx' macro had its `group-n' form introduced only in Emacs 24.2
---
lua-mode.el | 39 ++++++++++++++++++++-------------------
1 file changed, 20 insertions(+), 19 deletions(-)
diff --git a/lua-mode.el b/lua-mode.el
index 2dd9087..328005c 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -500,11 +500,11 @@ Groups 6-9 can be used in any of argument regexps."
(rx (or (seq (regexp "\\(?:\\_<function\\_>\\)")
(* blank)
(? (regexp "\\(?1:\\_<[[:alpha:]][[:alnum:]]*\\_>\\)"))
- (group-n 2 (* nonl)))
+ (regexp "\\(?2:.*\\)"))
(seq (? (regexp "\\(?1:\\_<[[:alpha:]][[:alnum:]]*\\_>\\)"))
(* blank) "=" (* blank)
(regexp "\\(?:\\_<function\\_>\\)")
- (group-n 2 (* nonl)))))))
+ (regexp "\\(?2:.*\\)"))))))
(defvar lua-font-lock-keywords
(eval-when-compile
@@ -1285,27 +1285,28 @@ one."
(defconst lua--left-shifter-regexp
(eval-when-compile
(rx
- ;; All matches are returned via same group 1, even those that can match
- ;; simultaneously. This is correct as long as, according to the manual
[1]:
+ ;; 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?
;;
- ;; There is no particular restriction on the numbering, e.g., you can
- ;; have several groups with the same number in which case the last one
- ;; to match (i.e., the rightmost match) will win.
- ;;
- ;; 1. C-h i g "(elisp)regexp backslash" // i really need to stop
forgetting
- ;; things.
- (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))))
+ ;; 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:\\)")
;; right hand side
(or "{"
"function"
- (seq (group-n 1 (eval lua--function-name-rx) (* blank))
- (any "({")))))))
+ (seq
+ (eval lua--function-name-rx) (* blank)
+ (regexp "\\(?1:\\)") (any "({")))))))
"Regular expression that matches left-shifter expression.
- [nongnu] elpa/lua-mode 6beb586 123/468: Add customizable lua-automark-multiline-interval variable, (continued)
- [nongnu] elpa/lua-mode 6beb586 123/468: Add customizable lua-automark-multiline-interval variable, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode eab8fc0 136/468: Move docstrings to the end of constants., Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a5cc71f 149/468: Bump version & URL, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode caa3d0c 162/468: lua-jump-to-traceback: fix compilation warning about goto-line func, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode fb53190 164/468: First part of the fix for #34, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 086736c 168/468: #36 Don't continue lines on some keywords, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b9541ce 173/468: lua-send-proc is now an alias to lua-send-defun, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8d28342 187/468: Revisit block-close unindentation logic (issue #26), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b1ac542 191/468: Major refactoring of font-lock-keywords:, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 57c696c 192/468: Add var name highlighting in "for x, y in ..." construct, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 97ce427 198/468: Restore compatibility with Emacs23 broken by commit 8d28342,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode ff3f5e1 199/468: lua-font-lock-keywords: don't eval-when-compile initial value, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 2a0314b 200/468: Improve multiline highlighting via font-lock-syntactic-keywords, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cd5c071 201/468: Clean up lua-mode start-up function a bit, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b195cdc 205/468: Bump TODO, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode cee511c 206/468: for/local varname highlighting: match '=' at EOL properly, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a1dc850 207/468: Post-refactoring fix: evaluate string variables in font-lock-defaults value, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8ffd075 208/468: lua-calculate-indentation-info: non-functional refactoring, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 4484128 215/468: lua-calculate-indentation-override: unindent to the last block-close token, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 79e6815 216/468: Rewrite lua-beginning-of-proc, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode f2e7138 220/468: Move font-lock test helpers into a separate file, Philip Kaludercic, 2021/08/05