@@ -8,14 +8,6 @@ import {
88import { type RawNGComment } from './types.js' ;
99import { Context } from './context.js' ;
1010
11- const NG_PARSE_FAKE_LOCATION = 'angular-estree-parser' ;
12- const NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX = 'NgEstreeParser' ;
13- const NG_PARSE_FAKE_ABSOLUTE_OFFSET = 0 ;
14- const NG_PARSE_SHARED_PARAMS : readonly [ string , number ] = [
15- NG_PARSE_FAKE_LOCATION ,
16- NG_PARSE_FAKE_ABSOLUTE_OFFSET ,
17- ] ;
18-
1911function createParser ( ) {
2012 return new Parser ( new Lexer ( ) ) ;
2113}
@@ -33,29 +25,20 @@ function parse(
3325}
3426
3527function parseBinding ( text : string ) {
36- return parse ( text , ( text , parser ) =>
37- parser . parseBinding ( text , ...NG_PARSE_SHARED_PARAMS ) ,
38- ) ;
28+ return parse ( text , ( text , parser ) => parser . parseBinding ( text , '' , 0 ) ) ;
3929}
4030
4131function parseSimpleBinding ( text : string ) {
42- return parse ( text , ( text , parser ) =>
43- parser . parseSimpleBinding ( text , ...NG_PARSE_SHARED_PARAMS ) ,
44- ) ;
32+ return parse ( text , ( text , parser ) => parser . parseSimpleBinding ( text , '' , 0 ) ) ;
4533}
4634
4735function parseAction ( text : string ) {
48- return parse ( text , ( text , parser ) =>
49- parser . parseAction ( text , ...NG_PARSE_SHARED_PARAMS ) ,
50- ) ;
36+ return parse ( text , ( text , parser ) => parser . parseAction ( text , '' , 0 ) ) ;
5137}
5238
5339function parseInterpolationExpression ( text : string ) {
5440 return parse ( text , ( text , parser ) => {
55- const result = parser . parseInterpolationExpression (
56- text ,
57- ...NG_PARSE_SHARED_PARAMS ,
58- ) ;
41+ const result = parser . parseInterpolationExpression ( text , '' , 0 ) ;
5942 result . ast = ( result . ast as Interpolation ) . expressions [ 0 ] ;
6043 return result ;
6144 } ) ;
@@ -65,13 +48,7 @@ function parseTemplateBindings(text: string) {
6548 const context = new Context ( text ) ;
6649 const parser = createParser ( ) ;
6750 const { templateBindings : expressions , errors } =
68- parser . parseTemplateBindings (
69- NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX ,
70- text ,
71- NG_PARSE_FAKE_LOCATION ,
72- NG_PARSE_FAKE_ABSOLUTE_OFFSET ,
73- NG_PARSE_FAKE_ABSOLUTE_OFFSET ,
74- ) ;
51+ parser . parseTemplateBindings ( '' , text , '' , 0 , 0 ) ;
7552 assertAstErrors ( errors ) ;
7653 return { expressions, context } ;
7754}
@@ -107,7 +84,6 @@ function extractComments(
10784}
10885
10986export {
110- NG_PARSE_TEMPLATE_BINDINGS_FAKE_PREFIX ,
11187 parseBinding ,
11288 parseSimpleBinding ,
11389 parseAction ,
0 commit comments