werediver / dart-reptr-rs Goto Github PK
View Code? Open in Web Editor NEWFast code generation for Dart. Eventually. Maybe.
License: MIT License
Fast code generation for Dart. Eventually. Maybe.
License: MIT License
The goal is to identify Dart source files which were parsed without a failure before, but cannot be parsed after certain changes.
To achieve that:
Please create and link 🎟️ tickets for individual items.
deferred
: (deferred? as <typeIdentifier>)?as
)show
, hide
)part
and part of
export
show
, hide
)import
statement)
'x'
, "x"
(line breaks not allowed)'''x'''
, """x"""
(the line break right after the opening quotes is ignored)r'x'
, r"x"
, r"""x"""
(raw, no escape sequences or interpolation)Object
, Map<String, Object?>
)T Function<T>(T)
)List
(<·>[]
), Set
(<·>{}
), Map
(<·, ·>{}
)@immutable
, @JsonSerializable(fieldRename: FieldRename.snake)
, etc.)Parse type parameters, with constraints.
Examples:
class Log<T extends Object> {}
// ^^^^^^^^^^^^^^^^^^
U? nmap<T, U>(T? o, U Function(T) f) => o != null ? f(o) : null;
// ^^^^^^
Note that in Dart multi-line comments allow nesting (/* x /* x */ x */
).
Parse function types (e.g. void Function() Function()
) in various positions. See identifier_ext()
.
P.S. Don't fall into left recursion.
Create a custom (hand-coded) parser using nom.
// A comment
class Record {
int field;
}
The base-line implementation. Compare to #5.
Allow accurate back-to-source transformation to enable in-place code generation and code transformation.
Parse typedef
type aliases (ref.).
Some examples:
typedef JsonObject = Map<String, Object?>;
typedef Many<T extends Object> = List<T>;
From Intro to Dart, Metadata:
Metadata can appear before a library, class, typedef, type parameter, constructor, factory, function, field, parameter, or variable declaration and before an import or export directive.
From Dart lang spec, Metadata:
It is a compile-time error if [the annotation expression] e is not one of the following:
- A reference to a constant variable.
- A call to a constant constructor.
The expression e occurs in a constant context (17.3.2), which means that
const
modifiers need not be specified explicitly.
See Methods / Operators.
Implement a Dart parser based on the ANTLR4 grammar https://github.com/dart-lang/sdk/blob/main/tools/spec_parser/Dart.g in Rust.
See #61 for details.
Parse identifiers with type arguments (with nested identifiers with type arguments).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.