diff --git a/grammars.yml b/grammars.yml index 1bedce80..ae0245e4 100644 --- a/grammars.yml +++ b/grammars.yml @@ -420,3 +420,5 @@ https://github.com/wmertens/sublime-nix: - source.nix https://raw.githubusercontent.com/eregon/oz-tmbundle/master/Syntaxes/Oz.tmLanguage: - source.oz +https://raw.githubusercontent.com/tenbits/sublime-mask/release/Syntaxes/mask.tmLanguage: +- source.mask \ No newline at end of file diff --git a/lib/linguist/heuristics.rb b/lib/linguist/heuristics.rb index 48b64d0c..b41469ce 100644 --- a/lib/linguist/heuristics.rb +++ b/lib/linguist/heuristics.rb @@ -155,6 +155,22 @@ module Linguist Language["LiveScript"] end end + + disambiguate "Common Lisp", "NewLisp" do |data| + if /^\s*\((defun|defactor|in-package|defpackage) /.match(data) + Language["Common Lisp"] + elsif /^\s*\(define /.match(data) + Language["NewLisp"] + end + end + + disambiguate "TypeScript", "XML" do |data| + if data.include?(" + + + + MainWindow + + + United Kingdom + Reino Unido + + + + God save the Queen + Deus salve a Rainha + + + + England + Inglaterra + + + + Wales + Gales + + + + Scotland + Escócia + + + + Northern Ireland + Irlanda Norte + + + + Portuguese + Português + + + + English + Inglês + + + diff --git a/test/test_heuristics.rb b/test/test_heuristics.rb index 195fb7c8..a384f63f 100644 --- a/test/test_heuristics.rb +++ b/test/test_heuristics.rb @@ -150,4 +150,11 @@ class TestHeuristcs < Test::Unit::TestCase "LoomScript" => "LoomScript/HelloWorld.ls" }) end + + def test_ts_by_heuristics + assert_heuristics({ + "TypeScript" => all_fixtures("TypeScript", "*.ts"), + "XML" => all_fixtures("XML", "*.ts") + }) + end end