Skip to content

Commit

Permalink
Merge pull request RPTools#5227 from fishface60/fix-strformat-newline
Browse files Browse the repository at this point in the history
Support strformat literals without passing args
  • Loading branch information
kwvanderlinde authored Feb 13, 2025
2 parents d8a0cbf + 97cf72c commit ab44985
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,7 @@ public Object childEvaluate(
}
if (functionName.equalsIgnoreCase("strformat")) {
int size = parameters.size();
if (size > 1) {
return format(parameters.get(0).toString(), resolver, parameters.subList(1, size));
} else {
return format(parameters.get(0).toString(), resolver, null);
}
return format(parameters.get(0).toString(), resolver, parameters.subList(1, size));
}
if (functionName.equalsIgnoreCase("matches")) {
if (parameters.size() < 2) {
Expand Down Expand Up @@ -443,10 +439,6 @@ public String format(String string, VariableResolver resolver, List<Object> args
}
m.appendTail(sb);

if (args == null) {
return sb.toString();
}

Object[] argArray = args.toArray();

// Change all integers in BigDecimal to BigIntegers so formating specifiers work correctly.
Expand Down

0 comments on commit ab44985

Please sign in to comment.