Closed richardo2016 closed 2 years ago
Well, after reading some history commits, I found maybe ./lib/lexer.js
was written maually, rather than generated by emcc
(written in makfile
)?
I will appreciate for your reply. @guybedford
@richardo2016 emcc
will generate lib/lexer.js
per that command, but getting to the final result requires manual manipulation yes.
@richardo2016
emcc
will generatelib/lexer.js
per that command, but getting to the final result requires manual manipulation yes.
Thx for your reply!
Sure enough, I found the parts of source in lib/lexer.js
is manual-like, and the other parts is generated-like.
I try to resolve this issue: #67 . It seems to be required to regenerate lib/lexer.js
if I supported string imports/exports. So if I finished it and make PR to repo. Could you do the regeneration?
Of course, would be happy to take a PR and manually do the build. There was actually a similar PR to cjs-module-lexer recently here - https://github.com/guybedford/cjs-module-lexer/pull/54. Perhaps compare your results on that, also noting the pure JS implementation as well, which can be nice to keep in sync.
Oh sorry of course that PR is not related code, slow on context switching today apparently.
Of course, would be happy to take a PR and manually do the build. There was actually a similar PR to cjs-module-lexer recently here - guybedford/cjs-module-lexer#54. Perhaps compare your results on that, also noting the pure JS implementation as well, which can be nice to keep in sync.
No problem.
Oh sorry of course that PR is not related code, slow on context switching today apparently.
That's OK, I have read this comment when I want to resolve this issue #67 . Maybe I should do little normalization to track changes in guybedford/cjs-module-lexer.
It would be a huge help, thank you so much for looking into this.
It seems I should use emcc 1.40.1-fastcomp (legacy engine) rather emcc 1.40.1. After changing it, I can generate lib/lexer.asm.js
.
But I haven't compiled a valid result, on top of this fix commit, I run commands below to compile lib/lexer.asm.js
success:
rm -f lib/lexer.asm.js && make lib/lexer.asm.js
But I don't know how to run tests, commands below seems wrong:
npm run build:asm && npm run test:js
I got error:
So I took a diff view to compare valid lib/lexer.asm.js
with local one I compiled:
Should I follow the instructions at the start of left view(the VALID revision) to manipulate codes in right view(the revision I compiled)
@guybedford Hi, another PR so soon again :P , but it's not about this issue. After this commit, I can generate lib/lexer.js
as expected, just some correction to Makefile required as in PR before. This issue could be closed.
I cannot build
lib/lexer.js
by myself withmake lib/lexer.js
,Error like below:
Env Info
OS: macOS emscripten version: 1.40.1
as mentioned #86 , I installed emscripten 1.40.1 and activate it in my bash session.
I'm sure I haved installed it, because I checked it by
./emsdk list
and./emcc -v
.and
Should I do extra jobs to make it work?
Thx for your reading here :P