Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inline modifiers inside lookarounds #133

Closed

Conversation

stulov
Copy link
Contributor

@stulov stulov commented Jul 24, 2023

Inside parseAtomAndExtendedAtom, (? used to be searched from the start of the string, rather than from the current position. So, trying to parse an expression containing nested lookarounds and inline modifiers (e.g., /(?<=(?i:un))parse(?=(?i:able))/) threw an error.

Didn't quite understand how the tests work, so didn't write one, sorry.

@JLHwung
Copy link
Collaborator

JLHwung commented Sep 29, 2023

Didn't quite understand how the tests work, so didn't write one, sorry.

No worry. Can you add a test before

"^[a-z](?imi:[a-z])$": {

?

You can put the test regex as key and leave an empty object as value, then run node ./test/update-fixtures.js, it will update the actual AST as value and we can see if it works as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants