mirror of
https://github.com/DanilaFe/abacus
synced 2024-12-04 15:32:59 -08: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));
|
||||
if(tokens == null) return null;
|
||||
Collections.reverse(tokens);
|
||||
return constructRecursive(tokens);
|
||||
TreeNode constructedTree = constructRecursive(tokens);
|
||||
return tokens.size() == 0 ? constructedTree : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user