Is there a better way to register an attribute transformation than this?
I'm trying to port the @pass bit and I'm stumped!
let[@pass Scheme0 => SchemeNoLet (* Declare the type of the pass*)] remove_let =
[%passes (* Start writing the passes over each non-terminal. In this case, we only have [expr] *)
let[@entry] rec expr = function (* [@entry] means that the pass function will take an entry and recurse from there *)
| `Let (id, value [@r] (* [@r] = Recursively apply this pass *), body [@r]) -> (* Matches the Scheme0 let expression *)
`Apply (`Lambda (id, body), value) (* Must be a SchemeNoLet-compatible AST *)
]
Is there a better way to register an attribute transformation than this?
I'm trying to port the
@passbit and I'm stumped!