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
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
# File 'lib/haproxy/treetop/nodes.rb', line 218 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 if depth < [:max_depth] && e.elements && !e.respond_to?(:content) e.elements.each do |child| print_node(child, depth + 1, ) end end end |