source: trip-planner-front/node_modules/@angular/compiler/src/expression_parser/lexer.js@ 59329aa

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

initial commit

  • Property mode set to 100644
File size: 55.6 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(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/expression_parser/lexer", ["require", "exports", "@angular/compiler/src/chars"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.isIdentifier = exports.EOF = exports.Token = exports.Lexer = exports.TokenType = void 0;
20 var chars = require("@angular/compiler/src/chars");
21 var TokenType;
22 (function (TokenType) {
23 TokenType[TokenType["Character"] = 0] = "Character";
24 TokenType[TokenType["Identifier"] = 1] = "Identifier";
25 TokenType[TokenType["PrivateIdentifier"] = 2] = "PrivateIdentifier";
26 TokenType[TokenType["Keyword"] = 3] = "Keyword";
27 TokenType[TokenType["String"] = 4] = "String";
28 TokenType[TokenType["Operator"] = 5] = "Operator";
29 TokenType[TokenType["Number"] = 6] = "Number";
30 TokenType[TokenType["Error"] = 7] = "Error";
31 })(TokenType = exports.TokenType || (exports.TokenType = {}));
32 var KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this'];
33 var Lexer = /** @class */ (function () {
34 function Lexer() {
35 }
36 Lexer.prototype.tokenize = function (text) {
37 var scanner = new _Scanner(text);
38 var tokens = [];
39 var token = scanner.scanToken();
40 while (token != null) {
41 tokens.push(token);
42 token = scanner.scanToken();
43 }
44 return tokens;
45 };
46 return Lexer;
47 }());
48 exports.Lexer = Lexer;
49 var Token = /** @class */ (function () {
50 function Token(index, end, type, numValue, strValue) {
51 this.index = index;
52 this.end = end;
53 this.type = type;
54 this.numValue = numValue;
55 this.strValue = strValue;
56 }
57 Token.prototype.isCharacter = function (code) {
58 return this.type == TokenType.Character && this.numValue == code;
59 };
60 Token.prototype.isNumber = function () {
61 return this.type == TokenType.Number;
62 };
63 Token.prototype.isString = function () {
64 return this.type == TokenType.String;
65 };
66 Token.prototype.isOperator = function (operator) {
67 return this.type == TokenType.Operator && this.strValue == operator;
68 };
69 Token.prototype.isIdentifier = function () {
70 return this.type == TokenType.Identifier;
71 };
72 Token.prototype.isPrivateIdentifier = function () {
73 return this.type == TokenType.PrivateIdentifier;
74 };
75 Token.prototype.isKeyword = function () {
76 return this.type == TokenType.Keyword;
77 };
78 Token.prototype.isKeywordLet = function () {
79 return this.type == TokenType.Keyword && this.strValue == 'let';
80 };
81 Token.prototype.isKeywordAs = function () {
82 return this.type == TokenType.Keyword && this.strValue == 'as';
83 };
84 Token.prototype.isKeywordNull = function () {
85 return this.type == TokenType.Keyword && this.strValue == 'null';
86 };
87 Token.prototype.isKeywordUndefined = function () {
88 return this.type == TokenType.Keyword && this.strValue == 'undefined';
89 };
90 Token.prototype.isKeywordTrue = function () {
91 return this.type == TokenType.Keyword && this.strValue == 'true';
92 };
93 Token.prototype.isKeywordFalse = function () {
94 return this.type == TokenType.Keyword && this.strValue == 'false';
95 };
96 Token.prototype.isKeywordThis = function () {
97 return this.type == TokenType.Keyword && this.strValue == 'this';
98 };
99 Token.prototype.isError = function () {
100 return this.type == TokenType.Error;
101 };
102 Token.prototype.toNumber = function () {
103 return this.type == TokenType.Number ? this.numValue : -1;
104 };
105 Token.prototype.toString = function () {
106 switch (this.type) {
107 case TokenType.Character:
108 case TokenType.Identifier:
109 case TokenType.Keyword:
110 case TokenType.Operator:
111 case TokenType.PrivateIdentifier:
112 case TokenType.String:
113 case TokenType.Error:
114 return this.strValue;
115 case TokenType.Number:
116 return this.numValue.toString();
117 default:
118 return null;
119 }
120 };
121 return Token;
122 }());
123 exports.Token = Token;
124 function newCharacterToken(index, end, code) {
125 return new Token(index, end, TokenType.Character, code, String.fromCharCode(code));
126 }
127 function newIdentifierToken(index, end, text) {
128 return new Token(index, end, TokenType.Identifier, 0, text);
129 }
130 function newPrivateIdentifierToken(index, end, text) {
131 return new Token(index, end, TokenType.PrivateIdentifier, 0, text);
132 }
133 function newKeywordToken(index, end, text) {
134 return new Token(index, end, TokenType.Keyword, 0, text);
135 }
136 function newOperatorToken(index, end, text) {
137 return new Token(index, end, TokenType.Operator, 0, text);
138 }
139 function newStringToken(index, end, text) {
140 return new Token(index, end, TokenType.String, 0, text);
141 }
142 function newNumberToken(index, end, n) {
143 return new Token(index, end, TokenType.Number, n, '');
144 }
145 function newErrorToken(index, end, message) {
146 return new Token(index, end, TokenType.Error, 0, message);
147 }
148 exports.EOF = new Token(-1, -1, TokenType.Character, 0, '');
149 var _Scanner = /** @class */ (function () {
150 function _Scanner(input) {
151 this.input = input;
152 this.peek = 0;
153 this.index = -1;
154 this.length = input.length;
155 this.advance();
156 }
157 _Scanner.prototype.advance = function () {
158 this.peek = ++this.index >= this.length ? chars.$EOF : this.input.charCodeAt(this.index);
159 };
160 _Scanner.prototype.scanToken = function () {
161 var input = this.input, length = this.length;
162 var peek = this.peek, index = this.index;
163 // Skip whitespace.
164 while (peek <= chars.$SPACE) {
165 if (++index >= length) {
166 peek = chars.$EOF;
167 break;
168 }
169 else {
170 peek = input.charCodeAt(index);
171 }
172 }
173 this.peek = peek;
174 this.index = index;
175 if (index >= length) {
176 return null;
177 }
178 // Handle identifiers and numbers.
179 if (isIdentifierStart(peek))
180 return this.scanIdentifier();
181 if (chars.isDigit(peek))
182 return this.scanNumber(index);
183 var start = index;
184 switch (peek) {
185 case chars.$PERIOD:
186 this.advance();
187 return chars.isDigit(this.peek) ? this.scanNumber(start) :
188 newCharacterToken(start, this.index, chars.$PERIOD);
189 case chars.$LPAREN:
190 case chars.$RPAREN:
191 case chars.$LBRACE:
192 case chars.$RBRACE:
193 case chars.$LBRACKET:
194 case chars.$RBRACKET:
195 case chars.$COMMA:
196 case chars.$COLON:
197 case chars.$SEMICOLON:
198 return this.scanCharacter(start, peek);
199 case chars.$SQ:
200 case chars.$DQ:
201 return this.scanString();
202 case chars.$HASH:
203 return this.scanPrivateIdentifier();
204 case chars.$PLUS:
205 case chars.$MINUS:
206 case chars.$STAR:
207 case chars.$SLASH:
208 case chars.$PERCENT:
209 case chars.$CARET:
210 return this.scanOperator(start, String.fromCharCode(peek));
211 case chars.$QUESTION:
212 return this.scanQuestion(start);
213 case chars.$LT:
214 case chars.$GT:
215 return this.scanComplexOperator(start, String.fromCharCode(peek), chars.$EQ, '=');
216 case chars.$BANG:
217 case chars.$EQ:
218 return this.scanComplexOperator(start, String.fromCharCode(peek), chars.$EQ, '=', chars.$EQ, '=');
219 case chars.$AMPERSAND:
220 return this.scanComplexOperator(start, '&', chars.$AMPERSAND, '&');
221 case chars.$BAR:
222 return this.scanComplexOperator(start, '|', chars.$BAR, '|');
223 case chars.$NBSP:
224 while (chars.isWhitespace(this.peek))
225 this.advance();
226 return this.scanToken();
227 }
228 this.advance();
229 return this.error("Unexpected character [" + String.fromCharCode(peek) + "]", 0);
230 };
231 _Scanner.prototype.scanCharacter = function (start, code) {
232 this.advance();
233 return newCharacterToken(start, this.index, code);
234 };
235 _Scanner.prototype.scanOperator = function (start, str) {
236 this.advance();
237 return newOperatorToken(start, this.index, str);
238 };
239 /**
240 * Tokenize a 2/3 char long operator
241 *
242 * @param start start index in the expression
243 * @param one first symbol (always part of the operator)
244 * @param twoCode code point for the second symbol
245 * @param two second symbol (part of the operator when the second code point matches)
246 * @param threeCode code point for the third symbol
247 * @param three third symbol (part of the operator when provided and matches source expression)
248 */
249 _Scanner.prototype.scanComplexOperator = function (start, one, twoCode, two, threeCode, three) {
250 this.advance();
251 var str = one;
252 if (this.peek == twoCode) {
253 this.advance();
254 str += two;
255 }
256 if (threeCode != null && this.peek == threeCode) {
257 this.advance();
258 str += three;
259 }
260 return newOperatorToken(start, this.index, str);
261 };
262 _Scanner.prototype.scanIdentifier = function () {
263 var start = this.index;
264 this.advance();
265 while (isIdentifierPart(this.peek))
266 this.advance();
267 var str = this.input.substring(start, this.index);
268 return KEYWORDS.indexOf(str) > -1 ? newKeywordToken(start, this.index, str) :
269 newIdentifierToken(start, this.index, str);
270 };
271 /** Scans an ECMAScript private identifier. */
272 _Scanner.prototype.scanPrivateIdentifier = function () {
273 var start = this.index;
274 this.advance();
275 if (!isIdentifierStart(this.peek)) {
276 return this.error('Invalid character [#]', -1);
277 }
278 while (isIdentifierPart(this.peek))
279 this.advance();
280 var identifierName = this.input.substring(start, this.index);
281 return newPrivateIdentifierToken(start, this.index, identifierName);
282 };
283 _Scanner.prototype.scanNumber = function (start) {
284 var simple = (this.index === start);
285 var hasSeparators = false;
286 this.advance(); // Skip initial digit.
287 while (true) {
288 if (chars.isDigit(this.peek)) {
289 // Do nothing.
290 }
291 else if (this.peek === chars.$_) {
292 // Separators are only valid when they're surrounded by digits. E.g. `1_0_1` is
293 // valid while `_101` and `101_` are not. The separator can't be next to the decimal
294 // point or another separator either. Note that it's unlikely that we'll hit a case where
295 // the underscore is at the start, because that's a valid identifier and it will be picked
296 // up earlier in the parsing. We validate for it anyway just in case.
297 if (!chars.isDigit(this.input.charCodeAt(this.index - 1)) ||
298 !chars.isDigit(this.input.charCodeAt(this.index + 1))) {
299 return this.error('Invalid numeric separator', 0);
300 }
301 hasSeparators = true;
302 }
303 else if (this.peek === chars.$PERIOD) {
304 simple = false;
305 }
306 else if (isExponentStart(this.peek)) {
307 this.advance();
308 if (isExponentSign(this.peek))
309 this.advance();
310 if (!chars.isDigit(this.peek))
311 return this.error('Invalid exponent', -1);
312 simple = false;
313 }
314 else {
315 break;
316 }
317 this.advance();
318 }
319 var str = this.input.substring(start, this.index);
320 if (hasSeparators) {
321 str = str.replace(/_/g, '');
322 }
323 var value = simple ? parseIntAutoRadix(str) : parseFloat(str);
324 return newNumberToken(start, this.index, value);
325 };
326 _Scanner.prototype.scanString = function () {
327 var start = this.index;
328 var quote = this.peek;
329 this.advance(); // Skip initial quote.
330 var buffer = '';
331 var marker = this.index;
332 var input = this.input;
333 while (this.peek != quote) {
334 if (this.peek == chars.$BACKSLASH) {
335 buffer += input.substring(marker, this.index);
336 this.advance();
337 var unescapedCode = void 0;
338 // Workaround for TS2.1-introduced type strictness
339 this.peek = this.peek;
340 if (this.peek == chars.$u) {
341 // 4 character hex code for unicode character.
342 var hex = input.substring(this.index + 1, this.index + 5);
343 if (/^[0-9a-f]+$/i.test(hex)) {
344 unescapedCode = parseInt(hex, 16);
345 }
346 else {
347 return this.error("Invalid unicode escape [\\u" + hex + "]", 0);
348 }
349 for (var i = 0; i < 5; i++) {
350 this.advance();
351 }
352 }
353 else {
354 unescapedCode = unescape(this.peek);
355 this.advance();
356 }
357 buffer += String.fromCharCode(unescapedCode);
358 marker = this.index;
359 }
360 else if (this.peek == chars.$EOF) {
361 return this.error('Unterminated quote', 0);
362 }
363 else {
364 this.advance();
365 }
366 }
367 var last = input.substring(marker, this.index);
368 this.advance(); // Skip terminating quote.
369 return newStringToken(start, this.index, buffer + last);
370 };
371 _Scanner.prototype.scanQuestion = function (start) {
372 this.advance();
373 var str = '?';
374 // Either `a ?? b` or 'a?.b'.
375 if (this.peek === chars.$QUESTION || this.peek === chars.$PERIOD) {
376 str += this.peek === chars.$PERIOD ? '.' : '?';
377 this.advance();
378 }
379 return newOperatorToken(start, this.index, str);
380 };
381 _Scanner.prototype.error = function (message, offset) {
382 var position = this.index + offset;
383 return newErrorToken(position, this.index, "Lexer Error: " + message + " at column " + position + " in expression [" + this.input + "]");
384 };
385 return _Scanner;
386 }());
387 function isIdentifierStart(code) {
388 return (chars.$a <= code && code <= chars.$z) || (chars.$A <= code && code <= chars.$Z) ||
389 (code == chars.$_) || (code == chars.$$);
390 }
391 function isIdentifier(input) {
392 if (input.length == 0)
393 return false;
394 var scanner = new _Scanner(input);
395 if (!isIdentifierStart(scanner.peek))
396 return false;
397 scanner.advance();
398 while (scanner.peek !== chars.$EOF) {
399 if (!isIdentifierPart(scanner.peek))
400 return false;
401 scanner.advance();
402 }
403 return true;
404 }
405 exports.isIdentifier = isIdentifier;
406 function isIdentifierPart(code) {
407 return chars.isAsciiLetter(code) || chars.isDigit(code) || (code == chars.$_) ||
408 (code == chars.$$);
409 }
410 function isExponentStart(code) {
411 return code == chars.$e || code == chars.$E;
412 }
413 function isExponentSign(code) {
414 return code == chars.$MINUS || code == chars.$PLUS;
415 }
416 function unescape(code) {
417 switch (code) {
418 case chars.$n:
419 return chars.$LF;
420 case chars.$f:
421 return chars.$FF;
422 case chars.$r:
423 return chars.$CR;
424 case chars.$t:
425 return chars.$TAB;
426 case chars.$v:
427 return chars.$VTAB;
428 default:
429 return code;
430 }
431 }
432 function parseIntAutoRadix(text) {
433 var result = parseInt(text);
434 if (isNaN(result)) {
435 throw new Error('Invalid integer literal when parsing ' + text);
436 }
437 return result;
438 }
439});
440//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGV4ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb21waWxlci9zcmMvZXhwcmVzc2lvbl9wYXJzZXIvbGV4ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7O0lBRUgsbURBQWtDO0lBRWxDLElBQVksU0FTWDtJQVRELFdBQVksU0FBUztRQUNuQixtREFBUyxDQUFBO1FBQ1QscURBQVUsQ0FBQTtRQUNWLG1FQUFpQixDQUFBO1FBQ2pCLCtDQUFPLENBQUE7UUFDUCw2Q0FBTSxDQUFBO1FBQ04saURBQVEsQ0FBQTtRQUNSLDZDQUFNLENBQUE7UUFDTiwyQ0FBSyxDQUFBO0lBQ1AsQ0FBQyxFQVRXLFNBQVMsR0FBVCxpQkFBUyxLQUFULGlCQUFTL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gICAgIHJldHVybiBjaGFycy4kQ1I7XG4gICAgY2FzZSBjaGFycy4kdDpcbiAgICAgIHJldHVybiBjaGFycy4kVEFCO1xuICAgIGNhc2UgY2hhcnMuJHY6XG4gICAgICByZXR1cm4gY2hhcnMuJFZUQUI7XG4gICAgZGVmYXVsdDpcbiAgICAgIHJldHVybiBjb2RlO1xuICB9XG59XG5cbmZ1bmN0aW9uIHBhcnNlSW50QXV0b1JhZGl4KHRleHQ6IHN0cmluZyk6IG51bWJlciB7XG4gIGNvbnN0IHJlc3VsdDogbnVtYmVyID0gcGFyc2VJbnQodGV4dCk7XG4gIGlmIChpc05hTihyZXN1bHQpKSB7XG4gICAgdGhyb3cgbmV3IEVycm9yKCdJbnZhbGlkIGludGVnZXIgbGl0ZXJhbCB3aGVuIHBhcnNpbmcgJyArIHRleHQpO1xuICB9XG4gIHJldHVybiByZXN1bHQ7XG59XG4iXX0=
Note: See TracBrowser for help on using the repository browser.