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

ruby-changes:26220

From: drbrain <ko1@a...>
Date: Sun, 9 Dec 2012 06:19:38 +0900 (JST)
Subject: [ruby-changes:26220] drbrain:r38277 (trunk): * lib/rdoc/markdown/entities.rb: Added documentation.

drbrain	2012-12-09 06:19:22 +0900 (Sun, 09 Dec 2012)

  New Revision: 38277

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

  Log:
    * lib/rdoc/markdown/entities.rb:  Added documentation.
    
    * lib/rdoc/parser/ruby.rb:  Updated style
    
    * lib/rdoc/ruby_lex.rb:  Parse characters up to \u{FFFFF}
    * test/rdoc/test_rdoc_ruby_lex.rb:  Test for above.

  Modified files:
    trunk/ChangeLog
    trunk/lib/rdoc/markdown/entities.rb
    trunk/lib/rdoc/parser/ruby.rb
    trunk/lib/rdoc/ruby_lex.rb
    trunk/test/rdoc/test_rdoc_ruby_lex.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 38276)
+++ ChangeLog	(revision 38277)
@@ -1,3 +1,12 @@
+Sun Dec  9 06:19:04 2012  Eric Hodel  <drbrain@s...>
+
+	* lib/rdoc/markdown/entities.rb:  Added documentation.
+
+	* lib/rdoc/parser/ruby.rb:  Updated style
+
+	* lib/rdoc/ruby_lex.rb:  Parse characters up to \u{FFFFF}
+	* test/rdoc/test_rdoc_ruby_lex.rb:  Test for above.
+
 Sat Dec  8 22:38:35 2012  Shugo Maeda  <shugo@r...>
 
 	* eval.c (rb_mod_refine): don't override Module#include.  It's
Index: lib/rdoc/markdown/entities.rb
===================================================================
--- lib/rdoc/markdown/entities.rb	(revision 38276)
+++ lib/rdoc/markdown/entities.rb	(revision 38277)
@@ -1,3 +1,6 @@
+##
+# HTML entity name map for RDoc::Markdown
+
 RDoc::Markdown::HTML_ENTITIES = {
   "AElig" => [0x000C6],
   "AMP" => [0x00026],
Index: lib/rdoc/ruby_lex.rb
===================================================================
--- lib/rdoc/ruby_lex.rb	(revision 38276)
+++ lib/rdoc/ruby_lex.rb	(revision 38277)
@@ -857,7 +857,7 @@
   end
 
   IDENT_RE = if defined? Encoding then
-               /[\w\u0080-\uFFFF]/u
+               eval '/[\w\u{0080}-\u{FFFFF}]/u' # 1.8 can't parse \u{}
              else
                /[\w\x80-\xFF]/
              end
Index: lib/rdoc/parser/ruby.rb
===================================================================
--- lib/rdoc/parser/ruby.rb	(revision 38276)
+++ lib/rdoc/parser/ruby.rb	(revision 38277)
@@ -1300,16 +1300,16 @@
   #
   # and add this as the block_params for the method
 
-  def parse_method_parameters(method)
+  def parse_method_parameters method
     res = parse_method_or_yield_parameters method
 
     res = "(#{res})" unless res =~ /\A\(/
     method.params = res unless method.params
 
-    if method.block_params.nil? then
-      skip_tkspace false
-      read_documentation_modifiers method, RDoc::METHOD_MODIFIERS
-    end
+    return if  method.block_params
+
+    skip_tkspace false
+    read_documentation_modifiers method, RDoc::METHOD_MODIFIERS
   end
 
   ##
Index: test/rdoc/test_rdoc_ruby_lex.rb
===================================================================
--- test/rdoc/test_rdoc_ruby_lex.rb	(revision 38276)
+++ test/rdoc/test_rdoc_ruby_lex.rb	(revision 38277)
@@ -1,3 +1,5 @@
+# coding: UTF-8
+
 require 'rdoc/test_case'
 
 class TestRDocRubyLex < RDoc::TestCase
@@ -133,6 +135,14 @@
     assert_equal expected, tokens
   end
 
+  def test_class_tokenize_identifier_high_unicode
+    tokens = RDoc::RubyLex.tokenize '', nil
+
+    expected = @TK::TkIDENTIFIER.new(0, 1, 0, '')
+
+    assert_equal expected, tokens.first
+  end
+
   def test_class_tokenize_percent_1
     tokens = RDoc::RubyLex.tokenize 'v%10==10', nil
 

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

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