Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Proposal: expose the AST for expressions parsed through $parse. #16253

Closed
@fpipita

Description

@fpipita

I'm submitting a ...

  • bug report
  • feature request
  • other (Please do not submit support requests here (see above))

Current behavior:

Currently, there seems to be no way to access the AST of expressions parsed through $parse.
Expected / new behavior:

It could be useful to be able to access the AST of parsed expressions in order to avoid building a custom parser to handle advanced use cases in which it is required to work on the expression's AST.

I believe that the format of the current AST is not going to change in the future, so exposing it should not be of concern for possibly breaking changes.

It would be a nice add to have it exposed through the $parse's return value. The new behavior could be made opt-in, just in case keeping the AST "alive" after parsing and for each expression, affects the memory consumption.

Thank you for your time!

AngularJS version: 1.6.6

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions