Repository navigation
Conversation
Replaces the "// MRI: rb_foo" and "/** rb_foo */" comments that only name CRuby functions with @cruby annotations, giving `file` when exactly one CRuby file defines the name. Comment lines with more text, names CRuby does not define, comments inside method bodies and generated parser and lexer files are left as they are. Any rest of a Javadoc is kept. Every converted name was checked against CRuby 4.1 (master 6203c21e58). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dc9b113 to
121d066
Compare
|
@headius here is my first round attempt to convert many of the comments to CRuby annotations, let me know if we are good to proceed with this or you want to have more discussions with @enebo and @kares . We can see that there are many ways of marking comments with cruby implementation functions so I think there can be value in having a consistent format going forward. |
|
I don't have any feedback other than changing |
|
Yeah I like the cleanup and consistency. As for the retention... I tend to err on the side of retaining always "just in case" we have any tooling that wants to use it within a running JRuby. However... we have no such tools and no plans to make them right now. The annotations add about 17k to lib/jruby.jar. I'm fine with making this SOURCE retention until we have a need for more. |
|
Thanks! I've made this ready for review/merge when you are up to it. |
Nothing reads @cruby at runtime, and RUNTIME retention adds about 17k to lib/jruby.jar. Agreed on #9804: #9804 (comment) #9804 (comment) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Follow-up to #9782: converts the existing comment-style CRuby references to
@CRuby. The tool that checks the annotations against a CRuby checkout will come in a separate PR, so it can be discussed on its own.// MRI: rb_hash_new@CRuby(value = "rb_hash_new", file = "hash.c")/** rb_cmperr**/@CRuby(value = "rb_cmperr", file = "compar.c")// MRI: ary_reject_bang and reject_bang_i@CRuby(value = "ary_reject_bang", file = "array.c")@CRuby(value = "reject_bang_i", file = "array.c")/*** rb_make_metaclass* @param superClass ...*//*** @param superClass ...*/@CRuby(value = "rb_make_metaclass", file = "class.c")/** rb_ary_push - specialized rb_ary_store */Survey of the existing comments
Comments in
core/src/main/javathat name CRuby, checked against CRuby 4.1 (master at 6203c21e58):@CRubyMRI: name, extra texton one linenote = "..."That comes to 1130
@CRubyannotations (1126 new) on 1116 declarations in 91 files.Changes
fileis given when exactly one CRuby file defines the name, and left out otherwise (the 43 notes).import org.jruby.anno.CRuby;added where needed.Testing
file)../mvnw -Pbootstrapbuilds;spec/ruby/core/{array,comparable,string,io}pass with the existing tags (8583 examples, 0 failures).Not in this PR
qualifiedcomments and the 49 comments in method bodies.tool/cruby_annotations.rb) and its CONTRIBUTING / Javadoc mentions; that will be a separate PR.🤖 Generated with Claude Code