Merge pull request #1891 from github/fix-grammars

Fix some bugs in grammars.yml
This commit is contained in:
Arfon Smith
2014-12-17 15:35:30 -08:00
4 changed files with 65 additions and 36 deletions

View File

@@ -26,13 +26,13 @@ https://github.com/AlanQuatermain/go-tmbundle:
- source.go - source.go
https://github.com/Anomareh/PHP-Twig.tmbundle: https://github.com/Anomareh/PHP-Twig.tmbundle:
- text.html.twig - text.html.twig
https://github.com/Cirru/sublime-cirru/raw/master/Cirru.tmLanguage: https://github.com/Cirru/sublime-cirru:
- source.cirru - source.cirru
https://github.com/Cykey/Sublime-Logos: https://github.com/Cykey/Sublime-Logos:
- source.logos - source.logos
https://github.com/Drako/SublimeBrainfuck/raw/master/Brainfuck.tmLanguage: https://github.com/Drako/SublimeBrainfuck:
- source.bf - source.bf
https://github.com/JohnNilsson/awk-sublime/raw/master/AWK.tmLanguage: https://github.com/JohnNilsson/awk-sublime:
- source.awk - source.awk
https://github.com/JonBons/Sublime-SQF-Language: https://github.com/JonBons/Sublime-SQF-Language:
- source.sqf - source.sqf
@@ -46,7 +46,7 @@ https://github.com/Red-Nova-Technologies/autoitv3-tmbundle:
- source.autoit.3 - source.autoit.3
https://github.com/SalGnt/Sublime-VimL: https://github.com/SalGnt/Sublime-VimL:
- source.viml - source.viml
https://github.com/Shammah/boo-sublime/raw/master/Boo.tmLanguage: https://github.com/Shammah/boo-sublime:
- source.boo - source.boo
https://github.com/SublimeText/ColdFusion: https://github.com/SublimeText/ColdFusion:
- source.cfscript - source.cfscript
@@ -74,6 +74,8 @@ https://github.com/aroben/ruby.tmbundle@4636a3023153c3034eb6ffc613899ba9cf33b41f
- text.html.erb - text.html.erb
https://github.com/asbjornenge/Docker.tmbundle: https://github.com/asbjornenge/Docker.tmbundle:
- source.dockerfile - source.dockerfile
https://github.com/atmarksharp/jasmin-sublime:
- source.jasmin
https://github.com/atom/language-clojure: https://github.com/atom/language-clojure:
- source.clojure - source.clojure
https://github.com/atom/language-coffee-script: https://github.com/atom/language-coffee-script:
@@ -84,7 +86,7 @@ https://github.com/atom/language-csharp:
- source.csx - source.csx
- source.nant-build - source.nant-build
https://github.com/atom/language-gfm: https://github.com/atom/language-gfm:
- text.html.markdown - source.gfm
https://github.com/atom/language-javascript: https://github.com/atom/language-javascript:
- source.js - source.js
- source.js.regexp - source.js.regexp
@@ -110,7 +112,8 @@ https://github.com/brandonwamboldt/sublime-nginx:
- source.nginx - source.nginx
https://github.com/bro/bro-sublime: https://github.com/bro/bro-sublime:
- source.bro - source.bro
https://github.com/carsonoid/sublime_man_page_support/raw/master/man-groff.tmLanguage: https://github.com/carsonoid/sublime_man_page_support:
- source.man
- text.groff - text.groff
https://github.com/ccreutzig/sublime-MuPAD: https://github.com/ccreutzig/sublime-MuPAD:
- source.mupad - source.mupad
@@ -127,7 +130,7 @@ https://github.com/clemos/haxe-sublime-bundle:
https://github.com/cucumber/cucumber-tmbundle: https://github.com/cucumber/cucumber-tmbundle:
- source.ruby.rspec.cucumber.steps - source.ruby.rspec.cucumber.steps
- text.gherkin.feature - text.gherkin.feature
https://github.com/daaain/Handlebars/raw/master/Handlebars.tmLanguage: https://github.com/daaain/Handlebars:
- text.html.handlebars - text.html.handlebars
https://github.com/davidpeckham/powershell.tmbundle: https://github.com/davidpeckham/powershell.tmbundle:
- source.powershell - source.powershell
@@ -138,9 +141,12 @@ https://github.com/elixir-lang/elixir-tmbundle:
- source.elixir - source.elixir
- text.elixir - text.elixir
- text.html.elixir - text.html.elixir
https://github.com/eregon/oz-tmbundle/raw/master/Syntaxes/Oz.tmLanguage:
- source.oz
https://github.com/ericzou/ebundles/raw/master/Bundles/MSDOS%20batch%20file.tmbundle/Syntaxes/MSDOS%20batch%20file.tmLanguage: https://github.com/ericzou/ebundles/raw/master/Bundles/MSDOS%20batch%20file.tmbundle/Syntaxes/MSDOS%20batch%20file.tmLanguage:
- source.dosbatch - source.dosbatch
https://github.com/euler0/sublime-glsl/raw/master/GLSL.tmLanguage: https://github.com/euler0/sublime-glsl:
- source.essl
- source.glsl - source.glsl
https://github.com/fancy-lang/fancy-tmbundle: https://github.com/fancy-lang/fancy-tmbundle:
- source.fancy - source.fancy
@@ -148,27 +154,32 @@ https://github.com/fsharp/fsharpbinding:
- source.fsharp - source.fsharp
https://github.com/gingerbeardman/monkey.tmbundle: https://github.com/gingerbeardman/monkey.tmbundle:
- source.monkey - source.monkey
https://github.com/guillermooo/dart-sublime-bundle/raw/master/Dart.tmLanguage: https://github.com/guillermooo/dart-sublime-bundle:
- source.dart - source.dart
https://github.com/harrism/sublimetext-cuda-cpp/raw/master/cuda-c%2B%2B.tmLanguage: - source.pubspec
- text.dart-doccomments
https://github.com/harrism/sublimetext-cuda-cpp:
- source.cuda-c++ - source.cuda-c++
https://github.com/hww3/pike-textmate: https://github.com/hww3/pike-textmate:
- source.pike - source.pike
https://github.com/jeancharles-roger/ceylon-sublimetext/raw/master/Ceylon.tmLanguage: https://github.com/jeancharles-roger/ceylon-sublimetext:
- module.ceylon
- source.ceylon - source.ceylon
https://github.com/jfairbank/Sublime-Text-2-OpenEdge-ABL: https://github.com/jfairbank/Sublime-Text-2-OpenEdge-ABL:
- source.abl - source.abl
https://github.com/jhasse/sublime-rust: https://github.com/jhasse/sublime-rust:
- source.rust - source.rust
https://github.com/johanasplund/sublime-befunge/raw/master/Befunge-93.tmLanguage: https://github.com/johanasplund/sublime-befunge:
- source.befunge - source.befunge
https://github.com/joshaven/RDoc.tmbundle: https://github.com/joshaven/RDoc.tmbundle:
- text.rdoc - text.rdoc
https://github.com/jpcamara/Textmate-Gosu-Bundle/raw/master/Gosu.tmbundle/Syntaxes/Gosu.tmLanguage: https://github.com/jpcamara/Textmate-Gosu-Bundle:
- source.gosu.2 - source.gosu.2
https://github.com/kswedberg/jquery-tmbundle: https://github.com/kswedberg/jquery-tmbundle:
- source.js.jquery - source.js.jquery
https://github.com/laughedelic/sublime-idris/raw/master/Idris.tmLanguage: https://github.com/l15n/fish-tmbundle:
- source.fish
https://github.com/laughedelic/sublime-idris:
- source.idris - source.idris
https://github.com/lavrton/sublime-better-typescript: https://github.com/lavrton/sublime-better-typescript:
- source.ts - source.ts
@@ -196,14 +207,15 @@ https://github.com/mgalloy/idl.tmbundle:
- text.idl-idldoc - text.idl-idldoc
https://github.com/michaeledgar/protobuf-tmbundle: https://github.com/michaeledgar/protobuf-tmbundle:
- source.protobuf - source.protobuf
https://github.com/mkolosick/Sublime-Coq/raw/master/Coq.tmLanguage: https://github.com/mkolosick/Sublime-Coq:
- source.coq - source.coq
https://github.com/mokus0/Agda.tmbundle: https://github.com/mokus0/Agda.tmbundle:
- source.agda - source.agda
https://github.com/nanoant/Julia.tmbundle: https://github.com/nanoant/Julia.tmbundle:
- source.julia - source.julia
https://github.com/nanoant/assembly.tmbundle/raw/master/Syntaxes/objdump%20C%2B%2B.tmLanguage: https://github.com/nanoant/assembly.tmbundle:
- objdump.x86asm - objdump.x86asm
- source.x86asm
https://github.com/nilium/ooc.tmbundle: https://github.com/nilium/ooc.tmbundle:
- source.ooc - source.ooc
https://github.com/paulmillr/LiveScript.tmbundle: https://github.com/paulmillr/LiveScript.tmbundle:
@@ -217,6 +229,8 @@ https://github.com/pvl/abap.tmbundle:
https://github.com/scalate/Scalate.tmbundle: https://github.com/scalate/Scalate.tmbundle:
- source.scaml - source.scaml
- text.html.ssp - text.html.ssp
https://github.com/sebgod/mercury-tmlanguage:
- source.mercury
https://github.com/shadanan/mathematica-tmbundle: https://github.com/shadanan/mathematica-tmbundle:
- source.mathematica - source.mathematica
https://github.com/shellderp/sublime-robot-plugin: https://github.com/shellderp/sublime-robot-plugin:
@@ -229,8 +243,9 @@ https://github.com/skozlovf/Sublime-QML:
- source.qml - source.qml
https://github.com/slash-lang/Slash.tmbundle: https://github.com/slash-lang/Slash.tmbundle:
- text.html.slash - text.html.slash
https://github.com/slavapestov/factor/raw/master/misc/Factor.tmbundle/Syntaxes/Factor.tmLanguage: https://github.com/slavapestov/factor:
- source.factor - source.factor
- text.html.factor
https://github.com/slim-template/ruby-slim.tmbundle: https://github.com/slim-template/ruby-slim.tmbundle:
- text.slim - text.slim
https://github.com/staltz/SublimeXtend: https://github.com/staltz/SublimeXtend:
@@ -240,6 +255,8 @@ https://github.com/statatmbundle/Stata.tmbundle:
- source.stata - source.stata
https://github.com/technosophos/Vala-TMBundle: https://github.com/technosophos/Vala-TMBundle:
- source.vala - source.vala
https://github.com/tenbits/sublime-mask/raw/release/Syntaxes/mask.tmLanguage:
- source.mask
https://github.com/textmate/ant.tmbundle: https://github.com/textmate/ant.tmbundle:
- text.xml.ant - text.xml.ant
https://github.com/textmate/antlr.tmbundle: https://github.com/textmate/antlr.tmbundle:
@@ -254,10 +271,6 @@ https://github.com/textmate/asp.tmbundle:
- text.html.asp - text.html.asp
https://github.com/textmate/bison.tmbundle: https://github.com/textmate/bison.tmbundle:
- source.bison - source.bison
https://github.com/vmg/c.tmbundle:
- source.c
- source.c++
- source.c.platform
https://github.com/textmate/capnproto.tmbundle: https://github.com/textmate/capnproto.tmbundle:
- source.capnp - source.capnp
https://github.com/textmate/cmake.tmbundle: https://github.com/textmate/cmake.tmbundle:
@@ -410,25 +423,17 @@ https://github.com/textmate/xml.tmbundle:
- text.xml.xsl - text.xml.xsl
https://github.com/tomas-stefano/smalltalk-tmbundle: https://github.com/tomas-stefano/smalltalk-tmbundle:
- source.smalltalk - source.smalltalk
https://github.com/vic/ioke-outdated/raw/master/share/TextMate/Ioke.tmbundle/Syntaxes/Ioke.tmLanguage: https://github.com/vic/ioke-outdated:
- source.ioke - source.ioke
https://github.com/vkostyukov/kotlin-sublime-package: https://github.com/vkostyukov/kotlin-sublime-package:
- source.Kotlin - source.Kotlin
https://github.com/vmg/c.tmbundle:
- source.c
- source.c++
- source.c.platform
https://github.com/vmg/zephir-sublime: https://github.com/vmg/zephir-sublime:
- source.php.zephir - source.php.zephir
https://github.com/whitequark/llvm.tmbundle: https://github.com/whitequark/llvm.tmbundle:
- source.llvm - source.llvm
https://github.com/wmertens/sublime-nix: https://github.com/wmertens/sublime-nix:
- source.nix - source.nix
https://raw.githubusercontent.com/eregon/oz-tmbundle/master/Syntaxes/Oz.tmLanguage:
- source.oz
https://raw.githubusercontent.com/sebgod/mercury-tmlanguage/master/Mercury.tmLanguage:
- source.mercury
https://raw.githubusercontent.com/tenbits/sublime-mask/release/Syntaxes/mask.tmLanguage:
- source.mask
https://github.com/l15n/fish-tmbundle:
- source.fish
https://raw.githubusercontent.com/andik/IDL-Syntax/master/IDL.tmLanguage:
- source.webidl
https://raw.githubusercontent.com/atmarksharp/jasmin-sublime/master/Jasmin.tmLanguage:
- source.jasmin

View File

@@ -1725,7 +1725,7 @@ Markdown:
- .mkdn - .mkdn
- .mkdown - .mkdown
- .ron - .ron
tm_scope: text.html.markdown tm_scope: source.gfm
Mask: Mask:
type: markup type: markup
@@ -3057,7 +3057,7 @@ WebIDL:
type: programming type: programming
extensions: extensions:
- .webidl - .webidl
tm_scope: source.webidl tm_scope: none
ace_mode: text ace_mode: text
XC: XC:

13
test/test_grammars.rb Normal file
View File

@@ -0,0 +1,13 @@
require_relative "./helper"
class TestGrammars < Test::Unit::TestCase
def setup
@grammars = YAML.load(File.read(File.expand_path("../../grammars.yml", __FILE__)))
end
def test_no_duplicate_scopes
scopes = @grammars.values.flatten
duplicates = scopes.group_by { |s| s }.select { |k, v| v.length > 1 }.map(&:first)
assert duplicates.empty?, "The following scopes appear in grammars.yml more than once:\n#{duplicates.sort.join("\n")}"
end
end

View File

@@ -3,6 +3,7 @@ require_relative "./helper"
class TestPedantic < Test::Unit::TestCase class TestPedantic < Test::Unit::TestCase
filename = File.expand_path("../../lib/linguist/languages.yml", __FILE__) filename = File.expand_path("../../lib/linguist/languages.yml", __FILE__)
LANGUAGES = YAML.load(File.read(filename)) LANGUAGES = YAML.load(File.read(filename))
GRAMMARS = YAML.load(File.read(File.expand_path("../../grammars.yml", __FILE__)))
def test_language_names_are_sorted def test_language_names_are_sorted
assert_sorted LANGUAGES.keys assert_sorted LANGUAGES.keys
@@ -21,6 +22,16 @@ class TestPedantic < Test::Unit::TestCase
end end
end end
def test_grammars_are_sorted
assert_sorted GRAMMARS.keys
end
def test_scopes_are_sorted
GRAMMARS.values.each do |scopes|
assert_sorted scopes
end
end
def assert_sorted(list) def assert_sorted(list)
list.each_cons(2) do |previous, item| list.each_cons(2) do |previous, item|
flunk "#{previous} should come after #{item}" if previous > item flunk "#{previous} should come after #{item}" if previous > item