Request for comments: std.d.lexer
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Jan 31 07:54:42 PST 2013
On Thu, Jan 31, 2013 at 01:48:02PM +0100, Jacob Carlborg wrote:
> On 2013-01-31 13:34, FG wrote:
>
> >Do you know where you can safely cut it without having it lexed
> >beforehand? :)
>
> I was thinking that myself. It would probably be possible to just
> cut it in the middle and then lex a few characters forward and
> backwards until you get a valid token. Try and calculate the correct
> index where to cut.
[...]
Doesn't work if the middle happens to be inside a string literal
containing code. Esp. a q{} literal (you wouldn't be able to tell where
it starts/ends without scanning the entire file, because the {}'s nest).
T
--
Life is unfair. Ask too much from it, and it may decide you don't
deserve what you have now either.
More information about the Digitalmars-d
mailing list