You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Concrete patterns start to behave as expected. Here are some TC issues I found:
module experiments::Compiler::Examples::Tst
import ParseTree;
syntax A = a: "a";
syntax As = as: A+ alist;
syntax C = c: A a "x" As as;
test bool tstAs(){
pt = parse(#As, "aaa");
return as(al) := pt && pt is as && pt.alist == al;
}
test bool tstC(){
pt = parse(#C, "axaaa");
return c(A a, As as) := pt && pt.a == a && pt.as == as && size([x | x <- as.alist]) == 3;
}
gives
error("Name x is not in scope",|rascal:///experiments/Compiler/Examples/Tst.rsc|(361,1,<18,68>,<18,69>))
error("Only constructors or productions with a different arity are available",|rascal:///experiments/Compiler/Examples/Tst.rsc|(199,6,<13,11>,<13,17>))
error("Type of pattern could not be computed",|rascal:///experiments/Compiler/Examples/Tst.rsc|(199,6,<13,11>,<13,17>))
error("Type A+ is not enumerable",|rascal:///experiments/Compiler/Examples/Tst.rsc|(365,13,<18,72>,<18,85>))
error("A+ and inferred(1) incomparable",|rascal:///experiments/Compiler/Examples/Tst.rsc|(227,14,<13,39>,<13,53>))
error("Type of pattern could not be computed",|rascal:///experiments/Compiler/Examples/Tst.rsc|(304,13,<18,11>,<18,24>))
error("Name size is not in scope",|rascal:///experiments/Compiler/Examples/Tst.rsc|(355,4,<18,62>,<18,66>))
error("Only constructors or productions with a different arity are available",|rascal:///experiments/Compiler/Examples/Tst.rsc|(304,13,<18,11>,<18,24>))
The text was updated successfully, but these errors were encountered:
I just pushed something that fixes a bit of this, but need to look through the production-handling code to make sure that, when using the constructor forms, whitespace is not counted as an argument position (it is now, which is why the above don't match, but I'm assuming we don't want it to).
Thanks @mahills, the situation is indeed improved. The current situation is:
module experiments::Compiler::Examples::Tst
import Exception;
import List;
import IO;
import ParseTree;
syntax A = a: "a";
syntax As = as: A+ alist;
syntax C = c: A a "x" As as;
test bool tstAs(){
pt = parse(#As, "aaa");
return as(al) := pt && pt is as && pt.alist == al;
}
test bool tstC(){
pt = parse(#C, "axaaa");
return c(A a, As as) := pt && pt.a == a && pt.as == as && size([x | x <- as.alist]) == 3;
}
gives
error("Only constructors or productions with a different arity are available",|rascal:///experiments/Compiler/Examples/Tst.rsc|(347,13,<22,11>,<22,24>))
error("Type of pattern could not be computed",|rascal:///experiments/Compiler/Examples/Tst.rsc|(347,13,<22,11>,<22,24>))
error("A+ and inferred(1) incomparable",|rascal:///experiments/Compiler/Examples/Tst.rsc|(270,14,<17,39>,<17,53>))
error("Type of pattern could not be computed",|rascal:///experiments/Compiler/Examples/Tst.rsc|(242,6,<17,11>,<17,17>))
error("Only constructors or productions with a different arity are available",|rascal:///experiments/Compiler/Examples/Tst.rsc|(242,6,<17,11>,<17,17>))
Concrete patterns start to behave as expected. Here are some TC issues I found:
gives
The text was updated successfully, but these errors were encountered: