Fix the parsing of ParseTree to ignore previous parsed instances
Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
parent
014ea9060b
commit
7df47da354
|
@ -119,7 +119,9 @@ namespace Parser {
|
||||||
if (not parseTree.empty()) {
|
if (not parseTree.empty()) {
|
||||||
try {
|
try {
|
||||||
auto& previous = dynamic_cast<ParseTree&>(*parseTree.at(parseTree.size() - 1));
|
auto& previous = dynamic_cast<ParseTree&>(*parseTree.at(parseTree.size() - 1));
|
||||||
if (current.toktype != LPAR or previous.getId() == typeid(Call)) {
|
if (find_if(reverse_iterator(lexed.begin() + i), lexed.rend(), [&closingCharacter](const tok& token){
|
||||||
|
return token.toktype != SEMICOLON;
|
||||||
|
})->toktype != *closingCharacter) {
|
||||||
previous = parse(subTokens);
|
previous = parse(subTokens);
|
||||||
i = distance(lexed.begin(), closingCharacter);
|
i = distance(lexed.begin(), closingCharacter);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue