[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode ac7431c 174/352: Mark @ and ! as a symbol const
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode ac7431c 174/352: Mark @ and ! as a symbol constituents, as suggested by @Clemens-H. |
Date: |
Sun, 29 Aug 2021 11:22:39 -0400 (EDT) |
branch: elpa/julia-mode
commit ac7431c4a943903ffb179c248dbc4f049e74d6d1
Author: Wilfred Hughes <me@wilfred.me.uk>
Commit: Yichao Yu <yyc1992@gmail.com>
Mark @ and ! as a symbol constituents, as suggested by @Clemens-H.
Generally only [a-zA-Z0-9] should be word constituents, and everything
else should be a symbol constituent. See
http://emacs.stackexchange.com/q/1075/304 for a discussion.
This also enables us to simplify our regexps.
---
julia-mode.el | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/julia-mode.el b/julia-mode.el
index d5e9ad2..c4e3522 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -49,8 +49,9 @@
(defvar julia-mode-syntax-table
(let ((table (make-syntax-table)))
- (modify-syntax-entry ?_ "w" table) ; underscores in words
- (modify-syntax-entry ?@ "w" table)
+ (modify-syntax-entry ?_ "_" table)
+ (modify-syntax-entry ?@ "_" table)
+ (modify-syntax-entry ?! "_" table)
(modify-syntax-entry ?# "< 14" table) ; # single-line and multiline start
(modify-syntax-entry ?= ". 23bn" table)
(modify-syntax-entry ?\n ">" table) ; \n single-line comment end
@@ -106,16 +107,16 @@
].* \\(in\\)\\(\\s-\\|$\\)+")
(defconst julia-function-regex
- (rx symbol-start "function"
+ (rx line-start symbol-start "function"
(1+ space)
;; Don't highlight module names in function declarations:
- (* (seq (1+ (or word ?_)) "."))
+ (* (seq (1+ (or word (syntax symbol))) "."))
;; The function name itself
- (group (1+ (or word ?_ ?!)))))
+ (group (1+ (or word (syntax symbol))))))
(defconst julia-function-assignment-regex
(rx line-start symbol-start
- (group (1+ (or word ?_ ?!)))
+ (group (1+ (or word (syntax symbol))))
(* space)
(? "{" (* (not (any "}"))) "}")
(* space)
@@ -124,19 +125,19 @@
"="))
(defconst julia-type-regex
- (rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+
(or word ?_)))))
+ (rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+
(or word (syntax symbol))))))
(defconst julia-type-annotation-regex
- (rx "::" (group (1+ (or word ?_)))))
+ (rx "::" (group (1+ (or word (syntax symbol))))))
;;(defconst julia-type-parameter-regex
-;; (rx symbol-start (1+ (or word ?_)) "{" (group (1+ (or word ?_))) "}"))
+;; (rx symbol-start (1+ (or (or word (syntax symbol)) ?_)) "{" (group (1+ (or
(or word (syntax symbol)) ?_))) "}"))
(defconst julia-subtype-regex
- (rx "<:" (1+ space) (group (1+ (or word ?_))) (0+ space) (or "\n" "{"
"end")))
+ (rx "<:" (1+ space) (group (1+ (or word (syntax symbol)))) (0+ space) (or
"\n" "{" "end")))
(defconst julia-macro-regex
- (rx symbol-start (group "@" (1+ (or word ?_ ?!)))))
+ (rx symbol-start (group "@" (1+ (or word (syntax symbol))))))
(defconst julia-keyword-regex
(regexp-opt
- [nongnu] elpa/julia-mode df2ab77 319/352: test on Emacs25, simplify setup code (#95), (continued)
- [nongnu] elpa/julia-mode df2ab77 319/352: test on Emacs25, simplify setup code (#95), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 5238f9a 323/352: Increase lookback. (#98), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 7de3b0c 330/352: Remove highlighting for :: and <:. (#112), ELPA Syncer, 2021/08/29
- [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 <=
- [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, 2021/08/29
- [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