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

JS Nile compiler missing NileParser #2

Open
djdeath opened this issue Dec 13, 2013 · 3 comments
Open

JS Nile compiler missing NileParser #2

djdeath opened this issue Dec 13, 2013 · 3 comments

Comments

@djdeath
Copy link

djdeath commented Dec 13, 2013

Trying to get the Nile browser compiler in compiler/js/nile-compiler.html to work, I get a browser error :

ReferenceError: NileParser is not defined

Not sure if something's missing or the parser js file wasn't generated.

@djdeath
Copy link
Author

djdeath commented Dec 13, 2013

Actually it works in Firefox, just fails in Chrome...

@damelang
Copy link
Owner

Yeah, that sounds familiar. I think it has something to do with the way the nile-grammer.ojs file is dynamically loaded. Like some browsers will block the load because of different policies on local file reading or something.

I'm not currently in a position to fix this, maybe early next year. The whole JS-based Nile compiler/runtime stuff needs a rewrite anyway, since the Nile language has evolved quite a bit since I last worked on the JS stuff.

@uhbif19
Copy link

uhbif19 commented Jun 6, 2020

@djdeath @damelang

I found what causes this. Chrome blocks AJAX request for .ojs file loading, by CORS poilcy. This is well-known problem, not related to Nile.

To get over it, you need to get compiler page from local HTTP server. If you have Python installed you can start server like this:

cd compilers/js
python -m http.server 8000

The compiler will be available on http://localhost:8000/nile-compiler.html then.

Nonetheless, the compiler is not very simple to work with. For example, then you made a syntax error in your code, there will be no error showed, just running it will do nothing.

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

3 participants