зеркало из https://github.com/github/ruby.git
* 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:
Родитель
54fce8119a
Коммит
4eaf05c847
|
@ -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>
|
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
|
* 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 = {
|
RDoc::Markdown::HTML_ENTITIES = {
|
||||||
"AElig" => [0x000C6],
|
"AElig" => [0x000C6],
|
||||||
"AMP" => [0x00026],
|
"AMP" => [0x00026],
|
||||||
|
|
|
@ -1300,17 +1300,17 @@ class RDoc::Parser::Ruby < RDoc::Parser
|
||||||
#
|
#
|
||||||
# and add this as the block_params for the method
|
# 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 = parse_method_or_yield_parameters method
|
||||||
|
|
||||||
res = "(#{res})" unless res =~ /\A\(/
|
res = "(#{res})" unless res =~ /\A\(/
|
||||||
method.params = res unless method.params
|
method.params = res unless method.params
|
||||||
|
|
||||||
if method.block_params.nil? then
|
return if method.block_params
|
||||||
|
|
||||||
skip_tkspace false
|
skip_tkspace false
|
||||||
read_documentation_modifiers method, RDoc::METHOD_MODIFIERS
|
read_documentation_modifiers method, RDoc::METHOD_MODIFIERS
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Parses an RDoc::NormalModule in +container+ with +comment+
|
# Parses an RDoc::NormalModule in +container+ with +comment+
|
||||||
|
|
|
@ -857,7 +857,7 @@ class RDoc::RubyLex
|
||||||
end
|
end
|
||||||
|
|
||||||
IDENT_RE = if defined? Encoding then
|
IDENT_RE = if defined? Encoding then
|
||||||
/[\w\u0080-\uFFFF]/u
|
eval '/[\w\u{0080}-\u{FFFFF}]/u' # 1.8 can't parse \u{}
|
||||||
else
|
else
|
||||||
/[\w\x80-\xFF]/
|
/[\w\x80-\xFF]/
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# coding: UTF-8
|
||||||
|
|
||||||
require 'rdoc/test_case'
|
require 'rdoc/test_case'
|
||||||
|
|
||||||
class TestRDocRubyLex < RDoc::TestCase
|
class TestRDocRubyLex < RDoc::TestCase
|
||||||
|
@ -133,6 +135,14 @@ U
|
||||||
assert_equal expected, tokens
|
assert_equal expected, tokens
|
||||||
end
|
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
|
def test_class_tokenize_percent_1
|
||||||
tokens = RDoc::RubyLex.tokenize 'v%10==10', nil
|
tokens = RDoc::RubyLex.tokenize 'v%10==10', nil
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче