Skip to content

Commit 066ab02

Browse files
committed
Unified: Consolidate modifier rules
1 parent 7561691 commit 066ab02

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

  • unified/extractor/src/languages/swift

‎unified/extractor/src/languages/swift/swift.rs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,8 +1172,14 @@ fn translation_rules() -> Vec<Rule<SwiftContext>> {
11721172
// A leading attribute (`@objc`) or access/function/member/mutation/
11731173
// ownership modifier (swift-syntax models each as a single `declModifier`)
11741174
// becomes a `modifier`; its source text is the modifier spelling.
1175-
rule!((attribute) @@m => (modifier #{m})),
1176-
rule!((declModifier) @@m => (modifier #{m})),
1175+
rule!(
1176+
[
1177+
(attribute)
1178+
(declModifier)
1179+
] @@m
1180+
=>
1181+
(modifier #{m})
1182+
),
11771183
// Type specifiers (`inout`, `sending`, ...) are mapped to modifiers.
11781184
rule!((simpleTypeSpecifier) @@m => (modifier #{m})),
11791185
rule!((lifetimeTypeSpecifier) @@m => (modifier #{m})),

0 commit comments

Comments
 (0)