-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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] Support Dart multiple platforms. #3250
Conversation
* `dart compile exe` is preferred since Dart v2.10 .
* Reorganize dart:io usages and support 'io', 'html'. * 'ui' and 'isolate' TBD. * Rewrite bit operations with 32-bit version because Dart2JS does not support 64-bit integers.
* Reorganize dart:io usages and support 'io', 'html'. * 'ui' and 'isolate' TBD. * Rewrite bit operations with 32-bit version because Dart2JS does not support 64-bit integers.
…into multi-platform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall it looks pretty good! 👍
You also need to remove this import, potentially with a hack:
import 'dart:io'; |
This is how I would do it:
lingyv-li@2843096#diff-6e09474b1421fd5d94035b5b34836896dbf8534f6e7b65cb860590c36b314aabR2
Also since you've removed the locateDart2native
already, can you please also remove locatePub
?
protected String locatePub() { |
* Reorganize platform dependent files. * Replace `pub` with `dart pub` in tests. * Update runtime template to be platform dependent.
runtime-testsuite/resources/org/antlr/v4/test/runtime/templates/Dart.test.stg
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, can you show a working demo of it on web? Would be good to show it working against e.g. Java 9 grammar https://github.com/antlr/grammars-v4/tree/master/java/java9
@lingyv-li I did not know how to demo in Github (more specifically, presenting java9 grammar in web). I ended up creating two demos, one for web version and command line version. Please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ansiemens sorry it wasn't clear, and the Java grammar is a little tricky to work with. Don't worry I just tried and built a demo app from your branch for Java, it works great!
Screen.Recording.2021-08-11.at.11.36.51.pm.mov
https://github.com/lingyv-li/java9parser/tree/cc6318a0e3072ff2651fa704f2ff4cf331519ffc
Please remove the example folder that you've just added.
runtime/Dart/CHANGELOG.md
Outdated
## 4.9.3-SNAPSHOT | ||
|
||
* Support multi-platform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file needs to follow semantic versioning. Change it to 4.9.3 so it will be used when publishing that version.
Also it's better described as "Support web platform" since it already support other native platforms before this version.
## 4.9.3-SNAPSHOT | |
* Support multi-platform. | |
## 4.9.3 | |
* Support web platform. |
Cool! Updated the PR. PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @ansiemens
@ericvergnaud can you pls check & merge this PR
cc @parrt |
The change doesn't relate to the issue. Could you please elaborate on encountered errors? |
@cesarParra perhaps you could start a new issue with a sample grammar and input that causes the problem. |
fixes #3190
Support Dart multiple platforms.
dart:io
.dart2native
todart compile exe
.dartfmt
on Dart runtime.