Old loop styles don't generate parser errors
nbingham1 opened this issue · 3 comments
nbingham1 commented
defproc test(bool a[10], b[10], c, d)
{
(;i:10:
prs {
a[i] => b[i]-
}
)
prs {
(|:i:10: a[i] ) => c-
}
}
test t;
$ aflat test.act
"t.a[0]"->"t.b[0]"-
~("t.a[0]")->"t.b[0]"+
"t.a[1]"->"t.b[1]"-
~("t.a[1]")->"t.b[1]"+
"t.a[2]"->"t.b[2]"-
~("t.a[2]")->"t.b[2]"+
"t.a[3]"->"t.b[3]"-
~("t.a[3]")->"t.b[3]"+
"t.a[4]"->"t.b[4]"-
~("t.a[4]")->"t.b[4]"+
"t.a[5]"->"t.b[5]"-
~("t.a[5]")->"t.b[5]"+
"t.a[6]"->"t.b[6]"-
~("t.a[6]")->"t.b[6]"+
"t.a[7]"->"t.b[7]"-
~("t.a[7]")->"t.b[7]"+
"t.a[8]"->"t.b[8]"-
~("t.a[8]")->"t.b[8]"+
"t.a[9]"->"t.b[9]"-
~("t.a[9]")->"t.b[9]"+
"t.a[0]"|"t.a[1]"|"t.a[2]"|"t.a[3]"|"t.a[4]"|"t.a[5]"|"t.a[6]"|"t.a[7]"|"t.a[8]"|"t.a[9]"->"t.c"-
~("t.a[0]"|"t.a[1]"|"t.a[2]"|"t.a[3]"|"t.a[4]"|"t.a[5]"|"t.a[6]"|"t.a[7]"|"t.a[8]"|"t.a[9]")->"t.c"+
rmanohar commented
The (;i:...)
construct is still currently supported, although it is deprecated as it's not really the correct syntactic replication construction. The (|i:...)
construct is right; what doesn't work is the older syntax of (:|i:...)
nbingham1 commented
The syntax I have written is (|:i:...)
with the extra colon just before the variable name. Perhaps a warning about future deprecation would help. Low priority anyway, just figured that I'd make note of it. :)
rmanohar commented
It now complains about a parse error for the (|:i:...)