module Bpl::AST::Printing

Public Class Methods

braces(str) click to toggle source
# File lib/bpl/ast/statement.rb, line 13
def self.braces(str) "{\n" + indent(str) + "\n}" end
indent(str) click to toggle source
# File lib/bpl/ast/statement.rb, line 9
def self.indent(str)
  str.gsub(/^(.*)$/,"  \\1").
  gsub(/^\s+(#{Bpl::IDENTIFIER}:[^=].*)$/,"\\1")
end