Coder Social home page Coder Social logo

dart-reptr-rs's People

Contributors

taym95 avatar werediver avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

taym95 mrafik92

dart-reptr-rs's Issues

Log test runs, detect regressions per file

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:

  • Log both the successful and failed parses
  • Match the set of files parsed successfully during a run against a "reference" set
    • Report regressions (was parsed, not failed)
    • Report improvements (was failed, now parsed)
    • Distinguish regressions and improvements from results for new or deleted files

Parse more

Please create and link 🎟️ tickets for individual items.

  • Comment (ref.)
    • Single line (including doc-comment)
    • Multi-line
  • Directives
    • Import
      • Simple import
      • deferred: (deferred? as <typeIdentifier>)?
      • Qualified (as)
      • Selective (show, hide)
    • part and part of
    • export
      • Selective (show, hide)
  • String
    • Simple single- and double-quoted (e.g. as in import statement)
    • Variations
      • '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)
      • A newline starting a multiline string is ignored
    • Escape sequences
    • (Skip) Interpolation
    • (Unimportant?) Adjacent literals (ref.)
  • Type alias (ref.)
  • Types
    • Simple types (e.g. Object, Map<String, Object?>)
    • Function type
      • #37
      • Generic function type (T Function<T>(T))
    • Tuple type
      • Tuples with named fields
  • (Skip) Special constructors for List (<·>[]), Set (<·>{}), Map (<·, ·>{})
  • Identifier
  • Generics (ref.)
    • Type parameters with constraints (extends)
    • Type arguments (with nested parametrized types)
  • Top-level variable
  • Top-level function (skip the implementation)
  • Class
    • Class modifiers (final, sealed, etc.)
    • extends clause
    • implements clause
    • Constructor (ref.)
      • Unnamed
      • Named
      • (Skip) Initializer list, assertions, delegation / redirection
    • Method (ref.)
      • Always skip the implementation
      • Getter (abstract and with implementation)
      • Setter (abstract and with implementation)
      • Instance method (abstract and with implementation)
      • Operator (ref.)
    • Stored property (instance variable)
  • Enum
    • Enhanced enum
  • Extension
  • Annotation (ref.)
    • #40
    • Class annotation (e.g. @immutable, @JsonSerializable(fieldRename: FieldRename.snake), etc.)
    • Class member annotation
    • Top-level function, variable annotation
    • Function parameter annotation

References

Parse type parameters

Parse type parameters, with constraints.

Examples:

  • Type parameters of a generic class
class Log<T extends Object> {}
//       ^^^^^^^^^^^^^^^^^^
  • Type parameters of a generic function
U? nmap<T, U>(T? o, U Function(T) f) => o != null ? f(o) : null;
//     ^^^^^^

Reference

Parse function types

Parse function types (e.g. void Function() Function()) in various positions. See identifier_ext().

P.S. Don't fall into left recursion.

Parse very basic class declaration syntax

Create a custom (hand-coded) parser using nom.

  • Skip over whitespace and comments
  • Parse a very basic subset of the class declaration syntax
// A comment
class Record {
  int field;
}

Parse type aliases

Parse typedef type aliases (ref.).

Some examples:

typedef JsonObject = Map<String, Object?>;
typedef Many<T extends Object> = List<T>;

Parse annotations

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.