1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Enable RDoc debugging only with $DEBUG_RDOC

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
drbrain 2007-12-25 00:13:12 +00:00
parent 951200ac63
commit 29962f8fb6
5 changed files with 32 additions and 28 deletions

View file

@ -1,13 +1,17 @@
Tue Dec 25 09:12:13 2007 Eric Hodel <drbrain@segment7.net>
* lib/rdoc/: Enable RDoc debugging only with $DEBUG_RDOC.
Tue Dec 25 08:37:43 2007 James Edward Gray II <jeg2@ruby-lang.org> Tue Dec 25 08:37:43 2007 James Edward Gray II <jeg2@ruby-lang.org>
* lib/csv.rb, test/csv/test_csv.rb: Removed in preparation for FasterCSV * lib/csv.rb, test/csv/test_csv.rb: Removed in preparation for
code import. FasterCSV code import.
Tue Dec 25 08:27:43 2007 Eric Hodel <drbrain@segment7.net> Tue Dec 25 08:27:43 2007 Eric Hodel <drbrain@segment7.net>
* lib/rubygems.rb: Fix test failures. * lib/rubygems.rb: Fix test failures.
* test/rubygems/test_gem.rb: Fix test failure. * test/rubygems/test_gem.rb: Fix test failure.
Tue Dec 25 06:23:40 2007 Koichi Sasada <ko1@atdot.net> Tue Dec 25 06:23:40 2007 Koichi Sasada <ko1@atdot.net>

View file

@ -236,7 +236,7 @@ module RDoc
end end
def add_method(a_method) def add_method(a_method)
puts "Adding #@visibility method #{a_method.name} to #@name" if $DEBUG puts "Adding #@visibility method #{a_method.name} to #@name" if $DEBUG_RDOC
a_method.visibility = @visibility a_method.visibility = @visibility
add_to(@method_list, a_method) add_to(@method_list, a_method)
end end
@ -280,10 +280,10 @@ module RDoc
def add_class_or_module(collection, class_type, name, superclass=nil) def add_class_or_module(collection, class_type, name, superclass=nil)
cls = collection[name] cls = collection[name]
if cls if cls
puts "Reusing class/module #{name}" if $DEBUG puts "Reusing class/module #{name}" if $DEBUG_RDOC
else else
cls = class_type.new(name, superclass) cls = class_type.new(name, superclass)
puts "Adding class/module #{name} to #@name" if $DEBUG puts "Adding class/module #{name} to #@name" if $DEBUG_RDOC
# collection[name] = cls if @document_self && !@done_documenting # collection[name] = cls if @document_self && !@done_documenting
collection[name] = cls if !@done_documenting collection[name] = cls if !@done_documenting
cls.parent = self cls.parent = self
@ -497,7 +497,7 @@ module RDoc
def add_class_or_module(collection, class_type, name, superclass) def add_class_or_module(collection, class_type, name, superclass)
cls = collection[name] cls = collection[name]
if cls if cls
puts "Reusing class/module #{name}" if $DEBUG puts "Reusing class/module #{name}" if $DEBUG_RDOC
else else
if class_type == NormalModule if class_type == NormalModule
all = @@all_modules all = @@all_modules
@ -509,7 +509,7 @@ module RDoc
cls = class_type.new(name, superclass) cls = class_type.new(name, superclass)
all[name] = cls unless @done_documenting all[name] = cls unless @done_documenting
end end
puts "Adding class/module #{name} to #@name" if $DEBUG puts "Adding class/module #{name} to #@name" if $DEBUG_RDOC
collection[name] = cls unless @done_documenting collection[name] = cls unless @done_documenting
cls.parent = self cls.parent = self
end end

View file

@ -246,17 +246,17 @@ module SM
def flow(str) def flow(str)
@str = str @str = str
puts("Before flow, str='#{@str.dump}'") if $DEBUG puts("Before flow, str='#{@str.dump}'") if $DEBUG_RDOC
mask_protected_sequences mask_protected_sequences
@attrs = AttrSpan.new(@str.length) @attrs = AttrSpan.new(@str.length)
puts("After protecting, str='#{@str.dump}'") if $DEBUG puts("After protecting, str='#{@str.dump}'") if $DEBUG_RDOC
convert_attrs(@str, @attrs) convert_attrs(@str, @attrs)
convert_html(@str, @attrs) convert_html(@str, @attrs)
convert_specials(str, @attrs) convert_specials(str, @attrs)
unmask_protected_sequences unmask_protected_sequences
puts("After flow, str='#{@str.dump}'") if $DEBUG puts("After flow, str='#{@str.dump}'") if $DEBUG_RDOC
return split_into_flow return split_into_flow
end end
@ -284,7 +284,7 @@ module SM
def split_into_flow def split_into_flow
display_attributes if $DEBUG display_attributes if $DEBUG_RDOC
res = [] res = []
current_attr = 0 current_attr = 0

View file

@ -386,7 +386,7 @@ class Options
case opt case opt
when "--all" then @show_all = true when "--all" then @show_all = true
when "--charset" then @charset = arg when "--charset" then @charset = arg
when "--debug" then $DEBUG = true when "--debug" then $DEBUG_RDOC = true
when "--exclude" then @exclude << Regexp.new(arg) when "--exclude" then @exclude << Regexp.new(arg)
when "--inline-source" then @inline_source = true when "--inline-source" then @inline_source = true
when "--line-numbers" then @include_line_numbers = true when "--line-numbers" then @include_line_numbers = true

View file

@ -23,7 +23,7 @@ require "rdoc/markup/simple_markup/preprocess"
require "rdoc/parsers/parserfactory" require "rdoc/parsers/parserfactory"
$TOKEN_DEBUG = $DEBUG $TOKEN_DEBUG = $DEBUG_RDOC
# Definitions of all tokens involved in the lexical analysis # Definitions of all tokens involved in the lexical analysis
@ -544,7 +544,7 @@ class RubyLex
get_read get_read
end end
# throw :eof unless tk # throw :eof unless tk
p tk if $DEBUG p tk if $DEBUG_RDOC
tk tk
end end
@ -1666,21 +1666,21 @@ module RDoc
when TkUNTIL, TkWHILE when TkUNTIL, TkWHILE
nest += 1 nest += 1
puts "FOUND #{tk.class} in #{container.name}, nest = #{nest}, " + puts "FOUND #{tk.class} in #{container.name}, nest = #{nest}, " +
"line #{tk.line_no}" if $DEBUG "line #{tk.line_no}" if $DEBUG_RDOC
skip_optional_do_after_expression skip_optional_do_after_expression
# 'for' is trickier # 'for' is trickier
when TkFOR when TkFOR
nest += 1 nest += 1
puts "FOUND #{tk.class} in #{container.name}, nest = #{nest}, " + puts "FOUND #{tk.class} in #{container.name}, nest = #{nest}, " +
"line #{tk.line_no}" if $DEBUG "line #{tk.line_no}" if $DEBUG_RDOC
skip_for_variable skip_for_variable
skip_optional_do_after_expression skip_optional_do_after_expression
when TkCASE, TkDO, TkIF, TkUNLESS, TkBEGIN when TkCASE, TkDO, TkIF, TkUNLESS, TkBEGIN
nest += 1 nest += 1
puts "Found #{tk.class} in #{container.name}, nest = #{nest}, " + puts "Found #{tk.class} in #{container.name}, nest = #{nest}, " +
"line #{tk.line_no}" if $DEBUG "line #{tk.line_no}" if $DEBUG_RDOC
when TkIDENTIFIER when TkIDENTIFIER
if nest == 1 and current_method.nil? if nest == 1 and current_method.nil?
@ -1710,8 +1710,8 @@ module RDoc
when TkEND when TkEND
nest -= 1 nest -= 1
puts "Found 'end' in #{container.name}, nest = #{nest}, line #{tk.line_no}" if $DEBUG puts "Found 'end' in #{container.name}, nest = #{nest}, line #{tk.line_no}" if $DEBUG_RDOC
puts "Method = #{current_method.name}" if $DEBUG and current_method puts "Method = #{current_method.name}" if $DEBUG_RDOC and current_method
if nest == 0 if nest == 0
read_documentation_modifiers(container, CLASS_MODIFIERS) read_documentation_modifiers(container, CLASS_MODIFIERS)
container.ongoing_visibility = save_visibility container.ongoing_visibility = save_visibility
@ -1846,7 +1846,7 @@ module RDoc
loop do loop do
puts("Param: #{tk}, #{@scanner.continue} " + puts("Param: #{tk}, #{@scanner.continue} " +
"#{@scanner.lex_state} #{nest}") if $DEBUG "#{@scanner.lex_state} #{nest}") if $DEBUG_RDOC
case tk case tk
when TkSEMICOLON when TkSEMICOLON
@ -2042,7 +2042,7 @@ module RDoc
loop do loop do
puts("Param: #{tk.inspect}, #{@scanner.continue} " + puts("Param: #{tk.inspect}, #{@scanner.continue} " +
"#{@scanner.lex_state} #{nest}") if $DEBUG "#{@scanner.lex_state} #{nest}") if $DEBUG_RDOC
case tk case tk
when TkSEMICOLON when TkSEMICOLON
break break
@ -2098,7 +2098,7 @@ module RDoc
loop do loop do
puts("\nWhile: #{tk}, #{@scanner.continue} " + puts("\nWhile: #{tk}, #{@scanner.continue} " +
"#{@scanner.lex_state} #{nest}") if $DEBUG "#{@scanner.lex_state} #{nest}") if $DEBUG_RDOC
case tk case tk
when TkSEMICOLON when TkSEMICOLON
break break
@ -2169,7 +2169,7 @@ module RDoc
loop do loop do
puts("Call param: #{tk}, #{@scanner.continue} " + puts("Call param: #{tk}, #{@scanner.continue} " +
"#{@scanner.lex_state} #{nest}") if $DEBUG "#{@scanner.lex_state} #{nest}") if $DEBUG_RDOC
case tk case tk
when TkSEMICOLON when TkSEMICOLON
break break
@ -2251,7 +2251,7 @@ module RDoc
def read_directive(allowed) def read_directive(allowed)
tk = get_tk tk = get_tk
puts "directive: #{tk.inspect}" if $DEBUG puts "directive: #{tk.inspect}" if $DEBUG_RDOC
result = nil result = nil
if tk.kind_of?(TkCOMMENT) if tk.kind_of?(TkCOMMENT)
if tk.text =~ /\s*:?(\w+):\s*(.*)/ if tk.text =~ /\s*:?(\w+):\s*(.*)/
@ -2560,7 +2560,7 @@ module RDoc
break break
when TkCOMMA when TkCOMMA
else else
warn("unexpected token: '#{tk2.inspect}'") if $DEBUG warn("unexpected token: '#{tk2.inspect}'") if $DEBUG_RDOC
break break
end end
end end
@ -2598,7 +2598,7 @@ module RDoc
when TkSTRING when TkSTRING
eval @read[-1] eval @read[-1]
else else
warn("Expected symbol or string, got #{tk.inspect}") if $DEBUG warn("Expected symbol or string, got #{tk.inspect}") if $DEBUG_RDOC
nil nil
end end
end end