diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-08 21:19:22 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-08 21:19:22 +0000 |
commit | 4eaf05c847bd32d246968b68c8d6c88381ce5c01 (patch) | |
tree | b380162e28d68f3a1fe072f50eb1fbff7a3e23bb | |
parent | 54fce8119a4697638ec1c37104f6b9d5d7cfe0c2 (diff) |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38277 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | lib/rdoc/markdown/entities.rb | 3 | ||||
-rw-r--r-- | lib/rdoc/parser/ruby.rb | 10 | ||||
-rw-r--r-- | lib/rdoc/ruby_lex.rb | 2 | ||||
-rw-r--r-- | test/rdoc/test_rdoc_ruby_lex.rb | 10 |
5 files changed, 28 insertions, 6 deletions
@@ -1,3 +1,12 @@ +Sun Dec 9 06:19:04 2012 Eric Hodel <[email protected]> + + * 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 <[email protected]> * eval.c (rb_mod_refine): don't override Module#include. It's diff --git a/lib/rdoc/markdown/entities.rb b/lib/rdoc/markdown/entities.rb index 2b45f20d37..0661abab78 100644 --- a/lib/rdoc/markdown/entities.rb +++ b/lib/rdoc/markdown/entities.rb @@ -1,3 +1,6 @@ +## +# HTML entity name map for RDoc::Markdown + RDoc::Markdown::HTML_ENTITIES = { "AElig" => [0x000C6], "AMP" => [0x00026], diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb index 31e31b5ce9..d42b70b516 100644 --- a/lib/rdoc/parser/ruby.rb +++ b/lib/rdoc/parser/ruby.rb @@ -1300,16 +1300,16 @@ class RDoc::Parser::Ruby < RDoc::Parser # # 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 ## diff --git a/lib/rdoc/ruby_lex.rb b/lib/rdoc/ruby_lex.rb index 845569b0bc..313e69ea47 100644 --- a/lib/rdoc/ruby_lex.rb +++ b/lib/rdoc/ruby_lex.rb @@ -857,7 +857,7 @@ class RDoc::RubyLex 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 diff --git a/test/rdoc/test_rdoc_ruby_lex.rb b/test/rdoc/test_rdoc_ruby_lex.rb index 1dc11e95a3..dfa350e018 100644 --- a/test/rdoc/test_rdoc_ruby_lex.rb +++ b/test/rdoc/test_rdoc_ruby_lex.rb @@ -1,3 +1,5 @@ +# coding: UTF-8 + require 'rdoc/test_case' class TestRDocRubyLex < RDoc::TestCase @@ -133,6 +135,14 @@ U 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 |