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

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

[nongnu] elpa/julia-mode 03325fc 144/352: Highlight function names and t


From: ELPA Syncer
Subject: [nongnu] elpa/julia-mode 03325fc 144/352: Highlight function names and type names.
Date: Sun, 29 Aug 2021 11:22:33 -0400 (EDT)

branch: elpa/julia-mode
commit 03325fcb23e95bf7a6d2dae94ec8a31718140a73
Author: Wilfred Hughes <me@wilfred.me.uk>
Commit: Yichao Yu <yyc1992@gmail.com>

    Highlight function names and type names.
---
 julia-mode.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/julia-mode.el b/julia-mode.el
index 03a9ec0..fea11dd 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -79,6 +79,12 @@
   "for +.*[^
 ].* \\(in\\)\\(\\s-\\|$\\)+")
 
+(defconst julia-function-regex
+  (rx symbol-start "function" (1+ space) (group (1+ (or word ?_ ?!)))))
+
+(defconst julia-type-regex
+  (rx symbol-start "type" (1+ space) (group (1+ (or word ?_)))))
+
 (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)
@@ -97,7 +103,8 @@
     (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)
-    ;(list julia-string-regex 0 'font-lock-string-face)
+    (list julia-function-regex 1 'font-lock-function-name-face)
+    (list julia-type-regex 1 'font-lock-type-face)
 ))
 
 (defconst julia-block-start-keywords



reply via email to

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