[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/nix-mode e744c602fd 304/500: Replace regex operations with
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/nix-mode e744c602fd 304/500: Replace regex operations with faster alternatives in the lexer. |
Date: |
Sat, 29 Jan 2022 08:27:16 -0500 (EST) |
branch: elpa/nix-mode
commit e744c602fdcb505021d36f00238a1c09ab6f8bc2
Author: Jakub Piecuch <j.piecuch96@gmail.com>
Commit: Jakub Piecuch <j.piecuch96@gmail.com>
Replace regex operations with faster alternatives in the lexer.
---
nix-mode.el | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/nix-mode.el b/nix-mode.el
index c08ca91e24..ffdbcb1477 100644
--- a/nix-mode.el
+++ b/nix-mode.el
@@ -401,9 +401,7 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(right " -bseqskip- ")
(left " -fseqskip- "))))))
-(defconst nix-smie--symbols-re
- (regexp-opt '(":" "->" "||" "&&" "==" "!=" "<" "<=" ">" ">="
- "//" "-" "+" "*" "/" "++" "?" "=" "," ";" "!")))
+(defconst nix-smie--symbol-chars ":->|&=!</-+*?,;!")
(defconst nix-smie--infix-symbols-re
(regexp-opt '(":" "->" "||" "&&" "==" "!=" "<" "<=" ">" ">="
@@ -516,8 +514,8 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(point)
(progn
(or (/= 0 (skip-syntax-forward "'w_"))
- (and (looking-at nix-smie--symbols-re)
- (goto-char (match-end 0))))
+ (/= 0 (skip-chars-forward nix-smie--symbol-chars))
+ (skip-syntax-forward ".'"))
(point)))))
(defun nix-smie--forward-token ()
@@ -536,8 +534,8 @@ STRING-TYPE type of string based off of Emacs syntax table
types"
(point)
(progn
(or (/= 0 (skip-syntax-backward "'w_"))
- (and (looking-back nix-smie--symbols-re (- (point) 2) t)
- (goto-char (match-beginning 0))))
+ (/= 0 (skip-chars-backward nix-smie--symbol-chars))
+ (skip-syntax-backward ".'"))
(point)))))
(defun nix-smie--backward-token ()
- [nongnu] elpa/nix-mode b62c395b65 264/500: Remove nix-shell-haskell.el, (continued)
- [nongnu] elpa/nix-mode b62c395b65 264/500: Remove nix-shell-haskell.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1dd112e5cf 267/500: Fix function used as variable, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode f1973ceb4b 269/500: Add .nix to auto-mode-alist, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1389a6b25a 275/500: Fix flycheck warnings, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 95ef285e74 277/500: Update .nix script, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1ade7b76bd 282/500: ert/indent: Add testcase for contents of lists, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 02b59d9bcf 283/500: ert/indent: Add testcases for issues reported in #60, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode bb602e160f 286/500: Cleanups, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7526a43ea0 292/500: tests: Rename test for consistency with the rest, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode aa47e0c5ae 302/500: Fix indentation of lambdas starting at bol., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode e744c602fd 304/500: Replace regex operations with faster alternatives in the lexer.,
ELPA Syncer <=
- [nongnu] elpa/nix-mode 8721f63650 310/500: Merge pull request #79 from j-piecuch/smie, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 5fcdd667de 312/500: Make smie-indent-line the default indent function, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode b902e15c1f 003/500: Create nix-mode.el, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 1e74e5021a 002/500: Create LICENSE, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 616c368898 007/500: Add two spaces after period., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7292d8971c 021/500: Refactor indenting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 7f69c71f8d 019/500: Fixup mode map., ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 32929d9aed 024/500: Indent relative for string, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 9ab56cd6c9 035/500: Refactor indenting, ELPA Syncer, 2022/01/29
- [nongnu] elpa/nix-mode 65d0b6471f 039/500: Add more font lock constants., ELPA Syncer, 2022/01/29