Skip to content

Commit 70ca7af

Browse files
tausbnCopilot
andcommitted
Address PR review comments
- unified/swift: Mark `binding_kind` as a raw `@@` capture in the property_declaration rule. It is only used to read its source text (`ctx.ast.source_text`), never as a translated node. With `@` the auto-translate prefix would route the unnamed `let`/`var` token through the catch-all `_ @node => {node}` fallback for a no-op roundtrip; `@@` makes the intent explicit and removes that reliance. - shared/yeast/tests: Reword a stale comment in test_raw_capture_marker. The text claimed a "second assertion" exists in this test, but the explicit-translation check actually lives in the companion test_raw_capture_marker_explicit_translate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 664f012 commit 70ca7af

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

shared/yeast/tests/test.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,9 +1099,10 @@ fn test_raw_capture_marker() {
10991099
// `method:` uses the raw source text ("x"); if `@@` were broken and
11001100
// auto-translation ran on `raw_lhs`, it would still produce the
11011101
// string "x" (source_text inherits the input range), so the dump
1102-
// wouldn't change. Add a second assertion: explicitly translating
1103-
// the raw NodeRef inside the body must succeed and produce
1104-
// `(identifier "ID")`.
1102+
// wouldn't change here. The companion test
1103+
// `test_raw_capture_marker_explicit_translate` exercises the
1104+
// stronger property that `ctx.translate(raw_lhs)?` succeeds and
1105+
// produces the translated `(identifier "ID")`.
11051106
assert_dump_eq(
11061107
&dump,
11071108
r#"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ fn translation_rules() -> Vec<Rule<SwiftContext>> {
301301
// `modifier:` lists from the start.
302302
rule!(
303303
(property_declaration
304-
binding: (value_binding_pattern mutability: @binding_kind)
304+
binding: (value_binding_pattern mutability: @@binding_kind)
305305
declarator: _* @@decls
306306
(modifiers)* @mods)
307307
=>

0 commit comments

Comments
 (0)