Ping ? On Tue, Feb 25, 2014 at 12:55 AM, Prathamesh Kulkarni <bilbotheelffriend@xxxxxxxxx> wrote: > How do I backtrack the lexer to restart lexing from a particular token > on the same > line ? > Shall this be correct: ? > cpp_token *cur_token = pfile->cur_token; > if (foo (pfile) == 0) // foo advances pfile->cur_token > pfile->cur_token = cur_token; // restart lexing from cur_token > > foo does not advance pfile->cur_token beyond the same line, so I guess > cur_token shall still be pointing to a valid token (since tokens on > the same line are preserved) ? > > Thanks and Regards, > Prathamesh