mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Warn about duplicate lexers
This commit is contained in:
@@ -43,8 +43,17 @@ module Linguist
|
|||||||
end
|
end
|
||||||
|
|
||||||
YAML.load_file(File.expand_path("../lexers.yml", __FILE__)).each do |lexer|
|
YAML.load_file(File.expand_path("../lexers.yml", __FILE__)).each do |lexer|
|
||||||
|
if @name_index.key?(lexer.name.downcase)
|
||||||
|
warn "Duplicate lexer name: #{lexer.name}"
|
||||||
|
end
|
||||||
|
|
||||||
@name_index[lexer.name.downcase] = lexer
|
@name_index[lexer.name.downcase] = lexer
|
||||||
|
|
||||||
lexer.aliases.each do |name|
|
lexer.aliases.each do |name|
|
||||||
|
if @alias_index.key?(name)
|
||||||
|
warn "Duplicate alias: #{name}"
|
||||||
|
end
|
||||||
|
|
||||||
@alias_index[name] = lexer
|
@alias_index[name] = lexer
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user