use constant instead of magic string

This commit is contained in:
ucrhh 2021-02-06 10:33:04 +01:00
parent a01811936e
commit 09ce138bc2
2 changed files with 3 additions and 4 deletions

View File

@ -38,6 +38,7 @@ public final class LatexCreatorConstants {
protected static final String USER_VARIABLE = "\\tau";
protected static final String GAMMA = "\\Gamma";
protected static final String PHANTOM_X = "\\phantom{x}";
protected static final String SUBSTITUTION_SIGN = "\\mathrel{\\unicode{x21E8}}";
protected static final String LAMBDA = "\\lambda";
protected static final String LATEX_SPACE = "\\ ";

View File

@ -13,15 +13,13 @@ public class LatexCreatorConstraints implements StepVisitor {
public LatexCreatorConstraints(TypeInfererInterface typeInferer) {
constraints = new ArrayList<>();
constraints.add("\\phantom{x}");
constraints.add(PHANTOM_X);
typeInferer.getFirstInferenceStep().accept(this);
}
protected List<String> getConstraints() {
List<String> temp = new ArrayList<>(constraints);
temp.replaceAll(current -> current.equals("")
? current
: DOLLAR_SIGN + current + DOLLAR_SIGN);
temp.replaceAll(current -> DOLLAR_SIGN + current + DOLLAR_SIGN);
//todo vllt. noch was anderes drumrum schreiben
return temp;
}