Throw the "Unexpected character" error for all unrecognized characters in Parser.hpp

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-04-16 15:34:31 +02:00
parent 3c4902605a
commit d059d1e507
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 2 additions and 2 deletions

View File

@ -103,6 +103,7 @@ namespace Parser {
}
}
break;
case ';': break;
case LPAR: case LBRACE: case LBRACKET: {
const auto closingCharacter = find_corresponding(lexed.begin() + i + 1, lexed.end(), current.toktype, tok::inverseLCharacter(current.toktype));
vector<tok> subTokens(lexed.begin() + i + 1, closingCharacter);
@ -134,8 +135,7 @@ namespace Parser {
i = distance(lexed.begin(), closingCharacter);
break;
}
case RPAR: case RBRACE: case RBRACKET: parsingError(current, " \u27F5 Unexpected character", true);
default: break;
default: parsingError(current, " \u27F5 Unexpected character", true);
}
}
return parseTree;