Errors with valid ES6 import syntax
This results in an error:
module.js
export syntax hi = function(ctx) {
return #`console.log('hello, world!')`;
}
file2.js
export const TEST = 3;
file.js
import { hi } from "./module.js";
import * as Test from "./file2.js";
hi;
Running sjs file.js
results in
/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/token_stream.js:95
var rightChar = tokenStr.charAt(0);
^
TypeError: tokenStr.charAt is not a function
at TokenStream.put (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/token_stream.js:95:32)
at Token.emit (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/coderep.js:247:10)
at /usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/coderep.js:444:19
at Array.forEach (native)
at Seq.emit (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/coderep.js:443:21)
at /usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/coderep.js:444:19
at Array.forEach (native)
at Seq.emit (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/coderep.js:443:21)
at codeGen (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/shift-codegen/dist/index.js:153:7)
at codegen (/usr/local/lib/node_modules/@sweet-js/cli/node_modules/@sweet-js/core/dist/codegen.js:16:38)