Class: MilkTea::PrettyPrinter::ASTFormatter

Inherits:
BaseFormatter show all
Defined in:
lib/milk_tea/core/pretty_printer/ast_formatter.rb

Constant Summary collapse

IF_EXPRESSION_PRECEDENCE =
5
POSTFIX_PRECEDENCE =
90
UNARY_PRECEDENCE =
80
IS_PRECEDENCE =
25

Constants inherited from BaseFormatter

BaseFormatter::INDENT

Instance Method Summary collapse

Methods inherited from BaseFormatter

#initialize

Constructor Details

This class inherits a constructor from MilkTea::PrettyPrinter::BaseFormatter

Instance Method Details

#format(node, trivia: []) ⇒ Object



11
12
13
14
15
# File 'lib/milk_tea/core/pretty_printer/ast_formatter.rb', line 11

def format(node, trivia: [])
  @comment_map = build_comment_map(trivia)
  emit_source_file(node)
  finish
end