lib/linguist/heuristics.rb in github-linguist-4.8.1 vs lib/linguist/heuristics.rb in github-linguist-4.8.2
- old
+ new
@@ -125,9 +125,17 @@
Language["ECLiPSe"]
elsif data.include?(":=")
Language["ECL"]
end
end
+
+ disambiguate ".es" do |data|
+ if /^\s*(?:%%|main\s*\(.*?\)\s*->)/.match(data)
+ Language["Erlang"]
+ elsif /(?:\/\/|("|')use strict\1|export\s+default\s|\/\*.*?\*\/)/m.match(data)
+ Language["JavaScript"]
+ end
+ end
disambiguate ".for", ".f" do |data|
if /^: /.match(data)
Language["Forth"]
elsif /^([c*][^abd-z]| (subroutine|program|end)\s|\s*!)/i.match(data)