-
Notifications
You must be signed in to change notification settings - Fork 49
Throwing matches and update to CustomMatchingRegexComponent #273
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
Conversation
Could anyone call out to @swift-ci for me? |
@swift-ci please test |
Tests are failing because I was still using the old function names before Michael's renaming cleanup |
1a1340c
to
874c302
Compare
@swift-ci please test |
@@ -293,13 +293,15 @@ extension Compiler.ByteCodeGen { | |||
mutating func emitMatcher( | |||
_ matcher: @escaping _MatcherInterface, | |||
into capture: CaptureRegister? = nil | |||
) { | |||
) throws { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm why does the compiler need to throw? It's only the underlying matcher that throws, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm you're right that it doesn't. I didn't understand how this works well so I thought it was needed. For my information why does the compiler need to throw in the case like emitTransform
and emitCharacter
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's because they call emitNode
which throws. emitNode
throws because emitReference
throws. emitReference
throws because it needs to check the validity of references and throw RegexCompilationError
.
- Update the name `CustomRegexComponent` to `CustomMatchingRegexComponent` per pitch - Adopt `throws` for `CustomMatchingRegexComponent` as added in swiftlang#261. Errors thrown by `CustomMatchingRegexComponent`'s conformers will be bubbled up to the engine and surfaced at client-side.
874c302
to
c6cdf6c
Compare
@swift-ci please test |
We need this in ASAP to make 5.7. Merging. |
Throwing matches and update to CustomMatchingRegexComponent
CustomRegexComponent
toCustomMatchingRegexComponent
per pitchthrows
forCustomMatchingRegexComponent
as added in Throwing customization hooks #261. Errors thrown byCustomMatchingRegexComponent
's conformers will be bubbled up to the engine and surfaced at client-side.