Module: HAProxy::Treetop
Defined Under Namespace
Modules: ConfigBlockContainer, OptionalValueElement, ServerContainer, ServiceAddressContainer, StrippedTextContent Classes: BackendHeader, BackendSection, BlankLine, Char, CommentLine, CommentText, ConfigBlock, ConfigLine, ConfigurationFile, DefaultsHeader, DefaultsSection, FrontendHeader, FrontendSection, GlobalHeader, GlobalSection, Host, Keyword, LineBreak, ListenHeader, ListenSection, OptionLine, Port, ProxyName, ServerLine, ServerName, ServiceAddress, UserlistHeader, UserlistSection, Value, Whitespace
Instance Method Summary collapse
Instance Method Details
#print_node(e, depth, options = nil) ⇒ Object
203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/haproxy/treetop/nodes.rb', line 203 def print_node(e, depth, = nil) ||= {} = {:max_depth => 2}.merge() puts if depth == 0 print "--" * depth print " #{e.class.name.split('::').last}" print " [#{e.text_value}]" if e.class == ::Treetop::Runtime::SyntaxNode print " [#{e.content}]" if e.respond_to? :content puts e.elements.each do |child| print_node(child, depth + 1, ) end if depth < [:max_depth] && e.elements && !e.respond_to?(:content) end |