Skip to content

Conversation

dag-erling
Copy link
Collaborator

Previously, when the parser encountered a left or right parenthesis while parsing an atom, it would check if it was either in ERE mode or if the preceding character was a backslash. This is unreliable as we cannot know at this point if said backslash was itself escaped. Instead, when we encounter a backslash (which we know is not escaped), and are not in ERE mode, check if the next character is a left or right parenthesis, and if so, jump directly to the appropriate point.

Previously, when the parser encountered a left or right parenthesis while
parsing an atom, it would check if it was either in ERE mode or if the
preceding character was a backslash.  This is unreliable as we cannot
know at this point if said backslash was itself escaped.  Instead, when
we encounter a backslash (which we know is not escaped), and are not in
ERE mode, check if the next character is a left or right parenthesis,
and if so, jump directly to the appropriate point.
@dag-erling
Copy link
Collaborator Author

Note that there is a similar issue with parsing carets in BREs, but unfortunately it can't be fixed as easily.

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.

1 participant