fix for jscl and empty functions
This commit is contained in:
@@ -139,7 +139,7 @@ public enum MathType {
|
||||
@NotNull
|
||||
private final String match;
|
||||
|
||||
private Result(@NotNull MathType mathType, @NotNull String match){
|
||||
public Result(@NotNull MathType mathType, @NotNull String match){
|
||||
this.mathType = mathType;
|
||||
|
||||
this.match = match;
|
||||
|
@@ -42,6 +42,14 @@ class ToJsclTextProcessor implements TextProcessor {
|
||||
} else if (mathType == MathType.function) {
|
||||
sb.append(toJsclFunction(mathTypeResult.getMatch()));
|
||||
i += mathTypeResult.getMatch().length() - 1;
|
||||
|
||||
// NOTE: fix for jscl for EMPTY functions processing (see tests)
|
||||
startsWithFinder.setI(i + 1);
|
||||
if ( i < s.length() && CollectionsUtils.get(MathType.groupSymbols, startsWithFinder) != null) {
|
||||
i += 2;
|
||||
sb.append("(foo)");
|
||||
mathTypeResult = new MathType.Result(MathType.close_group_symbol, ")");
|
||||
}
|
||||
} else if (mathType == MathType.constant) {
|
||||
sb.append(mathTypeResult.getMatch());
|
||||
i += mathTypeResult.getMatch().length() - 1;
|
||||
|
Reference in New Issue
Block a user