+ case '\'':
+ next_char();
+ goto end_of_wide_char_constant;
+
+ case EOF: {
+ errorf(&lexer_token.base.source_position,
+ "EOF while parsing character constant");
+ lexer_token.kind = T_ERROR;
+ return;
+ }
+
+ default:
+ obstack_grow_symbol(&symbol_obstack, c);
+ next_char();
+ break;
+ }
+ }
+
+end_of_wide_char_constant:;
+ obstack_1grow(&symbol_obstack, '\0');
+ size_t size = (size_t) obstack_object_size(&symbol_obstack) - 1;
+ char *string = obstack_finish(&symbol_obstack);
+
+ lexer_token.kind = T_WIDE_CHARACTER_CONSTANT;
+ lexer_token.string.string = identify_string(string, size);
+
+ if (size == 0) {
+ errorf(&lexer_token.base.source_position, "empty character constant");
+ }
+}
+
+/**
+ * Parse a wide string literal and set lexer_token.
+ */
+static void parse_wide_string_literal(void)
+{
+ parse_string_literal();
+ if (lexer_token.kind == T_STRING_LITERAL)
+ lexer_token.kind = T_WIDE_STRING_LITERAL;
+}
+
+/**
+ * Parse a character constant and set lexer_token.
+ */
+static void parse_character_constant(void)
+{
+ eat('\'');
+
+ while (true) {
+ switch (c) {
+ case '\\': {
+ utf32 const tc = parse_escape_sequence();
+ if (tc >= 0x100) {
+ warningf(WARN_OTHER, &lexer_pos, "escape sequence out of range");
+ }
+ obstack_1grow(&symbol_obstack, tc);