Closed GoogleCodeExporter closed 9 years ago
I generally want to get tokens out of my parser as char *, not wchar *. So, I
have been using
coco_string_create_char(t->val). But this is lossy -- from UTF-8 input I will
not get UTF-8 output! So I think
I'm looking for a way to get the original (char) token from the input stream,
rather than the (wchar) token
used by the parser...
JD
Hi!
That should be possible. The token already stores the start position in the
original file. You can read the
original string from there. The length in characters you can get from the
token->val (or store the length into
the token in Scanner::NextToken for a better performance).
To read the raw string, you could extend the Buffer with a fitting method.
Original comment by john.david.duncan
on 14 May 2009 at 8:24
See r576
Original comment by john.david.duncan
on 6 Jun 2009 at 2:19
Original comment by john.david.duncan
on 10 Jun 2009 at 3:38
Original comment by john.david.duncan
on 25 Jun 2009 at 3:59
Original issue reported on code.google.com by
john.david.duncan
on 14 May 2009 at 8:23