Skip to content

Instantly share code, notes, and snippets.

@disnet disnet/helpers.js
Created Apr 10, 2017

Embed
What would you like to do?
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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.