[#79440] [Ruby trunk Bug#13188] Reinitialize Ruby VM. — shyouhei@...
Issue #13188 has been updated by Shyouhei Urabe.
6 messages
2017/02/06
[#79441] Re: [Ruby trunk Bug#13188] Reinitialize Ruby VM.
— SASADA Koichi <ko1@...>
2017/02/06
On 2017/02/06 10:10, shyouhei@ruby-lang.org wrote:
[#79532] Immutable Strings vs Symbols — Daniel Ferreira <subtileos@...>
Hi,
15 messages
2017/02/15
[#79541] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/15
Em 15-02-2017 05:05, Daniel Ferreira escreveu:
[#79543] Re: Immutable Strings vs Symbols
— Daniel Ferreira <subtileos@...>
2017/02/16
Hi Rodrigo,
[#79560] Re: Immutable Strings vs Symbols
— Rodrigo Rosenfeld Rosas <rr.rosas@...>
2017/02/16
Em 15-02-2017 22:39, Daniel Ferreira escreveu:
[ruby-core:79662] [Ruby trunk Feature#13047][Assigned] Use String literal instead of `String#+` for multiline pretty-printing of multiline strings
From:
shyouhei@...
Date:
2017-02-22 07:09:02 UTC
List:
ruby-core #79662
Issue #13047 has been updated by Shyouhei Urabe.
Status changed from Open to Assigned
Assignee set to Akira Tanaka
----------------------------------------
Feature #13047: Use String literal instead of `String#+` for multiline pretty-printing of multiline strings
https://bugs.ruby-lang.org/issues/13047#change-63079
* Author: Fumiaki Matsushima
* Status: Assigned
* Priority: Normal
* Assignee: Akira Tanaka
* Target version:
----------------------------------------
Multiline pretty-printing of multiline strings is introduced. (https://bugs.ruby-lang.org/issues/12664)
~~~ ruby
> pp "bundler.rb"=> "module Bundler\n BundlerError = Class.new(Exception)\n def self.setup\n end\nend\n"
{"bundler.rb"=>
"module Bundler\n" +
" BundlerError = Class.new(Exception)\n" +
" def self.setup\n" +
" end\n" +
"end\n"}
~~~
It is awesome but we can use String literal instead of `String#+`:
~~~ ruby
> pp "bundler.rb"=> "module Bundler\n BundlerError = Class.new(Exception)\n def self.setup\n end\nend\n"
{"bundler.rb"=>
"module Bundler\n" \
" BundlerError = Class.new(Exception)\n" \
" def self.setup\n" \
" end\n" \
"end\n"}
~~~
It seems that `pp` want to output evaluable snippet but we can override `String#+` so it may not work well.
Non-broken String will be:
~~~ ruby
> pp "bundler.rb"=> "module Bundler\nend\n"
{"bundler.rb"=> "module Bundler\n" "end\n"}
~~~
How do you think?
-------------
I tried to write patch but I can't find a way to append "\" to broken line only by current PP's API.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>