| ... | @@ -1107,6 +1107,7 @@ void tokenize(Buf *buf, Tokenization *out) { | ... | @@ -1107,6 +1107,7 @@ void tokenize(Buf *buf, Tokenization *out) { |
| 1107 | if (t.unicode) { | 1107 | if (t.unicode) { |
| 1108 | if (t.char_code > 0x10ffff) { | 1108 | if (t.char_code > 0x10ffff) { |
| 1109 | tokenize_error(&t, "unicode value out of range: %x", t.char_code); | 1109 | tokenize_error(&t, "unicode value out of range: %x", t.char_code); |
| | 1110 | break; |
| 1110 | } | 1111 | } |
| 1111 | if (t.cur_tok->id == TokenIdCharLiteral) { | 1112 | if (t.cur_tok->id == TokenIdCharLiteral) { |
| 1112 | t.cur_tok->data.char_lit.c = t.char_code; | 1113 | t.cur_tok->data.char_lit.c = t.char_code; |
| ... | @@ -1147,6 +1148,7 @@ void tokenize(Buf *buf, Tokenization *out) { | ... | @@ -1147,6 +1148,7 @@ void tokenize(Buf *buf, Tokenization *out) { |
| 1147 | switch (c) { | 1148 | switch (c) { |
| 1148 | case '\'': | 1149 | case '\'': |
| 1149 | tokenize_error(&t, "expected character"); | 1150 | tokenize_error(&t, "expected character"); |
| | 1151 | break; |
| 1150 | case '\\': | 1152 | case '\\': |
| 1151 | t.state = TokenizeStateStringEscape; | 1153 | t.state = TokenizeStateStringEscape; |
| 1152 | break; | 1154 | break; |
| ... | @@ -1390,8 +1392,10 @@ void tokenize(Buf *buf, Tokenization *out) { | ... | @@ -1390,8 +1392,10 @@ void tokenize(Buf *buf, Tokenization *out) { |
| 1390 | case TokenizeStateCharCode: | 1392 | case TokenizeStateCharCode: |
| 1391 | if (t.cur_tok->id == TokenIdStringLiteral) { | 1393 | if (t.cur_tok->id == TokenIdStringLiteral) { |
| 1392 | tokenize_error(&t, "unterminated string"); | 1394 | tokenize_error(&t, "unterminated string"); |
| | 1395 | break; |
| 1393 | } else if (t.cur_tok->id == TokenIdCharLiteral) { | 1396 | } else if (t.cur_tok->id == TokenIdCharLiteral) { |
| 1394 | tokenize_error(&t, "unterminated character literal"); | 1397 | tokenize_error(&t, "unterminated character literal"); |
| | 1398 | break; |
| 1395 | } else { | 1399 | } else { |
| 1396 | zig_unreachable(); | 1400 | zig_unreachable(); |
| 1397 | } | 1401 | } |