@@ -288,7 +288,9 @@ class JsBuilder {
288
288
}
289
289
290
290
Iterable <Literal > joinLiterals (
291
- Iterable <Literal > items, Literal separator) sync * {
291
+ Iterable <Literal > items,
292
+ Literal separator,
293
+ ) sync * {
292
294
bool first = true ;
293
295
for (final item in items) {
294
296
if (! first) yield separator;
@@ -314,7 +316,10 @@ class JsBuilder {
314
316
Comment comment (String text) => Comment (text);
315
317
316
318
Call propertyCall (
317
- Expression receiver, Expression fieldName, List <Expression > arguments) {
319
+ Expression receiver,
320
+ Expression fieldName,
321
+ List <Expression > arguments,
322
+ ) {
318
323
return Call (PropertyAccess (receiver, fieldName), arguments);
319
324
}
320
325
@@ -347,7 +352,10 @@ LiteralNumber number(num value) => js.number(value);
347
352
ArrayInitializer numArray (Iterable <int > list) => js.numArray (list);
348
353
ArrayInitializer stringArray (Iterable <String > list) => js.stringArray (list);
349
354
Call propertyCall (
350
- Expression receiver, Expression fieldName, List <Expression > arguments) {
355
+ Expression receiver,
356
+ Expression fieldName,
357
+ List <Expression > arguments,
358
+ ) {
351
359
return js.propertyCall (receiver, fieldName, arguments);
352
360
}
353
361
@@ -404,8 +412,7 @@ enum _Category {
404
412
arrow,
405
413
hash,
406
414
whitespace,
407
- other,
408
- ;
415
+ other;
409
416
410
417
static const _asciiTable = < _Category > [
411
418
other, other, other, other, other, other, other, other, // 0-7
@@ -528,7 +535,7 @@ class MiniJsParser {
528
535
'typeof' ,
529
536
'void' ,
530
537
'delete' ,
531
- 'await'
538
+ 'await' ,
532
539
};
533
540
534
541
static final OPERATORS_THAT_LOOK_LIKE_IDENTIFIERS = {
@@ -537,7 +544,7 @@ class MiniJsParser {
537
544
'delete' ,
538
545
'in' ,
539
546
'instanceof' ,
540
- 'await'
547
+ 'await' ,
541
548
};
542
549
543
550
static _Category _category (int code) {
@@ -678,11 +685,12 @@ class MiniJsParser {
678
685
// Special code to disallow !, ~ and / in non-first position in token,
679
686
// so that !! and ~~ parse as two tokens and != parses as one, while =/
680
687
// parses as a an equals token followed by a regexp literal start.
681
- newCat = (code == char_codes.$BANG ||
682
- code == char_codes.$SLASH ||
683
- code == char_codes.$TILDE )
684
- ? _Category .none
685
- : _category (code);
688
+ newCat =
689
+ (code == char_codes.$BANG ||
690
+ code == char_codes.$SLASH ||
691
+ code == char_codes.$TILDE )
692
+ ? _Category .none
693
+ : _category (code);
686
694
} while (! _singleCharCategory (cat) &&
687
695
(cat == newCat ||
688
696
(cat == _Category .alpha &&
@@ -819,8 +827,9 @@ class MiniJsParser {
819
827
return expression;
820
828
} else if (_acceptCategory (_Category .hash)) {
821
829
var nameOrPosition = parseHash ();
822
- InterpolatedExpression expression =
823
- InterpolatedExpression (nameOrPosition);
830
+ InterpolatedExpression expression = InterpolatedExpression (
831
+ nameOrPosition,
832
+ );
824
833
interpolatedValues.add (expression);
825
834
return expression;
826
835
} else {
@@ -843,8 +852,9 @@ class MiniJsParser {
843
852
for (;;) {
844
853
if (_acceptCategory (_Category .hash)) {
845
854
var nameOrPosition = parseHash ();
846
- InterpolatedParameter parameter =
847
- InterpolatedParameter (nameOrPosition);
855
+ InterpolatedParameter parameter = InterpolatedParameter (
856
+ nameOrPosition,
857
+ );
848
858
interpolatedValues.add (parameter);
849
859
params.add (parameter);
850
860
} else {
@@ -899,8 +909,9 @@ class MiniJsParser {
899
909
propertyName = LiteralString (identifier);
900
910
} else if (_acceptCategory (_Category .hash)) {
901
911
var nameOrPosition = parseHash ();
902
- InterpolatedLiteral interpolatedLiteral =
903
- InterpolatedLiteral (nameOrPosition);
912
+ InterpolatedLiteral interpolatedLiteral = InterpolatedLiteral (
913
+ nameOrPosition,
914
+ );
904
915
interpolatedValues.add (interpolatedLiteral);
905
916
propertyName = interpolatedLiteral;
906
917
} else {
@@ -1070,8 +1081,10 @@ class MiniJsParser {
1070
1081
return Assignment (lhs, rhs);
1071
1082
} else {
1072
1083
// Handle +=, -=, etc.
1073
- String operator =
1074
- assignmentOperator.substring (0 , assignmentOperator.length - 1 );
1084
+ String operator = assignmentOperator.substring (
1085
+ 0 ,
1086
+ assignmentOperator.length - 1 ,
1087
+ );
1075
1088
return Assignment .compound (lhs, operator , rhs);
1076
1089
}
1077
1090
}
@@ -1111,7 +1124,8 @@ class MiniJsParser {
1111
1124
return parseArrowFunctionBody (params);
1112
1125
}
1113
1126
return expressions.reduce (
1114
- (Expression value, Expression element) => Binary (',' , value, element));
1127
+ (Expression value, Expression element) => Binary (',' , value, element),
1128
+ );
1115
1129
}
1116
1130
1117
1131
Expression parseArrowFunctionBody (List <Parameter > params) {
@@ -1130,7 +1144,8 @@ class MiniJsParser {
1130
1144
}
1131
1145
1132
1146
VariableDeclarationList finishVariableDeclarationList (
1133
- Declaration firstVariable) {
1147
+ Declaration firstVariable,
1148
+ ) {
1134
1149
var initialization = < VariableInitialization > [];
1135
1150
1136
1151
void declare (Declaration declaration) {
@@ -1248,8 +1263,9 @@ class MiniJsParser {
1248
1263
// statement.
1249
1264
if (expression is InterpolatedExpression ) {
1250
1265
assert (identical (interpolatedValues.last, expression));
1251
- InterpolatedStatement statement =
1252
- InterpolatedStatement (expression.nameOrPosition);
1266
+ InterpolatedStatement statement = InterpolatedStatement (
1267
+ expression.nameOrPosition,
1268
+ );
1253
1269
interpolatedValues[interpolatedValues.length - 1 ] = statement;
1254
1270
return statement;
1255
1271
}
@@ -1337,10 +1353,10 @@ class MiniJsParser {
1337
1353
_expectCategory (_Category .rparen);
1338
1354
Statement body = parseStatement ();
1339
1355
return ForIn (
1340
- VariableDeclarationList (
1341
- [ VariableInitialization (declaration, null )]) ,
1342
- objectExpression ,
1343
- body );
1356
+ VariableDeclarationList ([ VariableInitialization (declaration, null )]),
1357
+ objectExpression ,
1358
+ body ,
1359
+ );
1344
1360
}
1345
1361
Expression declarations = finishVariableDeclarationList (declaration);
1346
1362
_expectCategory (_Category .semicolon);
@@ -1355,8 +1371,9 @@ class MiniJsParser {
1355
1371
Declaration parseVariableDeclaration () {
1356
1372
if (_acceptCategory (_Category .hash)) {
1357
1373
var nameOrPosition = parseHash ();
1358
- InterpolatedDeclaration declaration =
1359
- InterpolatedDeclaration (nameOrPosition);
1374
+ InterpolatedDeclaration declaration = InterpolatedDeclaration (
1375
+ nameOrPosition,
1376
+ );
1360
1377
interpolatedValues.add (declaration);
1361
1378
return declaration;
1362
1379
} else {
0 commit comments