Class: ShellOpts::Grammar::Code

Inherits:
DocNode show all
Defined in:
lib/shellopts/grammar.rb,
lib/shellopts/formatter.rb

Constant Summary

Constants inherited from Node

Node::ALLOWED_PARENTS

Instance Attribute Summary

Attributes inherited from DocNode

#tokens

Attributes inherited from Node

#children, #parent, #token

Instance Method Summary collapse

Methods inherited from DocNode

#initialize, #to_s

Methods inherited from Node

#analyzer_error, #ancestors, #dump_ast, #dump_attrs, #dump_idr, #initialize, #inspect, #parents, #parse, parse, #parser_error, #puts_help, #puts_usage, #remove_arg_descr_nodes, #remove_arg_spec_nodes, #remove_brief_nodes, #traverse

Constructor Details

This class inherits a constructor from ShellOpts::Grammar::DocNode

Instance Method Details

#linesObject



360
# File 'lib/shellopts/grammar.rb', line 360

def lines() @lines ||= tokens.map { |t| " " * [t.charno - token.charno, 0].max + t.source } end

#puts_descrObject



182
# File 'lib/shellopts/formatter.rb', line 182

def puts_descr() indent { super } end

#textObject



359
# File 'lib/shellopts/grammar.rb', line 359

def text() @text ||= lines.join("\n") end