diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-14 15:18:53 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-14 15:18:53 +0000 |
commit | f3d95cce97237eff6ef8248e29e0c40062c72d44 (patch) | |
tree | c97a328c74e2ad48882c56d3174f1425ba73b7bd /lib/prettyprint.rb | |
parent | 83453ab1caa08ea053627f28ca5b9d1ee72a7920 (diff) |
trailing spaces removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/prettyprint.rb')
-rw-r--r-- | lib/prettyprint.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/prettyprint.rb b/lib/prettyprint.rb index 315c422e9e..48f2ebf1e4 100644 --- a/lib/prettyprint.rb +++ b/lib/prettyprint.rb @@ -2,7 +2,7 @@ # This class implements a pretty printing algorithm. It finds line breaks and # nice indentations for grouped structure. -# +# # By default, the class assumes that primitive elements are strings and each # byte in the strings have single column in width. But it can be used for # other situations by giving suitable arguments for some methods: @@ -18,28 +18,28 @@ # == Bugs # * Box based formatting? # * Other (better) model/algorithm? -# +# # == References # Christian Lindig, Strictly Pretty, March 2000, # http://www.st.cs.uni-sb.de/~lindig/papers/#pretty -# +# # Philip Wadler, A prettier printer, March 1998, # http://homepages.inf.ed.ac.uk/wadler/topics/language-design.html#prettier -# +# # == Author # Tanaka Akira <[email protected]> -# +# class PrettyPrint # This is a convenience method which is same as follows: - # + # # begin # q = PrettyPrint.new(output, maxwidth, newline, &genspace) # ... # q.flush # output # end - # + # def PrettyPrint.format(output='', maxwidth=79, newline="\n", genspace=lambda {|n| ' ' * n}) q = PrettyPrint.new(output, maxwidth, newline, &genspace) yield q |