Skip to content

feat: add sprite clone, array/hash constructor support#549

Merged
takaokouji merged 2 commits into
developfrom
feat/clone-and-constructors
Apr 19, 2026
Merged

feat: add sprite clone, array/hash constructor support#549
takaokouji merged 2 commits into
developfrom
feat/clone-and-constructors

Conversation

@takaokouji
Copy link
Copy Markdown

Summary

  • self.clonecreate_clone_of("myself") + @ruby:method:clone でラウンドトリップ
  • Array.new[], Array.new(n, val) → 配列リテラルに展開
  • Hash.new{}, Hash.new(default) → 変換エラー

Test Plan

  • self.clone ラウンドトリップ pass
  • Array.new(5, 0)[0, 0, 0, 0, 0] pass
  • Hash.new(0) 変換エラー pass
  • 既存テスト 30件 pass
  • lint pass

Closes #548

- self.clone → create_clone_of("myself") with @ruby:method:clone
  comment for roundtrip. Existing create_clone() still works.
- Array.new → [] (empty array)
- Array.new(n, val) → [val, val, ...] (expand to literal)
- Hash.new → {} (empty hash)
- Hash.new(default) → conversion error (default values not supported)

Closes #548

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

- Generator outputs `clone` instead of `self.clone` (self省略)
- Converter accepts both `clone` and `self.clone`
- Add furigana: clone → クローンを作る
- Stage cannot clone (returns null → falls through to ruby_statement)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@takaokouji takaokouji merged commit c8802eb into develop Apr 19, 2026
9 checks passed
@takaokouji takaokouji deleted the feat/clone-and-constructors branch April 19, 2026 11:45
github-actions Bot pushed a commit that referenced this pull request Apr 19, 2026
…d-constructors

feat: add sprite clone, array/hash constructor support
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.

feat: Sprite#clone → create_clone_of + Array.new 展開 + Hash.new エラー

1 participant