You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resolves#438. There were two remaining uses of error_syntax:
One is in the region parsing non-capturing groups and assertions. If it is not one of these, then ? is essentially a quantifier applied to nothing, so error_badrepeat seems an apt choice among the available codes to me. (The error code error_paren used by libstdc++ feels a bit weird to me in this context because this error code is intended for unbalanced parentheses, which this isn't.)
The other case can only be reached by an STL or compiler bug, so I replaced it by _STL_INTERNAL_CHECK: _Alternative() only returns normally when _Mchar is _Meta_eos, _Meta_bar or it is _Meta_rpar while _Disj_count != 0. Its caller, _Disjunction(), only returns if _Mchar is not _Meta_bar after _Alternative() returned. So this means the error could only be thrown when _Mchar is _Meta_eos or _Meta_rpar with _Disj_count != 0. But in either case, this is a bug in the parser: Either _Meta_eos was assigned to _Mchar before the end of the regex was reached (but see _Trans() for the only case where _Meta_eos is assigned) or an unbalanced number of increments and decrements to Disj_count were performed.
The reason will be displayed to describe this comment to others. Learn more.
No change requested: It would be more consistent to follow the pattern of commenting // TRANSITION, keeping behavior here, but the comment on the enumerator definition is sufficient. This isn't worth resetting testing.
bugSomething isn't workingregexmeow is a substring of homeowner
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #438. There were two remaining uses of
error_syntax
:?
is essentially a quantifier applied to nothing, soerror_badrepeat
seems an apt choice among the available codes to me. (The error codeerror_paren
used by libstdc++ feels a bit weird to me in this context because this error code is intended for unbalanced parentheses, which this isn't.)_STL_INTERNAL_CHECK
:_Alternative()
only returns normally when_Mchar
is_Meta_eos
,_Meta_bar
or it is_Meta_rpar
while_Disj_count != 0
. Its caller,_Disjunction()
, only returns if_Mchar
is not_Meta_bar
after_Alternative()
returned. So this means the error could only be thrown when_Mchar
is_Meta_eos
or_Meta_rpar
with_Disj_count != 0
. But in either case, this is a bug in the parser: Either_Meta_eos
was assigned to_Mchar
before the end of the regex was reached (but see_Trans()
for the only case where_Meta_eos
is assigned) or an unbalanced number of increments and decrements toDisj_count
were performed.