@@ -46,6 +46,7 @@ public class CodeGenerator {
46
46
private final boolean preferSingleQuotes ;
47
47
private final boolean preserveTypeAnnotations ;
48
48
private final boolean printNonJSDocComments ;
49
+
49
50
/**
50
51
* To distinguish between gents and non-gents mode so that we can turn off checking the sanity of
51
52
* the source location of comments, and also provide a different mode for comment printing between
@@ -303,7 +304,7 @@ protected void add(Node node, Context context, boolean printComments) {
303
304
304
305
// Must have a ';' after a throw statement, otherwise safari can't
305
306
// parse this.
306
- cc .endStatement (/*needSemiColon=*/ true , hasTrailingCommentOnSameLine (node ));
307
+ cc .endStatement (/* needSemiColon= */ true , hasTrailingCommentOnSameLine (node ));
307
308
break ;
308
309
309
310
case RETURN :
@@ -572,7 +573,7 @@ protected void add(Node node, Context context, boolean printComments) {
572
573
add ("import.meta" );
573
574
break ;
574
575
575
- // CLASS -> NAME,EXPR|EMPTY,BLOCK
576
+ // CLASS -> NAME,EXPR|EMPTY,BLOCK
576
577
case CLASS :
577
578
{
578
579
checkState (childCount == 3 , node );
@@ -1364,7 +1365,7 @@ protected void add(Node node, Context context, boolean printComments) {
1364
1365
cc .endTemplateLit ();
1365
1366
break ;
1366
1367
1367
- // Type Declaration ASTs.
1368
+ // Type Declaration ASTs.
1368
1369
case STRING_TYPE :
1369
1370
add ("string" );
1370
1371
break ;
@@ -1411,7 +1412,7 @@ protected void add(Node node, Context context, boolean printComments) {
1411
1412
addList (first .getNext ());
1412
1413
add (">" );
1413
1414
break ;
1414
- // CLASS -> NAME,EXPR|EMPTY,BLOCK
1415
+ // CLASS -> NAME,EXPR|EMPTY,BLOCK
1415
1416
case GENERIC_TYPE_LIST :
1416
1417
add ("<" );
1417
1418
addList (first , false , Context .STATEMENT , "," );
@@ -1794,7 +1795,7 @@ private void addNonEmptyStatement(Node n, Context context, boolean allowNonBlock
1794
1795
cc .endBlock (cc .breakAfterBlockFor (n , context == Context .STATEMENT ));
1795
1796
} else {
1796
1797
printTrailingComment (n );
1797
- cc .endStatement (/* needSemiColon= */ true , /*hasTrailingCommentOnSameLine=*/ false );
1798
+ cc .endStatement (/* needSemiColon= */ true , /* hasTrailingCommentOnSameLine= */ false );
1798
1799
}
1799
1800
return ;
1800
1801
}
@@ -1821,7 +1822,7 @@ private void addNonEmptyStatement(Node n, Context context, boolean allowNonBlock
1821
1822
1822
1823
if (nodeToProcess .isEmpty ()) {
1823
1824
printTrailingComment (n );
1824
- cc .endStatement (/* needSemiColon= */ true , /*hasTrailingCommentOnSameLine=*/ false );
1825
+ cc .endStatement (/* needSemiColon= */ true , /* hasTrailingCommentOnSameLine= */ false );
1825
1826
} else {
1826
1827
add (nodeToProcess , context );
1827
1828
printTrailingComment (n );
@@ -2145,7 +2146,7 @@ private String strEscape(
2145
2146
sb .append ("\\ x0B" );
2146
2147
}
2147
2148
break ;
2148
- // From the SingleEscapeCharacter grammar production.
2149
+ // From the SingleEscapeCharacter grammar production.
2149
2150
case '\b' :
2150
2151
sb .append ("\\ b" );
2151
2152
break ;
@@ -2282,7 +2283,7 @@ private String escapeUnrecognizedCharacters(String s) {
2282
2283
for (int i = 0 ; i < s .length (); i ++) {
2283
2284
char c = s .charAt (i );
2284
2285
switch (c ) {
2285
- // From the SingleEscapeCharacter grammar production.
2286
+ // From the SingleEscapeCharacter grammar production.
2286
2287
case '\b' :
2287
2288
case '\f' :
2288
2289
case '\n' :
@@ -2337,6 +2338,7 @@ static String identifierEscape(String s) {
2337
2338
}
2338
2339
return sb .toString ();
2339
2340
}
2341
+
2340
2342
/**
2341
2343
* @param maxCount The maximum number of children to look for.
2342
2344
* @return The number of children of this node that are non empty up to maxCount.
@@ -2453,7 +2455,7 @@ private void processEnd(Node n, Context context) {
2453
2455
break ;
2454
2456
case FUNCTION :
2455
2457
if (n .getLastChild ().isEmpty ()) {
2456
- cc .endStatement (/* needSemiColon= */ true , /*hasTrailingCommentOnSameLine=*/ false );
2458
+ cc .endStatement (/* needSemiColon= */ true , /* hasTrailingCommentOnSameLine= */ false );
2457
2459
} else {
2458
2460
cc .endFunction (context == Context .STATEMENT );
2459
2461
}
@@ -2471,22 +2473,22 @@ private void processEnd(Node n, Context context) {
2471
2473
break ;
2472
2474
case COMPUTED_PROP :
2473
2475
if (n .hasOneChild ()) {
2474
- cc .endStatement (/* needSemiColon= */ true , /*hasTrailingCommentOnSameLine=*/ false );
2476
+ cc .endStatement (/* needSemiColon= */ true , /* hasTrailingCommentOnSameLine= */ false );
2475
2477
}
2476
2478
break ;
2477
2479
case MEMBER_FUNCTION_DEF :
2478
2480
case GETTER_DEF :
2479
2481
case SETTER_DEF :
2480
2482
if (n .getFirstChild ().getLastChild ().isEmpty ()) {
2481
- cc .endStatement (/* needSemiColon= */ true , /*hasTrailingCommentOnSameLine=*/ false );
2483
+ cc .endStatement (/* needSemiColon= */ true , /* hasTrailingCommentOnSameLine= */ false );
2482
2484
}
2483
2485
break ;
2484
2486
case MEMBER_VARIABLE_DEF :
2485
- cc .endStatement (/* needSemiColon= */ true , /*hasTrailingCommentOnSameLine=*/ false );
2487
+ cc .endStatement (/* needSemiColon= */ true , /* hasTrailingCommentOnSameLine= */ false );
2486
2488
break ;
2487
2489
default :
2488
2490
if (context == Context .STATEMENT ) {
2489
- cc .endStatement (/*hasTrailingCommentOnSameLine=*/ false );
2491
+ cc .endStatement (/* hasTrailingCommentOnSameLine= */ false );
2490
2492
}
2491
2493
}
2492
2494
}
0 commit comments