method
cut_off
ruby latest stable - Class:
RDoc::RD::BlockParser
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v2_2_9) is shown here.
cut_off(src)private
Cuts off excess whitespace in src
# File lib/rdoc/rd/block_parser.rb, line 282
def cut_off(src)
ret = []
whiteline_buf = []
line = src.shift
/^\s*/ =~ line
indent = Regexp.quote($&)
ret.push($')
while line = src.shift
if /^(\s*)$/ =~ line
whiteline_buf.push(line)
elsif /^#{indent}/ =~ line
unless whiteline_buf.empty?
ret.concat(whiteline_buf)
whiteline_buf.clear
end
ret.push($')
else
raise "[BUG]: probably Parser Error while cutting off.\n"
end
end
ret
end Related methods
- Instance methods
- add_footnote
- add_label
- content
- line_index
- next_token
- on_error
- paragraph
- parse
- Class methods
- new
- Private methods
-
cut_off -
format_line_num -
get_included -
if_current_indent_equal -
parse_subtree -
set_term_to_element