Skip to content

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Jun 15, 2022

Relax the ban on unsetting extended syntax in a multi-line literal such that it does not apply to a scoped unset e.g (?-x:...), as long as it does not span multiple lines.

This PR also bans the use of (?^) in a multi-line literal, unless it is scoped and does not span multiple lines. Instead, (?^x) must be written, as PCRE defines (?^) to be equivalent to (?-imnsx).

@hamishknight hamishknight requested a review from milseman June 15, 2022 11:20
This shouldn't include e.g `namedCapturesOnly`.
This should always be set in a multi-line literal,
with extended syntax potentially being set and
unset as we parse.
Relax the ban on unsetting extended syntax in a
multi-line literal such that it does not apply to
a scoped unset e.g `(?-x:...)`, as long as it does
not span multiple lines.

This commit also bans the use of `(?^)` in a
multi-line literal, unless it is scoped and does
not span multiple lines. Instead, `(?^x)` must be
written, as PCRE defines `(?^)` to be equivalent to
`(?-imnsx)`.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hamishknight hamishknight merged commit 3076eba into swiftlang:main Jun 17, 2022
@hamishknight hamishknight deleted the limited-run-syntax branch June 17, 2022 09:39
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