Feature #14170
closedAdd allbits?, anybits and nobits? to Ripper::Lexer::State
Description
@nobu (Nobuyoshi Nakada) added Ripper::Lexer::State at @60665
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/60665/diff/ext/ripper/lib/ripper/lexer.rb
and I think it's necessary for RDoc, I commented it at ruby-core:84111.
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/84111
aycabta (aycabta .) wrote:
In Ruby 2.5, Ripper::Lexer::State is introduced:
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/60945/entry/ext/ripper/lib/ripper/lexer.rb#L49It is for lex_state of parse.y, and has #& and #| for bit operations with lex_state_bits:
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/60945/entry/parse.y#L78RDoc uses it:
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/60945/entry/lib/rdoc/parser/ripper_state_lex.rb#L321If Integer#allbit? is implemented at 2.5, it's good for Ripper::Lexer::State and I'll use it for RDoc on 2.5.
I add allbits?, anybits and nobits? to Ripper::Lexer::State by the attached patch.
Files