Class: SyntaxTree::CLI::Doc
Overview
An action of the CLI that prints out the doc tree IR for the given source.
Instance Attribute Summary
Attributes inherited from Action
Instance Method Summary collapse
Methods inherited from Action
#failure, #initialize, #success
Constructor Details
This class inherits a constructor from SyntaxTree::CLI::Action
Instance Method Details
#run(item) ⇒ Object
289 290 291 292 293 294 295 296 297 |
# File 'lib/syntax_tree/cli.rb', line 289 def run(item) source = item.source = . formatter = Formatter.new(source, [], options: ) item.handler.parse(source).format(formatter) pp formatter.groups.first end |