ruby-changes:49090
From: nobu <ko1@a...>
Date: Wed, 13 Dec 2017 19:26:14 +0900 (JST)
Subject: [ruby-changes:49090] nobu:r61205 (trunk): Ripper::Lexer bit predicates
nobu 2017-12-13 19:26:09 +0900 (Wed, 13 Dec 2017) New Revision: 61205 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61205 Log: Ripper::Lexer bit predicates * ext/ripper/lib/ripper/lexer.rb (Ripper::Lexer): added allbits?, anybits? and nobits? methods, as well as Integer. a patch by aycabta. [Feature #14170] Modified files: trunk/ext/ripper/lib/ripper/lexer.rb Index: ext/ripper/lib/ripper/lexer.rb =================================================================== --- ext/ripper/lib/ripper/lexer.rb (revision 61204) +++ ext/ripper/lib/ripper/lexer.rb (revision 61205) @@ -54,6 +54,9 @@ class Ripper https://github.com/ruby/ruby/blob/trunk/ext/ripper/lib/ripper/lexer.rb#L54 def ==(i) super or to_int == i end def &(i) self.class.new(to_int & i) end def |(i) self.class.new(to_int & i) end + def allbits?(i) to_int.allbits?(i) end + def anybits?(i) to_int.anybits?(i) end + def nobits?(i) to_int.nobits?(i) end end Elem = Struct.new(:pos, :event, :tok, :state) do -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/