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

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

[nongnu] elpa/lua-mode 7605d2c 186/468: lua-font-lock-keywords: rewrite


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode 7605d2c 186/468: lua-font-lock-keywords: rewrite poorly written regexp (issue #47)
Date: Thu, 5 Aug 2021 04:58:33 -0400 (EDT)

branch: elpa/lua-mode
commit 7605d2c3d9cd6df4c89870a54c14c2c119102a2e
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>

    lua-font-lock-keywords: rewrite poorly written regexp (issue #47)
    
    Said regexp caused O(4^N) match attempts on lines containing N
    underscores, because underscore had 'word' syntax class.
---
 lua-mode.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lua-mode.el b/lua-mode.el
index 8fd0b23..acd11be 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -432,8 +432,8 @@ index of respective Lua reference manuals.")
            (1 font-lock-builtin-face) (2 font-lock-builtin-face nil noerror))
 
      ;; Handle function names in assignments
-     '("\\(\\(\\sw:\\|\\sw\\.\\|\\sw_\\|\\sw\\)+\\)[ \t]*=[ 
\t]*\\(function\\)\\_>"
-       (1 font-lock-function-name-face nil t) (3 font-lock-keyword-face))
+     '("\\([[:alnum:]_]+\\(?:[:.][[:alnum:]_]+\\)*\\)[ \t]*=[ \t]*function\\_>"
+       (1 font-lock-function-name-face))
 
      ;; octal numbers
      '("\\_<0x[[:xdigit:]]+\\_>" . font-lock-constant-face)



reply via email to

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