mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Add ".es" to recognised ECMAScript extensions
* Add ".es" to recognised JavaScript extensions * Add heuristic to differentiate Erlang from ECMAScript * Add test-case for .es heuristic
This commit is contained in:
committed by
Arfon Smith
parent
7c8bc8561d
commit
24b368a30c
@@ -127,6 +127,14 @@ module Linguist
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user