Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't appear to work anymore. #29

Open
Happy-Ferret opened this issue Oct 14, 2016 · 2 comments
Open

Doesn't appear to work anymore. #29

Happy-Ferret opened this issue Oct 14, 2016 · 2 comments

Comments

@Happy-Ferret
Copy link

Running sjs --module contracts-js/macros -o output.js ... on an otherwise (just the import, nothing else) empty .js file yields the following output.

$ sjs --module contracts-js/macros -o output.js test.js
C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\enforester.js:269
    throw this.createError(lookahead, 'unexpected syntax');
    ^

Error: unexpected syntax
__@__ from contracts.js
    at Enforester.createError (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\enforester.js:2290:12)
    at Enforester.enforestImportDeclaration (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\enforester.js:269:16)
    at Enforester.enforestModuleItem (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\enforester.js:117:19)
    at Enforester.enforestBody (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\enforester.js:110:17)
    at Enforester.enforestModule (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\enforester.js:106:17)
    at Enforester.enforest (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\enforester.js:96:21)
    at TokenExpander.expand (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\token-expander.js:124:37)
    at C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\node_modules\ramda\dist\ramda.js:1226:23
    at C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\node_modules\ramda\dist\ramda.js:48:27
    at C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\node_modules\ramda\dist\ramda.js:259:35

Running it on a file containing the "broken" code from the main page yields the following error

$ sjs --module contracts-js/macros -o output.js test.js
C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\errors.js:26
    throw new Error("[assertion error]: " + message);
    ^

Error: [assertion error]: cannot get the val of a delimiter
    at assert (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\errors.js:26:11)
    at Syntax.val (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\syntax.js:359:24)
    at ctx.rest.slice.map.flatten.map.s (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\dist\enforester.js:2285:18)
    at C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\node_modules\immutable\dist\immutable.js:3018:46
    at List.__iterate (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\node_modules\immutable\dist\immutable.js:2208:13)
    at IndexedIterable.mappedSequence.__iterateUncached (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\node_modules\immutable\dist\immutable.js:3017:23)
    at seqIterate (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\node_modules\immutable\dist\immutable.js:606:16)
    at IndexedIterable.IndexedSeq.__iterate (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\node_modules\immutable\dist\immutable.js:322:14)
    at IndexedIterable.toArray (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\node_modules\immutable\dist\immutable.js:4260:23)
    at new List (C:\Users\user123\AppData\Roaming\npm\node_modules\sweet.js\node_modules\immutable\dist\immutable.js:2067:62)

I suspect this is the result of newer versions of sweet.js being incompatible with contracts.js (but as I'm new to both sweet.js and contract.js, I cannot be sure).

Would be nice if there was something that could be done about this.

@vendethiel
Copy link

I suspect this is the result of newer versions of sweet.js being incompatible with contracts.js (but as I'm new to both sweet.js and contract.js, I cannot be sure).

That's correct.

@Happy-Ferret
Copy link
Author

Temporary workaround:

npm install -g sweet.js@0.7.4

instead of

npm install -g sweet.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants