Skip to content

Commit

Permalink
Fix interpolated name in type constructors (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
ViktorQvarfordt committed Apr 26, 2017
1 parent 5fae5bd commit da05d94
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Julia.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ contexts:
set: function-parameters

decl-type:
- match: \b(mutable struct|type|struct|immutable|abstract type|abstract|primitive type)\s+({{symb_id}}+)({{nested_curly}})?
# Dollar is ok because type names can be interpolated.
- match: \b(mutable struct|type|struct|immutable|abstract type|abstract|primitive type)\s+((?:\$|{{symb_id}})+)({{nested_curly}})?
scope: meta.type.julia
captures:
1: keyword.other.julia
Expand Down
10 changes: 9 additions & 1 deletion syntax_test_julia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
# ^^^ support.type
# ^^^ keyword.other
mutable struct Foo{T} end
# ^^^^^^ keyword.other
# ^^^^^^^ keyword.other
# ^^^^^^ keyword.other
# ^^^ entity.name.type
# ^^^ support.type
Expand All @@ -441,6 +441,14 @@
# ^^ constant.numeric
# ^^^ keyword.other

# (issue 52)
mutable struct $Foo{T} end
# ^^^^^^^ keyword.other
# ^^^^^^ keyword.other
# ^^^^ entity.name.type
# ^^^ support.type
# ^^^ keyword.other


##
## FUNCTION DEFINITIONS
Expand Down

0 comments on commit da05d94

Please sign in to comment.