markdown2 :: MdIndentedCodeBlockParser :: content=
Block contentmarkdown2 :: MdIndentedCodeBlockParser :: use_tabs=
Indent is tab?markdown2 $ MdIndentedCodeBlockParser :: BLOCK
Kind of block under constructionmarkdown2 $ MdIndentedCodeBlockParser :: SELF
Type of this instance, automatically specialized in every classmarkdown2 $ MdIndentedCodeBlockParser :: add_line
Addline
to the current block
markdown2 $ MdIndentedCodeBlockParser :: finalize
Finalize the currentblock
markdown2 $ MdIndentedCodeBlockParser :: try_continue
Canself
continue from the current index
in parser
?
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
markdown2 :: MdBlockParser :: column_start=
Column startmarkdown2 :: MdIndentedCodeBlockParser :: content=
Block contentmarkdown2 :: MdBlockParser :: content_offset
Column where the content startsmarkdown2 :: MdBlockParser :: content_offset=
Column where the content startscore :: Object :: defaultinit
markdown2 :: MdBlockParser :: initialize
Initialize the currentblock
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
markdown2 :: MdBlockParser :: location=
Location at startcore :: Object :: output_class_name
Display class name on stdout (debug only).markdown2 :: MdBlockParser :: parse_inlines
Parseblock
lines
markdown2 :: MdBlockParser :: try_continue
Canself
continue from the current index
in parser
?
markdown2 :: MdIndentedCodeBlockParser :: use_tabs=
Indent is tab?
# Indented code blocks parser
class MdIndentedCodeBlockParser
super MdBlockParser
redef type BLOCK: MdIndentedCodeBlock
redef var block = new MdIndentedCodeBlock(location, use_tabs) is lazy
# Indent is tab?
var use_tabs: Bool
# Block content
var content = new Buffer
redef fun try_continue(state) do
if state.indent >= 4 then
return new MdBlockContinue.at_column(state.column + 4)
else if state.is_blank then
return new MdBlockContinue.at_index(state.next_non_space_index)
end
return null
end
redef fun add_line(line) do
if not content.is_empty then
content.add('\n')
end
content.append(line)
end
redef fun finalize(parser) do
super
add_line(" ")
var content = self.content.to_s
var literal = content.replace_first(re_trailing_blank_lines, "\n")
block.literal = literal
var lines = literal.split("\n")
location.line_end = location.line_start + lines.length - 2
location.column_end = content_offset + lines[lines.length - 2].length + 4
end
end
lib/markdown2/markdown_block_parsing.nit:780,1--821,3