Fix heuristic for Unix Assembly with .ms extension (#3550)

This commit is contained in:
Santiago M. Mola
2017-04-06 14:01:42 +02:00
committed by John Gardner
parent fa6ae1116f
commit e80b92e407
2 changed files with 8 additions and 1 deletions

View File

@@ -298,7 +298,7 @@ module Linguist
if /^[.'][a-z][a-z](\s|$)/i.match(data)
Language["Groff"]
elsif /(?<!\S)\.(include|globa?l)\s/.match(data) || /(?<!\/\*)(\A|\n)\s*\.[A-Za-z]/.match(data.gsub(/"([^\\"]|\\.)*"|'([^\\']|\\.)*'|\\\s*(?:--.*)?\n/, ""))
Language["GAS"]
Language["Unix Assembly"]
else
Language["MAXScript"]
end

View File

@@ -178,6 +178,13 @@ class TestHeuristcs < Minitest::Test
})
end
def test_ms_by_heuristics
assert_heuristics({
"Unix Assembly" => all_fixtures("Unix Assembly", "*.ms"),
"MAXScript" => all_fixtures("MAXScript", "*.ms")
})
end
# Candidate languages = ["C++", "Objective-C"]
def test_obj_c_by_heuristics
# Only calling out '.h' filenames as these are the ones causing issues