-
Notifications
You must be signed in to change notification settings - Fork 10
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
Dart 2.0 support #23
Comments
ok, I've forked parsers and installed it locally just to remove the dart 2.0 constraint. sadly it doesn't work. f.e. running
let me know if I could somehow help you with making parsers work on dart 2.0 |
Hi, what happened is: a while ago I wanted to make parsers dart 2 ready so I fixed all strong mode errors but didn't bump the dart version constraint as 2 hadn't launched. In the meantime, the dart 2 runtime added more runtime checks and those are now catching more type errors than the analyzer. Looks like the analyzer is not complete, or wasn't at the time (source: polux/propcheck#2 (comment)). I need to run the tests and fix the type annotation or add casts where the type system cannot express the invariants of the lib. I have no idea how much work this represents: I'll discover it as I go. Unfortunately I don't have much time for this righ now. If you're willing to give it a try, I'll happily review your PRs. If not I'll have a look when I get some time. |
as of now this is way above my head :) but, I'm migrating some other less advanced dart stuff to dart 2.0 and see how much I'll get along the way... maybe I could give it a try then an create a PR. Though, tbh, another option might be that I'll trash Dart alltogether... just saying in case this issue gets old over time and nothing happens :P |
Sure, do what works best for you. You can also have a look at PetitParser, another dart parser combinator library. |
Hi @polux, Working with @elmcrest I'm trying to bring in the Dart 2.0 support. devkabiir/parsers. So far I've fixed most type casting issues. The main thing I see is Dart doesn't support type parameters for operators and since they are heavily used everywhere all the instances of Currently I'm replacing all the operators with their function equivalents to help retain the type info. But that doesn't feel like an efficient way also using operators improves readability of a parser and helps In defining it too. However replacing hasn't proved an easy task so far. 😅 Edit: Updated the link to my repo 😅 |
Hi Dinesh, this is great! Unfortunately I don't know how to work around the lack of generic arguments for operators issue other than by declaring non-operator methods. I've asked for generic arguments on operators but was told "no" on the grounds that there would be no good syntax for it. So I guess if we want this library to work with dart 2 we have no choice. |
from @devkabiir 👍 |
Happy to accept a pull request when this is ready. |
Hey,
since strong_mode is working I was thinking Dart 2 is already supported, but if I try to pub get
^1.0.0
of parsers I'll get:The text was updated successfully, but these errors were encountered: