-
Notifications
You must be signed in to change notification settings - Fork 49
Implement named backreferences #433
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
@swift-ci please test |
Hmm, removing |
@swift-ci please test macOS |
looks like a CI glitch! |
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.
LGTM
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.
Thanks!
@@ -38,13 +38,24 @@ extension MEProgram where Input.Element: Hashable { | |||
// Special addresses or instructions | |||
var failAddressToken: AddressToken? = nil | |||
|
|||
var captureList = CaptureList() | |||
private(set) var namedCaptureOffsets: [String: Int] = [:] |
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.
Could we just fully drop the dictionary? If there are fewer than 2^4-ish named captures I'd expect linear search to be better anyways. It seems like CaptureList
could just have an API for this
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.
Makes sense, how does this look?
Use the CaptureList as the source of truth on which index a name corresponds to, and query it when emitting a named backreference.
This doesn't appear to be used, and should be available from the CaptureList.
a9fcc86
to
4b7d534
Compare
@swift-ci please test |
Use the CaptureList as the source of truth on which index a name corresponds to, and query it when emitting a named backreference.
Resolves #388