This adds a helper module for macro authors. This will make it easier to change our underlying data model without causing pain for macro authors who use the new helper library.
It should replace the various methods we had on Syntax
objects. Use looks something like:
import * as H from 'sweet.js/helpers' for syntax;
syntax m = ctx => {
let v = ctx.next().value;
if (H.isIdentifier(v, 'foo') {
return H.fromString(v, 'bar');
}
return H.fromString(v, 'baz');
}
m foo; // expands to 'bar'