mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Merge pull request #1938 from floscher/carto-grammar
Add grammar for CartoCSS
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
1
vendor/grammars/carto-atom
vendored
Submodule
Submodule vendor/grammars/carto-atom added at 8086625aa5
Reference in New Issue
Block a user