class YARP::ParseResult::MarkNewlinesVisitor

Keep in sync with Java MarkNewlinesVisitor

def initialize(newline_marked)

def initialize(newline_marked)
  @newline_marked = newline_marked
end

def visit_block_node(node)

def visit_block_node(node)
  old_newline_marked = @newline_marked
  @newline_marked = Array.new(old_newline_marked.size, false)
  begin
    super(node)
  ensure
    @newline_marked = old_newline_marked
  end
end

def visit_if_node(node)

def visit_if_node(node)
  node.set_newline_flag(@newline_marked)
  super(node)
end

def visit_statements_node(node)

def visit_statements_node(node)
  node.body.each do |child|
    child.set_newline_flag(@newline_marked)
  end
  super(node)
end