Add eval_error
This commit is contained in:
parent
01b610b146
commit
0b2c565cff
3 changed files with 27 additions and 0 deletions
7
lib/errors/var_not_defined.rb
Normal file
7
lib/errors/var_not_defined.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
module Mm2ep
|
||||
module Depend
|
||||
class VarNotDefined < Depend::EvalError
|
||||
|
||||
end
|
||||
end
|
||||
end
|
|
@ -8,3 +8,5 @@ require 'rly'
|
|||
|
||||
require 'mm2ep_depend/lexer'
|
||||
require 'mm2ep_depend/parser'
|
||||
require 'mm2ep_depend/eval_error'
|
||||
require 'errors/var_not_defined'
|
||||
|
|
18
lib/mm2ep_depend/eval_error.rb
Normal file
18
lib/mm2ep_depend/eval_error.rb
Normal file
|
@ -0,0 +1,18 @@
|
|||
module Mm2ep
|
||||
module Depend
|
||||
class EvalError
|
||||
attr_accessor :var
|
||||
attr_accessor :message
|
||||
|
||||
def initialize(hash)
|
||||
# validate input
|
||||
raise ArgumentError unless hash[:message]
|
||||
|
||||
# load input
|
||||
@message = hash[:message]
|
||||
@var = hash[:var]
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue