-
Notifications
You must be signed in to change notification settings - Fork 50
Structuralization of captures #160
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
@rxwei I have a lot of tests cases in this PR if you'd like to take a look. I'm not entirely sure what behavior we want for all of them. |
Literal capture structure tests look good to me. Did you plan to add DSL capture tests as well? For example, the following DSL let regex = Regex {
oneOrMore {
capture("a")
capture("b")
}
} // `Regex<(Substring, [(Substring, Substring)])>` is expected to produce Unrelated to this PR: By the current DSL design, we'll have a let regex = Regex {
oneOrMore {
capture("a")
capture("b")
}.flatten()
} // `Regex<(Substring, [Substring], [Substring])>` |
What is |
|
eccd21b
to
92de597
Compare
@swift-ci please test linux platform |
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.
func _match( | ||
// TODO: Should we expose parameters for testing? | ||
// Currently, tests just use the execution interface directly. | ||
func _performLegacyMatch( |
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.
Should this be deleted now that we don't need the VM?
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.
CaptureTests uses this kind of functionality, but there it's hand-invoking the VM. We could delete it, unless it's useful for a match-API-based test. I was considering taking the legacy stuff out of the _StringProcessing
module and put it back into the Prototypes
module, at which point I believe this would move with it.
I'll follow up after this PR.
Structuralize matching engine captures, at least partially.