[前][次][番号順一覧][スレッド一覧]

ruby-changes:30458

From: zzak <ko1@a...>
Date: Tue, 13 Aug 2013 08:54:45 +0900 (JST)
Subject: [ruby-changes:30458] zzak:r42537 (trunk): * doc/syntax/literals.rdoc: [DOC] String literal concat by @cknadler

zzak	2013-08-13 08:54:38 +0900 (Tue, 13 Aug 2013)

  New Revision: 42537

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42537

  Log:
    * doc/syntax/literals.rdoc: [DOC] String literal concat by @cknadler
      [Fixes GH-380] https://github.com/ruby/ruby/pull/380

  Modified files:
    trunk/ChangeLog
    trunk/doc/syntax/literals.rdoc
Index: doc/syntax/literals.rdoc
===================================================================
--- doc/syntax/literals.rdoc	(revision 42536)
+++ doc/syntax/literals.rdoc	(revision 42537)
@@ -111,6 +111,18 @@ like a single-quote string (no interpola https://github.com/ruby/ruby/blob/trunk/doc/syntax/literals.rdoc#L111
 <tt>%Q</tt> behaves as a double-quote string.  See Percent Strings below for
 more discussion of the syntax of percent strings.
 
+Adjacent string literals are automatically concatenated by the interpreter:
+
+  "con" "cat" "en" "at" "ion" #=> "concatenation"
+  "This string contains "\
+  "no newlines."              #=> "This string contains no newlines."
+
+Any combination of adjacent single-quote, double-quote, percent strings will
+be concatenated as long as a percent-string is not last.
+
+  %q{a} 'b' "c" #=> "abc"
+  "a" 'b' %q{c} #=> NameError: uninitialized constant q
+
 === Here Documents
 
 If you are writing a large block of text you may use a "here document" or
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42536)
+++ ChangeLog	(revision 42537)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Aug 13 08:52:18 2013  Zachary Scott  <e@z...>
+
+	* doc/syntax/literals.rdoc: [DOC] String literal concat by @cknadler
+	  [Fixes GH-380] https://github.com/ruby/ruby/pull/380
+
 Mon Aug 12 23:07:21 2013  Masaya Tarui  <tarui@r...>
 
 	* gc.c (gc_marks_test): inhibit gc for st's operation.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]