java: avoid useless work

* data/skeletons/lalr1.java (yySymbolPrint): Avoid the computation of
the argument if useless.
While at it, fix Java coding style.
This commit is contained in:
Akim Demaille
2020-05-01 07:27:22 +02:00
parent 0407acbc59
commit 01d5f232a9

View File

@@ -505,13 +505,14 @@ import java.text.MessageFormat;
`--------------------------------*/
private void yySymbolPrint(String s, SymbolKind yykind,
]b4_yystype[ yyvalue]b4_locations_if([, ]b4_location_type[ yylocation])[)
{
]b4_yystype[ yyvalue]b4_locations_if([, ]b4_location_type[ yylocation])[) {
if (0 < yydebug) {
yycdebug(s
+ (yykind.getCode() < YYNTOKENS_ ? " token " : " nterm ")
+ yykind.getName() + " ("]b4_locations_if([
+ yylocation + ": "])[
+ (yyvalue == null ? "(null)" : yyvalue.toString()) + ")");
}
}]])[
]b4_push_if([],[[