@auscope/angular2parse 20.0.2 → 21.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/.editorconfig +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +66 -49
  4. package/angular.json +56 -0
  5. package/package.json +41 -33
  6. package/projects/angular2parse/README.md +49 -0
  7. package/projects/angular2parse/ng-package.json +7 -0
  8. package/projects/angular2parse/package.json +19 -0
  9. package/projects/angular2parse/src/lib/angular/compiler/assertions.d.ts +10 -0
  10. package/projects/angular2parse/src/lib/angular/compiler/assertions.d.ts.map +1 -0
  11. package/projects/angular2parse/src/lib/angular/compiler/assertions.js +45 -0
  12. package/projects/angular2parse/src/lib/angular/compiler/assertions.js.map +1 -0
  13. package/projects/angular2parse/src/lib/angular/compiler/assertions.ts +49 -0
  14. package/projects/angular2parse/src/lib/angular/compiler/ast.d.ts +243 -0
  15. package/projects/angular2parse/src/lib/angular/compiler/ast.d.ts.map +1 -0
  16. package/projects/angular2parse/src/lib/angular/compiler/ast.js +393 -0
  17. package/projects/angular2parse/src/lib/angular/compiler/ast.js.map +1 -0
  18. package/projects/angular2parse/src/lib/angular/compiler/ast.ts +393 -0
  19. package/projects/angular2parse/src/lib/angular/compiler/chars.d.ts +70 -0
  20. package/projects/angular2parse/src/lib/angular/compiler/chars.d.ts.map +1 -0
  21. package/projects/angular2parse/src/lib/angular/compiler/chars.js +78 -0
  22. package/projects/angular2parse/src/lib/angular/compiler/chars.js.map +1 -0
  23. package/projects/angular2parse/src/lib/angular/compiler/chars.ts +89 -0
  24. package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.d.ts +15 -0
  25. package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.d.ts.map +1 -0
  26. package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.js +24 -0
  27. package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.js.map +1 -0
  28. package/projects/angular2parse/src/lib/angular/compiler/interpolation-config.ts +25 -0
  29. package/projects/angular2parse/src/lib/angular/compiler/lexer.d.ts +45 -0
  30. package/projects/angular2parse/src/lib/angular/compiler/lexer.d.ts.map +1 -0
  31. package/projects/angular2parse/src/lib/angular/compiler/lexer.js +344 -0
  32. package/projects/angular2parse/src/lib/angular/compiler/lexer.js.map +1 -0
  33. package/projects/angular2parse/src/lib/angular/compiler/lexer.ts +383 -0
  34. package/projects/angular2parse/src/lib/angular/compiler/parser.d.ts +93 -0
  35. package/projects/angular2parse/src/lib/angular/compiler/parser.d.ts.map +1 -0
  36. package/projects/angular2parse/src/lib/angular/compiler/parser.js +735 -0
  37. package/projects/angular2parse/src/lib/angular/compiler/parser.js.map +1 -0
  38. package/projects/angular2parse/src/lib/angular/compiler/parser.ts +825 -0
  39. package/projects/angular2parse/src/lib/angular/compiler.d.ts +7 -0
  40. package/projects/angular2parse/src/lib/angular/compiler.d.ts.map +1 -0
  41. package/projects/angular2parse/src/lib/angular/compiler.js +7 -0
  42. package/projects/angular2parse/src/lib/angular/compiler.js.map +1 -0
  43. package/projects/angular2parse/src/lib/angular/compiler.ts +6 -0
  44. package/projects/angular2parse/src/lib/angular/facade/lang.d.ts +45 -0
  45. package/projects/angular2parse/src/lib/angular/facade/lang.d.ts.map +1 -0
  46. package/projects/angular2parse/src/lib/angular/facade/lang.js +85 -0
  47. package/projects/angular2parse/src/lib/angular/facade/lang.js.map +1 -0
  48. package/projects/angular2parse/src/lib/angular/facade/lang.ts +124 -0
  49. package/projects/angular2parse/src/lib/angular/facade.d.ts +2 -0
  50. package/projects/angular2parse/src/lib/angular/facade.d.ts.map +1 -0
  51. package/projects/angular2parse/src/lib/angular/facade.js +2 -0
  52. package/projects/angular2parse/src/lib/angular/facade.js.map +1 -0
  53. package/projects/angular2parse/src/lib/angular/facade.ts +1 -0
  54. package/projects/angular2parse/src/lib/angular.d.ts +3 -0
  55. package/projects/angular2parse/src/lib/angular.d.ts.map +1 -0
  56. package/projects/angular2parse/src/lib/angular.js +3 -0
  57. package/projects/angular2parse/src/lib/angular.js.map +1 -0
  58. package/projects/angular2parse/src/lib/angular.ts +2 -0
  59. package/projects/angular2parse/src/lib/module.d.ts +6 -0
  60. package/projects/angular2parse/src/lib/module.d.ts.map +1 -0
  61. package/projects/angular2parse/src/lib/module.js +17 -0
  62. package/projects/angular2parse/src/lib/module.js.map +1 -0
  63. package/projects/angular2parse/src/lib/module.ts +12 -0
  64. package/projects/angular2parse/src/lib/parse.d.ts +19 -0
  65. package/projects/angular2parse/src/lib/parse.d.ts.map +1 -0
  66. package/projects/angular2parse/src/lib/parse.js +61 -0
  67. package/projects/angular2parse/src/lib/parse.js.map +1 -0
  68. package/projects/angular2parse/src/lib/parse.ts +78 -0
  69. package/projects/angular2parse/src/lib/util/binary-operations.d.ts +2 -0
  70. package/projects/angular2parse/src/lib/util/binary-operations.d.ts.map +1 -0
  71. package/projects/angular2parse/src/lib/util/binary-operations.js +18 -0
  72. package/projects/angular2parse/src/lib/util/binary-operations.js.map +1 -0
  73. package/projects/angular2parse/src/lib/util/binary-operations.ts +17 -0
  74. package/projects/angular2parse/src/lib/util/lang.d.ts +5 -0
  75. package/projects/angular2parse/src/lib/util/lang.d.ts.map +1 -0
  76. package/projects/angular2parse/src/lib/util/lang.js +13 -0
  77. package/projects/angular2parse/src/lib/util/lang.js.map +1 -0
  78. package/projects/angular2parse/src/lib/util/lang.ts +15 -0
  79. package/projects/angular2parse/src/lib/util.d.ts +3 -0
  80. package/projects/angular2parse/src/lib/util.d.ts.map +1 -0
  81. package/projects/angular2parse/src/lib/util.js +3 -0
  82. package/projects/angular2parse/src/lib/util.js.map +1 -0
  83. package/projects/angular2parse/src/lib/util.ts +2 -0
  84. package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.d.ts +24 -0
  85. package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.d.ts.map +1 -0
  86. package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.js +96 -0
  87. package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.js.map +1 -0
  88. package/projects/angular2parse/src/lib/visitors/parse-visitor-compiler.ts +149 -0
  89. package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.d.ts +26 -0
  90. package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.d.ts.map +1 -0
  91. package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.js +141 -0
  92. package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.js.map +1 -0
  93. package/projects/angular2parse/src/lib/visitors/parse-visitor-resolver.ts +208 -0
  94. package/projects/angular2parse/src/lib/visitors.d.ts +3 -0
  95. package/projects/angular2parse/src/lib/visitors.d.ts.map +1 -0
  96. package/projects/angular2parse/src/lib/visitors.js +3 -0
  97. package/projects/angular2parse/src/lib/visitors.js.map +1 -0
  98. package/projects/angular2parse/src/lib/visitors.ts +2 -0
  99. package/projects/angular2parse/src/public-api.d.ts +3 -0
  100. package/projects/angular2parse/src/public-api.d.ts.map +1 -0
  101. package/projects/angular2parse/src/public-api.js +6 -0
  102. package/projects/angular2parse/src/public-api.js.map +1 -0
  103. package/projects/angular2parse/src/public-api.ts +5 -0
  104. package/projects/angular2parse/tsconfig.lib.json +22 -0
  105. package/projects/angular2parse/tsconfig.lib.prod.json +15 -0
  106. package/tsconfig.json +21 -0
  107. package/fesm2022/auscope-angular2parse.mjs +0 -2033
  108. package/fesm2022/auscope-angular2parse.mjs.map +0 -1
  109. package/index.d.ts +0 -32
@@ -0,0 +1,243 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ export declare class ParserError {
9
+ input: string;
10
+ errLocation: string;
11
+ ctxLocation?: any | undefined;
12
+ message: string;
13
+ constructor(message: string, input: string, errLocation: string, ctxLocation?: any | undefined);
14
+ }
15
+ export declare class ParseSpan {
16
+ start: number;
17
+ end: number;
18
+ constructor(start: number, end: number);
19
+ }
20
+ export declare class AST {
21
+ span: ParseSpan;
22
+ constructor(span: ParseSpan);
23
+ visit(visitor: AstVisitor, context?: any): any;
24
+ toString(): string;
25
+ }
26
+ /**
27
+ * Represents a quoted expression of the form:
28
+ *
29
+ * quote = prefix `:` uninterpretedExpression
30
+ * prefix = identifier
31
+ * uninterpretedExpression = arbitrary string
32
+ *
33
+ * A quoted expression is meant to be pre-processed by an AST transformer that
34
+ * converts it into another AST that no longer contains quoted expressions.
35
+ * It is meant to allow third-party developers to extend Angular template
36
+ * expression language. The `uninterpretedExpression` part of the quote is
37
+ * therefore not interpreted by the Angular's own expression parser.
38
+ */
39
+ export declare class Quote extends AST {
40
+ prefix: string;
41
+ uninterpretedExpression: string;
42
+ location: any;
43
+ constructor(span: ParseSpan, prefix: string, uninterpretedExpression: string, location: any);
44
+ visit(visitor: AstVisitor, context?: any): any;
45
+ toString(): string;
46
+ }
47
+ export declare class EmptyExpr extends AST {
48
+ visit(visitor: AstVisitor, context?: any): void;
49
+ }
50
+ export declare class ImplicitReceiver extends AST {
51
+ visit(visitor: AstVisitor, context?: any): any;
52
+ }
53
+ /**
54
+ * Multiple expressions separated by a semicolon.
55
+ */
56
+ export declare class Chain extends AST {
57
+ expressions: any[];
58
+ constructor(span: ParseSpan, expressions: any[]);
59
+ visit(visitor: AstVisitor, context?: any): any;
60
+ }
61
+ export declare class Conditional extends AST {
62
+ condition: AST;
63
+ trueExp: AST;
64
+ falseExp: AST;
65
+ constructor(span: ParseSpan, condition: AST, trueExp: AST, falseExp: AST);
66
+ visit(visitor: AstVisitor, context?: any): any;
67
+ }
68
+ export declare class PropertyRead extends AST {
69
+ receiver: AST;
70
+ name: string;
71
+ constructor(span: ParseSpan, receiver: AST, name: string);
72
+ visit(visitor: AstVisitor, context?: any): any;
73
+ }
74
+ export declare class PropertyWrite extends AST {
75
+ receiver: AST;
76
+ name: string;
77
+ value: AST;
78
+ constructor(span: ParseSpan, receiver: AST, name: string, value: AST);
79
+ visit(visitor: AstVisitor, context?: any): any;
80
+ }
81
+ export declare class SafePropertyRead extends AST {
82
+ receiver: AST;
83
+ name: string;
84
+ constructor(span: ParseSpan, receiver: AST, name: string);
85
+ visit(visitor: AstVisitor, context?: any): any;
86
+ }
87
+ export declare class KeyedRead extends AST {
88
+ obj: AST;
89
+ key: AST;
90
+ constructor(span: ParseSpan, obj: AST, key: AST);
91
+ visit(visitor: AstVisitor, context?: any): any;
92
+ }
93
+ export declare class KeyedWrite extends AST {
94
+ obj: AST;
95
+ key: AST;
96
+ value: AST;
97
+ constructor(span: ParseSpan, obj: AST, key: AST, value: AST);
98
+ visit(visitor: AstVisitor, context?: any): any;
99
+ }
100
+ export declare class BindingPipe extends AST {
101
+ exp: AST;
102
+ name: string;
103
+ args: any[];
104
+ constructor(span: ParseSpan, exp: AST, name: string, args: any[]);
105
+ visit(visitor: AstVisitor, context?: any): any;
106
+ }
107
+ export declare class LiteralPrimitive extends AST {
108
+ value: any;
109
+ constructor(span: ParseSpan, value: any);
110
+ visit(visitor: AstVisitor, context?: any): any;
111
+ }
112
+ export declare class LiteralArray extends AST {
113
+ expressions: any[];
114
+ constructor(span: ParseSpan, expressions: any[]);
115
+ visit(visitor: AstVisitor, context?: any): any;
116
+ }
117
+ export declare class LiteralMap extends AST {
118
+ keys: any[];
119
+ values: any[];
120
+ constructor(span: ParseSpan, keys: any[], values: any[]);
121
+ visit(visitor: AstVisitor, context?: any): any;
122
+ }
123
+ export declare class Interpolation extends AST {
124
+ strings: any[];
125
+ expressions: any[];
126
+ constructor(span: ParseSpan, strings: any[], expressions: any[]);
127
+ visit(visitor: AstVisitor, context?: any): any;
128
+ }
129
+ export declare class Binary extends AST {
130
+ operation: string;
131
+ left: AST;
132
+ right: AST;
133
+ constructor(span: ParseSpan, operation: string, left: AST, right: AST);
134
+ visit(visitor: AstVisitor, context?: any): any;
135
+ }
136
+ export declare class PrefixNot extends AST {
137
+ expression: AST;
138
+ constructor(span: ParseSpan, expression: AST);
139
+ visit(visitor: AstVisitor, context?: any): any;
140
+ }
141
+ export declare class MethodCall extends AST {
142
+ receiver: AST;
143
+ name: string;
144
+ args: any[];
145
+ constructor(span: ParseSpan, receiver: AST, name: string, args: any[]);
146
+ visit(visitor: AstVisitor, context?: any): any;
147
+ }
148
+ export declare class SafeMethodCall extends AST {
149
+ receiver: AST;
150
+ name: string;
151
+ args: any[];
152
+ constructor(span: ParseSpan, receiver: AST, name: string, args: any[]);
153
+ visit(visitor: AstVisitor, context?: any): any;
154
+ }
155
+ export declare class FunctionCall extends AST {
156
+ target: AST;
157
+ args: any[];
158
+ constructor(span: ParseSpan, target: AST, args: any[]);
159
+ visit(visitor: AstVisitor, context?: any): any;
160
+ }
161
+ export declare class ASTWithSource extends AST {
162
+ ast: AST;
163
+ source: string;
164
+ location: string;
165
+ errors: ParserError[];
166
+ constructor(ast: AST, source: string, location: string, errors: ParserError[]);
167
+ visit(visitor: AstVisitor, context?: any): any;
168
+ toString(): string;
169
+ }
170
+ export declare class TemplateBinding {
171
+ span: ParseSpan;
172
+ key: string;
173
+ keyIsVar: boolean;
174
+ name: string;
175
+ expression: ASTWithSource;
176
+ constructor(span: ParseSpan, key: string, keyIsVar: boolean, name: string, expression: ASTWithSource);
177
+ }
178
+ export interface AstVisitor {
179
+ visitBinary(ast: Binary, context: any): any;
180
+ visitChain(ast: Chain, context: any): any;
181
+ visitConditional(ast: Conditional, context: any): any;
182
+ visitFunctionCall(ast: FunctionCall, context: any): any;
183
+ visitImplicitReceiver(ast: ImplicitReceiver, context: any): any;
184
+ visitInterpolation(ast: Interpolation, context: any): any;
185
+ visitKeyedRead(ast: KeyedRead, context: any): any;
186
+ visitKeyedWrite(ast: KeyedWrite, context: any): any;
187
+ visitLiteralArray(ast: LiteralArray, context: any): any;
188
+ visitLiteralMap(ast: LiteralMap, context: any): any;
189
+ visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;
190
+ visitMethodCall(ast: MethodCall, context: any): any;
191
+ visitPipe(ast: BindingPipe, context: any): any;
192
+ visitPrefixNot(ast: PrefixNot, context: any): any;
193
+ visitPropertyRead(ast: PropertyRead, context: any): any;
194
+ visitPropertyWrite(ast: PropertyWrite, context: any): any;
195
+ visitQuote(ast: Quote, context: any): any;
196
+ visitSafeMethodCall(ast: SafeMethodCall, context: any): any;
197
+ visitSafePropertyRead(ast: SafePropertyRead, context: any): any;
198
+ }
199
+ export declare class RecursiveAstVisitor implements AstVisitor {
200
+ visitBinary(ast: Binary, context: any): any;
201
+ visitChain(ast: Chain, context: any): any;
202
+ visitConditional(ast: Conditional, context: any): any;
203
+ visitPipe(ast: BindingPipe, context: any): any;
204
+ visitFunctionCall(ast: FunctionCall, context: any): any;
205
+ visitImplicitReceiver(ast: ImplicitReceiver, context: any): any;
206
+ visitInterpolation(ast: Interpolation, context: any): any;
207
+ visitKeyedRead(ast: KeyedRead, context: any): any;
208
+ visitKeyedWrite(ast: KeyedWrite, context: any): any;
209
+ visitLiteralArray(ast: LiteralArray, context: any): any;
210
+ visitLiteralMap(ast: LiteralMap, context: any): any;
211
+ visitLiteralPrimitive(ast: LiteralPrimitive, context: any): any;
212
+ visitMethodCall(ast: MethodCall, context: any): any;
213
+ visitPrefixNot(ast: PrefixNot, context: any): any;
214
+ visitPropertyRead(ast: PropertyRead, context: any): any;
215
+ visitPropertyWrite(ast: PropertyWrite, context: any): any;
216
+ visitSafePropertyRead(ast: SafePropertyRead, context: any): any;
217
+ visitSafeMethodCall(ast: SafeMethodCall, context: any): any;
218
+ visitAll(asts: AST[], context: any): any;
219
+ visitQuote(ast: Quote, context: any): any;
220
+ }
221
+ export declare class AstTransformer implements AstVisitor {
222
+ visitImplicitReceiver(ast: ImplicitReceiver, context: any): AST;
223
+ visitInterpolation(ast: Interpolation, context: any): AST;
224
+ visitLiteralPrimitive(ast: LiteralPrimitive, context: any): AST;
225
+ visitPropertyRead(ast: PropertyRead, context: any): AST;
226
+ visitPropertyWrite(ast: PropertyWrite, context: any): AST;
227
+ visitSafePropertyRead(ast: SafePropertyRead, context: any): AST;
228
+ visitMethodCall(ast: MethodCall, context: any): AST;
229
+ visitSafeMethodCall(ast: SafeMethodCall, context: any): AST;
230
+ visitFunctionCall(ast: FunctionCall, context: any): AST;
231
+ visitLiteralArray(ast: LiteralArray, context: any): AST;
232
+ visitLiteralMap(ast: LiteralMap, context: any): AST;
233
+ visitBinary(ast: Binary, context: any): AST;
234
+ visitPrefixNot(ast: PrefixNot, context: any): AST;
235
+ visitConditional(ast: Conditional, context: any): AST;
236
+ visitPipe(ast: BindingPipe, context: any): AST;
237
+ visitKeyedRead(ast: KeyedRead, context: any): AST;
238
+ visitKeyedWrite(ast: KeyedWrite, context: any): AST;
239
+ visitAll(asts: any[]): any[];
240
+ visitChain(ast: Chain, context: any): AST;
241
+ visitQuote(ast: Quote, context: any): AST;
242
+ }
243
+ //# sourceMappingURL=ast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["ast.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,qBAAa,WAAW;IAGQ,KAAK,EAAE,MAAM;IAAS,WAAW,EAAE,MAAM;IAAS,WAAW,CAAC,EAAE,GAAG;IAFxF,OAAO,EAAE,MAAM,CAAC;gBAEnB,OAAO,EAAE,MAAM,EAAS,KAAK,EAAE,MAAM,EAAS,WAAW,EAAE,MAAM,EAAS,WAAW,CAAC,EAAE,GAAG,YAAA;CAGlG;AAED,qBAAa,SAAS;IACC,KAAK,EAAE,MAAM;IAAS,GAAG,EAAE,MAAM;gBAAjC,KAAK,EAAE,MAAM,EAAS,GAAG,EAAE,MAAM;CACvD;AAED,qBAAa,GAAG;IACO,IAAI,EAAE,SAAS;gBAAf,IAAI,EAAE,SAAS;IAClC,KAAK,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,GAAE,GAAU,GAAG,GAAG;IACpD,QAAQ,IAAI,MAAM;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,KAAM,SAAQ,GAAG;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KAAK,EAAE,OAAO,EAAE,GAAG,GAAG,GAAG;IAIzC,UAAU,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,GAAG,GAAG;CAG5C"}
@@ -0,0 +1,393 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google Inc. All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.io/license
7
+ */
8
+ import { isBlank } from '../facade/lang';
9
+ export class ParserError {
10
+ constructor(message, input, errLocation, ctxLocation) {
11
+ this.input = input;
12
+ this.errLocation = errLocation;
13
+ this.ctxLocation = ctxLocation;
14
+ this.message = `Parser Error: ${message} ${errLocation} [${input}] in ${ctxLocation}`;
15
+ }
16
+ }
17
+ export class ParseSpan {
18
+ constructor(start, end) {
19
+ this.start = start;
20
+ this.end = end;
21
+ }
22
+ }
23
+ export class AST {
24
+ constructor(span) {
25
+ this.span = span;
26
+ }
27
+ visit(visitor, context = null) { return null; }
28
+ toString() { return 'AST'; }
29
+ }
30
+ /**
31
+ * Represents a quoted expression of the form:
32
+ *
33
+ * quote = prefix `:` uninterpretedExpression
34
+ * prefix = identifier
35
+ * uninterpretedExpression = arbitrary string
36
+ *
37
+ * A quoted expression is meant to be pre-processed by an AST transformer that
38
+ * converts it into another AST that no longer contains quoted expressions.
39
+ * It is meant to allow third-party developers to extend Angular template
40
+ * expression language. The `uninterpretedExpression` part of the quote is
41
+ * therefore not interpreted by the Angular's own expression parser.
42
+ */
43
+ export class Quote extends AST {
44
+ constructor(span, prefix, uninterpretedExpression, location) {
45
+ super(span);
46
+ this.prefix = prefix;
47
+ this.uninterpretedExpression = uninterpretedExpression;
48
+ this.location = location;
49
+ }
50
+ visit(visitor, context = null) { return visitor.visitQuote(this, context); }
51
+ toString() { return 'Quote'; }
52
+ }
53
+ export class EmptyExpr extends AST {
54
+ visit(visitor, context = null) {
55
+ // do nothing
56
+ }
57
+ }
58
+ export class ImplicitReceiver extends AST {
59
+ visit(visitor, context = null) {
60
+ return visitor.visitImplicitReceiver(this, context);
61
+ }
62
+ }
63
+ /**
64
+ * Multiple expressions separated by a semicolon.
65
+ */
66
+ export class Chain extends AST {
67
+ constructor(span, expressions) {
68
+ super(span);
69
+ this.expressions = expressions;
70
+ }
71
+ visit(visitor, context = null) { return visitor.visitChain(this, context); }
72
+ }
73
+ export class Conditional extends AST {
74
+ constructor(span, condition, trueExp, falseExp) {
75
+ super(span);
76
+ this.condition = condition;
77
+ this.trueExp = trueExp;
78
+ this.falseExp = falseExp;
79
+ }
80
+ visit(visitor, context = null) {
81
+ return visitor.visitConditional(this, context);
82
+ }
83
+ }
84
+ export class PropertyRead extends AST {
85
+ constructor(span, receiver, name) {
86
+ super(span);
87
+ this.receiver = receiver;
88
+ this.name = name;
89
+ }
90
+ visit(visitor, context = null) {
91
+ return visitor.visitPropertyRead(this, context);
92
+ }
93
+ }
94
+ export class PropertyWrite extends AST {
95
+ constructor(span, receiver, name, value) {
96
+ super(span);
97
+ this.receiver = receiver;
98
+ this.name = name;
99
+ this.value = value;
100
+ }
101
+ visit(visitor, context = null) {
102
+ return visitor.visitPropertyWrite(this, context);
103
+ }
104
+ }
105
+ export class SafePropertyRead extends AST {
106
+ constructor(span, receiver, name) {
107
+ super(span);
108
+ this.receiver = receiver;
109
+ this.name = name;
110
+ }
111
+ visit(visitor, context = null) {
112
+ return visitor.visitSafePropertyRead(this, context);
113
+ }
114
+ }
115
+ export class KeyedRead extends AST {
116
+ constructor(span, obj, key) {
117
+ super(span);
118
+ this.obj = obj;
119
+ this.key = key;
120
+ }
121
+ visit(visitor, context = null) {
122
+ return visitor.visitKeyedRead(this, context);
123
+ }
124
+ }
125
+ export class KeyedWrite extends AST {
126
+ constructor(span, obj, key, value) {
127
+ super(span);
128
+ this.obj = obj;
129
+ this.key = key;
130
+ this.value = value;
131
+ }
132
+ visit(visitor, context = null) {
133
+ return visitor.visitKeyedWrite(this, context);
134
+ }
135
+ }
136
+ export class BindingPipe extends AST {
137
+ constructor(span, exp, name, args) {
138
+ super(span);
139
+ this.exp = exp;
140
+ this.name = name;
141
+ this.args = args;
142
+ }
143
+ visit(visitor, context = null) { return visitor.visitPipe(this, context); }
144
+ }
145
+ export class LiteralPrimitive extends AST {
146
+ constructor(span, value) {
147
+ super(span);
148
+ this.value = value;
149
+ }
150
+ visit(visitor, context = null) {
151
+ return visitor.visitLiteralPrimitive(this, context);
152
+ }
153
+ }
154
+ export class LiteralArray extends AST {
155
+ constructor(span, expressions) {
156
+ super(span);
157
+ this.expressions = expressions;
158
+ }
159
+ visit(visitor, context = null) {
160
+ return visitor.visitLiteralArray(this, context);
161
+ }
162
+ }
163
+ export class LiteralMap extends AST {
164
+ constructor(span, keys, values) {
165
+ super(span);
166
+ this.keys = keys;
167
+ this.values = values;
168
+ }
169
+ visit(visitor, context = null) {
170
+ return visitor.visitLiteralMap(this, context);
171
+ }
172
+ }
173
+ export class Interpolation extends AST {
174
+ constructor(span, strings, expressions) {
175
+ super(span);
176
+ this.strings = strings;
177
+ this.expressions = expressions;
178
+ }
179
+ visit(visitor, context = null) {
180
+ return visitor.visitInterpolation(this, context);
181
+ }
182
+ }
183
+ export class Binary extends AST {
184
+ constructor(span, operation, left, right) {
185
+ super(span);
186
+ this.operation = operation;
187
+ this.left = left;
188
+ this.right = right;
189
+ }
190
+ visit(visitor, context = null) {
191
+ return visitor.visitBinary(this, context);
192
+ }
193
+ }
194
+ export class PrefixNot extends AST {
195
+ constructor(span, expression) {
196
+ super(span);
197
+ this.expression = expression;
198
+ }
199
+ visit(visitor, context = null) {
200
+ return visitor.visitPrefixNot(this, context);
201
+ }
202
+ }
203
+ export class MethodCall extends AST {
204
+ constructor(span, receiver, name, args) {
205
+ super(span);
206
+ this.receiver = receiver;
207
+ this.name = name;
208
+ this.args = args;
209
+ }
210
+ visit(visitor, context = null) {
211
+ return visitor.visitMethodCall(this, context);
212
+ }
213
+ }
214
+ export class SafeMethodCall extends AST {
215
+ constructor(span, receiver, name, args) {
216
+ super(span);
217
+ this.receiver = receiver;
218
+ this.name = name;
219
+ this.args = args;
220
+ }
221
+ visit(visitor, context = null) {
222
+ return visitor.visitSafeMethodCall(this, context);
223
+ }
224
+ }
225
+ export class FunctionCall extends AST {
226
+ constructor(span, target, args) {
227
+ super(span);
228
+ this.target = target;
229
+ this.args = args;
230
+ }
231
+ visit(visitor, context = null) {
232
+ return visitor.visitFunctionCall(this, context);
233
+ }
234
+ }
235
+ export class ASTWithSource extends AST {
236
+ constructor(ast, source, location, errors) {
237
+ super(new ParseSpan(0, isBlank(source) ? 0 : source.length));
238
+ this.ast = ast;
239
+ this.source = source;
240
+ this.location = location;
241
+ this.errors = errors;
242
+ }
243
+ visit(visitor, context = null) { return this.ast.visit(visitor, context); }
244
+ toString() { return `${this.source} in ${this.location}`; }
245
+ }
246
+ export class TemplateBinding {
247
+ constructor(span, key, keyIsVar, name, expression) {
248
+ this.span = span;
249
+ this.key = key;
250
+ this.keyIsVar = keyIsVar;
251
+ this.name = name;
252
+ this.expression = expression;
253
+ }
254
+ }
255
+ export class RecursiveAstVisitor {
256
+ visitBinary(ast, context) {
257
+ ast.left.visit(this);
258
+ ast.right.visit(this);
259
+ return null;
260
+ }
261
+ visitChain(ast, context) { return this.visitAll(ast.expressions, context); }
262
+ visitConditional(ast, context) {
263
+ ast.condition.visit(this);
264
+ ast.trueExp.visit(this);
265
+ ast.falseExp.visit(this);
266
+ return null;
267
+ }
268
+ visitPipe(ast, context) {
269
+ ast.exp.visit(this);
270
+ this.visitAll(ast.args, context);
271
+ return null;
272
+ }
273
+ visitFunctionCall(ast, context) {
274
+ ast.target.visit(this);
275
+ this.visitAll(ast.args, context);
276
+ return null;
277
+ }
278
+ visitImplicitReceiver(ast, context) { return null; }
279
+ visitInterpolation(ast, context) {
280
+ return this.visitAll(ast.expressions, context);
281
+ }
282
+ visitKeyedRead(ast, context) {
283
+ ast.obj.visit(this);
284
+ ast.key.visit(this);
285
+ return null;
286
+ }
287
+ visitKeyedWrite(ast, context) {
288
+ ast.obj.visit(this);
289
+ ast.key.visit(this);
290
+ ast.value.visit(this);
291
+ return null;
292
+ }
293
+ visitLiteralArray(ast, context) {
294
+ return this.visitAll(ast.expressions, context);
295
+ }
296
+ visitLiteralMap(ast, context) { return this.visitAll(ast.values, context); }
297
+ visitLiteralPrimitive(ast, context) { return null; }
298
+ visitMethodCall(ast, context) {
299
+ ast.receiver.visit(this);
300
+ return this.visitAll(ast.args, context);
301
+ }
302
+ visitPrefixNot(ast, context) {
303
+ ast.expression.visit(this);
304
+ return null;
305
+ }
306
+ visitPropertyRead(ast, context) {
307
+ ast.receiver.visit(this);
308
+ return null;
309
+ }
310
+ visitPropertyWrite(ast, context) {
311
+ ast.receiver.visit(this);
312
+ ast.value.visit(this);
313
+ return null;
314
+ }
315
+ visitSafePropertyRead(ast, context) {
316
+ ast.receiver.visit(this);
317
+ return null;
318
+ }
319
+ visitSafeMethodCall(ast, context) {
320
+ ast.receiver.visit(this);
321
+ return this.visitAll(ast.args, context);
322
+ }
323
+ visitAll(asts, context) {
324
+ asts.forEach(ast => ast.visit(this, context));
325
+ return null;
326
+ }
327
+ visitQuote(ast, context) { return null; }
328
+ }
329
+ export class AstTransformer {
330
+ visitImplicitReceiver(ast, context) { return ast; }
331
+ visitInterpolation(ast, context) {
332
+ return new Interpolation(ast.span, ast.strings, this.visitAll(ast.expressions));
333
+ }
334
+ visitLiteralPrimitive(ast, context) {
335
+ return new LiteralPrimitive(ast.span, ast.value);
336
+ }
337
+ visitPropertyRead(ast, context) {
338
+ return new PropertyRead(ast.span, ast.receiver.visit(this), ast.name);
339
+ }
340
+ visitPropertyWrite(ast, context) {
341
+ return new PropertyWrite(ast.span, ast.receiver.visit(this), ast.name, ast.value);
342
+ }
343
+ visitSafePropertyRead(ast, context) {
344
+ return new SafePropertyRead(ast.span, ast.receiver.visit(this), ast.name);
345
+ }
346
+ visitMethodCall(ast, context) {
347
+ return new MethodCall(ast.span, ast.receiver.visit(this), ast.name, this.visitAll(ast.args));
348
+ }
349
+ visitSafeMethodCall(ast, context) {
350
+ return new SafeMethodCall(ast.span, ast.receiver.visit(this), ast.name, this.visitAll(ast.args));
351
+ }
352
+ visitFunctionCall(ast, context) {
353
+ return new FunctionCall(ast.span, ast.target.visit(this), this.visitAll(ast.args));
354
+ }
355
+ visitLiteralArray(ast, context) {
356
+ return new LiteralArray(ast.span, this.visitAll(ast.expressions));
357
+ }
358
+ visitLiteralMap(ast, context) {
359
+ return new LiteralMap(ast.span, ast.keys, this.visitAll(ast.values));
360
+ }
361
+ visitBinary(ast, context) {
362
+ return new Binary(ast.span, ast.operation, ast.left.visit(this), ast.right.visit(this));
363
+ }
364
+ visitPrefixNot(ast, context) {
365
+ return new PrefixNot(ast.span, ast.expression.visit(this));
366
+ }
367
+ visitConditional(ast, context) {
368
+ return new Conditional(ast.span, ast.condition.visit(this), ast.trueExp.visit(this), ast.falseExp.visit(this));
369
+ }
370
+ visitPipe(ast, context) {
371
+ return new BindingPipe(ast.span, ast.exp.visit(this), ast.name, this.visitAll(ast.args));
372
+ }
373
+ visitKeyedRead(ast, context) {
374
+ return new KeyedRead(ast.span, ast.obj.visit(this), ast.key.visit(this));
375
+ }
376
+ visitKeyedWrite(ast, context) {
377
+ return new KeyedWrite(ast.span, ast.obj.visit(this), ast.key.visit(this), ast.value.visit(this));
378
+ }
379
+ visitAll(asts) {
380
+ const res = new Array(asts.length);
381
+ for (let i = 0; i < asts.length; ++i) {
382
+ res[i] = asts[i].visit(this);
383
+ }
384
+ return res;
385
+ }
386
+ visitChain(ast, context) {
387
+ return new Chain(ast.span, this.visitAll(ast.expressions));
388
+ }
389
+ visitQuote(ast, context) {
390
+ return new Quote(ast.span, ast.prefix, ast.uninterpretedExpression, ast.location);
391
+ }
392
+ }
393
+ //# sourceMappingURL=ast.js.map