1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-12-23 07:50:09 -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 48e6e658d0
commit b1b8af014d

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