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 | (function (factory) {
|
---|
9 | if (typeof module === "object" && typeof module.exports === "object") {
|
---|
10 | var v = factory(require, exports);
|
---|
11 | if (v !== undefined) module.exports = v;
|
---|
12 | }
|
---|
13 | else if (typeof define === "function" && define.amd) {
|
---|
14 | define("@angular/compiler/src/i18n/i18n_ast", ["require", "exports"], factory);
|
---|
15 | }
|
---|
16 | })(function (require, exports) {
|
---|
17 | "use strict";
|
---|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
19 | exports.RecurseVisitor = exports.CloneVisitor = exports.IcuPlaceholder = exports.Placeholder = exports.TagPlaceholder = exports.Icu = exports.Container = exports.Text = exports.Message = void 0;
|
---|
20 | var Message = /** @class */ (function () {
|
---|
21 | /**
|
---|
22 | * @param nodes message AST
|
---|
23 | * @param placeholders maps placeholder names to static content and their source spans
|
---|
24 | * @param placeholderToMessage maps placeholder names to messages (used for nested ICU messages)
|
---|
25 | * @param meaning
|
---|
26 | * @param description
|
---|
27 | * @param customId
|
---|
28 | */
|
---|
29 | function Message(nodes, placeholders, placeholderToMessage, meaning, description, customId) {
|
---|
30 | this.nodes = nodes;
|
---|
31 | this.placeholders = placeholders;
|
---|
32 | this.placeholderToMessage = placeholderToMessage;
|
---|
33 | this.meaning = meaning;
|
---|
34 | this.description = description;
|
---|
35 | this.customId = customId;
|
---|
36 | this.id = this.customId;
|
---|
37 | /** The ids to use if there are no custom id and if `i18nLegacyMessageIdFormat` is not empty */
|
---|
38 | this.legacyIds = [];
|
---|
39 | if (nodes.length) {
|
---|
40 | this.sources = [{
|
---|
41 | filePath: nodes[0].sourceSpan.start.file.url,
|
---|
42 | startLine: nodes[0].sourceSpan.start.line + 1,
|
---|
43 | startCol: nodes[0].sourceSpan.start.col + 1,
|
---|
44 | endLine: nodes[nodes.length - 1].sourceSpan.end.line + 1,
|
---|
45 | endCol: nodes[0].sourceSpan.start.col + 1
|
---|
46 | }];
|
---|
47 | }
|
---|
48 | else {
|
---|
49 | this.sources = [];
|
---|
50 | }
|
---|
51 | }
|
---|
52 | return Message;
|
---|
53 | }());
|
---|
54 | exports.Message = Message;
|
---|
55 | var Text = /** @class */ (function () {
|
---|
56 | function Text(value, sourceSpan) {
|
---|
57 | this.value = value;
|
---|
58 | this.sourceSpan = sourceSpan;
|
---|
59 | }
|
---|
60 | Text.prototype.visit = function (visitor, context) {
|
---|
61 | return visitor.visitText(this, context);
|
---|
62 | };
|
---|
63 | return Text;
|
---|
64 | }());
|
---|
65 | exports.Text = Text;
|
---|
66 | // TODO(vicb): do we really need this node (vs an array) ?
|
---|
67 | var Container = /** @class */ (function () {
|
---|
68 | function Container(children, sourceSpan) {
|
---|
69 | this.children = children;
|
---|
70 | this.sourceSpan = sourceSpan;
|
---|
71 | }
|
---|
72 | Container.prototype.visit = function (visitor, context) {
|
---|
73 | return visitor.visitContainer(this, context);
|
---|
74 | };
|
---|
75 | return Container;
|
---|
76 | }());
|
---|
77 | exports.Container = Container;
|
---|
78 | var Icu = /** @class */ (function () {
|
---|
79 | function Icu(expression, type, cases, sourceSpan) {
|
---|
80 | this.expression = expression;
|
---|
81 | this.type = type;
|
---|
82 | this.cases = cases;
|
---|
83 | this.sourceSpan = sourceSpan;
|
---|
84 | }
|
---|
85 | Icu.prototype.visit = function (visitor, context) {
|
---|
86 | return visitor.visitIcu(this, context);
|
---|
87 | };
|
---|
88 | return Icu;
|
---|
89 | }());
|
---|
90 | exports.Icu = Icu;
|
---|
91 | var TagPlaceholder = /** @class */ (function () {
|
---|
92 | function TagPlaceholder(tag, attrs, startName, closeName, children, isVoid,
|
---|
93 | // TODO sourceSpan should cover all (we need a startSourceSpan and endSourceSpan)
|
---|
94 | sourceSpan, startSourceSpan, endSourceSpan) {
|
---|
95 | this.tag = tag;
|
---|
96 | this.attrs = attrs;
|
---|
97 | this.startName = startName;
|
---|
98 | this.closeName = closeName;
|
---|
99 | this.children = children;
|
---|
100 | this.isVoid = isVoid;
|
---|
101 | this.sourceSpan = sourceSpan;
|
---|
102 | this.startSourceSpan = startSourceSpan;
|
---|
103 | this.endSourceSpan = endSourceSpan;
|
---|
104 | }
|
---|
105 | TagPlaceholder.prototype.visit = function (visitor, context) {
|
---|
106 | return visitor.visitTagPlaceholder(this, context);
|
---|
107 | };
|
---|
108 | return TagPlaceholder;
|
---|
109 | }());
|
---|
110 | exports.TagPlaceholder = TagPlaceholder;
|
---|
111 | var Placeholder = /** @class */ (function () {
|
---|
112 | function Placeholder(value, name, sourceSpan) {
|
---|
113 | this.value = value;
|
---|
114 | this.name = name;
|
---|
115 | this.sourceSpan = sourceSpan;
|
---|
116 | }
|
---|
117 | Placeholder.prototype.visit = function (visitor, context) {
|
---|
118 | return visitor.visitPlaceholder(this, context);
|
---|
119 | };
|
---|
120 | return Placeholder;
|
---|
121 | }());
|
---|
122 | exports.Placeholder = Placeholder;
|
---|
123 | var IcuPlaceholder = /** @class */ (function () {
|
---|
124 | function IcuPlaceholder(value, name, sourceSpan) {
|
---|
125 | this.value = value;
|
---|
126 | this.name = name;
|
---|
127 | this.sourceSpan = sourceSpan;
|
---|
128 | }
|
---|
129 | IcuPlaceholder.prototype.visit = function (visitor, context) {
|
---|
130 | return visitor.visitIcuPlaceholder(this, context);
|
---|
131 | };
|
---|
132 | return IcuPlaceholder;
|
---|
133 | }());
|
---|
134 | exports.IcuPlaceholder = IcuPlaceholder;
|
---|
135 | // Clone the AST
|
---|
136 | var CloneVisitor = /** @class */ (function () {
|
---|
137 | function CloneVisitor() {
|
---|
138 | }
|
---|
139 | CloneVisitor.prototype.visitText = function (text, context) {
|
---|
140 | return new Text(text.value, text.sourceSpan);
|
---|
141 | };
|
---|
142 | CloneVisitor.prototype.visitContainer = function (container, context) {
|
---|
143 | var _this = this;
|
---|
144 | var children = container.children.map(function (n) { return n.visit(_this, context); });
|
---|
145 | return new Container(children, container.sourceSpan);
|
---|
146 | };
|
---|
147 | CloneVisitor.prototype.visitIcu = function (icu, context) {
|
---|
148 | var _this = this;
|
---|
149 | var cases = {};
|
---|
150 | Object.keys(icu.cases).forEach(function (key) { return cases[key] = icu.cases[key].visit(_this, context); });
|
---|
151 | var msg = new Icu(icu.expression, icu.type, cases, icu.sourceSpan);
|
---|
152 | msg.expressionPlaceholder = icu.expressionPlaceholder;
|
---|
153 | return msg;
|
---|
154 | };
|
---|
155 | CloneVisitor.prototype.visitTagPlaceholder = function (ph, context) {
|
---|
156 | var _this = this;
|
---|
157 | var children = ph.children.map(function (n) { return n.visit(_this, context); });
|
---|
158 | return new TagPlaceholder(ph.tag, ph.attrs, ph.startName, ph.closeName, children, ph.isVoid, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);
|
---|
159 | };
|
---|
160 | CloneVisitor.prototype.visitPlaceholder = function (ph, context) {
|
---|
161 | return new Placeholder(ph.value, ph.name, ph.sourceSpan);
|
---|
162 | };
|
---|
163 | CloneVisitor.prototype.visitIcuPlaceholder = function (ph, context) {
|
---|
164 | return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan);
|
---|
165 | };
|
---|
166 | return CloneVisitor;
|
---|
167 | }());
|
---|
168 | exports.CloneVisitor = CloneVisitor;
|
---|
169 | // Visit all the nodes recursively
|
---|
170 | var RecurseVisitor = /** @class */ (function () {
|
---|
171 | function RecurseVisitor() {
|
---|
172 | }
|
---|
173 | RecurseVisitor.prototype.visitText = function (text, context) { };
|
---|
174 | RecurseVisitor.prototype.visitContainer = function (container, context) {
|
---|
175 | var _this = this;
|
---|
176 | container.children.forEach(function (child) { return child.visit(_this); });
|
---|
177 | };
|
---|
178 | RecurseVisitor.prototype.visitIcu = function (icu, context) {
|
---|
179 | var _this = this;
|
---|
180 | Object.keys(icu.cases).forEach(function (k) {
|
---|
181 | icu.cases[k].visit(_this);
|
---|
182 | });
|
---|
183 | };
|
---|
184 | RecurseVisitor.prototype.visitTagPlaceholder = function (ph, context) {
|
---|
185 | var _this = this;
|
---|
186 | ph.children.forEach(function (child) { return child.visit(_this); });
|
---|
187 | };
|
---|
188 | RecurseVisitor.prototype.visitPlaceholder = function (ph, context) { };
|
---|
189 | RecurseVisitor.prototype.visitIcuPlaceholder = function (ph, context) { };
|
---|
190 | return RecurseVisitor;
|
---|
191 | }());
|
---|
192 | exports.RecurseVisitor = RecurseVisitor;
|
---|
193 | });
|
---|
194 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaTE4bl9hc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci9zcmMvaTE4bi9pMThuX2FzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7SUFnQkg7UUFNRTs7Ozs7OztXQU9HO1FBQ0gsaUJBQ1csS0FBYSxFQUFTLFlBQW9ELEVBQzFFLG9CQUFpRCxFQUFTLE9BQWUsRUFDekUsV0FBbUIsRUFBUyxRQUFnQjtZQUY1QyxVQUFLLEdBQUwsS0FBSyxDQUFRO1lBQVMsaUJBQVksR0FBWixZQUFZLENBQXdDO1lBQzFFLHlCQUFvQixHQUFwQixvQkFBb0IsQ0FBNkI7WUFBUyxZQUFPLEdBQVAsT0FBTyxDQUFRO1lBQ3pFLGdCQUFXLEdBQVgsV0FBVyxDQUFRO1lBQVMsYUFBUSxHQUFSLFFBQVEsQ0FBUTtZQWZ2RCxPQUFFLEdBQVcsSUFBSSxDQUFDLFFBQVEsQ0FBQztZQUMzQiwrRkFBK0Y7WUFDL0YsY0FBUyxHQUFhLEVBQUUsQ0FBQztZQWN2QixJQUFJLEtBQUssQ0FBQyxNQUFNLEVBQUU7Z0JBQ2hCLElBQUksQ0FBQyxPQUFPLEdBQUcsQ0F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