Skip to content

fix: Swift の空タプルを式とパターンとして解析する - #43

Merged
owayo merged 1 commit into
mainfrom
fix/issue-41-swift-empty-tuple-expression
Oct 8, 2026
Merged

owayo merged 1 commit into
mainfrom
fix/issue-41-swift-empty-tuple-expression

Conversation

@owayo

@owayo owayo commented Oct 8, 2026

Copy link
Copy Markdown
Owner

概要

有効な Swift コードで () を値やパターンとして使うと、symbols と ast が構文エラーを報告する問題を修正しました。

原因

同梱の Swift 文法で tuple_expression と _tuple_pattern が要素を 1 個以上要求していました。

変更内容

  • 両方の規則で空タプルを受け入れ、tree-sitter 0.26.6 / ABI 15 でパーサーを再生成
  • tuple_expression.value が省略可能になる node-types を反映
  • 値・配列・クロージャ・switch パターンと、従来の引数なし呼び出し・関数型の対照を回帰テストに追加

検証

  • swiftc -typecheck tests/fixtures/swift_empty_tuple.swift: pass
  • cargo test: pass
  • make check: pass
  • cargo build --release: pass
  • target/release/astro-sight review --dir . --git: 追加検出なし
  • 上流コーパスの抽出ケース: 修正前後の AST が一致

Closes #41

同梱の Swift 文法はタプルの要素を必須としていたため、値やパターンの
空タプルに MISSING ノードや ERROR ノードが生じていた。
両方の規則で要素を省略可能にし、生成パーサーを更新する。

回帰テスト: swift_empty_tuple_cli_parses_values_and_patterns_without_diagnostics
Issue: #41
@coderabbitai

coderabbitai Bot commented Oct 8, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0a8635a2-ba27-4abc-b05e-179e2ac38f05
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@owayo
owayo merged commit 600e7b1 into main Oct 8, 2026
9 checks passed
@owayo
owayo deleted the fix/issue-41-swift-empty-tuple-expression branch October 8, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swift の空タプル () を式に書くと、コンパイルが通るコードでも symbols / ast の diagnostics に Parse error が出る

1 participant