angular-docs-cn/packages/compiler
ayazhafiz 3bbbf39b58 feat(compiler): Recover on malformed keyed reads and keyed writes (#39004)
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 #38596

PR Close #39004
2020-10-02 11:37:03 -07:00
..
design docs: fix typo in architecture.md guide (#38853) 2020-09-16 15:19:43 -07:00
src feat(compiler): Recover on malformed keyed reads and keyed writes (#39004) 2020-10-02 11:37:03 -07:00
test feat(compiler): Recover on malformed keyed reads and keyed writes (#39004) 2020-10-02 11:37:03 -07:00
testing build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
BUILD.bazel build: add npm_integration_test && angular_integration_test (#33927) 2020-02-24 08:59:18 -08:00
compiler.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
index.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00
package.json Revert "build: remove wombot proxy registry from package.jsons for release (#37378)" (#37495) 2020-06-10 08:21:45 -07:00
public_api.ts build: update license headers to reference Google LLC (#37205) 2020-05-26 14:26:58 -04:00