One of the items on my TODO list is creating a fun coding language that 'compiles' to JavaScript. I would like to try out Sweet.js for this, but I'm wondering if it is possible to write a rule that targets keywords that are before the rule?
As an example, let's say you'd want to create a Yoda-styled JavaScript. A source line could look like this:
six var is;
Would be mapped to
var six;
Is this possible using Sweet.js?