[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode c718e8c 145/352: Use regexp-opt for keyword and
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode c718e8c 145/352: Use regexp-opt for keyword and constant regexps, because it outputs |
Date: |
Sun, 29 Aug 2021 11:22:33 -0400 (EDT) |
branch: elpa/julia-mode
commit c718e8c24368ded1b03c40fbebca3c2eadcdd260
Author: Wilfred Hughes <me@wilfred.me.uk>
Commit: Yichao Yu <yyc1992@gmail.com>
Use regexp-opt for keyword and constant regexps, because it outputs
regexps that are more efficient.
---
julia-mode.el | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/julia-mode.el b/julia-mode.el
index fea11dd..85488ec 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -85,21 +85,27 @@
(defconst julia-type-regex
(rx symbol-start "type" (1+ space) (group (1+ (or word ?_)))))
+(defconst julia-macro-regex
+ "@\\w+")
+
+(defconst julia-keyword-regex
+ (regexp-opt
+ '("if" "else" "elseif" "while" "for" "begin" "end" "quote"
+ "try" "catch" "return" "local" "abstract" "function" "macro" "ccall"
+ "finally" "typealias" "break" "continue" "type" "global"
+ "module" "using" "import" "export" "const" "let" "bitstype" "do"
+ "baremodule" "importall" "immutable")))
+
(defconst julia-font-lock-keywords
- (list
'("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|DataType\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|DenseArray\\|Range\\|OrdinalRange\\|StepRange\\|UnitRange
[...]
- font-lock-type-face)
+ (list
+
'("\\<\\(\\|Uint\\(8\\|16\\|32\\|64\\|128\\)\\|Int\\(8\\|16\\|32\\|64\\|128\\)\\|BigInt\\|Integer\\|BigFloat\\|FloatingPoint\\|Float16\\|Float32\\|Float64\\|Complex128\\|Complex64\\|ComplexPair\\|Bool\\|Char\\|DataType\\|Number\\|Real\\|Int\\|Uint\\|Array\\|DArray\\|AbstractArray\\|AbstractVector\\|AbstractMatrix\\|AbstractSparseMatrix\\|SubArray\\|StridedArray\\|StridedVector\\|StridedMatrix\\|VecOrMat\\|StridedVecOrMat\\|DenseArray\\|Range\\|OrdinalRange\\|StepRange\\|UnitRange\\|Fl
[...]
+ font-lock-type-face)
+ (cons julia-keyword-regex 'font-lock-keyword-face)
+ (cons julia-macro-regex 'font-lock-keyword-face)
(cons
- (concat "\\<\\("
- (mapconcat
- 'identity
- '("if" "else" "elseif" "while" "for" "begin" "end" "quote"
- "try" "catch" "return" "local" "abstract" "function" "macro"
"ccall"
- "finally" "typealias" "break" "continue" "type" "global" "@\\w+"
- "module" "using" "import" "export" "const" "let" "bitstype" "do"
- "baremodule" "importall" "immutable")
- "\\|") "\\)\\>")
- 'font-lock-keyword-face)
-
'("\\<\\(true\\|false\\|C_NULL\\|Inf\\|NaN\\|Inf32\\|NaN32\\|nothing\\)\\>" .
font-lock-constant-face)
+ (regexp-opt
+ '("true" "false" "C_NULL" "Inf" "NaN" "Inf32" "NaN32" "nothing"))
+ 'font-lock-constant-face)
(list julia-unquote-regex 2 'font-lock-constant-face)
(list julia-char-regex 2 'font-lock-string-face)
(list julia-forloop-in-regex 1 'font-lock-keyword-face)
- [nongnu] elpa/julia-mode 7c0cfff 130/352: base StridedArray on the abstract DenseArray. closes #2345, (continued)
- [nongnu] elpa/julia-mode 7c0cfff 130/352: base StridedArray on the abstract DenseArray. closes #2345, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 3b5f6b0 105/352: make "using Base" implicit, and add baremodule. closes #1522, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 81e46b1 129/352: Update cjh in .mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 75dc105 124/352: Merge ESS changes to julia-mode.el with backwards compatibility., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode b829e08 131/352: Added DataType to the list of highlighted type words in julia-mode.el., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 9dd8281 134/352: Add support for multiline comments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c74045a 125/352: emacs mode: change underscores back to word characters, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 873639b 127/352: emacs mode: make @ a word character again, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 314a731 136/352: more sensible sorting of substitutions; only search backwards as in REPL, and allow a wider range of chars (for things like #6927), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 070bd0c 140/352: Adding proper header and footer (use M-x checkdoc to confirm)., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c718e8c 145/352: Use regexp-opt for keyword and constant regexps, because it outputs,
ELPA Syncer <=
- [nongnu] elpa/julia-mode 03325fc 144/352: Highlight function names and type names., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 15051b5 157/352: updated julia-mode.el for recent latex-symbol additions (#7961 and #7962), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 38b74a9 164/352: emacs-mode fix for emacs 22: need to check whether codepoints outside the BMP are supported by emacs, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 91f2a15 101/352: Update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 099b687 107/352: organize Core exports list, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode e51b039 099/352: fixing a bug in emacs mode with block start at beginning of buffer, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 267cebf 118/352: Autoload julia-mode., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 88aab43 121/352: Merge in changes from ESS' version of julia-mode.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode cde82a9 120/352: Add Float16 to julia-mode.el, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 72d2e0f 123/352: Add support for Float16 to various array constructors, ELPA Syncer, 2021/08/29