# Parser for a specific block node
abstract class MdBlockParser
# Kind of block under construction
type BLOCK: MdBlock
# MdBlock under construction
fun block: BLOCK is abstract
# Line Start
var line_start: Int
# Column start
var column_start: Int
# Location at start
#
# The location end it initialized at `-1` and will be set later in the
# `finalize` method.
var location: MdLocation is lazy do return new MdLocation(line_start, column_start, -1, -1)
# Column where the content starts
var content_offset: Int
# Initialize the current `block`
fun initialize(parser: MdParser) do end
# Can `self` continue from the current `index` in `parser`?
#
# Return a new `MdBlockContinue` if `self` can continue parsing.
# Return null otherwise.
fun try_continue(state: MdParser): nullable MdBlockContinue is abstract
# Add `line` to the current `block`
fun add_line(line: String) do end
# Finalize the current `block`
#
# Deactivate `self` from `parser` and call `close_block`.
fun finalize(parser: MdParser) do
if parser.active_block_parser == self then
parser.deactivate_block_parser
end
end
# Parse `block` lines
fun parse_inlines(inline_parser: MdInlineParser) do end
end
lib/markdown2/markdown_block_parsing.nit:478,1--525,3