* 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
This commit is contained in:
drbrain 2012-12-08 21:19:22 +00:00
Родитель 54fce8119a
Коммит 4eaf05c847
5 изменённых файлов: 28 добавлений и 6 удалений

Просмотреть файл

@ -1,3 +1,12 @@
Sun Dec 9 06:19:04 2012 Eric Hodel <drbrain@segment7.net>
* 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@ruby-lang.org>
* eval.c (rb_mod_refine): don't override Module#include. It's

Просмотреть файл

@ -1,3 +1,6 @@
##
# HTML entity name map for RDoc::Markdown
RDoc::Markdown::HTML_ENTITIES = {
"AElig" => [0x000C6],
"AMP" => [0x00026],

Просмотреть файл

@ -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
##

Просмотреть файл

@ -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

Просмотреть файл

@ -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