Skip to content

Commit e77eb30

Browse files
Tidy up some code
1 parent 0101883 commit e77eb30

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

src/main/java/net/marcellperger/mathexpr/SymbolInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
public enum SymbolInfo {
2020
// Let's say that precedence 0 is for (parens) OR literals - TODO add a class?? but it wouldn't actually be used !
21-
POW(PowOperation.class, 1, GroupingDirection.RightToLeft, "**"), // TODO PowOperation::new
21+
POW(PowOperation.class, 1, GroupingDirection.RightToLeft, "**", PowOperation::new),
2222
MUL(MulOperation.class, 2, GroupingDirection.LeftToRight, "*", MulOperation::new),
2323
DIV(DivOperation.class, 2, GroupingDirection.LeftToRight, "/", DivOperation::new),
2424

src/main/java/net/marcellperger/mathexpr/parser/Parser.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ public MathSymbol parseInfixPrecedenceLevel(int level) throws ExprParseException
8585
Set<SymbolInfo> symbols = Util.requireNonEmptyNonNull(SymbolInfo.PREC_TO_INFO_MAP.get(level));
8686
@Nullable GroupingDirection dirn = symbols.stream()
8787
.map(sm -> sm.groupingDirection).distinct().collect(UtilCollectors.singleItem());
88-
// if(dirn != GroupingDirection.LeftToRight) { return parseInfixPrecedenceLevel(level - 1); } // TODO TDD: remove
89-
// assert dirn == GroupingDirection.LeftToRight: "RTL/unknown operators not implemented yet"; // TODO
9088
Map<String, SymbolInfo> infixToSymbolInfo = symbols.stream().collect( // TODO pre-compute/cache these
9189
Collectors.toUnmodifiableMap(
9290
si -> Objects.requireNonNull(si.infix, "null infix not allowed for parseInfixPrecedenceLevel"),

0 commit comments

Comments
 (0)