sweet-js/sweet-core

Errors with valid ES6 import syntax

glaba opened this issue · 3 comments

glaba commented

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)

Hi! Is there any progress regarding this issue? Is this library still being developed? I'm asking because the number of bug reports increases and there was no single commit in the past months :(

It's still being developed, just been busy the past few months. Hope to get some time soon.

@disnet Okay, I know this project is inactive, but are there any plans (any) this project can revive?
I started studying sweet.js internals just for fun (after reading the Honu paper) for the past half year, and I progressed pretty much to the point where I understand most of sweet.js v1.0.0 code, but I figured out to understand the codebase to real I should write the whole thing myself.

I may be doing a rewrite of sweet.js (and make something similar), but I just wanted to ask if there is any possibility for sweet.js can revive. If it does, I would be better joining forces & helping on the bugs right now. If not, I would be proceeding to the rewrite!