mirror of
https://github.com/ziglang/zig.git
synced 2025-12-25 15:43:06 +00:00
stage1 tokenizer: add more missing break statements
This commit is contained in:
parent
87901baa28
commit
2eba779af5
@ -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();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user