@@ -21,11 +21,13 @@ class AstBuilder {
21
21
return RawAstBuilder .identifierFromString (name);
22
22
}
23
23
24
- static PrefixedIdentifier prefixedIdentifier (Identifier pre, Identifier id) {
24
+ static PrefixedIdentifier prefixedIdentifier (
25
+ SimpleIdentifier pre, SimpleIdentifier id) {
25
26
return RawAstBuilder .prefixedIdentifier (pre, id);
26
27
}
27
28
28
- static TypeParameter typeParameter (Identifier name, [TypeName bound = null ]) {
29
+ static TypeParameter typeParameter (SimpleIdentifier name,
30
+ [TypeName bound = null ]) {
29
31
return RawAstBuilder .typeParameter (name, bound);
30
32
}
31
33
@@ -47,8 +49,9 @@ class AstBuilder {
47
49
return RawAstBuilder .typeName (id, argList);
48
50
}
49
51
50
- static FunctionTypeAlias functionTypeAlias (TypeName ret, Identifier name,
51
- List <TypeParameter > tParams, List <FormalParameter > params) {
52
+ static FunctionTypeAlias functionTypeAlias (TypeName ret,
53
+ SimpleIdentifier name, List <TypeParameter > tParams,
54
+ List <FormalParameter > params) {
52
55
TypeParameterList tps =
53
56
(tParams.length == 0 ) ? null : typeParameterList (tParams);
54
57
FormalParameterList fps = formalParameterList (params);
@@ -248,17 +251,18 @@ class AstBuilder {
248
251
return RawAstBuilder .block (statements);
249
252
}
250
253
251
- static MethodDeclaration blockMethodDeclaration (TypeName rt, Identifier m,
252
- List < FormalParameter > params , List <Statement > statements ,
253
- {bool isStatic: false }) {
254
+ static MethodDeclaration blockMethodDeclaration (TypeName rt,
255
+ SimpleIdentifier m , List <FormalParameter > params ,
256
+ List < Statement > statements, {bool isStatic: false }) {
254
257
FormalParameterList fl = formalParameterList (params);
255
258
Block b = block (statements);
256
259
BlockFunctionBody body = RawAstBuilder .blockFunctionBody (b);
257
260
return RawAstBuilder .methodDeclaration (rt, m, fl, body, isStatic: isStatic);
258
261
}
259
262
260
- static FunctionDeclaration blockFunctionDeclaration (TypeName rt, Identifier f,
261
- List <FormalParameter > params, List <Statement > statements) {
263
+ static FunctionDeclaration blockFunctionDeclaration (TypeName rt,
264
+ SimpleIdentifier f, List <FormalParameter > params,
265
+ List <Statement > statements) {
262
266
FunctionExpression fexp = blockFunction (params, statements);
263
267
return RawAstBuilder .functionDeclaration (rt, f, fexp);
264
268
}
@@ -279,7 +283,7 @@ class AstBuilder {
279
283
}
280
284
281
285
static FunctionDeclarationStatement functionDeclarationStatement (
282
- TypeName rType, Identifier name, FunctionExpression fe) {
286
+ TypeName rType, SimpleIdentifier name, FunctionExpression fe) {
283
287
var fd = RawAstBuilder .functionDeclaration (rType, name, fe);
284
288
return RawAstBuilder .functionDeclarationStatement (fd);
285
289
}
@@ -295,12 +299,12 @@ class AstBuilder {
295
299
return application (parenthesize (l), < Expression > [e1]);
296
300
}
297
301
298
- static SimpleFormalParameter simpleFormal (Identifier v, TypeName t) {
302
+ static SimpleFormalParameter simpleFormal (SimpleIdentifier v, TypeName t) {
299
303
return RawAstBuilder .simpleFormalParameter (v, t);
300
304
}
301
305
302
306
static FunctionTypedFormalParameter functionTypedFormal (
303
- TypeName ret, Identifier v, List <FormalParameter > params) {
307
+ TypeName ret, SimpleIdentifier v, List <FormalParameter > params) {
304
308
FormalParameterList ps = formalParameterList (params);
305
309
return RawAstBuilder .functionTypedFormalParameter (ret, v, ps);
306
310
}
@@ -334,12 +338,14 @@ class RawAstBuilder {
334
338
return new SimpleIdentifier (token);
335
339
}
336
340
337
- static PrefixedIdentifier prefixedIdentifier (Identifier pre, Identifier id) {
341
+ static PrefixedIdentifier prefixedIdentifier (
342
+ SimpleIdentifier pre, SimpleIdentifier id) {
338
343
Token period = new Token (TokenType .PERIOD , 0 );
339
344
return new PrefixedIdentifier (pre, period, id);
340
345
}
341
346
342
- static TypeParameter typeParameter (Identifier name, [TypeName bound = null ]) {
347
+ static TypeParameter typeParameter (SimpleIdentifier name,
348
+ [TypeName bound = null ]) {
343
349
Token keyword =
344
350
(bound == null ) ? null : new KeywordToken (Keyword .EXTENDS , 0 );
345
351
return new TypeParameter (null , null , name, keyword, bound);
@@ -367,8 +373,8 @@ class RawAstBuilder {
367
373
return new TypeName (id, l);
368
374
}
369
375
370
- static FunctionTypeAlias functionTypeAlias (TypeName ret, Identifier name,
371
- TypeParameterList tps, FormalParameterList fps) {
376
+ static FunctionTypeAlias functionTypeAlias (TypeName ret,
377
+ SimpleIdentifier name, TypeParameterList tps, FormalParameterList fps) {
372
378
Token semi = new Token (TokenType .SEMICOLON , 0 );
373
379
Token td = new KeywordToken (Keyword .TYPEDEF , 0 );
374
380
return new FunctionTypeAlias (null , null , td, ret, name, tps, fps, semi);
@@ -468,13 +474,12 @@ class RawAstBuilder {
468
474
}
469
475
470
476
static FunctionDeclaration functionDeclaration (
471
- TypeName rt, Identifier f, FunctionExpression fexp) {
477
+ TypeName rt, SimpleIdentifier f, FunctionExpression fexp) {
472
478
return new FunctionDeclaration (null , null , null , rt, null , f, fexp);
473
479
}
474
480
475
- static MethodDeclaration methodDeclaration (
476
- TypeName rt, Identifier m, FormalParameterList fl, FunctionBody body,
477
- {bool isStatic: false }) {
481
+ static MethodDeclaration methodDeclaration (TypeName rt, SimpleIdentifier m,
482
+ FormalParameterList fl, FunctionBody body, {bool isStatic: false }) {
478
483
Token st = isStatic ? new KeywordToken (Keyword .STATIC , 0 ) : null ;
479
484
return new MethodDeclaration (
480
485
null , null , null , st, rt, null , null , m, null , fl, body);
@@ -496,12 +501,13 @@ class RawAstBuilder {
496
501
return new ReturnStatement (ret, e, semi);
497
502
}
498
503
499
- static SimpleFormalParameter simpleFormalParameter (Identifier v, TypeName t) {
504
+ static SimpleFormalParameter simpleFormalParameter (
505
+ SimpleIdentifier v, TypeName t) {
500
506
return new SimpleFormalParameter (null , < Annotation > [], null , t, v);
501
507
}
502
508
503
509
static FunctionTypedFormalParameter functionTypedFormalParameter (
504
- TypeName ret, Identifier v, FormalParameterList ps) {
510
+ TypeName ret, SimpleIdentifier v, FormalParameterList ps) {
505
511
return new FunctionTypedFormalParameter (
506
512
null , < Annotation > [], ret, v, null , ps);
507
513
}
@@ -518,11 +524,11 @@ class RawAstBuilder {
518
524
return new DefaultFormalParameter (fp, ParameterKind .NAMED , null , null );
519
525
}
520
526
521
- static NamedExpression namedParameter (Identifier s, Expression e) {
527
+ static NamedExpression namedParameter (SimpleIdentifier s, Expression e) {
522
528
return namedExpression (s, e);
523
529
}
524
530
525
- static NamedExpression namedExpression (Identifier s, Expression e) {
531
+ static NamedExpression namedExpression (SimpleIdentifier s, Expression e) {
526
532
Label l = new Label (s, new Token (TokenType .COLON , 0 ));
527
533
return new NamedExpression (l, e);
528
534
}
0 commit comments