[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode 76d5d75 183/352: Optimising julia-at-keyword.
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode 76d5d75 183/352: Optimising julia-at-keyword. |
Date: |
Sun, 29 Aug 2021 11:22:41 -0400 (EDT) |
branch: elpa/julia-mode
commit 76d5d75243840e7edbe1f9761db64b2807d1114e
Author: Wilfred Hughes <me@wilfred.me.uk>
Commit: Yichao Yu <yyc1992@gmail.com>
Optimising julia-at-keyword.
It's an expensive function and we call it quite often. Ensure
we do the cheap checks first, and avoid calling julia-in-brackets
only if necessary.
---
julia-mode.el | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/julia-mode.el b/julia-mode.el
index 7419cfe..cac3f03 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -220,12 +220,6 @@ This function provides equivalent functionality, but makes
no efforts to optimis
(defconst julia-block-end-keywords
(list "end" "else" "elseif" "catch" "finally"))
-(defun julia-member (item lst)
- (if (null lst)
- nil
- (or (equal item (car lst))
- (julia-member item (cdr lst)))))
-
(defun julia-in-comment ()
"Return non-nil if point is inside a comment.
Handles both single-line and multi-line comments."
@@ -289,9 +283,11 @@ a keyword if used as a field name, X.word, or quoted,
:word."
(and (or (= (point) 1)
(and (not (equal (char-before (point)) ?.))
(not (equal (char-before (point)) ?:))))
+ (member (current-word t) kw-list)
(not (julia-in-comment))
- (not (julia-in-brackets))
- (julia-member (current-word t) kw-list)))
+ ;; 'end' is not a keyword when used for indexing, e.g. foo[end-2]
+ (or (not (equal (current-word t) "end"))
+ (not (julia-in-brackets)))))
;; if backward-sexp gives an error, move back 1 char to move over the '('
(defun julia-safe-backward-sexp ()
- [nongnu] elpa/julia-mode 1c122f1 328/352: Fix multiple type face highlighting. Add tests. (#110), (continued)
- [nongnu] elpa/julia-mode 1c122f1 328/352: Fix multiple type face highlighting. Add tests. (#110), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 6e9e60b 327/352: Fix forloop matching on == instead of = (#105), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ac22747 178/352: remove trailing ws from repo, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c3d3e3a 182/352: Don't call parse-partial-sexp to find the last opening paren., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c45c786 335/352: Add more tests, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 549a7b4 341/352: Remove C_NULL from constants and add Cvoid, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 13a3c53 344/352: Merge branch 'master' into triple-quote-cmd, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ac7431c 174/352: Mark @ and ! as a symbol constituents, as suggested by @Clemens-H., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ac55340 175/352: Factoring out a types regex., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode d96a08c 180/352: Refactoring julia-char-regex as an rx form., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 76d5d75 183/352: Optimising julia-at-keyword.,
ELPA Syncer <=
- [nongnu] elpa/julia-mode 9cdad57 187/352: Make julia-char-regex stricter., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ff5fc36 202/352: julia-mode.el: allow space or no space after :: and <:, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 05f002c 203/352: When indenting code, limit how far back we search., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 70bbe82 204/352: Adding unit tests for indentation., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ff8adf5 221/352: Add tests for #11684. [ci skip], ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 8ab2a60 222/352: julia-paren-indent skips blanks after paren, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c8dfbe2 227/352: Declare indentation as customizable, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 011435c 237/352: julia-mode: Fix indent for hanging ops and module, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c2f0ed8 235/352: julia-mode: Fix prompt regexp, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode a95b06b 252/352: Merge pull request #20 from tpapp/indent-export, ELPA Syncer, 2021/08/29