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:
parent
3c4902605a
commit
d059d1e507
|
@ -103,6 +103,7 @@ namespace Parser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ';': break;
|
||||||
case LPAR: case LBRACE: case LBRACKET: {
|
case LPAR: case LBRACE: case LBRACKET: {
|
||||||
const auto closingCharacter = find_corresponding(lexed.begin() + i + 1, lexed.end(), current.toktype, tok::inverseLCharacter(current.toktype));
|
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);
|
vector<tok> subTokens(lexed.begin() + i + 1, closingCharacter);
|
||||||
|
@ -134,8 +135,7 @@ namespace Parser {
|
||||||
i = distance(lexed.begin(), closingCharacter);
|
i = distance(lexed.begin(), closingCharacter);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case RPAR: case RBRACE: case RBRACKET: parsingError(current, " \u27F5 Unexpected character", true);
|
default: parsingError(current, " \u27F5 Unexpected character", true);
|
||||||
default: break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return parseTree;
|
return parseTree;
|
||||||
|
|
Loading…
Reference in New Issue