Oh boy, there is a lot to unpack here. But I *think* it boils down to
you want to know why this pattern isn't working:
```
[(decl ([,var* ,rhs*] ...) ,[p])
(let* ([renamed (map uniq var*)]
[processed (map Expr rhs*)]
[combined (map (λ (v r) (list v r))
renamed processed)])
`(decl ,combined ,p))])
```
And the answer is that the pattern matcher just isn't that smart
sadly. (At least not the one for Racket's version).
What you *could* do however is rewrite it as:
```
[(decl ([,var* ,rhs*] ...) ,[p])
(let* ([renamed (map uniq var*)]
[processed (map Expr rhs*)])
`(decl ([,renamed ,processed] ...) ,p))])
```
Which should work.
This stems from your original pattern for `decl`, which is:
```
(decl ([var* rhs*] ...) p)
```
Therefor when you are constructing a decl in the template of a pass,
it expects your code to be of that form. While you and I know that
combined is a zipped list, the pattern matcher is not that clever, so
you have to help it out a little.
> Do I need empty... productions?... for the parts of the grammar that I want pass-through on? Eg. do I need the Expr empty transform, and also need empty Program and TLP transforms if those are supposed to be "default" or "pass-through" spaces in this particular pass?
If you are asking what I think you are asking, the answer is no, you
usually don't need empty productions for non-terminals. There are a
few cases where you might, but those don't apply here.
Hope that helps.
~Leif Andersen
> --
> You received this message because you are subscribed to the Google Groups
> "nanopass-framework" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
nanopass-framew...@googlegroups.com.
> To post to this group, send email to
nanopass-...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/nanopass-framework/d06cb242-e96c-4c6e-9b77-ae5022525f31%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.