When an a collection antiquote is the last item in the list, avoid generating an append operation. For example:
ableC_Decl {
int foo(int a, float b, $Parameters{params}, int c, $Parameters{moreParams}) {
...
int res = foo(1, 2, $Exprs{args}, 3, ${moreArgs});
...
}
}
With params and args above, we need to use appendParams and appendExprs to append extra items to the antiquoted expressions, but with moreParams and moreArgs we can just place them end of the cons chain instead of nilParameters()/nilExpr().
This change is needed in my experiments with using decoration-site expressions in ableC extensions, since functions like appendParameters transform/re-decorate the operands and aren't currently compatible with decorated tree sharing.
Changes
When an a collection antiquote is the last item in the list, avoid generating an append operation. For example:
With
params
andargs
above, we need to useappendParams
andappendExprs
to append extra items to the antiquoted expressions, but withmoreParams
andmoreArgs
we can just place them end of the cons chain instead ofnilParameters()
/nilExpr()
.This change is needed in my experiments with using decoration-site expressions in ableC extensions, since functions like
appendParameters
transform/re-decorate the operands and aren't currently compatible with decorated tree sharing.Documentation
Corresponding changes in silver-ableC, and docs updated there: https://github.com/melt-umn/silver-ableC/compare/feature/collection-antiquote-tail.