summaryrefslogtreecommitdiff
path: root/lib/rdoc/parser/ruby.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-10 06:36:13 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-10 06:36:13 +0000
commit1325437297539bf433904b64db63a3186e62177e (patch)
tree01608a107ec3939b1013152d961b6407a5ba9c25 /lib/rdoc/parser/ruby.rb
parentce2b574017cacc2c3f2b0e92f82a7f250639fc34 (diff)
* lib/rdoc: Import RDoc 2.5.2
* lib/rdoc/parser/ruby.rb (RDoc::Parser::Ruby): Don't parse rdoc files, reverts r24976 in favor of include directive support in C parser. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/parser/ruby.rb')
-rw-r--r--lib/rdoc/parser/ruby.rb27
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/rdoc/parser/ruby.rb b/lib/rdoc/parser/ruby.rb
index 7550508b81..b1684a6900 100644
--- a/lib/rdoc/parser/ruby.rb
+++ b/lib/rdoc/parser/ruby.rb
@@ -146,7 +146,7 @@ $TOKEN_DEBUG ||= nil
class RDoc::Parser::Ruby < RDoc::Parser
- parse_files_matching(/\.(?:rbw?|rdoc)\z/)
+ parse_files_matching(/\.rbw?$/)
include RDoc::RubyToken
include RDoc::TokenStream
@@ -212,7 +212,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
def error(msg)
msg = make_message msg
$stderr.puts msg
- exit(false)
+ exit false
end
##
@@ -377,10 +377,9 @@ class RDoc::Parser::Ruby < RDoc::Parser
# This routine modifies it's parameter
def look_for_directives_in(context, comment)
- preprocess = RDoc::Markup::PreProcess.new(@file_name,
- @options.rdoc_include)
+ preprocess = RDoc::Markup::PreProcess.new @file_name, @options.rdoc_include
- preprocess.handle(comment) do |directive, param|
+ preprocess.handle comment do |directive, param|
case directive
when 'enddoc' then
throw :enddoc
@@ -391,7 +390,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
'attr', 'attr_accessor', 'attr_reader', 'attr_writer' then
false # handled elsewhere
when 'section' then
- context.set_current_section(param, comment)
+ context.set_current_section param, comment
comment.replace ''
break
when 'startdoc' then
@@ -405,7 +404,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
@options.title = param
''
else
- warn "Unrecognized directive '#{directive}'"
+ warn "Unrecognized directive :#{directive}:"
false
end
end
@@ -1405,16 +1404,12 @@ class RDoc::Parser::Ruby < RDoc::Parser
end
end
- def parse_yield_parameters
- parse_method_or_yield_parameters
- end
-
def parse_yield(context, single, tk, method)
- if method.block_params.nil?
- get_tkread
- @scanner.instance_eval{@continue = false}
- method.block_params = parse_yield_parameters
- end
+ return if method.block_params
+
+ get_tkread
+ @scanner.instance_eval { @continue = false }
+ method.block_params = parse_method_or_yield_parameters
end
##