Skip to content

Commit c1ef3f1

Browse files
committed
unified: Drive-by fix: Explicitly unsupport subscriptCallExpr
Subscript support is deliberately post-poned to a point where we can design an end-to-end solution for it.
1 parent a22033f commit c1ef3f1

4 files changed

Lines changed: 4 additions & 27 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ fn translation_rules() -> Vec<Rule<SwiftContext>> {
10091009
rule!(
10101010
(subscriptCallExpr calledExpression: @callee arguments: _* @args)
10111011
=>
1012-
(call_expr callee: {callee} argument: {args})
1012+
(unsupported_node)
10131013
),
10141014
// ---- Optionals and errors ----
10151015
// Postfix `?` in a pattern means `Optional.some`. E.g: `(x,y)?` -> `Optional.some((x,y))`

unified/extractor/tests/corpus/swift/collections/dictionary-subscript.output

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,4 @@ top_level
5050
pattern:
5151
name_pattern
5252
identifier: identifier "v"
53-
value:
54-
call_expr
55-
callee:
56-
name_expr
57-
identifier: identifier "d"
58-
argument:
59-
argument
60-
value:
61-
string_interpolation_expr
62-
element: string_literal "key"
53+
value: unsupported_node "d[\"key\"]"

unified/extractor/tests/corpus/swift/collections/subscript-access.output

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,4 @@ top_level
4747
pattern:
4848
name_pattern
4949
identifier: identifier "first"
50-
value:
51-
call_expr
52-
callee:
53-
name_expr
54-
identifier: identifier "xs"
55-
argument:
56-
argument
57-
value: int_literal "0"
50+
value: unsupported_node "xs[0]"

unified/extractor/tests/corpus/swift/control-flow/switch-expression-pattern.output

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -426,14 +426,7 @@ top_level
426426
identifier: identifier "y"
427427
string_literal
428428
expr_equality_pattern
429-
expr:
430-
call_expr
431-
callee:
432-
name_expr
433-
identifier: identifier "y"
434-
argument:
435-
argument
436-
value: int_literal "4"
429+
expr: unsupported_node "y[4]"
437430
body:
438431
block
439432
stmt:

0 commit comments

Comments
 (0)