Skip to content

Commit f0f22ab

Browse files
committed
Unified: Consolidate unresolved operator rules
1 parent 0b2d2ce commit f0f22ab

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

  • unified/extractor/src/languages/swift

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,15 @@ fn translation_rules() -> Vec<Rule<SwiftContext>> {
260260
// to an opaque `unsupported_node`. These bare nodes only occur inside an
261261
// unresolved sequence — folded forms are handled by the dedicated rules
262262
// above (assignment) and below (`ternaryExpr`).
263-
rule!((assignmentExpr) @@op => (infix_operator #{op})),
264-
rule!((unresolvedAsExpr) @@op => (infix_operator #{op})),
265-
rule!((unresolvedIsExpr) @@op => (infix_operator #{op})),
263+
rule!(
264+
[
265+
(assignmentExpr)
266+
(unresolvedAsExpr)
267+
(unresolvedIsExpr)
268+
] @@op
269+
=>
270+
(infix_operator #{op})
271+
),
266272
// The ternary is a three-part operator (`? thenExpr :`) that *wraps* a
267273
// nested expression. Splice it into `?`, the then-expression, `:` so the
268274
// then-expression survives as a real (traversable) operand rather than

0 commit comments

Comments
 (0)