Right now, the grammar requires that you have a rule, and within a rule you can have multiple provider_matchers. A provider matcher is a combination of the provider to be used and a first matcher, e.g.
rule "example" {
Swift::ClassDeclaration {
// ...
}
}
However, this doesn't allow matching multiple top-level siblings, e.g. in #9 where a rule is needed to match both a top-level protocol and a top-level class.
I think the most straight forward solution is to make the top level matcher optional, e.g.
rule "example" {
Swift {
var top_level_var := false
ClassDeclaration {
// ...
}
ProtocolDeclaration {
// ...
}
}
}
Right now, the grammar requires that you have a
rule, and within aruleyou can have multipleprovider_matchers. A provider matcher is a combination of theproviderto be used and a firstmatcher, e.g.However, this doesn't allow matching multiple top-level siblings, e.g. in #9 where a rule is needed to match both a top-level protocol and a top-level class.
I think the most straight forward solution is to make the top level matcher optional, e.g.