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:
parent
48e6e658d0
commit
b1b8af014d
|
@ -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