mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Merge branch 'master' into newlisp
This commit is contained in:
@@ -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
|
||||
@@ -61,6 +61,14 @@ module Linguist
|
||||
@heuristic.call(data)
|
||||
end
|
||||
|
||||
disambiguate "BitBake", "BlitzBasic" do |data|
|
||||
if /^\s*; /.match(data) || data.include?("End Function")
|
||||
Language["BlitzBasic"]
|
||||
elsif /^\s*(# |include|require)\b/.match(data)
|
||||
Language["BitBake"]
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "Objective-C", "C++", "C" do |data|
|
||||
if (/@(interface|class|protocol|property|end|synchronised|selector|implementation)\b/.match(data))
|
||||
Language["Objective-C"]
|
||||
@@ -156,6 +164,14 @@ module Linguist
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "TypeScript", "XML" do |data|
|
||||
if data.include?("<TS ")
|
||||
Language["XML"]
|
||||
else
|
||||
Language["TypeScript"]
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "Frege", "Forth", "text" do |data|
|
||||
if /^(: |also |new-device|previous )/.match(data)
|
||||
Language["Forth"]
|
||||
@@ -165,13 +181,5 @@ module Linguist
|
||||
Language["text"]
|
||||
end
|
||||
end
|
||||
|
||||
disambiguate "BitBake", "BlitzBasic" do |data|
|
||||
if /^\s*; /.match(data) || data.include?("End Function")
|
||||
Language["BlitzBasic"]
|
||||
elsif /^\s*(# |include|require)\b/.match(data)
|
||||
Language["BitBake"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1726,7 +1726,7 @@ Mask:
|
||||
ace_mode: mask
|
||||
extensions:
|
||||
- .mask
|
||||
tm_scope: source.scss
|
||||
tm_scope: source.mask
|
||||
|
||||
Mathematica:
|
||||
type: programming
|
||||
@@ -2327,6 +2327,7 @@ Python:
|
||||
- BUILD
|
||||
- SConscript
|
||||
- SConstruct
|
||||
- Snakefile
|
||||
- wscript
|
||||
interpreters:
|
||||
- python
|
||||
@@ -3073,6 +3074,7 @@ XML:
|
||||
- .tmSnippet
|
||||
- .tmTheme
|
||||
- .tml
|
||||
- .ts
|
||||
- .ui
|
||||
- .urdf
|
||||
- .vbproj
|
||||
|
||||
47
samples/XML/pt_BR.ts
Normal file
47
samples/XML/pt_BR.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.0" language="pt_BR">
|
||||
<context>
|
||||
<name>MainWindow</name>
|
||||
<message>
|
||||
<location filename="../forms/mainwindow.ui" line="22"/>
|
||||
<source>United Kingdom</source>
|
||||
<translation>Reino Unido</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../forms/mainwindow.ui" line="38"/>
|
||||
<source>God save the Queen</source>
|
||||
<translation>Deus salve a Rainha</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="46"/>
|
||||
<source>England</source>
|
||||
<translation>Inglaterra</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="47"/>
|
||||
<source>Wales</source>
|
||||
<translation>Gales</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="48"/>
|
||||
<source>Scotland</source>
|
||||
<translation>Escócia</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="49"/>
|
||||
<source>Northern Ireland</source>
|
||||
<translation>Irlanda Norte</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="51"/>
|
||||
<source>Portuguese</source>
|
||||
<translation>Português</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../mainwindow.cpp" line="52"/>
|
||||
<source>English</source>
|
||||
<translation>Inglês</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user