Merge pull request #1938 from floscher/carto-grammar

Add grammar for CartoCSS
This commit is contained in:
Adam Roben
2015-01-07 09:31:34 -05:00
5 changed files with 11 additions and 2 deletions

3
.gitmodules vendored
View File

@@ -531,3 +531,6 @@
[submodule "vendor/grammars/sass-textmate-bundle"]
path = vendor/grammars/sass-textmate-bundle
url = https://github.com/nathos/sass-textmate-bundle
[submodule "vendor/grammars/carto-atom"]
path = vendor/grammars/carto-atom
url = https://github.com/yohanboniface/carto-atom

View File

@@ -136,6 +136,8 @@ vendor/grammars/c.tmbundle:
- source.c.platform
vendor/grammars/capnproto.tmbundle:
- source.capnp
vendor/grammars/carto-atom:
- source.css.mss
vendor/grammars/ceylon-sublimetext:
- module.ceylon
- source.ceylon

View File

@@ -450,12 +450,13 @@ Cap'n Proto:
ace_mode: text
CartoCSS:
type: programming
aliases:
- Carto
extensions:
- .mss
ace_mode: text
tm_scope: none
tm_scope: source.css.mss
Ceylon:
type: programming

View File

@@ -44,7 +44,7 @@ class DirectoryPackage
path.split('/')[-2] == 'Syntaxes'
when '.tmlanguage'
true
when '.cson'
when '.cson', '.json'
path.split('/')[-2] == 'grammars'
else
false
@@ -152,6 +152,8 @@ def load_grammar(path)
cson = `"#{CSONC}" "#{path}"`
raise "Failed to convert CSON grammar '#{path}': #{$?.to_s}" unless $?.success?
JSON.parse(cson)
when '.json'
JSON.parse(File.read(path))
else
raise "Invalid document type #{path}"
end

1
vendor/grammars/carto-atom vendored Submodule