Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Jan 15, 2020
1 parent 139f99b commit 492a3a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions grammars/julia.cson
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ repository:
name: "keyword.operator.transpose.julia"
name: "meta.array.julia"
patterns: [
{
match: "\\bbegin\\b"
name: "constant.numeric.julia"
}
{
match: "\\bend\\b"
name: "constant.numeric.julia"
Expand Down
9 changes: 9 additions & 0 deletions spec/julia-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ describe "Julia grammar", ->
expect(tokens[6]).toEqual value: "y", scopes: ["source.julia", "meta.array.julia"]
expect(tokens[7]).toEqual value: "]", scopes: ["source.julia", "meta.array.julia", "meta.bracket.julia"]

it "tokenizes begin/end indexing", ->
{tokens} = grammar.tokenizeLine("ary[begin:end]")
expect(tokens[0]).toEqual value: "ary", scopes: ["source.julia"]
expect(tokens[1]).toEqual value: "[", scopes: ["source.julia", "meta.array.julia", "meta.bracket.julia"]
expect(tokens[2]).toEqual value: "begin", scopes: ["source.julia", "meta.array.julia", "constant.numeric.julia"]
expect(tokens[3]).toEqual value: ":", scopes: ["source.julia", "meta.array.julia", "keyword.operator.range.julia"]
expect(tokens[4]).toEqual value: "end", scopes: ["source.julia", "meta.array.julia", "constant.numeric.julia"]
expect(tokens[5]).toEqual value: "]", scopes: ["source.julia", "meta.array.julia", "meta.bracket.julia"]

it "tokenizes qualified names", ->
{tokens} = grammar.tokenizeLine("Base.@time")
expect(tokens[0]).toEqual value: "Base", scopes: ["source.julia"]
Expand Down

0 comments on commit 492a3a2

Please sign in to comment.