Add eval_error

This commit is contained in:
Roguelearg 2017-09-14 15:36:59 +02:00
parent 01b610b146
commit 0b2c565cff
3 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,7 @@
module Mm2ep
module Depend
class VarNotDefined < Depend::EvalError
end
end
end

View file

@ -8,3 +8,5 @@ require 'rly'
require 'mm2ep_depend/lexer'
require 'mm2ep_depend/parser'
require 'mm2ep_depend/eval_error'
require 'errors/var_not_defined'

View 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