Commit befbc71d authored by Jeff Smits's avatar Jeff Smits

Backtracking+closures test input

parent bf2e5c1b
Specification([Signature([Constructors([])]),Strategies([SDefT("main_0_0",[],[],Scope(["b_0"],Let([SDefT("c_0",[],[],Seq(Match(Var("b_0")),Fail))],GuardedLChoice(CallT(SVar("c_0"),[],[]),Id,Build(Var("b_0"))))))])])
\ No newline at end of file
module backtrack
imports libstratego-lib
strategies
// EXPECTED BEHAVIOUR: program fails at runtime because of unbound b
// f always fails, but it binds b before that. In a guarded choice, the binding to b needs to be undone. But if you
// compile this program with -O 0 (no optimisations), f stays a separate strategy and becomes a closure inside the
// execution environment. Interaction between closures and backtracking can be trick, hence this "test".
main = {b: let f = ?b; fail in f <+ !b end }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment