-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Refactor Language interface #318
Conversation
3258351
to
6884e50
Compare
091b7ff
to
47f53af
Compare
ef2a789
to
3bb18b1
Compare
b8dace5
to
758d26d
Compare
(Rebasing was not very clean; now fixed.) |
If you change this:
then you can also do this:
|
@torhovland My -- probably naive -- reasoning for this is that the Do you think, for the API, implementations against the references would be more idiomatic? |
Well, the
I would take that as a hint that I need that implementation. |
Good point. I suppose what I'm trying to do is anticipate the need of future downstream API users, but perhaps that is futile, or at the very least, secondary compared to current needs. |
The original purpose of this PR was to expose extension points to Tree-sitter's parser, at the library level, such that the binary could emit a serialised form of the parsed tree (i.e., to satisfy #11). After much thought, however, it is my opinion that it is not the library's job to provide this and is only offered by the binary as a "nice-to-have". Specifically:
This PR is therefore just a refactoring of the
Language
type: Rather than explicit methods, we use conversion traits instead, plus there's more documentation. It's not strictly necessary, but ought to make the subsequent code for the binary slightly more idiomatic.