Replies: 1 comment
-
My brain switched into second gear and found a nicer way of getting this escaping right, but the question still stands :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I've played with Prism + require-hooks for metaprogramming, inspired by strict_ivars.
I've followed a pattern of using Prism to find source locations, then modifying the source code string around those locations.
But this feels fragile. For example, in one experiment, escaping got a bit messy to avoid injections.
Does Prism offer ways of modifying code via nodes? E.g. "insert an X node after this other node I found", or "change the value of this integer node from 1 to 2" or similar? Or is that considered outside its scope? Didn't spot anything in the docs.
Beta Was this translation helpful? Give feedback.
All reactions