branch: elpa/julia-mode commit 1c122f1dff8dd2674245b2ce5e43b62504864bfd Author: Tamas K. Papp <tkp...@gmail.com> Commit: GitHub <nore...@github.com>
Fix multiple type face highlighting. Add tests. (#110) --- julia-mode-tests.el | 8 ++++++++ julia-mode.el | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/julia-mode-tests.el b/julia-mode-tests.el index 9187731..53a5f4f 100644 --- a/julia-mode-tests.el +++ b/julia-mode-tests.el @@ -498,6 +498,14 @@ end") (julia--should-font-lock string 25 nil) (julia--should-font-lock string 26 nil))) +(ert-deftest julia--test-typeparams-font-lock () + (let ((string "@with_kw struct Foo{A <: AbstractThingy, B <: Tuple}\n bar::A\n baz::B\nend")) + (julia--should-font-lock string 30 font-lock-type-face) ; AbstractThingy + (julia--should-font-lock string 50 font-lock-type-face) ; Tuple + (julia--should-font-lock string 63 font-lock-type-face) ; A + (julia--should-font-lock string 74 font-lock-type-face) ; B + )) + ;;; Movement (ert-deftest julia--test-beginning-of-defun-assn-1 () "Point moves to beginning of single-line assignment function." diff --git a/julia-mode.el b/julia-mode.el index 57c2874..fb030ee 100644 --- a/julia-mode.el +++ b/julia-mode.el @@ -249,7 +249,7 @@ (rx "::" (0+ space) (group (1+ (or word (syntax symbol)))))) (defconst julia-subtype-regex - (rx "<:" (0+ space) (group (1+ (or word (syntax symbol)))) (0+ space) (or "\n" "{" "}" "end"))) + (rx "<:" (0+ space) (group (1+ (or word (syntax symbol)))) (0+ space) (or "\n" "{" "}" "end" ","))) (defconst julia-macro-regex (rx symbol-start (group "@" (1+ (or word (syntax symbol))))))