regexp-to-ast icon indicating copy to clipboard operation
regexp-to-ast copied to clipboard

Failed parsing lookbehind expressions

Open HoldYourWaffle opened this issue 5 years ago • 1 comments

Looks like lookbehind-expressions are not supported (yet):

Error: Unable to use "first char" lexer optimizations:
	Failed parsing: < /(?<=FUNCTION(\s+)([a-zA-Z]\w*)(\s*)){(\\}|[^}])*}/ >
	Using the regexp-to-ast library version: 0.4.0
	Please open an issue at: https://github.com/bd82/regexp-to-ast/issues

As you can see I was told to open an issue, so here it is 😄

My pattern is:

/(?<=FUNCTION(\s+)([a-zA-Z]\w*)(\s*)){(\\}|[^}])*}/

but it happens for any kind of lookbehind expression ((?<=x)y).

HoldYourWaffle avatar Aug 29 '19 19:08 HoldYourWaffle

Yeah I have not implemented that feature or other newer RegExp features. Although I doubt it should be too complex as it is very similar to lookahead...

bd82 avatar Aug 29 '19 21:08 bd82