Skip to content

Commit

Permalink
Remove unreachable case from UHyper_Compiler expression_to_hyper
Browse files Browse the repository at this point in the history
UJSHOP_Parser already replaces single term conjunctions and
disjunctions.
  • Loading branch information
Maumagnaguagno committed Jan 24, 2024
1 parent 4ea5aab commit 5539644
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions UHyper_Compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ module UHyper_Compiler

def expression_to_hyper(precond_expression, axioms)
case precond_expression[0]
when 'and', 'or'
if precond_expression.size == 2 then expression_to_hyper(precond_expression[1], axioms)
else '(' << precond_expression.drop(1).map! {|exp| expression_to_hyper(exp, axioms)}.join(" #{precond_expression[0]} ") << ')'
end
when 'and', 'or' then '(' << precond_expression.drop(1).map! {|exp| expression_to_hyper(exp, axioms)}.join(" #{precond_expression[0]} ") << ')'
when 'not' then (term = expression_to_hyper(precond_expression[1], axioms)).delete_prefix!('not ') or 'not ' << term
when 'call' then call(precond_expression)
when 'assign' then '(_' << precond_expression[1].delete_prefix('?') << ' = ' << evaluate(precond_expression[2]) << ')'
Expand Down

0 comments on commit 5539644

Please sign in to comment.