feat: add String#reverse for TryRuby compatibility (#524 Phase1-1)#525
Merged
Conversation
Register String#reverse as a smalrubyRuby_stringMethodR block (0 args). Update the generator to emit `str.reverse` without parentheses when no ARG1 input exists. Refs #524 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
🚀 Preview deployed: https://smalruby.jp/smalruby3-editor/feat/tryruby-compat/ |
github-actions Bot
pushed a commit
that referenced
this pull request
Apr 17, 2026
…compat feat: add String#reverse for TryRuby compatibility (#524 Phase1-1)
This was referenced Apr 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
block.inputs.ARG1の有無を判定して括弧なし出力(str.reverse)を生成Changes
packages/scratch-gui/src/lib/ruby-to-blocks-converter/smalruby-ruby.js—.reverseコンバーター登録packages/scratch-gui/src/lib/ruby-generator/smalruby-ruby.js— 引数なしメソッドの括弧なし生成packages/scratch-vm/src/extensions/smalruby_ruby/index.js— VM 側argumentsByMethod+ メニュー + 実行ロジック追加Test Coverage
test/unit/lib/ruby-to-blocks-converter/smalruby-ruby.test.js— reverse の変換テストtest/unit/lib/ruby-generator/smalruby-ruby.test.js— reverse の生成テストinputsプロパティを追加(引数有無判定の影響)Related Issues
Refs #524 (Phase 1 #1)