Headings parser

Introduced properties

protected fun block=(block: BLOCK)

markdown2 :: MdHeadingParser :: block=

protected fun column_end=(column_end: Int)

markdown2 :: MdHeadingParser :: column_end=

Column end
fun content: String

markdown2 :: MdHeadingParser :: content

Heading content
protected fun content=(content: String)

markdown2 :: MdHeadingParser :: content=

Heading content
init defaultinit(line_start: Int, column_start: Int, content_offset: Int, line_end: Int, column_end: Int, level: Int, content: String, has_atx_trailing: Bool, is_setext: Bool)

markdown2 :: MdHeadingParser :: defaultinit

fun has_atx_trailing: Bool

markdown2 :: MdHeadingParser :: has_atx_trailing

Heading has ATX trailing
protected fun has_atx_trailing=(has_atx_trailing: Bool)

markdown2 :: MdHeadingParser :: has_atx_trailing=

Heading has ATX trailing
fun is_setext: Bool

markdown2 :: MdHeadingParser :: is_setext

Heading is setext format
protected fun is_setext=(is_setext: Bool)

markdown2 :: MdHeadingParser :: is_setext=

Heading is setext format
fun level: Int

markdown2 :: MdHeadingParser :: level

Heading level
protected fun level=(level: Int)

markdown2 :: MdHeadingParser :: level=

Heading level
protected fun line_end=(line_end: Int)

markdown2 :: MdHeadingParser :: line_end=

Line end

Redefined properties

redef type BLOCK: MdHeading

markdown2 $ MdHeadingParser :: BLOCK

Kind of block under construction
redef type SELF: MdHeadingParser

markdown2 $ MdHeadingParser :: SELF

Type of this instance, automatically specialized in every class
redef fun block: BLOCK

markdown2 $ MdHeadingParser :: block

MdBlock under construction
redef fun location: MdLocation

markdown2 $ MdHeadingParser :: location

Location at start
redef fun location=(location: MdLocation)

markdown2 $ MdHeadingParser :: location=

Location at start
redef fun parse_inlines(inline_parser: MdInlineParser)

markdown2 $ MdHeadingParser :: parse_inlines

Parse the heading content
redef fun try_continue(state: MdParser): nullable MdBlockContinue

markdown2 $ MdHeadingParser :: try_continue

Never continue parsing as an heading is a one liner

All properties

fun !=(other: nullable Object): Bool

core :: Object :: !=

Have self and other different values?
fun ==(other: nullable Object): Bool

core :: Object :: ==

Have self and other the same value?
type BLOCK: MdBlock

markdown2 :: MdBlockParser :: BLOCK

Kind of block under construction
type CLASS: Class[SELF]

core :: Object :: CLASS

The type of the class of self.
type SELF: Object

core :: Object :: SELF

Type of this instance, automatically specialized in every class
fun add_line(line: String)

markdown2 :: MdBlockParser :: add_line

Add line to the current block
abstract fun block: BLOCK

markdown2 :: MdBlockParser :: block

MdBlock under construction
protected fun block=(block: BLOCK)

markdown2 :: MdHeadingParser :: block=

protected fun class_factory(name: String): CLASS

core :: Object :: class_factory

Implementation used by get_class to create the specific class.
fun class_name: String

core :: Object :: class_name

The class name of the object.
protected fun column_end=(column_end: Int)

markdown2 :: MdHeadingParser :: column_end=

Column end
protected fun column_start=(column_start: Int)

markdown2 :: MdBlockParser :: column_start=

Column start
fun content: String

markdown2 :: MdHeadingParser :: content

Heading content
protected fun content=(content: String)

markdown2 :: MdHeadingParser :: content=

Heading content
fun content_offset: Int

markdown2 :: MdBlockParser :: content_offset

Column where the content starts
protected fun content_offset=(content_offset: Int)

markdown2 :: MdBlockParser :: content_offset=

Column where the content starts
init defaultinit(line_start: Int, column_start: Int, content_offset: Int)

markdown2 :: MdBlockParser :: defaultinit

init defaultinit(line_start: Int, column_start: Int, content_offset: Int, line_end: Int, column_end: Int, level: Int, content: String, has_atx_trailing: Bool, is_setext: Bool)

markdown2 :: MdHeadingParser :: defaultinit

fun finalize(parser: MdParser)

markdown2 :: MdBlockParser :: finalize

Finalize the current block
fun get_class: CLASS

core :: Object :: get_class

The meta-object representing the dynamic type of self.
fun has_atx_trailing: Bool

markdown2 :: MdHeadingParser :: has_atx_trailing

Heading has ATX trailing
protected fun has_atx_trailing=(has_atx_trailing: Bool)

markdown2 :: MdHeadingParser :: has_atx_trailing=

Heading has ATX trailing
fun hash: Int

core :: Object :: hash

The hash code of the object.
init init

core :: Object :: init

fun initialize(parser: MdParser)

markdown2 :: MdBlockParser :: initialize

Initialize the current block
fun inspect: String

core :: Object :: inspect

Developer readable representation of self.
protected fun inspect_head: String

core :: Object :: inspect_head

Return "CLASSNAME:#OBJECTID".
intern fun is_same_instance(other: nullable Object): Bool

core :: Object :: is_same_instance

Return true if self and other are the same instance (i.e. same identity).
fun is_same_serialized(other: nullable Object): Bool

core :: Object :: is_same_serialized

Is self the same as other in a serialization context?
intern fun is_same_type(other: Object): Bool

core :: Object :: is_same_type

Return true if self and other have the same dynamic type.
fun is_setext: Bool

markdown2 :: MdHeadingParser :: is_setext

Heading is setext format
protected fun is_setext=(is_setext: Bool)

markdown2 :: MdHeadingParser :: is_setext=

Heading is setext format
fun level: Int

markdown2 :: MdHeadingParser :: level

Heading level
protected fun level=(level: Int)

markdown2 :: MdHeadingParser :: level=

Heading level
protected fun line_end=(line_end: Int)

markdown2 :: MdHeadingParser :: line_end=

Line end
protected fun line_start=(line_start: Int)

markdown2 :: MdBlockParser :: line_start=

Line Start
fun location: MdLocation

markdown2 :: MdBlockParser :: location

Location at start
protected fun location=(location: MdLocation)

markdown2 :: MdBlockParser :: location=

Location at start
intern fun object_id: Int

core :: Object :: object_id

An internal hash code for the object based on its identity.
fun output

core :: Object :: output

Display self on stdout (debug only).
intern fun output_class_name

core :: Object :: output_class_name

Display class name on stdout (debug only).
fun parse_inlines(inline_parser: MdInlineParser)

markdown2 :: MdBlockParser :: parse_inlines

Parse block lines
fun serialization_hash: Int

core :: Object :: serialization_hash

Hash value use for serialization
intern fun sys: Sys

core :: Object :: sys

Return the global sys object, the only instance of the Sys class.
abstract fun to_jvalue(env: JniEnv): JValue

core :: Object :: to_jvalue

fun to_s: String

core :: Object :: to_s

User readable representation of self.
abstract fun try_continue(state: MdParser): nullable MdBlockContinue

markdown2 :: MdBlockParser :: try_continue

Can self continue from the current index in parser?
package_diagram markdown2::MdHeadingParser MdHeadingParser markdown2::MdBlockParser MdBlockParser markdown2::MdHeadingParser->markdown2::MdBlockParser core::Object Object markdown2::MdBlockParser->core::Object ...core::Object ... ...core::Object->core::Object

Ancestors

interface Object

core :: Object

The root of the class hierarchy.

Parents

abstract class MdBlockParser

markdown2 :: MdBlockParser

Parser for a specific block node

Class definitions

markdown2 $ MdHeadingParser
# Headings parser
class MdHeadingParser
	super MdBlockParser

	redef type BLOCK: MdHeading

	redef var block = new MdHeading(location, level, is_setext, has_atx_trailing) is lazy

	redef var location = new MdLocation(line_start, column_start, line_end, column_end) is lazy

	# Line end
	var line_end: Int

	# Column end
	var column_end: Int

	# Heading level
	var level: Int

	# Heading content
	var content: String

	# Heading has ATX trailing
	var has_atx_trailing: Bool

	# Heading is setext format
	var is_setext: Bool

	# Never continue parsing as an heading is a one liner
	redef fun try_continue(state) do return null

	# Parse the heading content
	redef fun parse_inlines(inline_parser) do
		inline_parser.parse(content, content_offset, block)
	end
end
lib/markdown2/markdown_block_parsing.nit:623,1--658,3