mirror of
https://github.com/DanilaFe/abacus
synced 2025-04-22 00:24:12 -07:00
Prevent leaving unparsed tokens ignored, throwing error instead.
This commit is contained in:
parent
a6832e09f4
commit
a984f2960d
@ -164,7 +164,8 @@ public class ShuntingYardParser implements Parser<Match<TokenType>>, PluginListe
|
|||||||
tokens = intoPostfix(new ArrayList<>(tokens));
|
tokens = intoPostfix(new ArrayList<>(tokens));
|
||||||
if(tokens == null) return null;
|
if(tokens == null) return null;
|
||||||
Collections.reverse(tokens);
|
Collections.reverse(tokens);
|
||||||
return constructRecursive(tokens);
|
TreeNode constructedTree = constructRecursive(tokens);
|
||||||
|
return tokens.size() == 0 ? constructedTree : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user