Class: Yard2steep::Engine

Inherits:
Object
  • Object
show all
Defined in:
lib/yard2steep/engine.rb

Class Method Summary collapse

Class Method Details

.execute(file, text, debug: false, debug_ast: false) ⇒ String

Parameters:

  • file (String)
  • text (String)
  • debug (bool) (defaults to: false)
  • debug_ast (bool) (defaults to: false)

Returns:

  • (String)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/yard2steep/engine.rb', line 8

def self.execute(file, text, debug: false, debug_ast: false)
  if debug
    print "## execute\n"
    print "  file: #{file}\n"
  end

  ast = Parser.new.parse(file, text, debug: debug)

  if debug_ast
    print "  ast: #{ast}\n\n"
  end

  Gen.new.gen(ast)
end