Skip to content

Commit 3f8e1a3

Browse files
authored
Highlight const etc as keywords (#160)
* local/global are not variables * make const, local, global keywords so they stand out in syntax themes that don't highlight `.storage.modifier`
1 parent 9c67175 commit 3f8e1a3

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

grammars/julia.cson

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ repository:
212212
}
213213
{
214214
match: "\\b(?<![:_])(?:global|local|const)\\b"
215-
name: "storage.modifier.variable.julia"
215+
name: "keyword.storage.modifier.julia"
216216
}
217217
{
218218
match: "\\b(?<![:_])(?:export)\\b"

spec/julia-spec.coffee

+5
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ describe "Julia grammar", ->
101101
expect(tokens[28]).toEqual value: "X.Y.Z", scopes: ["source.julia", "support.type.julia"]
102102
expect(tokens[29]).toEqual value: ")", scopes: ["source.julia", "meta.bracket.julia"]
103103

104+
it "tokenizes `const` as a keyword", ->
105+
{tokens} = grammar.tokenizeLine("const Foo")
106+
expect(tokens[0]).toEqual value: "const", scopes: ["source.julia", "keyword.storage.modifier.julia"]
107+
expect(tokens[1]).toEqual value: " Foo", scopes: ["source.julia"]
108+
104109
it "tokenizes functions and (shallowly nested) parameterized types", ->
105110
{tokens} = grammar.tokenizeLine("x{T <: Dict{Any, Tuple{Int, Int}}}(a::T, b::Union{Int, Set{Any}})")
106111
expect(tokens[0]).toEqual value: "x", scopes: ["source.julia", "support.function.julia"]

0 commit comments

Comments
 (0)