stage1 tokenizer: add more missing break statements

This commit is contained in:
Andrew Kelley 2019-05-16 16:50:24 -04:00
parent 87901baa28
commit 2eba779af5
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -1107,6 +1107,7 @@ void tokenize(Buf *buf, Tokenization *out) {
if (t.unicode) {
if (t.char_code > 0x10ffff) {
tokenize_error(&t, "unicode value out of range: %x", t.char_code);
break;
}
if (t.cur_tok->id == TokenIdCharLiteral) {
t.cur_tok->data.char_lit.c = t.char_code;
@ -1147,6 +1148,7 @@ void tokenize(Buf *buf, Tokenization *out) {
switch (c) {
case '\'':
tokenize_error(&t, "expected character");
break;
case '\\':
t.state = TokenizeStateStringEscape;
break;
@ -1390,8 +1392,10 @@ void tokenize(Buf *buf, Tokenization *out) {
case TokenizeStateCharCode:
if (t.cur_tok->id == TokenIdStringLiteral) {
tokenize_error(&t, "unterminated string");
break;
} else if (t.cur_tok->id == TokenIdCharLiteral) {
tokenize_error(&t, "unterminated character literal");
break;
} else {
zig_unreachable();
}