lib/linguist/heuristics.rb in github-linguist-4.5.6 vs lib/linguist/heuristics.rb in github-linguist-4.5.8
- old
+ new
@@ -272,9 +272,19 @@
elsif /=> |case\s+(\S+\s)+of/.match(data)
Language["Standard ML"]
end
end
+ disambiguate "XML", "Modula-2", "Linux Kernel Module", "AMPL" do |data|
+ if data.include?('<!ENTITY ')
+ Language["XML"]
+ elsif /MODULE\s\w+\s*;/i.match(data) || /^\s*END \w+;$/i.match(data)
+ Language["Modula-2"]
+ else
+ [Language["Linux Kernel Module"], Language["AMPL"]]
+ end
+ end
+
disambiguate "NL", "NewLisp" do |data|
if /^(b|g)[0-9]+ /.match(data)
Language["NL"]
else
Language["NewLisp"]