feat(compiler): Propagate source span and value span to Variable AST (#36047)

This commit propagates the `sourceSpan` and `valueSpan` of a `VariableBinding`
in a microsyntax expression to `ParsedVariable`, and subsequently to
View Engine Variable AST and Ivy Variable AST.

Note that this commit does not propagate the `keySpan`, because it involves
significant changes to the template AST.

PR Close #36047
This commit is contained in:
Keen Yee Liau
2020-03-11 16:46:08 -07:00
committed by Andrew Kushnir
parent e179c5827f
commit 31bec8ce61
7 changed files with 46 additions and 18 deletions

View File

@ -743,8 +743,14 @@ export class ParsedEvent {
public handlerSpan: ParseSourceSpan) {}
}
/**
* ParsedVariable represents a variable declaration in a microsyntax expression.
*/
export class ParsedVariable {
constructor(public name: string, public value: string, public sourceSpan: ParseSourceSpan) {}
constructor(
public readonly name: string, public readonly value: string,
public readonly sourceSpan: ParseSourceSpan, public readonly keySpan: ParseSourceSpan,
public readonly valueSpan?: ParseSourceSpan) {}
}
export const enum BindingType {