1
0
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:
Danila Fedorin 2017-08-05 16:01:08 -07:00
parent a6832e09f4
commit a984f2960d

View File

@ -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