Skip to content

Commit 910ef24

Browse files
committed
Unified: Accessors inherit modifiers
1 parent 1bc4e40 commit 910ef24

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • unified/extractor/src/languages/swift

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,16 @@ fn translation_rules() -> Vec<Rule<SwiftContext>> {
356356
rule!(
357357
(variableDecl
358358
bindingSpecifier: @@spec
359+
modifiers: _* @mods
359360
bindings: (patternBinding
360361
pattern: (identifierPattern identifier: @@name)
361362
typeAnnotation: (typeAnnotation type: @ty)
362363
initializer: (initializerClause value: @@val)?
363364
accessorBlock: (accessorBlock accessors: (accessorDecl)+ @@accessors)))
364365
=>
365366
member* {
366-
ctx.outer_modifiers = vec![tree!((modifier #{spec}))];
367+
let binding = tree!((modifier #{spec}));
368+
ctx.outer_modifiers = std::iter::once(binding).chain(mods).collect();
367369
ctx.property_name_node = Some(tree!((identifier #{name})));
368370
let mut result = Vec::new();
369371
if let Some(val) = val {

0 commit comments

Comments
 (0)