A project for parsing existing Dart code. You can then modify this parsed structure to modify any Dart source code.
This is an API designed to parse dart code and generate an intuitive tree for editing dart source code directly.
It will open a text file (typically a
.dart file) and parse it according to the dart grammar (v2.2).
NOTE: The format the parser outputs is syntactically the same as as any code parsed, but it will almost certainly change the format. It is not recommended to use this this parser to overwrite any files you may have written by hand (it will remove all comments).
Getting Started #
The project is written in Dart, and can be imported as a standard Dart library.
Thus, simply add it to your
pubspec.yaml like so:
dependencies: source_parser: ^1.1.2
Then import it into whatever code you are using by importing:
The only prerequisite should be Dart version >=2.2.0
This project is licensed under the BSD 3-Clause "New" or "Revised" License - see the LICENSE.md file for details