@angular-eslint/bundled-angular-compiler 19.1.1-alpha.1 → 19.1.1-alpha.3

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 (2) hide show
  1. package/dist/index.js +345 -96
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -141,11 +141,15 @@ __export(index_exports, {
141
141
  SplitInterpolation: () => SplitInterpolation,
142
142
  Statement: () => Statement,
143
143
  StmtModifier: () => StmtModifier,
144
+ StringToken: () => StringToken,
145
+ StringTokenKind: () => StringTokenKind,
144
146
  TagContentType: () => TagContentType,
145
- TaggedTemplateExpr: () => TaggedTemplateExpr,
147
+ TaggedTemplateLiteralExpr: () => TaggedTemplateLiteralExpr,
146
148
  TemplateBindingParseResult: () => TemplateBindingParseResult,
147
149
  TemplateLiteral: () => TemplateLiteral,
148
150
  TemplateLiteralElement: () => TemplateLiteralElement,
151
+ TemplateLiteralElementExpr: () => TemplateLiteralElementExpr,
152
+ TemplateLiteralExpr: () => TemplateLiteralExpr,
149
153
  Text: () => Text,
150
154
  ThisReceiver: () => ThisReceiver,
151
155
  TmplAstBlockNode: () => BlockNode,
@@ -265,7 +269,7 @@ __export(index_exports, {
265
269
  });
266
270
  module.exports = __toCommonJS(index_exports);
267
271
 
268
- // ../../node_modules/.pnpm/@angular+compiler@19.1.7/node_modules/@angular/compiler/fesm2022/compiler.mjs
272
+ // ../../node_modules/.pnpm/@angular+compiler@19.2.0/node_modules/@angular/compiler/fesm2022/compiler.mjs
269
273
  var _SELECTOR_REGEXP = new RegExp(
270
274
  `(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
271
275
  // 8: ","
@@ -1432,9 +1436,9 @@ var InvokeFunctionExpr = class _InvokeFunctionExpr extends Expression {
1432
1436
  return new _InvokeFunctionExpr(this.fn.clone(), this.args.map((arg) => arg.clone()), this.type, this.sourceSpan, this.pure);
1433
1437
  }
1434
1438
  };
1435
- var TaggedTemplateExpr = class _TaggedTemplateExpr extends Expression {
1439
+ var TaggedTemplateLiteralExpr = class _TaggedTemplateLiteralExpr extends Expression {
1436
1440
  static {
1437
- __name(this, "TaggedTemplateExpr");
1441
+ __name(this, "TaggedTemplateLiteralExpr");
1438
1442
  }
1439
1443
  tag;
1440
1444
  template;
@@ -1444,16 +1448,16 @@ var TaggedTemplateExpr = class _TaggedTemplateExpr extends Expression {
1444
1448
  this.template = template2;
1445
1449
  }
1446
1450
  isEquivalent(e) {
1447
- return e instanceof _TaggedTemplateExpr && this.tag.isEquivalent(e.tag) && areAllEquivalentPredicate(this.template.elements, e.template.elements, (a, b) => a.text === b.text) && areAllEquivalent(this.template.expressions, e.template.expressions);
1451
+ return e instanceof _TaggedTemplateLiteralExpr && this.tag.isEquivalent(e.tag) && this.template.isEquivalent(e.template);
1448
1452
  }
1449
1453
  isConstant() {
1450
1454
  return false;
1451
1455
  }
1452
1456
  visitExpression(visitor, context) {
1453
- return visitor.visitTaggedTemplateExpr(this, context);
1457
+ return visitor.visitTaggedTemplateLiteralExpr(this, context);
1454
1458
  }
1455
1459
  clone() {
1456
- return new _TaggedTemplateExpr(this.tag.clone(), this.template.clone(), this.type, this.sourceSpan);
1460
+ return new _TaggedTemplateLiteralExpr(this.tag.clone(), this.template.clone(), this.type, this.sourceSpan);
1457
1461
  }
1458
1462
  };
1459
1463
  var InstantiateExpr = class _InstantiateExpr extends Expression {
@@ -1502,34 +1506,52 @@ var LiteralExpr = class _LiteralExpr extends Expression {
1502
1506
  return new _LiteralExpr(this.value, this.type, this.sourceSpan);
1503
1507
  }
1504
1508
  };
1505
- var TemplateLiteral = class _TemplateLiteral {
1509
+ var TemplateLiteralExpr = class _TemplateLiteralExpr extends Expression {
1506
1510
  static {
1507
- __name(this, "TemplateLiteral");
1511
+ __name(this, "TemplateLiteralExpr");
1508
1512
  }
1509
1513
  elements;
1510
1514
  expressions;
1511
- constructor(elements, expressions) {
1515
+ constructor(elements, expressions, sourceSpan) {
1516
+ super(null, sourceSpan);
1512
1517
  this.elements = elements;
1513
1518
  this.expressions = expressions;
1514
1519
  }
1520
+ isEquivalent(e) {
1521
+ return e instanceof _TemplateLiteralExpr && areAllEquivalentPredicate(this.elements, e.elements, (a, b) => a.text === b.text) && areAllEquivalent(this.expressions, e.expressions);
1522
+ }
1523
+ isConstant() {
1524
+ return false;
1525
+ }
1526
+ visitExpression(visitor, context) {
1527
+ return visitor.visitTemplateLiteralExpr(this, context);
1528
+ }
1515
1529
  clone() {
1516
- return new _TemplateLiteral(this.elements.map((el) => el.clone()), this.expressions.map((expr) => expr.clone()));
1530
+ return new _TemplateLiteralExpr(this.elements.map((el) => el.clone()), this.expressions.map((expr) => expr.clone()));
1517
1531
  }
1518
1532
  };
1519
- var TemplateLiteralElement = class _TemplateLiteralElement {
1533
+ var TemplateLiteralElementExpr = class _TemplateLiteralElementExpr extends Expression {
1520
1534
  static {
1521
- __name(this, "TemplateLiteralElement");
1535
+ __name(this, "TemplateLiteralElementExpr");
1522
1536
  }
1523
1537
  text;
1524
- sourceSpan;
1525
1538
  rawText;
1526
1539
  constructor(text2, sourceSpan, rawText) {
1540
+ super(STRING_TYPE, sourceSpan);
1527
1541
  this.text = text2;
1528
- this.sourceSpan = sourceSpan;
1529
1542
  this.rawText = rawText ?? sourceSpan?.toString() ?? escapeForTemplateLiteral(escapeSlashes(text2));
1530
1543
  }
1544
+ visitExpression(visitor, context) {
1545
+ return visitor.visitTemplateLiteralElementExpr(this, context);
1546
+ }
1547
+ isEquivalent(e) {
1548
+ return e instanceof _TemplateLiteralElementExpr && e.text === this.text && e.rawText === this.rawText;
1549
+ }
1550
+ isConstant() {
1551
+ return true;
1552
+ }
1531
1553
  clone() {
1532
- return new _TemplateLiteralElement(this.text, this.sourceSpan, this.rawText);
1554
+ return new _TemplateLiteralElementExpr(this.text, this.sourceSpan, this.rawText);
1533
1555
  }
1534
1556
  };
1535
1557
  var LiteralPiece = class {
@@ -2281,9 +2303,9 @@ var RecursiveAstVisitor$1 = class {
2281
2303
  this.visitAllExpressions(ast.args, context);
2282
2304
  return this.visitExpression(ast, context);
2283
2305
  }
2284
- visitTaggedTemplateExpr(ast, context) {
2306
+ visitTaggedTemplateLiteralExpr(ast, context) {
2285
2307
  ast.tag.visitExpression(this, context);
2286
- this.visitAllExpressions(ast.template.expressions, context);
2308
+ ast.template.visitExpression(this, context);
2287
2309
  return this.visitExpression(ast, context);
2288
2310
  }
2289
2311
  visitInstantiateExpr(ast, context) {
@@ -2355,6 +2377,14 @@ var RecursiveAstVisitor$1 = class {
2355
2377
  this.visitAllExpressions(ast.parts, context);
2356
2378
  return this.visitExpression(ast, context);
2357
2379
  }
2380
+ visitTemplateLiteralExpr(ast, context) {
2381
+ this.visitAllExpressions(ast.elements, context);
2382
+ this.visitAllExpressions(ast.expressions, context);
2383
+ return this.visitExpression(ast, context);
2384
+ }
2385
+ visitTemplateLiteralElementExpr(ast, context) {
2386
+ return this.visitExpression(ast, context);
2387
+ }
2358
2388
  visitAllExpressions(exprs, context) {
2359
2389
  exprs.forEach((expr) => expr.visitExpression(this, context));
2360
2390
  }
@@ -2453,7 +2483,7 @@ function ifStmt(condition, thenClause, elseClause, sourceSpan, leadingComments)
2453
2483
  }
2454
2484
  __name(ifStmt, "ifStmt");
2455
2485
  function taggedTemplate(tag, template2, type, sourceSpan) {
2456
- return new TaggedTemplateExpr(tag, template2, type, sourceSpan);
2486
+ return new TaggedTemplateLiteralExpr(tag, template2, type, sourceSpan);
2457
2487
  }
2458
2488
  __name(taggedTemplate, "taggedTemplate");
2459
2489
  function literal(value, type, sourceSpan) {
@@ -2536,11 +2566,11 @@ var output_ast = /* @__PURE__ */ Object.freeze({
2536
2566
  WriteKeyExpr,
2537
2567
  WritePropExpr,
2538
2568
  InvokeFunctionExpr,
2539
- TaggedTemplateExpr,
2569
+ TaggedTemplateLiteralExpr,
2540
2570
  InstantiateExpr,
2541
2571
  LiteralExpr,
2542
- TemplateLiteral,
2543
- TemplateLiteralElement,
2572
+ TemplateLiteralExpr,
2573
+ TemplateLiteralElementExpr,
2544
2574
  LiteralPiece,
2545
2575
  PlaceholderPiece,
2546
2576
  LocalizedString,
@@ -3815,16 +3845,26 @@ var AbstractEmitterVisitor = class {
3815
3845
  ctx.print(expr, `)`);
3816
3846
  return null;
3817
3847
  }
3818
- visitTaggedTemplateExpr(expr, ctx) {
3848
+ visitTaggedTemplateLiteralExpr(expr, ctx) {
3819
3849
  expr.tag.visitExpression(this, ctx);
3820
- ctx.print(expr, "`" + expr.template.elements[0].rawText);
3821
- for (let i = 1; i < expr.template.elements.length; i++) {
3822
- ctx.print(expr, "${");
3823
- expr.template.expressions[i - 1].visitExpression(this, ctx);
3824
- ctx.print(expr, `}${expr.template.elements[i].rawText}`);
3850
+ expr.template.visitExpression(this, ctx);
3851
+ return null;
3852
+ }
3853
+ visitTemplateLiteralExpr(expr, ctx) {
3854
+ ctx.print(expr, "`");
3855
+ for (let i = 0; i < expr.elements.length; i++) {
3856
+ expr.elements[i].visitExpression(this, ctx);
3857
+ const expression = i < expr.expressions.length ? expr.expressions[i] : null;
3858
+ if (expression !== null) {
3859
+ ctx.print(expression, "${");
3860
+ expression.visitExpression(this, ctx);
3861
+ ctx.print(expression, "}");
3862
+ }
3825
3863
  }
3826
3864
  ctx.print(expr, "`");
3827
- return null;
3865
+ }
3866
+ visitTemplateLiteralElementExpr(expr, ctx) {
3867
+ ctx.print(expr, expr.rawText);
3828
3868
  }
3829
3869
  visitWrappedNodeExpr(ast, ctx) {
3830
3870
  throw new Error("Abstract emitter cannot visit WrappedNodeExpr.");
@@ -4691,6 +4731,34 @@ var SafeCall = class extends AST {
4691
4731
  return visitor.visitSafeCall(this, context);
4692
4732
  }
4693
4733
  };
4734
+ var TemplateLiteral = class extends AST {
4735
+ static {
4736
+ __name(this, "TemplateLiteral");
4737
+ }
4738
+ elements;
4739
+ expressions;
4740
+ constructor(span, sourceSpan, elements, expressions) {
4741
+ super(span, sourceSpan);
4742
+ this.elements = elements;
4743
+ this.expressions = expressions;
4744
+ }
4745
+ visit(visitor, context) {
4746
+ return visitor.visitTemplateLiteral(this, context);
4747
+ }
4748
+ };
4749
+ var TemplateLiteralElement = class extends AST {
4750
+ static {
4751
+ __name(this, "TemplateLiteralElement");
4752
+ }
4753
+ text;
4754
+ constructor(span, sourceSpan, text2) {
4755
+ super(span, sourceSpan);
4756
+ this.text = text2;
4757
+ }
4758
+ visit(visitor, context) {
4759
+ return visitor.visitTemplateLiteralElement(this, context);
4760
+ }
4761
+ };
4694
4762
  var AbsoluteSourceSpan = class {
4695
4763
  static {
4696
4764
  __name(this, "AbsoluteSourceSpan");
@@ -4849,6 +4917,17 @@ var RecursiveAstVisitor = class {
4849
4917
  this.visit(ast.receiver, context);
4850
4918
  this.visitAll(ast.args, context);
4851
4919
  }
4920
+ visitTemplateLiteral(ast, context) {
4921
+ for (let i = 0; i < ast.elements.length; i++) {
4922
+ this.visit(ast.elements[i], context);
4923
+ const expression = i < ast.expressions.length ? ast.expressions[i] : null;
4924
+ if (expression !== null) {
4925
+ this.visit(expression, context);
4926
+ }
4927
+ }
4928
+ }
4929
+ visitTemplateLiteralElement(ast, context) {
4930
+ }
4852
4931
  // This is not part of the AstVisitor interface, just a helper method
4853
4932
  visitAll(asts, context) {
4854
4933
  for (const ast of asts) {
@@ -6975,7 +7054,7 @@ var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
6975
7054
  ctx.println(stmt, `;`);
6976
7055
  return null;
6977
7056
  }
6978
- visitTaggedTemplateExpr(ast, ctx) {
7057
+ visitTaggedTemplateLiteralExpr(ast, ctx) {
6979
7058
  const elements = ast.template.elements;
6980
7059
  ast.tag.visitExpression(this, ctx);
6981
7060
  ctx.print(ast, `(${makeTemplateObjectPolyfill}(`);
@@ -6988,6 +7067,23 @@ var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
6988
7067
  ctx.print(ast, ")");
6989
7068
  return null;
6990
7069
  }
7070
+ visitTemplateLiteralExpr(expr, ctx) {
7071
+ ctx.print(expr, "`");
7072
+ for (let i = 0; i < expr.elements.length; i++) {
7073
+ expr.elements[i].visitExpression(this, ctx);
7074
+ const expression = i < expr.expressions.length ? expr.expressions[i] : null;
7075
+ if (expression !== null) {
7076
+ ctx.print(expression, "${");
7077
+ expression.visitExpression(this, ctx);
7078
+ ctx.print(expression, "}");
7079
+ }
7080
+ }
7081
+ ctx.print(expr, "`");
7082
+ }
7083
+ visitTemplateLiteralElementExpr(expr, ctx) {
7084
+ ctx.print(expr, expr.rawText);
7085
+ return null;
7086
+ }
6991
7087
  visitFunctionExpr(ast, ctx) {
6992
7088
  ctx.print(ast, `function${ast.name ? " " + ast.name : ""}(`);
6993
7089
  this._visitParams(ast.params, ctx);
@@ -9719,7 +9815,7 @@ function transformExpressionsInExpression(expr, transform2, flags) {
9719
9815
  }
9720
9816
  } else if (expr instanceof NotExpr) {
9721
9817
  expr.condition = transformExpressionsInExpression(expr.condition, transform2, flags);
9722
- } else if (expr instanceof TaggedTemplateExpr) {
9818
+ } else if (expr instanceof TaggedTemplateLiteralExpr) {
9723
9819
  expr.tag = transformExpressionsInExpression(expr.tag, transform2, flags);
9724
9820
  expr.template.expressions = expr.template.expressions.map((e) => transformExpressionsInExpression(e, transform2, flags));
9725
9821
  } else if (expr instanceof ArrowFunctionExpr) {
@@ -9731,6 +9827,10 @@ function transformExpressionsInExpression(expr, transform2, flags) {
9731
9827
  expr.body = transformExpressionsInExpression(expr.body, transform2, flags);
9732
9828
  }
9733
9829
  } else if (expr instanceof WrappedNodeExpr) {
9830
+ } else if (expr instanceof TemplateLiteralExpr) {
9831
+ for (let i = 0; i < expr.expressions.length; i++) {
9832
+ expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform2, flags);
9833
+ }
9734
9834
  } else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr) {
9735
9835
  } else {
9736
9836
  throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
@@ -11223,7 +11323,7 @@ var ElementAttributes = class {
11223
11323
  if (!isStringLiteral(value)) {
11224
11324
  throw Error("AssertionError: extracted attribute value should be string literal");
11225
11325
  }
11226
- array.push(taggedTemplate(trustedValueFn, new TemplateLiteral([new TemplateLiteralElement(value.value)], []), void 0, value.sourceSpan));
11326
+ array.push(taggedTemplate(trustedValueFn, new TemplateLiteralExpr([new TemplateLiteralElementExpr(value.value)], []), void 0, value.sourceSpan));
11227
11327
  } else {
11228
11328
  array.push(value);
11229
11329
  }
@@ -16352,6 +16452,12 @@ var TokenType;
16352
16452
  TokenType2[TokenType2["Number"] = 6] = "Number";
16353
16453
  TokenType2[TokenType2["Error"] = 7] = "Error";
16354
16454
  })(TokenType || (TokenType = {}));
16455
+ var StringTokenKind;
16456
+ (function(StringTokenKind2) {
16457
+ StringTokenKind2[StringTokenKind2["Plain"] = 0] = "Plain";
16458
+ StringTokenKind2[StringTokenKind2["TemplateLiteralPart"] = 1] = "TemplateLiteralPart";
16459
+ StringTokenKind2[StringTokenKind2["TemplateLiteralEnd"] = 2] = "TemplateLiteralEnd";
16460
+ })(StringTokenKind || (StringTokenKind = {}));
16355
16461
  var KEYWORDS = [
16356
16462
  "var",
16357
16463
  "let",
@@ -16370,14 +16476,7 @@ var Lexer = class {
16370
16476
  __name(this, "Lexer");
16371
16477
  }
16372
16478
  tokenize(text2) {
16373
- const scanner = new _Scanner(text2);
16374
- const tokens = [];
16375
- let token = scanner.scanToken();
16376
- while (token != null) {
16377
- tokens.push(token);
16378
- token = scanner.scanToken();
16379
- }
16380
- return tokens;
16479
+ return new _Scanner(text2).scan();
16381
16480
  }
16382
16481
  };
16383
16482
  var Token = class {
@@ -16397,55 +16496,67 @@ var Token = class {
16397
16496
  this.strValue = strValue;
16398
16497
  }
16399
16498
  isCharacter(code) {
16400
- return this.type == TokenType.Character && this.numValue == code;
16499
+ return this.type === TokenType.Character && this.numValue === code;
16401
16500
  }
16402
16501
  isNumber() {
16403
- return this.type == TokenType.Number;
16502
+ return this.type === TokenType.Number;
16404
16503
  }
16405
16504
  isString() {
16406
- return this.type == TokenType.String;
16505
+ return this.type === TokenType.String;
16407
16506
  }
16408
16507
  isOperator(operator) {
16409
- return this.type == TokenType.Operator && this.strValue == operator;
16508
+ return this.type === TokenType.Operator && this.strValue === operator;
16410
16509
  }
16411
16510
  isIdentifier() {
16412
- return this.type == TokenType.Identifier;
16511
+ return this.type === TokenType.Identifier;
16413
16512
  }
16414
16513
  isPrivateIdentifier() {
16415
- return this.type == TokenType.PrivateIdentifier;
16514
+ return this.type === TokenType.PrivateIdentifier;
16416
16515
  }
16417
16516
  isKeyword() {
16418
- return this.type == TokenType.Keyword;
16517
+ return this.type === TokenType.Keyword;
16419
16518
  }
16420
16519
  isKeywordLet() {
16421
- return this.type == TokenType.Keyword && this.strValue == "let";
16520
+ return this.type === TokenType.Keyword && this.strValue === "let";
16422
16521
  }
16423
16522
  isKeywordAs() {
16424
- return this.type == TokenType.Keyword && this.strValue == "as";
16523
+ return this.type === TokenType.Keyword && this.strValue === "as";
16425
16524
  }
16426
16525
  isKeywordNull() {
16427
- return this.type == TokenType.Keyword && this.strValue == "null";
16526
+ return this.type === TokenType.Keyword && this.strValue === "null";
16428
16527
  }
16429
16528
  isKeywordUndefined() {
16430
- return this.type == TokenType.Keyword && this.strValue == "undefined";
16529
+ return this.type === TokenType.Keyword && this.strValue === "undefined";
16431
16530
  }
16432
16531
  isKeywordTrue() {
16433
- return this.type == TokenType.Keyword && this.strValue == "true";
16532
+ return this.type === TokenType.Keyword && this.strValue === "true";
16434
16533
  }
16435
16534
  isKeywordFalse() {
16436
- return this.type == TokenType.Keyword && this.strValue == "false";
16535
+ return this.type === TokenType.Keyword && this.strValue === "false";
16437
16536
  }
16438
16537
  isKeywordThis() {
16439
- return this.type == TokenType.Keyword && this.strValue == "this";
16538
+ return this.type === TokenType.Keyword && this.strValue === "this";
16440
16539
  }
16441
16540
  isKeywordTypeof() {
16442
16541
  return this.type === TokenType.Keyword && this.strValue === "typeof";
16443
16542
  }
16444
16543
  isError() {
16445
- return this.type == TokenType.Error;
16544
+ return this.type === TokenType.Error;
16446
16545
  }
16447
16546
  toNumber() {
16448
- return this.type == TokenType.Number ? this.numValue : -1;
16547
+ return this.type === TokenType.Number ? this.numValue : -1;
16548
+ }
16549
+ isTemplateLiteralPart() {
16550
+ return this.isString() && this.kind === StringTokenKind.TemplateLiteralPart;
16551
+ }
16552
+ isTemplateLiteralEnd() {
16553
+ return this.isString() && this.kind === StringTokenKind.TemplateLiteralEnd;
16554
+ }
16555
+ isTemplateLiteralInterpolationStart() {
16556
+ return this.isOperator("${");
16557
+ }
16558
+ isTemplateLiteralInterpolationEnd() {
16559
+ return this.isOperator("}");
16449
16560
  }
16450
16561
  toString() {
16451
16562
  switch (this.type) {
@@ -16464,6 +16575,16 @@ var Token = class {
16464
16575
  }
16465
16576
  }
16466
16577
  };
16578
+ var StringToken = class extends Token {
16579
+ static {
16580
+ __name(this, "StringToken");
16581
+ }
16582
+ kind;
16583
+ constructor(index, end, strValue, kind) {
16584
+ super(index, end, TokenType.String, 0, strValue);
16585
+ this.kind = kind;
16586
+ }
16587
+ };
16467
16588
  function newCharacterToken(index, end, code) {
16468
16589
  return new Token(index, end, TokenType.Character, code, String.fromCharCode(code));
16469
16590
  }
@@ -16484,10 +16605,6 @@ function newOperatorToken(index, end, text2) {
16484
16605
  return new Token(index, end, TokenType.Operator, 0, text2);
16485
16606
  }
16486
16607
  __name(newOperatorToken, "newOperatorToken");
16487
- function newStringToken(index, end, text2) {
16488
- return new Token(index, end, TokenType.String, 0, text2);
16489
- }
16490
- __name(newStringToken, "newStringToken");
16491
16608
  function newNumberToken(index, end, n) {
16492
16609
  return new Token(index, end, TokenType.Number, n, "");
16493
16610
  }
@@ -16502,20 +16619,33 @@ var _Scanner = class {
16502
16619
  __name(this, "_Scanner");
16503
16620
  }
16504
16621
  input;
16622
+ tokens = [];
16505
16623
  length;
16506
16624
  peek = 0;
16507
16625
  index = -1;
16626
+ literalInterpolationDepth = 0;
16627
+ braceDepth = 0;
16508
16628
  constructor(input) {
16509
16629
  this.input = input;
16510
16630
  this.length = input.length;
16511
16631
  this.advance();
16512
16632
  }
16633
+ scan() {
16634
+ let token = this.scanToken();
16635
+ while (token !== null) {
16636
+ this.tokens.push(token);
16637
+ token = this.scanToken();
16638
+ }
16639
+ return this.tokens;
16640
+ }
16513
16641
  advance() {
16514
16642
  this.peek = ++this.index >= this.length ? $EOF : this.input.charCodeAt(this.index);
16515
16643
  }
16516
16644
  scanToken() {
16517
- const input = this.input, length = this.length;
16518
- let peek = this.peek, index = this.index;
16645
+ const input = this.input;
16646
+ const length = this.length;
16647
+ let peek = this.peek;
16648
+ let index = this.index;
16519
16649
  while (peek <= $SPACE) {
16520
16650
  if (++index >= length) {
16521
16651
  peek = $EOF;
@@ -16529,10 +16659,12 @@ var _Scanner = class {
16529
16659
  if (index >= length) {
16530
16660
  return null;
16531
16661
  }
16532
- if (isIdentifierStart(peek))
16662
+ if (isIdentifierStart(peek)) {
16533
16663
  return this.scanIdentifier();
16534
- if (isDigit(peek))
16664
+ }
16665
+ if (isDigit(peek)) {
16535
16666
  return this.scanNumber(index);
16667
+ }
16536
16668
  const start = index;
16537
16669
  switch (peek) {
16538
16670
  case $PERIOD:
@@ -16540,17 +16672,22 @@ var _Scanner = class {
16540
16672
  return isDigit(this.peek) ? this.scanNumber(start) : newCharacterToken(start, this.index, $PERIOD);
16541
16673
  case $LPAREN:
16542
16674
  case $RPAREN:
16543
- case $LBRACE:
16544
- case $RBRACE:
16545
16675
  case $LBRACKET:
16546
16676
  case $RBRACKET:
16547
16677
  case $COMMA:
16548
16678
  case $COLON:
16549
16679
  case $SEMICOLON:
16550
16680
  return this.scanCharacter(start, peek);
16681
+ case $LBRACE:
16682
+ return this.scanOpenBrace(start, peek);
16683
+ case $RBRACE:
16684
+ return this.scanCloseBrace(start, peek);
16551
16685
  case $SQ:
16552
16686
  case $DQ:
16553
16687
  return this.scanString();
16688
+ case $BT:
16689
+ this.advance();
16690
+ return this.scanTemplateLiteralPart(start);
16554
16691
  case $HASH:
16555
16692
  return this.scanPrivateIdentifier();
16556
16693
  case $PLUS:
@@ -16588,6 +16725,21 @@ var _Scanner = class {
16588
16725
  this.advance();
16589
16726
  return newOperatorToken(start, this.index, str);
16590
16727
  }
16728
+ scanOpenBrace(start, code) {
16729
+ this.braceDepth++;
16730
+ this.advance();
16731
+ return newCharacterToken(start, this.index, code);
16732
+ }
16733
+ scanCloseBrace(start, code) {
16734
+ this.advance();
16735
+ if (this.braceDepth === 0 && this.literalInterpolationDepth > 0) {
16736
+ this.literalInterpolationDepth--;
16737
+ this.tokens.push(newOperatorToken(start, this.index, "}"));
16738
+ return this.scanTemplateLiteralPart(this.index);
16739
+ }
16740
+ this.braceDepth--;
16741
+ return newCharacterToken(start, this.index, code);
16742
+ }
16591
16743
  /**
16592
16744
  * Tokenize a 2/3 char long operator
16593
16745
  *
@@ -16672,24 +16824,11 @@ var _Scanner = class {
16672
16824
  const input = this.input;
16673
16825
  while (this.peek != quote) {
16674
16826
  if (this.peek == $BACKSLASH) {
16675
- buffer += input.substring(marker, this.index);
16676
- let unescapedCode;
16677
- this.advance();
16678
- if (this.peek == $u) {
16679
- const hex = input.substring(this.index + 1, this.index + 5);
16680
- if (/^[0-9a-f]+$/i.test(hex)) {
16681
- unescapedCode = parseInt(hex, 16);
16682
- } else {
16683
- return this.error(`Invalid unicode escape [\\u${hex}]`, 0);
16684
- }
16685
- for (let i = 0; i < 5; i++) {
16686
- this.advance();
16687
- }
16688
- } else {
16689
- unescapedCode = unescape(this.peek);
16690
- this.advance();
16827
+ const result = this.scanStringBackslash(buffer, marker);
16828
+ if (typeof result !== "string") {
16829
+ return result;
16691
16830
  }
16692
- buffer += String.fromCharCode(unescapedCode);
16831
+ buffer = result;
16693
16832
  marker = this.index;
16694
16833
  } else if (this.peek == $EOF) {
16695
16834
  return this.error("Unterminated quote", 0);
@@ -16699,7 +16838,7 @@ var _Scanner = class {
16699
16838
  }
16700
16839
  const last = input.substring(marker, this.index);
16701
16840
  this.advance();
16702
- return newStringToken(start, this.index, buffer + last);
16841
+ return new StringToken(start, this.index, buffer + last, StringTokenKind.Plain);
16703
16842
  }
16704
16843
  scanQuestion(start) {
16705
16844
  this.advance();
@@ -16710,10 +16849,61 @@ var _Scanner = class {
16710
16849
  }
16711
16850
  return newOperatorToken(start, this.index, str);
16712
16851
  }
16852
+ scanTemplateLiteralPart(start) {
16853
+ let buffer = "";
16854
+ let marker = this.index;
16855
+ while (this.peek !== $BT) {
16856
+ if (this.peek === $BACKSLASH) {
16857
+ const result = this.scanStringBackslash(buffer, marker);
16858
+ if (typeof result !== "string") {
16859
+ return result;
16860
+ }
16861
+ buffer = result;
16862
+ marker = this.index;
16863
+ } else if (this.peek === $$) {
16864
+ const dollar = this.index;
16865
+ this.advance();
16866
+ if (this.peek === $LBRACE) {
16867
+ this.literalInterpolationDepth++;
16868
+ this.tokens.push(new StringToken(start, dollar, buffer + this.input.substring(marker, dollar), StringTokenKind.TemplateLiteralPart));
16869
+ this.advance();
16870
+ return newOperatorToken(dollar, this.index, this.input.substring(dollar, this.index));
16871
+ }
16872
+ } else if (this.peek === $EOF) {
16873
+ return this.error("Unterminated template literal", 0);
16874
+ } else {
16875
+ this.advance();
16876
+ }
16877
+ }
16878
+ const last = this.input.substring(marker, this.index);
16879
+ this.advance();
16880
+ return new StringToken(start, this.index, buffer + last, StringTokenKind.TemplateLiteralEnd);
16881
+ }
16713
16882
  error(message, offset) {
16714
16883
  const position = this.index + offset;
16715
16884
  return newErrorToken(position, this.index, `Lexer Error: ${message} at column ${position} in expression [${this.input}]`);
16716
16885
  }
16886
+ scanStringBackslash(buffer, marker) {
16887
+ buffer += this.input.substring(marker, this.index);
16888
+ let unescapedCode;
16889
+ this.advance();
16890
+ if (this.peek === $u) {
16891
+ const hex = this.input.substring(this.index + 1, this.index + 5);
16892
+ if (/^[0-9a-f]+$/i.test(hex)) {
16893
+ unescapedCode = parseInt(hex, 16);
16894
+ } else {
16895
+ return this.error(`Invalid unicode escape [\\u${hex}]`, 0);
16896
+ }
16897
+ for (let i = 0; i < 5; i++) {
16898
+ this.advance();
16899
+ }
16900
+ } else {
16901
+ unescapedCode = unescape(this.peek);
16902
+ this.advance();
16903
+ }
16904
+ buffer += String.fromCharCode(unescapedCode);
16905
+ return buffer;
16906
+ }
16717
16907
  };
16718
16908
  function isIdentifierStart(code) {
16719
16909
  return $a <= code && code <= $z || $A <= code && code <= $Z || code == $_ || code == $$;
@@ -17479,7 +17669,11 @@ var _ParseAST = class {
17479
17669
  const value = this.next.toNumber();
17480
17670
  this.advance();
17481
17671
  return new LiteralPrimitive(this.span(start), this.sourceSpan(start), value);
17482
- } else if (this.next.isString()) {
17672
+ } else if (this.next.isTemplateLiteralEnd()) {
17673
+ return this.parseNoInterpolationTemplateLiteral(start);
17674
+ } else if (this.next.isTemplateLiteralPart()) {
17675
+ return this.parseTemplateLiteral();
17676
+ } else if (this.next.isString() && this.next.kind === StringTokenKind.Plain) {
17483
17677
  const literalValue = this.next.toString();
17484
17678
  this.advance();
17485
17679
  return new LiteralPrimitive(this.span(start), this.sourceSpan(start), literalValue);
@@ -17768,6 +17962,39 @@ var _ParseAST = class {
17768
17962
  const sourceSpan = new AbsoluteSourceSpan(spanStart, this.currentAbsoluteOffset);
17769
17963
  return new VariableBinding(sourceSpan, key, value);
17770
17964
  }
17965
+ parseNoInterpolationTemplateLiteral(start) {
17966
+ const text2 = this.next.strValue;
17967
+ this.advance();
17968
+ const span = this.span(start);
17969
+ const sourceSpan = this.sourceSpan(start);
17970
+ return new TemplateLiteral(span, sourceSpan, [new TemplateLiteralElement(span, sourceSpan, text2)], []);
17971
+ }
17972
+ parseTemplateLiteral() {
17973
+ const start = this.inputIndex;
17974
+ const elements = [];
17975
+ const expressions = [];
17976
+ while (this.next !== EOF) {
17977
+ const token = this.next;
17978
+ if (token.isTemplateLiteralPart() || token.isTemplateLiteralEnd()) {
17979
+ elements.push(new TemplateLiteralElement(this.span(this.inputIndex), this.sourceSpan(this.inputIndex), token.strValue));
17980
+ this.advance();
17981
+ if (token.isTemplateLiteralEnd()) {
17982
+ break;
17983
+ }
17984
+ } else if (token.isTemplateLiteralInterpolationStart()) {
17985
+ this.advance();
17986
+ const expression = this.parsePipe();
17987
+ if (expression instanceof EmptyExpr$1) {
17988
+ this.error("Template literal interpolation cannot be empty");
17989
+ } else {
17990
+ expressions.push(expression);
17991
+ }
17992
+ } else {
17993
+ this.advance();
17994
+ }
17995
+ }
17996
+ return new TemplateLiteral(this.span(start), this.sourceSpan(start), elements, expressions);
17997
+ }
17771
17998
  /**
17772
17999
  * Consume the optional statement terminator: semicolon or comma.
17773
18000
  */
@@ -17962,6 +18189,20 @@ var SerializeExpressionVisitor = class {
17962
18189
  visitASTWithSource(ast, context) {
17963
18190
  return ast.ast.visit(this, context);
17964
18191
  }
18192
+ visitTemplateLiteral(ast, context) {
18193
+ let result = "";
18194
+ for (let i = 0; i < ast.elements.length; i++) {
18195
+ result += ast.elements[i].visit(this, context);
18196
+ const expression = i < ast.expressions.length ? ast.expressions[i] : null;
18197
+ if (expression !== null) {
18198
+ result += "${" + expression.visit(this, context) + "}";
18199
+ }
18200
+ }
18201
+ return "`" + result + "`";
18202
+ }
18203
+ visitTemplateLiteralElement(ast, context) {
18204
+ return ast.text;
18205
+ }
17965
18206
  };
17966
18207
  function zip(left, right) {
17967
18208
  if (left.length !== right.length)
@@ -23448,6 +23689,10 @@ function convertAst(ast, job, baseSourceSpan) {
23448
23689
  return not(convertAst(ast.expression, job, baseSourceSpan), convertSourceSpan(ast.span, baseSourceSpan));
23449
23690
  } else if (ast instanceof TypeofExpression) {
23450
23691
  return typeofExpr(convertAst(ast.expression, job, baseSourceSpan));
23692
+ } else if (ast instanceof TemplateLiteral) {
23693
+ return new TemplateLiteralExpr(ast.elements.map((el) => {
23694
+ return new TemplateLiteralElementExpr(el.text, convertSourceSpan(el.span, baseSourceSpan));
23695
+ }), ast.expressions.map((expr) => convertAst(expr, job, baseSourceSpan)), convertSourceSpan(ast.span, baseSourceSpan));
23451
23696
  } else {
23452
23697
  throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan?.start.file.url}"`);
23453
23698
  }
@@ -27631,7 +27876,7 @@ function publishFacade(global) {
27631
27876
  ng.\u0275compilerFacade = new CompilerFacadeImpl();
27632
27877
  }
27633
27878
  __name(publishFacade, "publishFacade");
27634
- var VERSION = new Version("19.1.7");
27879
+ var VERSION = new Version("19.2.0");
27635
27880
  var CompilerConfig = class {
27636
27881
  static {
27637
27882
  __name(this, "CompilerConfig");
@@ -29409,7 +29654,7 @@ var MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = "18.0.0";
29409
29654
  function compileDeclareClassMetadata(metadata) {
29410
29655
  const definitionMap = new DefinitionMap();
29411
29656
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
29412
- definitionMap.set("version", literal("19.1.7"));
29657
+ definitionMap.set("version", literal("19.2.0"));
29413
29658
  definitionMap.set("ngImport", importExpr(Identifiers.core));
29414
29659
  definitionMap.set("type", metadata.type);
29415
29660
  definitionMap.set("decorators", metadata.decorators);
@@ -29428,7 +29673,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
29428
29673
  callbackReturnDefinitionMap.set("ctorParameters", metadata.ctorParameters ?? literal(null));
29429
29674
  callbackReturnDefinitionMap.set("propDecorators", metadata.propDecorators ?? literal(null));
29430
29675
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
29431
- definitionMap.set("version", literal("19.1.7"));
29676
+ definitionMap.set("version", literal("19.2.0"));
29432
29677
  definitionMap.set("ngImport", importExpr(Identifiers.core));
29433
29678
  definitionMap.set("type", metadata.type);
29434
29679
  definitionMap.set("resolveDeferredDeps", compileComponentMetadataAsyncResolver(dependencies));
@@ -29497,7 +29742,7 @@ function createDirectiveDefinitionMap(meta) {
29497
29742
  const definitionMap = new DefinitionMap();
29498
29743
  const minVersion = getMinimumVersionForPartialOutput(meta);
29499
29744
  definitionMap.set("minVersion", literal(minVersion));
29500
- definitionMap.set("version", literal("19.1.7"));
29745
+ definitionMap.set("version", literal("19.2.0"));
29501
29746
  definitionMap.set("type", meta.type.value);
29502
29747
  if (meta.isStandalone !== void 0) {
29503
29748
  definitionMap.set("isStandalone", literal(meta.isStandalone));
@@ -29825,7 +30070,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION$4 = "12.0.0";
29825
30070
  function compileDeclareFactoryFunction(meta) {
29826
30071
  const definitionMap = new DefinitionMap();
29827
30072
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
29828
- definitionMap.set("version", literal("19.1.7"));
30073
+ definitionMap.set("version", literal("19.2.0"));
29829
30074
  definitionMap.set("ngImport", importExpr(Identifiers.core));
29830
30075
  definitionMap.set("type", meta.type.value);
29831
30076
  definitionMap.set("deps", compileDependencies(meta.deps));
@@ -29848,7 +30093,7 @@ __name(compileDeclareInjectableFromMetadata, "compileDeclareInjectableFromMetada
29848
30093
  function createInjectableDefinitionMap(meta) {
29849
30094
  const definitionMap = new DefinitionMap();
29850
30095
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
29851
- definitionMap.set("version", literal("19.1.7"));
30096
+ definitionMap.set("version", literal("19.2.0"));
29852
30097
  definitionMap.set("ngImport", importExpr(Identifiers.core));
29853
30098
  definitionMap.set("type", meta.type.value);
29854
30099
  if (meta.providedIn !== void 0) {
@@ -29886,7 +30131,7 @@ __name(compileDeclareInjectorFromMetadata, "compileDeclareInjectorFromMetadata")
29886
30131
  function createInjectorDefinitionMap(meta) {
29887
30132
  const definitionMap = new DefinitionMap();
29888
30133
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
29889
- definitionMap.set("version", literal("19.1.7"));
30134
+ definitionMap.set("version", literal("19.2.0"));
29890
30135
  definitionMap.set("ngImport", importExpr(Identifiers.core));
29891
30136
  definitionMap.set("type", meta.type.value);
29892
30137
  definitionMap.set("providers", meta.providers);
@@ -29910,7 +30155,7 @@ function createNgModuleDefinitionMap(meta) {
29910
30155
  throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
29911
30156
  }
29912
30157
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
29913
- definitionMap.set("version", literal("19.1.7"));
30158
+ definitionMap.set("version", literal("19.2.0"));
29914
30159
  definitionMap.set("ngImport", importExpr(Identifiers.core));
29915
30160
  definitionMap.set("type", meta.type.value);
29916
30161
  if (meta.bootstrap.length > 0) {
@@ -29945,7 +30190,7 @@ __name(compileDeclarePipeFromMetadata, "compileDeclarePipeFromMetadata");
29945
30190
  function createPipeDefinitionMap(meta) {
29946
30191
  const definitionMap = new DefinitionMap();
29947
30192
  definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
29948
- definitionMap.set("version", literal("19.1.7"));
30193
+ definitionMap.set("version", literal("19.2.0"));
29949
30194
  definitionMap.set("ngImport", importExpr(Identifiers.core));
29950
30195
  definitionMap.set("type", meta.type.value);
29951
30196
  if (meta.isStandalone !== void 0) {
@@ -30081,11 +30326,15 @@ publishFacade(_global);
30081
30326
  SplitInterpolation,
30082
30327
  Statement,
30083
30328
  StmtModifier,
30329
+ StringToken,
30330
+ StringTokenKind,
30084
30331
  TagContentType,
30085
- TaggedTemplateExpr,
30332
+ TaggedTemplateLiteralExpr,
30086
30333
  TemplateBindingParseResult,
30087
30334
  TemplateLiteral,
30088
30335
  TemplateLiteralElement,
30336
+ TemplateLiteralElementExpr,
30337
+ TemplateLiteralExpr,
30089
30338
  Text,
30090
30339
  ThisReceiver,
30091
30340
  TmplAstBlockNode,
@@ -30207,7 +30456,7 @@ publishFacade(_global);
30207
30456
 
30208
30457
  @angular/compiler/fesm2022/compiler.mjs:
30209
30458
  (**
30210
- * @license Angular v19.1.7
30459
+ * @license Angular v19.2.0
30211
30460
  * (c) 2010-2024 Google LLC. https://angular.io/
30212
30461
  * License: MIT
30213
30462
  *)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/bundled-angular-compiler",
3
- "version": "19.1.1-alpha.1",
3
+ "version": "19.1.1-alpha.3",
4
4
  "description": "A CJS bundled version of @angular/compiler",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",