diff options
Diffstat (limited to 'lib/prettyprint.rb')
| -rw-r--r-- | lib/prettyprint.rb | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/lib/prettyprint.rb b/lib/prettyprint.rb index 188c2e6db0..44ca5e816f 100644 --- a/lib/prettyprint.rb +++ b/lib/prettyprint.rb @@ -23,16 +23,19 @@ # # == References # Christian Lindig, Strictly Pretty, March 2000, -# http://www.st.cs.uni-sb.de/~lindig/papers/#pretty +# https://lindig.github.io/papers/strictly-pretty-2000.pdf # # Philip Wadler, A prettier printer, March 1998, -# http://homepages.inf.ed.ac.uk/wadler/topics/language-design.html#prettier +# https://homepages.inf.ed.ac.uk/wadler/topics/language-design.html#prettier # # == Author # Tanaka Akira <akr@fsij.org> # class PrettyPrint + # The version string + VERSION = "0.2.0" + # This is a convenience method which is same as follows: # # begin @@ -484,8 +487,10 @@ class PrettyPrint # It is passed to be similar to a PrettyPrint object itself, by responding to: # * #text # * #breakable + # * #fill_breakable # * #nest # * #group + # * #group_sub # * #flush # * #first? # @@ -519,6 +524,13 @@ class PrettyPrint @output << sep end + # Appends +sep+ to the text to be output. By default +sep+ is ' ' + # + # +width+ argument is here for compatibility. It is a noop argument. + def fill_breakable(sep=' ', width=nil) + @output << sep + end + # Takes +indent+ arg, but does nothing with it. # # Yields to a block. @@ -542,6 +554,15 @@ class PrettyPrint @first.pop end + # Yields to a block for compatibility. + def group_sub # :nodoc: + yield + end + + # Method present for compatibility, but is a noop + def break_outmost_groups # :nodoc: + end + # Method present for compatibility, but is a noop def flush # :nodoc: end |
