You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Question]Add support for yield and block type annotations #34
First of all, thank you for starting this interesting project!
While testing various scenarios, I noticed that t-ruby currently does not support parsing and type-checking yield expressions and block type annotations.
For example....
I've written some abstract example code to illustrate the expected behavior. I would like to parse block types and the return values of yield expressions as shown here.
Currently, yield raises an error unless the return type is void, and it seems that block type annotations are not supported at all.
defhello_world: Integerreturncalculate{ |n| n + 3}: Integer -> Integerenddefcalculate: Integeryield(7)end
Since this is a critical feature for Ruby's idiomatic block-based programming patterns, could you please take a look?
Current Status
I investigated the codebase and found
Partial Support
Scanner recognizes yield as a keyword token (scanner.rb:57)
changed the title [-]Add support for yield and block type annotations[/-][+][Question]Add support for yield and block type annotations[/+]on Dec 31, 2025
Activity
[-]Add support for yield and block type annotations[/-][+][Question]Add support for yield and block type annotations[/+]feat: add yield statement support
yhk1038 commentedon Jan 17, 2026
Hi, @dfl.
Thank you for supporting.
Please send PR for your commits.
Then we can talk about that on comments thread.
And also, I'll put your pr into project#1
It's ok your pr is not completed, i can stand until it could be done.
Thank you.
yhk1038 commentedon Jan 19, 2026
It has been developed by PR #39 #38 .
And discussion is on going at #41 .