Fixing up some new heuristics

This commit is contained in:
Arfon Smith
2015-08-04 12:06:41 +01:00
parent 84d4fccb4d
commit 208ec3906f
2 changed files with 4 additions and 4 deletions

View File

@@ -329,7 +329,7 @@ module Linguist
end
end
disambiguate "Groff", "Nemerle" do |data|
disambiguate ".n" do |data|
if /^[.']/.match(data)
Language["Groff"]
elsif /^(module|namespace|using)\s/.match(data)
@@ -337,7 +337,7 @@ module Linguist
end
end
disambiguate "GAS", "Groff" do |data|
disambiguate ".ms" do |data|
if /^[.'][a-z][a-z](\s|$)/i.match(data)
Language["Groff"]
elsif /((^|\s)move?[. ])|\.(include|globa?l)\s/.match(data)
@@ -345,7 +345,7 @@ module Linguist
end
end
disambiguate "xBase", "Charity" do |data|
disambiguate ".ch" do |data|
if /^\s*#\s*(if|ifdef|ifndef|define|command|xcommand|translate|xtranslate|include|pragma|undef)\b/i.match(data)
Language["xBase"]
end

View File

@@ -176,7 +176,7 @@ class TestHeuristcs < Minitest::Test
def test_ch_by_heuristics
assert_heuristics({
"xBase" => all_fixtures("xBase")
"xBase" => all_fixtures("xBase", ".ch")
})
end
end