vendor/bundle/ruby/2.5.0/gems/parslet-1.5.0/lib/parslet/export.rb
# Pretty prints the given parslet using the visitor that has been
# configured in initialize. Returns the string representation of the
# Citrus or Treetop grammar.
#
Pretty prints the given parslet using the visitor that has been
configured in initialize. Returns the string representation of the
Citrus or Treetop grammar.
Pretty prints the given parslet using the visitor that has been configured in initialize . Returns the string representation of the Citrus or Treetop grammar .
def pretty_print(name, parslet)
      output = "grammar #{name}\n"
      output << rule('root', parslet)
      seen = Set.new
      loop do
        break if @todo.empty?
        name, block = @todo.shift
        next if seen.include?(name)
        seen << name
        output << rule(name, block.call)
      end
      output << "end\n"
    end
def pretty_print ( name , parslet ) output = "grammar #{name}\n" output << rule ( 'root' , parslet ) seen = Set . new loop do break if @todo . empty? name , block = @todo . shift next if seen . include? ( name ) seen << name output << rule ( name , block . call ) end output << "end\n" end
Pretty prints the given parslet using the visitor that has been
configured in initialize.
Pretty prints the given parslet using the visitor that has been configured in initialize .
# @todo is constantly filled by the visitor (see #deferred). We  # keep going until it is empty. # Track what rules we've already seen. This breaks loops.
name
<not_specific>
parslet
<not_specific>