Class: DuplicateDefError

Inherits:
CompilerError show all
Defined in:
lib/compiler_error.rb

Instance Method Summary collapse

Methods inherited from CompilerError

#to_s

Constructor Details

#initialize(type, name, old_ast, new_ast) ⇒ DuplicateDefError

Returns a new instance of DuplicateDefError.



44
45
46
47
48
49
50
# File 'lib/compiler_error.rb', line 44

def initialize type, name, old_ast, new_ast
	super new_ast.position
	@type = type
	@name = name
	@old_pos = old_ast.position
	@new_pos = new_ast.position
end

Instance Method Details

#infoObject



52
53
54
# File 'lib/compiler_error.rb', line 52

def info
	"'#{@name}' : #{@type} redefinition\n        #{@old_pos} : see previous #{@type} definition of '#{@name}'"
end