method
parse_constant
v1_8_6_287 -
Show latest stable
- Class:
RDoc::RubyParser
parse_constant(container, single, tk, comment)private
No documentation available.
# File lib/rdoc/parsers/parse_rb.rb, line 1827
def parse_constant(container, single, tk, comment)
name = tk.name
skip_tkspace(false)
eq_tk = get_tk
unless eq_tk.kind_of?(TkASSIGN)
unget_tk(eq_tk)
return
end
nest = 0
get_tkread
tk = get_tk
if tk.kind_of? TkGT
unget_tk(tk)
unget_tk(eq_tk)
return
end
loop do
puts("Param: #{tk}, #{@scanner.continue} " +
"#{@scanner.lex_state} #{nest}") if $DEBUG
case tk
when TkSEMICOLON
break
when TkLPAREN, TkfLPAREN
nest += 1
when TkRPAREN
nest -= 1
when TkCOMMENT
if nest <= 0 && @scanner.lex_state == EXPR_END
unget_tk(tk)
break
end
when TkNL
if (@scanner.lex_state == EXPR_END and nest <= 0) || [email protected]
unget_tk(tk)
break
end
end
tk = get_tk
end
res = get_tkread.tr("\n", " ").strip
res = "" if res == ";"
con = Constant.new(name, res, comment)
read_documentation_modifiers(con, CONSTANT_MODIFIERS)
if con.document_self
container.add_constant(con)
end
end