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

Javascript es6 migration #2931

Merged
merged 62 commits into from
Oct 10, 2020
Merged

Javascript es6 migration #2931

merged 62 commits into from
Oct 10, 2020

Conversation

ericvergnaud
Copy link
Contributor

No description provided.

@ericvergnaud
Copy link
Contributor Author

@carocad
Hi,
as I migrated one of my parser to this version, I noticed a number of remaining prototype inheritance fragments when generating lexer and parser. Also noticed a bug due to an incorrect require. Also got annoying warnings related to cyclical imports. I fixed all that.
I also decided to evolve towards esm semantics (which requires a more recent version of node).
It also requires exposing the runtime as a package, which I achieve using npm commands.
Everything works fine on my mac using node 14.12.
But for whatever reason, the travis build hangs when running the test cmd line.
I'm running out of ideas re why that is...
Would you be able to have a look, could be something obvious that I'm not seeing...

@carocad
Copy link
Contributor

carocad commented Oct 3, 2020

hey @ericvergnaud I will take a look later today. I dont have much experience with es6 imports in node.js since they are so new but I can take a look for sure 😉 .

@ericvergnaud
Copy link
Contributor Author

hey @ericvergnaud I will take a look later today. I dont have much experience with es6 imports in node.js since they are so new but I can take a look for sure 😉 .

Cool thanks
I see a suspicious thing in the build log:

Setting up nodejs (14.13.0-1nodesource1) ...
v8.9.1

as if installing node 14 had no effect on which node is used...

@@ -74,7 +74,7 @@ LANotEquals(i, v) ::= <%this._input.LA(<i>)!=<v>%>

TokenStartColumnEquals(i) ::= <%this._tokenStartColumn===<i>%>

ImportListener(X) ::= <<var <X>Listener = require('./<X>Listener').<X>Listener;>>
ImportListener(X) ::= ""
Copy link
Contributor

@carocad carocad Oct 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericvergnaud if I recall correctly these files are not needed anymore since we dropped the browser test suite in #2755

@ericvergnaud
Copy link
Contributor Author

ericvergnaud commented Oct 4, 2020 via email

@@ -2,4 +2,8 @@

set -euo pipefail

mvn -q -Dparallel=methods -DthreadCount=4 -Dtest=javascript.* test
cd ../runtime/JavaScript
npm install
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm install

I think this is not needed since the runtime doesn't have any production dependencies only for development.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

want to give it a try? you might be right, but if you are the cost is negligible

Copy link
Contributor

@carocad carocad Oct 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but if you are the cost is negligible

yeah, fair point. Lets keep it as it is

@ericvergnaud
Copy link
Contributor Author

@parrt blessed

@ericvergnaud
Copy link
Contributor Author

ericvergnaud commented Oct 10, 2020

@ewanmellor
hi,
JS runtime is upgraded to ES6, which requires node 14 and npm to run the tests
I haven't managed to get "npm link antlr4" to work on AppVeyor, so disabling node testing on AppVeyor for now
It's not blocking for releasing 4.9 since the tests pass on Linux, but if you want to have a go at it you're welcome

@parrt parrt added this to the 4.9 milestone Oct 10, 2020
@parrt parrt merged commit 9e64dfc into antlr:master Oct 10, 2020
@ericvergnaud ericvergnaud deleted the javascript-es6-migration branch October 11, 2020 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants