-
Notifications
You must be signed in to change notification settings - Fork 23
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
Handwritten parser #15
Conversation
@motet-a: Thanks very much for this! Two quick points:
|
|
It's late in Lyon! ;-P |
No, no more license hassles. We should find an appropriate way to credit you, however. Thank you for splitting the PR! |
9444f79
to
390a1dc
Compare
390a1dc
to
b932fc0
Compare
I have updated the commit message. The tests should pass on older Node.js versions now. |
This subjective and opinionated patch fixes many issues but has several drawbacks. The parser should be usable in strict mode now (see jslicense#9). It is not longer generated by `jison`. `parse.js` contains a simple handwritten recursive decent parser. It should be easier to debug and to hack, but there is definitely more code and one can prefer parser generators. Note that `jison` seems to have big maintainance issues. Note that [Yargs](https://github.com/yargs/yargs) is not usable in strict mode because it depends on this package. I also simplified the lexer (IMHO). I wrote more Mocha-based tests in `test/index.js`. I really like the embedded tests in `README.md`, but I was afraid to bloat it with boring spec-compliance tests. This patch does not introduce a breaking change and does not change dependencies (however, it changes devDependencies).
b932fc0
to
aec7e5d
Compare
@motet-a, I've invited you to the jslicense GitHub org, which in turn gives you write access to this repo. I will make PRs for all non-trivial changes going forward. Please do the same. We can look after each other ... not to mention the code! 😄 As a practical matter, this is now your package as much as it belongs to anyone. Congratulations! It's an important piece of community infrastructure. That is not my way of saying that I am about to disappear on you. Whether it's dealing with SPDX or npm or other projects, I think there will be plenty more work to do. 😛 I wish I knew how to write this part in French: This is one of the best rewrites I've seen in open source. It's obvious you took the time to read and understand the spec, and also the existing code. The code is good, and you submitted it in the most respectful and positive way possible. You don't need to hear it from me, but you're good at this. Technically, I share the opinion that a handwritten parser is best for the task. It was on my list to rewrite in this way for months, but I never found the time. I think you've done it cleaner than I would have. There are a couple small things to mention:
If there is anything else, I will bring it up via PRs. |
Wow, what a long comment! I am really happy to join jslicense. I will try to contribute more to open source projects. I will make PRs, I’m used to it. Regarding your questions:
|
My comment was too long. In short: Welcome! |
This subjective and opinionated patch fixes many issues but has
several drawbacks.
The parser should be usable in strict mode now (see #9). It is not
longer generated by
jison
.parse.js
contains a simple handwrittenrecursive decent parser. It should be easier to debug and to hack, but
there is definitely more code and one can prefer parser generators.
Note that
jison
seems to have big maintainance issues.Note that Yargs is not usable in strict mode because it depends on
this package.
I also simplified the lexer (IMHO).
I wrote more Mocha-based tests in
test/index.js
. I really like theembedded tests in
README.md
, but I was afraid to bloat it withboring spec-compliance tests.
This patch does not introduce a breaking change and does not change
dependencies (however, it changes devDependencies).