Skip to content

Commit

Permalink
Heuristic rules for XML and Modula-2
Browse files Browse the repository at this point in the history
  • Loading branch information
pchaigno committed Apr 25, 2015
1 parent af5e799 commit fc1f808
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/linguist/heuristics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,16 @@ def call(data)
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"]
Expand Down

0 comments on commit fc1f808

Please sign in to comment.