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

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

[nongnu] elpa/julia-mode 7eb9038 161/352: Highlight the function name, n


From: ELPA Syncer
Subject: [nongnu] elpa/julia-mode 7eb9038 161/352: Highlight the function name, not the module name, in declarations.
Date: Sun, 29 Aug 2021 11:22:36 -0400 (EDT)

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

    Highlight the function name, not the module name, in declarations.
    
    For example, the code:
    
    function Base.getindex{T,S}(x::ArraySplit{T,S,Nothing}, i::Int)
        (i >= 1 && i <= x.k) || throw(BoundsError())
        copy!(x.buf, 1, x.s, (i-1)*(x.n-x.noverlap) + 1, x.n)
    end
---
 julia-mode.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/julia-mode.el b/julia-mode.el
index bcfd170..b21378c 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -105,7 +105,12 @@
 ].* \\(in\\)\\(\\s-\\|$\\)+")
 
 (defconst julia-function-regex
-  (rx symbol-start "function" (1+ space) (group (1+ (or word ?_ ?!)))))
+  (rx symbol-start "function"
+      (1+ space)
+      ;; Don't highlight module names in function declarations:
+      (* (seq (1+ (or word ?_)) "."))
+      ;; The function name itself
+      (group (1+ (or word ?_ ?!)))))
 
 (defconst julia-type-regex
   (rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+ 
(or word ?_)))))



reply via email to

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