Sha256: a101e568cb8f3f189d167e73ed3ccf41692b889fc7d3820092a8cee62f18e9cb
Contents?: true
Size: 495 Bytes
Versions: 31
Compression:
Stored size: 495 Bytes
Contents
require 'rubygems' require 'treetop' module Erector class Indenting < Treetop::Runtime::SyntaxNode #:nodoc: @@indent = 0 def set_indent(x) @@indent = x self end def indent [0, @@indent].max end def indented(s) " " * indent + s + "\n" end def line(s) indented(s) end def line_in(s) s = indented(s) @@indent += 1 s end def line_out(s) @@indent -= 1 indented(s) end end end
Version data entries
31 entries across 31 versions & 3 rubygems