-
Notifications
You must be signed in to change notification settings - Fork 1
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
Things imported from the helper are not defined #3
Comments
evalmachine.:8 |
@zkuang can you provide your |
I have the same issue. The code is here: https://www.sweetjs.org/doc/tutorial.html#sweet-cond I have just installed |
Does sweet-js have a future ? I just found it and looks exactly what I need to support our "modified Javascript" language, however I am having the same basic issue, "isKeyword is not defined" even though my first line is to import ..
|
Same here. What I try to do: // test.sjs
import { isStringLiteral } from '@sweet-js/helpers' for syntax; // like the docs say
// import { isStringLiteral } from '@sweet-js/helpers/helpers.js' for syntax; // also tried this
syntax query = function (ctx) {
let selector = ctx.next().value
if (isStringLiteral(selector)) { // <-- using it here
return #`document.querySelector(${selector})`
} else {
let node = selector
let selector = ctx.next().value
return #`${node}.querySelector(${selector})`
}
}
let body = query "body"
let main = query body "main" Then I do
And then it logs the following:
Notice the first line:
Why does it skip this module? For the records, I (re)installed Sweet.js and the helpers today doing ...
... and the modules are actually installed globally, I checked it in the file system. The function The |
sjs try to compile the cond example says "isKeyword is not defined"
The text was updated successfully, but these errors were encountered: