Closed DanielMazurkiewicz closed 2 years ago
Can you say more precisely what kind of lookahead operation you're looking for, and an example of how you might use it?
(Also, I've enabled GitHub Discussions, so in the future, for questions, you can start a thread there instead of creating an issue.)
Lets say I want a content of hpp multiline comment, each line separately
/* bla 0
bla bla bla 1
bla bla 2
bla 3 */
so in this case once I find comment opening I want to match zero or more times everything till occurrence of new line or string "*/" or end of file (but without these delimiters)
Yes, this is supported in the lexer modes -- take a look at grammars/go.lang for an example, specifically the following lines:
`/*` => { push comment; pass; }
// ...
mode comment {
`*/` => { pass; pop_extract; }
_ => { pass; }
}
cool, thanks!
Eg. Match everything till
'\n'|'*/'|eof