57f8dd2978
The expression parser already has support for recovering on malformed property reads, but did not have tests describing the recovered ast in such cases. This commit adds tests to demonstrate such cases; in particular, the recovered ast is a full PropertyRead but with an empty property name. This is likely the most preferred option, as it does not constrain consumers of the AST to what the property name should look like. Furthermore, we cannot mark the property name as empty in any other way (e.g. an EmptyExpr) because the property name, as of present, is a string field rather than an AST itself. Note that tokens past a malformed property read are not preserved in the AST (for example in `foo.1234`, `1234` is not preserved in the AST). This is because the extra tokens do not belong to the singular expression created by the property read, and there is not a meaningful way to interpret a secondary expression in a single parsed expression. Part of #38596 PR Close #38998 |
||
---|---|---|
.. | ||
animations | ||
bazel | ||
benchpress | ||
common | ||
compiler | ||
compiler-cli | ||
core | ||
docs | ||
elements | ||
examples | ||
forms | ||
language-service | ||
localize | ||
misc/angular-in-memory-web-api | ||
platform-browser | ||
platform-browser-dynamic | ||
platform-server | ||
private/testing | ||
router | ||
service-worker | ||
upgrade | ||
zone.js | ||
BUILD.bazel | ||
README.md | ||
circular-deps-test.conf.js | ||
empty.ts | ||
goog.d.ts | ||
license-banner.txt | ||
system.d.ts | ||
tsconfig-build-no-strict.json | ||
tsconfig-build.json | ||
tsconfig-test.json | ||
tsconfig.json | ||
types.d.ts |
README.md
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT