mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Fixing up some new heuristics
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user