fix array in if_false

This commit is contained in:
Torsten Ruger
2015-09-19 17:11:15 +03:00
parent dab32bc307
commit 8e07a7568f
7 changed files with 99 additions and 94 deletions

View File

@ -6,19 +6,20 @@ ref ofthen(int n)
end
end
-- -- --
s(:expressions,
s(:function, :ref,
s(:name, :ofthen),
s(:parameters,
s(:field, :int, :n)),
s(:expressions,
s(:if,
s(:condition,
s(:int, 0)),
s(:if_true,
s(:assign,
s(:name, :isit),
s(:int, 42))),
s(:if_false, [s(:assign,
s(:name, :maybenot),
s(:int, 667))])))))
s(:expressions,
s(:function, :ref,
s(:name, :ofthen),
s(:parameters,
s(:field, :int, :n)),
s(:expressions,
s(:if,
s(:condition,
s(:int, 0)),
s(:if_true,
s(:assign,
s(:name, :isit),
s(:int, 42))),
s(:if_false,
s(:assign,
s(:name, :maybenot),
s(:int, 667)))))))

View File

@ -6,19 +6,20 @@ int retvar(int n)
end
end
-- -- --
s(:expressions,
s(:function, :int,
s(:name, :retvar),
s(:parameters,
s(:field, :int, :n)),
s(:expressions,
s(:if,
s(:condition,
s(:operator, ">",
s(:name, :n),
s(:int, 5))),
s(:if_true,
s(:return,
s(:int, 10))),
s(:if_false, [s(:return,
s(:int, 20))])))))
s(:expressions,
s(:function, :int,
s(:name, :retvar),
s(:parameters,
s(:field, :int, :n)),
s(:expressions,
s(:if,
s(:condition,
s(:operator, ">",
s(:name, :n),
s(:int, 5))),
s(:if_true,
s(:return,
s(:int, 10))),
s(:if_false,
s(:return,
s(:int, 20)))))))