source: trip-planner-front/node_modules/@angular/compiler/esm2015/src/render3/r3_ast.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 38.9 KB
Line 
1/**
2 * @license
3 * Copyright Google LLC 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/**
9 * This is an R3 `Node`-like wrapper for a raw `html.Comment` node. We do not currently
10 * require the implementation of a visitor for Comments as they are only collected at
11 * the top-level of the R3 AST, and only if `Render3ParseOptions['collectCommentNodes']`
12 * is true.
13 */
14export class Comment {
15 constructor(value, sourceSpan) {
16 this.value = value;
17 this.sourceSpan = sourceSpan;
18 }
19 visit(_visitor) {
20 throw new Error('visit() not implemented for Comment');
21 }
22}
23export class Text {
24 constructor(value, sourceSpan) {
25 this.value = value;
26 this.sourceSpan = sourceSpan;
27 }
28 visit(visitor) {
29 return visitor.visitText(this);
30 }
31}
32export class BoundText {
33 constructor(value, sourceSpan, i18n) {
34 this.value = value;
35 this.sourceSpan = sourceSpan;
36 this.i18n = i18n;
37 }
38 visit(visitor) {
39 return visitor.visitBoundText(this);
40 }
41}
42/**
43 * Represents a text attribute in the template.
44 *
45 * `valueSpan` may not be present in cases where there is no value `<div a></div>`.
46 * `keySpan` may also not be present for synthetic attributes from ICU expansions.
47 */
48export class TextAttribute {
49 constructor(name, value, sourceSpan, keySpan, valueSpan, i18n) {
50 this.name = name;
51 this.value = value;
52 this.sourceSpan = sourceSpan;
53 this.keySpan = keySpan;
54 this.valueSpan = valueSpan;
55 this.i18n = i18n;
56 }
57 visit(visitor) {
58 return visitor.visitTextAttribute(this);
59 }
60}
61export class BoundAttribute {
62 constructor(name, type, securityContext, value, unit, sourceSpan, keySpan, valueSpan, i18n) {
63 this.name = name;
64 this.type = type;
65 this.securityContext = securityContext;
66 this.value = value;
67 this.unit = unit;
68 this.sourceSpan = sourceSpan;
69 this.keySpan = keySpan;
70 this.valueSpan = valueSpan;
71 this.i18n = i18n;
72 }
73 static fromBoundElementProperty(prop, i18n) {
74 if (prop.keySpan === undefined) {
75 throw new Error(`Unexpected state: keySpan must be defined for bound attributes but was not for ${prop.name}: ${prop.sourceSpan}`);
76 }
77 return new BoundAttribute(prop.name, prop.type, prop.securityContext, prop.value, prop.unit, prop.sourceSpan, prop.keySpan, prop.valueSpan, i18n);
78 }
79 visit(visitor) {
80 return visitor.visitBoundAttribute(this);
81 }
82}
83export class BoundEvent {
84 constructor(name, type, handler, target, phase, sourceSpan, handlerSpan, keySpan) {
85 this.name = name;
86 this.type = type;
87 this.handler = handler;
88 this.target = target;
89 this.phase = phase;
90 this.sourceSpan = sourceSpan;
91 this.handlerSpan = handlerSpan;
92 this.keySpan = keySpan;
93 }
94 static fromParsedEvent(event) {
95 const target = event.type === 0 /* Regular */ ? event.targetOrPhase : null;
96 const phase = event.type === 1 /* Animation */ ? event.targetOrPhase : null;
97 if (event.keySpan === undefined) {
98 throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${event.name}: ${event.sourceSpan}`);
99 }
100 return new BoundEvent(event.name, event.type, event.handler, target, phase, event.sourceSpan, event.handlerSpan, event.keySpan);
101 }
102 visit(visitor) {
103 return visitor.visitBoundEvent(this);
104 }
105}
106export class Element {
107 constructor(name, attributes, inputs, outputs, children, references, sourceSpan, startSourceSpan, endSourceSpan, i18n) {
108 this.name = name;
109 this.attributes = attributes;
110 this.inputs = inputs;
111 this.outputs = outputs;
112 this.children = children;
113 this.references = references;
114 this.sourceSpan = sourceSpan;
115 this.startSourceSpan = startSourceSpan;
116 this.endSourceSpan = endSourceSpan;
117 this.i18n = i18n;
118 }
119 visit(visitor) {
120 return visitor.visitElement(this);
121 }
122}
123export class Template {
124 constructor(tagName, attributes, inputs, outputs, templateAttrs, children, references, variables, sourceSpan, startSourceSpan, endSourceSpan, i18n) {
125 this.tagName = tagName;
126 this.attributes = attributes;
127 this.inputs = inputs;
128 this.outputs = outputs;
129 this.templateAttrs = templateAttrs;
130 this.children = children;
131 this.references = references;
132 this.variables = variables;
133 this.sourceSpan = sourceSpan;
134 this.startSourceSpan = startSourceSpan;
135 this.endSourceSpan = endSourceSpan;
136 this.i18n = i18n;
137 }
138 visit(visitor) {
139 return visitor.visitTemplate(this);
140 }
141}
142export class Content {
143 constructor(selector, attributes, sourceSpan, i18n) {
144 this.selector = selector;
145 this.attributes = attributes;
146 this.sourceSpan = sourceSpan;
147 this.i18n = i18n;
148 this.name = 'ng-content';
149 }
150 visit(visitor) {
151 return visitor.visitContent(this);
152 }
153}
154export class Variable {
155 constructor(name, value, sourceSpan, keySpan, valueSpan) {
156 this.name = name;
157 this.value = value;
158 this.sourceSpan = sourceSpan;
159 this.keySpan = keySpan;
160 this.valueSpan = valueSpan;
161 }
162 visit(visitor) {
163 return visitor.visitVariable(this);
164 }
165}
166export class Reference {
167 constructor(name, value, sourceSpan, keySpan, valueSpan) {
168 this.name = name;
169 this.value = value;
170 this.sourceSpan = sourceSpan;
171 this.keySpan = keySpan;
172 this.valueSpan = valueSpan;
173 }
174 visit(visitor) {
175 return visitor.visitReference(this);
176 }
177}
178export class Icu {
179 constructor(vars, placeholders, sourceSpan, i18n) {
180 this.vars = vars;
181 this.placeholders = placeholders;
182 this.sourceSpan = sourceSpan;
183 this.i18n = i18n;
184 }
185 visit(visitor) {
186 return visitor.visitIcu(this);
187 }
188}
189export class NullVisitor {
190 visitElement(element) { }
191 visitTemplate(template) { }
192 visitContent(content) { }
193 visitVariable(variable) { }
194 visitReference(reference) { }
195 visitTextAttribute(attribute) { }
196 visitBoundAttribute(attribute) { }
197 visitBoundEvent(attribute) { }
198 visitText(text) { }
199 visitBoundText(text) { }
200 visitIcu(icu) { }
201}
202export class RecursiveVisitor {
203 visitElement(element) {
204 visitAll(this, element.attributes);
205 visitAll(this, element.inputs);
206 visitAll(this, element.outputs);
207 visitAll(this, element.children);
208 visitAll(this, element.references);
209 }
210 visitTemplate(template) {
211 visitAll(this, template.attributes);
212 visitAll(this, template.inputs);
213 visitAll(this, template.outputs);
214 visitAll(this, template.children);
215 visitAll(this, template.references);
216 visitAll(this, template.variables);
217 }
218 visitContent(content) { }
219 visitVariable(variable) { }
220 visitReference(reference) { }
221 visitTextAttribute(attribute) { }
222 visitBoundAttribute(attribute) { }
223 visitBoundEvent(attribute) { }
224 visitText(text) { }
225 visitBoundText(text) { }
226 visitIcu(icu) { }
227}
228export class TransformVisitor {
229 visitElement(element) {
230 const newAttributes = transformAll(this, element.attributes);
231 const newInputs = transformAll(this, element.inputs);
232 const newOutputs = transformAll(this, element.outputs);
233 const newChildren = transformAll(this, element.children);
234 const newReferences = transformAll(this, element.references);
235 if (newAttributes != element.attributes || newInputs != element.inputs ||
236 newOutputs != element.outputs || newChildren != element.children ||
237 newReferences != element.references) {
238 return new Element(element.name, newAttributes, newInputs, newOutputs, newChildren, newReferences, element.sourceSpan, element.startSourceSpan, element.endSourceSpan);
239 }
240 return element;
241 }
242 visitTemplate(template) {
243 const newAttributes = transformAll(this, template.attributes);
244 const newInputs = transformAll(this, template.inputs);
245 const newOutputs = transformAll(this, template.outputs);
246 const newTemplateAttrs = transformAll(this, template.templateAttrs);
247 const newChildren = transformAll(this, template.children);
248 const newReferences = transformAll(this, template.references);
249 const newVariables = transformAll(this, template.variables);
250 if (newAttributes != template.attributes || newInputs != template.inputs ||
251 newOutputs != template.outputs || newTemplateAttrs != template.templateAttrs ||
252 newChildren != template.children || newReferences != template.references ||
253 newVariables != template.variables) {
254 return new Template(template.tagName, newAttributes, newInputs, newOutputs, newTemplateAttrs, newChildren, newReferences, newVariables, template.sourceSpan, template.startSourceSpan, template.endSourceSpan);
255 }
256 return template;
257 }
258 visitContent(content) {
259 return content;
260 }
261 visitVariable(variable) {
262 return variable;
263 }
264 visitReference(reference) {
265 return reference;
266 }
267 visitTextAttribute(attribute) {
268 return attribute;
269 }
270 visitBoundAttribute(attribute) {
271 return attribute;
272 }
273 visitBoundEvent(attribute) {
274 return attribute;
275 }
276 visitText(text) {
277 return text;
278 }
279 visitBoundText(text) {
280 return text;
281 }
282 visitIcu(icu) {
283 return icu;
284 }
285}
286export function visitAll(visitor, nodes) {
287 const result = [];
288 if (visitor.visit) {
289 for (const node of nodes) {
290 const newNode = visitor.visit(node) || node.visit(visitor);
291 }
292 }
293 else {
294 for (const node of nodes) {
295 const newNode = node.visit(visitor);
296 if (newNode) {
297 result.push(newNode);
298 }
299 }
300 }
301 return result;
302}
303export function transformAll(visitor, nodes) {
304 const result = [];
305 let changed = false;
306 for (const node of nodes) {
307 const newNode = node.visit(visitor);
308 if (newNode) {
309 result.push(newNode);
310 }
311 changed = changed || newNode != node;
312 }
313 return changed ? result : nodes;
314}
315//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicjNfYXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXIvc3JjL3JlbmRlcjMvcjNfYXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQVlIOzs7OztHQUtHO0FBQ0gsTUFBTSxPQUFPLE9BQU87SUFDbEIsWUFBbUIsS0FBYSxFQUFTLFVBQTJCO1FBQWpELFVBQUssR0FBTCxLQUFLLENBQVE7UUFBUyxlQUFVLEdBQVYsVUFBVSxDQUFpQjtJQUFHLENBQUM7SUFDeEUsS0FBSyxDQUFTLFFBQXlCO1FBQ3JDLE1BQU0sSUFBSSxLQUFLLENBQUMscUNBQXFDLENBQUMsQ0FBQztJQUN6RCxDQUFDO0NBQ0Y7QUFFRCxNQUFNLE9BQU8sSUFBSTtJQUNmLFlBQW1CLEtBQWEsRUFBUyxVQUEyQjtRQUFqRCxVQUFLLEdBQUwsS0FBSyxDQUFRO1FBQVMsZUFBVSxHQUFWLFVBQVUsQ0FBaUI7SUFBRyxDQUFDO0lBQ3hFLEtBQUssQ0FBUyxPQUF3Qjt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