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()) {
 | 
			
		||||
                        try {
 | 
			
		||||
                            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);
 | 
			
		||||
                                i = distance(lexed.begin(), closingCharacter);
 | 
			
		||||
                                break;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user