Sha256: 6a305921d2c11aeca5b5250e3e766b87f22a990eab7e5676fadc05977e82e677

Contents?: true

Size: 1.29 KB

Versions: 3484

Compression:

Stored size: 1.29 KB

Contents

#--
#
#
#
# Copyright (c) 1999-2006 Minero Aoki
#
# This program is free software.
# You can distribute/modify this program under the same terms of ruby.
# see the file "COPYING".
#
#++

module Racc

  class DebugFlags
    def DebugFlags.parse_option_string(s)
      parse = rule = token = state = la = prec = conf = false
      s.split(//).each do |ch|
        case ch
        when 'p' then parse = true
        when 'r' then rule = true
        when 't' then token = true
        when 's' then state = true
        when 'l' then la = true
        when 'c' then prec = true
        when 'o' then conf = true
        else
          raise "unknown debug flag char: #{ch.inspect}"
        end
      end
      new(parse, rule, token, state, la, prec, conf)
    end

    def initialize(parse = false, rule = false, token = false, state = false,
                   la = false, prec = false, conf = false)
      @parse = parse
      @rule = rule
      @token = token
      @state = state
      @la = la
      @prec = prec
      @any = (parse || rule || token || state || la || prec)
      @status_logging = conf
    end

    attr_reader :parse
    attr_reader :rule
    attr_reader :token
    attr_reader :state
    attr_reader :la
    attr_reader :prec

    def any?
      @any
    end

    attr_reader :status_logging
  end

end

Version data entries

3,484 entries across 3,475 versions & 31 rubygems

Version Path
racc-1.6.2-java lib/racc/debugflags.rb
racc-1.6.2 lib/racc/debugflags.rb
racc-1.6.1-java lib/racc/debugflags.rb
racc-1.6.1 lib/racc/debugflags.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/racc-1.6.0/lib/racc/debugflags.rb
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/racc-1.5.2/lib/racc/debugflags.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/racc-1.6.0/lib/racc/debugflags.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/racc-1.6.0/lib/racc/debugflags.rb
racc-1.6.0-java lib/racc/debugflags.rb
racc-1.6.0 lib/racc/debugflags.rb
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/racc-1.5.2/lib/racc/debugflags.rb
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/racc-1.5.2/lib/racc/debugflags.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/racc-1.5.2/lib/racc/debugflags.rb
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/racc-1.5.2/lib/racc/debugflags.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/racc-1.5.2/lib/racc/debugflags.rb
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/racc-1.5.2/lib/racc/debugflags.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/racc-1.5.2/lib/racc/debugflags.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/racc-1.5.2/lib/racc/debugflags.rb
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/racc-1.5.2/lib/racc/debugflags.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/racc-1.5.2/lib/racc/debugflags.rb