method
parse_constant_body
v2_2_9 -
Show latest stable
-
0 notes -
Class: Ruby
- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10 (0)
- 2_2_9 (0)
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
parse_constant_body(container, constant)
public
Hide source
# File lib/rdoc/parser/ruby.rb, line 899 def parse_constant_body container, constant # :nodoc: nest = 0 rhs_name = '' get_tkread tk = get_tk loop do case tk when TkSEMICOLON then break if nest <= 0 when TkLPAREN, TkfLPAREN, TkLBRACE, TkfLBRACE, TkLBRACK, TkfLBRACK, TkDO, TkIF, TkUNLESS, TkCASE, TkDEF, TkBEGIN then nest += 1 when TkRPAREN, TkRBRACE, TkRBRACK, TkEND then nest -= 1 when TkCOMMENT then if nest <= 0 and stop_at_EXPR_END then unget_tk tk break else unget_tk tk read_documentation_modifiers constant, RDoc::CONSTANT_MODIFIERS end when TkCONSTANT then rhs_name << tk.name if nest <= 0 and TkNL === peek_tk then create_module_alias container, constant, rhs_name break end when TkNL then if nest <= 0 and stop_at_EXPR_END then unget_tk tk break end when TkCOLON2, TkCOLON3 then rhs_name << '::' when nil then break end tk = get_tk end get_tkread_clean(/^[ \t]+/, '') end