Skip to content
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

feat(compiler): Recover on malformed keyed reads and keyed writes #39004

Closed
wants to merge 5 commits into from

Commits on Oct 2, 2020

  1. feat(compiler): Recover on malformed keyed reads and keyed writes

    This patch adds support for recovering well-formed (and near-complete)
    ASTs for semantically malformed keyed reads and keyed writes. See the
    added tests for details on the types of semantics we can now recover;
    in particular, notice that some assumptions are made about the form of
    a keyed read/write intended by a user. For example, in the malformed
    expression `a[1 + = 2`, we assume that the user meant to write a binary
    expression for the key of `a`, and assign that key the value `2`. In
    particular, we now parse this as `a[1 + <empty expression>] = 2`. There
    are some different interpretations that can be made here, but I think
    this is reasonable.
    
    The actual changes in the parser code are fairly minimal (a nice
    surprise!); the biggest addition is a `writeContext` that marks whether
    the `=` operator can serve as a recovery point after error detection.
    
    Part of angular#38596
    ayazhafiz committed Oct 2, 2020
    Copy the full SHA
    b0f3ec4 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    7cc63ce View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    f6f8017 View commit details
    Browse the repository at this point in the history
  4. Copy the full SHA
    c93b550 View commit details
    Browse the repository at this point in the history
  5. Copy the full SHA
    80cee1b View commit details
    Browse the repository at this point in the history