Add bool_expr

This commit is contained in:
Roguelearg 2017-09-12 17:46:04 +02:00
parent 6fbe4f5a9a
commit c539723bc9

View file

@ -140,11 +140,15 @@ module Mm2ep
) )
end end
rule 'expr : T_BOOL' do |ex, l| rule 'bool_expr : F_BOOL'do |ex, l|
ex.value = BoolValue.new(l.value.to_s) ex.value = l.value
end end
rule 'expr : F_BOOL' do |ex, l| rule 'bool_expr : T_BOOL'do |ex, l|
ex.value = l.value
end
rule 'expr : bool_expr' do |ex, l|
ex.value = BoolValue.new(l.value.to_s) ex.value = BoolValue.new(l.value.to_s)
end end
@ -163,14 +167,7 @@ module Mm2ep
ex.value = e.value ex.value = e.value
end end
rule 'expr : VAR EQ_OP F_BOOL' do |ex, v, eq, n| rule 'expr : VAR EQ_OP bool_expr' do |ex, v, eq, n|
ex.value = EqOp.new(
VarValue.new(v.value.to_s),
BoolValue.new(n.value)
)
end
rule 'expr : VAR EQ_OP T_BOOL' do |ex, v, eq, n|
ex.value = EqOp.new( ex.value = EqOp.new(
VarValue.new(v.value.to_s), VarValue.new(v.value.to_s),
BoolValue.new(n.value) BoolValue.new(n.value)