branch: elpa/julia-mode commit fc047312eec2a0e75c908b2fffa88a1aa9a77838 Author: Wilfred Hughes <m...@wilfred.me.uk> Commit: Yichao Yu <yyc1...@gmail.com>
Highlight parameter types and subtypes. --- julia-mode.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/julia-mode.el b/julia-mode.el index 3d65664..ef22798 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -108,13 +108,16 @@ (rx symbol-start "function" (1+ space) (group (1+ (or word ?_ ?!))))) (defconst julia-type-regex - (rx symbol-start "type" (1+ space) (group (1+ (or word ?_))))) + (rx symbol-start (or "function" "type" "abstract") (1+ space) (group (1+ (or word ?_))))) (defconst julia-type-annotation-regex (rx "::" (group (1+ (or word ?_))))) +(defconst julia-type-parameter-regex + (rx symbol-start (1+ (or word ?_)) "{" (group (1+ (or word ?_))) "}")) + (defconst julia-subtype-regex - (rx "<:" (1+ space) (group (1+ (or word ?_))))) + (rx "<:" (1+ space) (group (1+ (or word ?_))) (0+ space) (or "\n" "{" "end"))) (defconst julia-macro-regex "@\\w+") @@ -144,6 +147,7 @@ (list julia-function-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) (list julia-subtype-regex 1 'font-lock-type-face) ))