-static void parse_wide_string_literal(void)
-{
- const unsigned start_linenr = input.position.linenr;
-
- assert(CC == '"');
- next_char();
-
- while(1) {
- switch(CC) {
- case '\\': {
- wchar_rep_t tc = parse_escape_sequence();
- obstack_grow(&symbol_obstack, &tc, sizeof(tc));
- break;
- }
-
- case EOF: {
- source_position_t source_position;
- source_position.input_name = pp_token.source_position.input_name;
- source_position.linenr = start_linenr;
- errorf(&source_position, "string has no end");
- pp_token.type = TP_ERROR;
- return;
- }
-
- case '"':
- next_char();
- goto end_of_string;
-
- default: {
- wchar_rep_t tc = CC;
- obstack_grow(&symbol_obstack, &tc, sizeof(tc));
- next_char();
- break;
- }
- }
- }
-
-end_of_string:;
- /* add finishing 0 to the string */
- static const wchar_rep_t nul = L'\0';
- obstack_grow(&symbol_obstack, &nul, sizeof(nul));
-
- const size_t size
- = (size_t)obstack_object_size(&symbol_obstack) / sizeof(wchar_rep_t);
- const wchar_rep_t *const string = obstack_finish(&symbol_obstack);
-
-#if 0 /* TODO hash */
- /* check if there is already a copy of the string */
- const wchar_rep_t *const result = strset_insert(&stringset, string);
- if(result != string) {
- obstack_free(&symbol_obstack, string);
- }
-#else
- const wchar_rep_t *const result = string;
-#endif
-
- pp_token.type = TP_WIDE_STRING_LITERAL;
- pp_token.v.wide_string.begin = result;
- pp_token.v.wide_string.size = size;
-}
-