Import not working
I can use sweet.js fine for most use cases, but any time I try to use imports from standard libraries, it fails to work. Here's an example from the documentation:
import { isStringLiteral } from '@sweet-js/helpers' for syntax;
syntax m = ctx => {
return isStringLiteral(ctx.next().value) ? #`'a string'` : #`'not a string'`;
};
m 'foo'
the error I get when I try to complie:
evalmachine.<anonymous>:5
return isStringLiteral(ctx_1.next().value) ? syntaxTemplate(1) : syntaxTemplate(2);
^
ReferenceError: isStringLiteral is not defined
at ctx_1 (evalmachine.<anonymous>:5:5)
at Enforester.expandMacro (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/@sweet-js/core/dist/enforester.js:1981:87)
at Enforester.enforestStatement (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/@sweet-js/core/dist/enforester.js:349:12)
at Enforester.enforestModuleItem (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/@sweet-js/core/dist/enforester.js:136:17)
at Enforester.enforestBody (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/@sweet-js/core/dist/enforester.js:123:17)
at Enforester.enforestModule (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/@sweet-js/core/dist/enforester.js:119:17)
at Enforester.enforest (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/@sweet-js/core/dist/enforester.js:109:21)
at TokenExpander.expand (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/@sweet-js/core/dist/token-expander.js:133:37)
at Compiler.compile (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/@sweet-js/core/dist/compiler.js:50:26)
at NodeLoader.compileSource (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/@sweet-js/core/dist/sweet-loader.js:211:53)