Skip to content

Commit

Permalink
julia-mode.el: improve matching of function assignment syntax
Browse files Browse the repository at this point in the history
The case when a module qualification is prepended to the function name
is handled like in normal function syntax, and support for one level of
nested parentheses is added, e.g. M.f(x::(Int,)) = 1 (tuple types) or
M.f(x, y=length(x)).
  • Loading branch information
rfourquet committed Dec 5, 2014
1 parent 1673768 commit d04ea58
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion contrib/julia-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,15 @@ This function provides equivalent functionality, but makes no efforts to optimis

(defconst julia-function-assignment-regex
(rx line-start symbol-start
(* (seq (1+ (or word (syntax symbol))) ".")) ; module name
(group (1+ (or word (syntax symbol))))
(* space)
(? "{" (* (not (any "}"))) "}")
(* space)
"(" (* (not (any ")"))) ")"
"(" (* (or
(seq "(" (* (not (any "(" ")"))) ")")
(not (any "(" ")"))))
")"
(* space)
"="))

Expand Down

0 comments on commit d04ea58

Please sign in to comment.