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"] [submodule "vendor/grammars/sass-textmate-bundle"]
path = vendor/grammars/sass-textmate-bundle path = vendor/grammars/sass-textmate-bundle
url = https://github.com/nathos/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 - source.c.platform
vendor/grammars/capnproto.tmbundle: vendor/grammars/capnproto.tmbundle:
- source.capnp - source.capnp
vendor/grammars/carto-atom:
- source.css.mss
vendor/grammars/ceylon-sublimetext: vendor/grammars/ceylon-sublimetext:
- module.ceylon - module.ceylon
- source.ceylon - source.ceylon

View File

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

View File

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

1
vendor/grammars/carto-atom vendored Submodule