class SyntaxTree::CLI::Json

An action of the CLI that converts the source into its equivalent JSON representation.

Public Instance Methods

run(item) click to toggle source
# File lib/syntax_tree/cli.rb, line 327
def run(item)
  object = item.handler.parse(item.source).accept(JSONVisitor.new)
  puts JSON.pretty_generate(object)
end