branch: elpa/julia-mode
commit ba5ba4c237f688cb711e4e17aee6fd1a0a41c621
Author: Wilfred Hughes <[email protected]>
Commit: Yichao Yu <[email protected]>
Highlight function names when defined with the assignment syntax.
---
julia-mode.el | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/julia-mode.el b/julia-mode.el
index 7a52c88..d3932ce 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -113,6 +113,16 @@
;; The function name itself
(group (1+ (or word ?_ ?!)))))
+(defconst julia-function-assignment-regex
+ (rx line-start symbol-start
+ (group (1+ (or word ?_ ?!)))
+ (* space)
+ (? "{" (* (not (any "}"))) "}")
+ (* space)
+ "(" (* (not (any ")"))) ")"
+ (* space)
+ "="))
+
(defconst julia-type-regex
(rx symbol-start (or "immutable" "type" "abstract") (1+ space) (group (1+
(or word ?_)))))
@@ -158,6 +168,7 @@
(list julia-char-regex 2 'font-lock-string-face)
(list julia-forloop-in-regex 1 'font-lock-keyword-face)
(list julia-function-regex 1 'font-lock-function-name-face)
+ (list julia-function-assignment-regex 1 'font-lock-function-name-face)
(list julia-type-regex 1 'font-lock-type-face)
(list julia-type-annotation-regex 1 'font-lock-type-face)
;;(list julia-type-parameter-regex 1 'font-lock-type-face)