Closed unkind closed 4 years ago
Thanks, we will work on it as soon as we have time! Do you need it in a project soon (just to help us prioritize)?
Luckily, I don't need to parse exactly this part. I just made some experiments with lexer based on (?|...)
("branch reset group"):
~
\G
(?|
(?:[^",\r\n]+)(*MARK:token0)
|
(?:"[^"\\]*(?:\\.[^"\\]*)*")(*MARK:token1)
|
(?:,)(*MARK:token2)
|
(?:\r?\n)(*MARK:token3)
|
[\S\s](*MARK:error)
)
~Jx
I parsed only tokens' sub-patterns: (?:[^",\r\n]+)
, (?:"[^"\\]*(?:\\.[^"\\]*)*")
, etc.
It required some time to reassemble regex string from modified AST, though.
http://pcre.org/current/doc/html/pcre2pattern.html#SEC27
It seems like there is no support yet for
(*MARK:foo)
,(*FAIL)
, etc. They are rarely needed, but sometimes they are required.