markdown2 :: MdListBlockParser :: block=
markdown2 :: MdListBlockParser :: bullet=
List bullet if unorderedmarkdown2 :: MdListBlockParser :: delim=
List delimiter if orderedmarkdown2 :: MdListBlockParser :: digit=
List digit if orderedmarkdown2 :: MdListBlockParser :: is_ordered=
Is this list orderedmarkdown2 $ MdListBlockParser :: BLOCK
Kind of block under constructionmarkdown2 $ MdListBlockParser :: SELF
Type of this instance, automatically specialized in every classmarkdown2 $ MdListBlockParser :: finalize
Finalize the currentblock
markdown2 $ MdListBlockParser :: parse_inlines
Parseblock
lines
markdown2 $ MdListBlockParser :: try_continue
Canself
continue from the current index
in parser
?
markdown2 :: MdListBlockParser :: block=
markdown2 :: MdListBlockParser :: bullet=
List bullet if unorderedcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
markdown2 :: MdBlockParser :: column_start=
Column startmarkdown2 :: MdBlockParser :: content_offset
Column where the content startsmarkdown2 :: MdBlockParser :: content_offset=
Column where the content startscore :: Object :: defaultinit
markdown2 :: MdListBlockParser :: delim=
List delimiter if orderedmarkdown2 :: MdListBlockParser :: digit=
List digit if orderedmarkdown2 :: MdBlockParser :: initialize
Initialize the currentblock
markdown2 :: MdListBlockParser :: is_ordered=
Is this list orderedcore :: 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
?
# List blocks parser
class MdListBlockParser
super MdBlockParser
redef type BLOCK: MdListBlock
redef var block is lazy do
if is_ordered then
return new MdOrderedList(location, digit.as(not null), delim.as(not null))
else
return new MdUnorderedList(location, bullet.as(not null))
end
end
# Is this list ordered
var is_ordered: Bool
# List bullet if unordered
var bullet: nullable Char
# List digit if ordered
var digit: nullable Int
# List delimiter if ordered
var delim: nullable Char
redef fun try_continue(state) do return new MdBlockContinue.at_index(state.index)
redef fun finalize(parser) do
super
var item = block.first_child
while item != null do
# check for non-final list item ending with blank line
if parser.ends_with_blank_line(item) and item.next != null then
block.is_tight = false
break
end
# recurse into children of list item to see if there are spaces between any of them
var sub_item = item.first_child
while sub_item != null do
if parser.ends_with_blank_line(sub_item) and
(item.next != null or sub_item.next != null) then
block.is_tight = false
break
end
sub_item = sub_item.next
end
item = item.next
end
end
redef fun parse_inlines(inline_parser) do
var last_child = block.last_child
if last_child != null then
location.line_end = last_child.location.line_end
location.column_end = last_child.location.column_end
end
end
end
lib/markdown2/markdown_block_parsing.nit:959,1--1018,3