fix: inporper detection of end of string in char, too

This commit is contained in:
TopchetoEU 2022-10-28 10:09:46 +03:00
parent 2a0104808c
commit 572e9cb484

View File

@ -136,7 +136,7 @@ static res_t lexlet_string(char c, std::vector<char> &tok) {
else return lexer_none();
};
static res_t lexlet_char(char c, std::vector<char> &tok) {
if (c == '\'' && tok.back() != '\\') return lexer_end(token_t::CHAR_LITERAL, false).add();
if ((c == '\'') && (tok.back() != '\\')) return lexer_end(token_t::CHAR_LITERAL, false).add();
else return lexer_none();
};