Module rustla::parser::types_and_aliases[][src]

A submodule that contains Parser-related type aliases.

Copyright © 2020 Santtu Söderholm

Enums

IndentationMatch

A enumeration of the different ways a node’s child indentation might interact with the indentation of the parent.

IndentedBlockResult

A enumeration of the different ways the function Parser::read_indented_block could succeed or fail.

InlineParsingResult

An enumeration of the different ways an inline parsing function might succeed or fail.

LineAdvance

An enum returned by the transition methods to tell the parser whether it needs to advance its line cursor after the method execution or not.

PushOrPop

An enum for manipulating the machine stack. Transition methods should return this information with a possible next state, so the parser knows how to proceed. The Push variant signifies a state should be pushed on top of the stack, Pop tells of the need to pop from the stack and Neither initiates a transition of the current state into another one.

TextBlockResult

A enumeration of the different ways the function Parser::read_text_block could succeed or fail.

TransitionResult

An enumeration of the different results, including errors, that a transition function might have.

Type Definitions

InlineParsingMethod

A type alias for a function describing an inline transition. Returns a node a length of the match, so that the inline parser could determine how many characters to eat off the start of the source string.

InlineTransition

A type alias for a tuple (PatternName, regex pattern, InlineTransitionMethod).

Transition

A type alias for a tuple (PatternName, Regex, TransitionMethod)

TransitionMethod

A function pointer type alias for a State transition method. TransitionMethods take in the document tree and regex captures for doctree modifications. They return a TransitionResult::{Success, Failure}, the success variant of which contains a doctree, a possible next state for the parser, information about manipulating the machine stack and whether to advance the parser line cursor. If the optional next state is not None, the current state is either replaced with the new state or the new state is pushed on top of the machine stack of the parser and parsing proceeds in that state from the current line.

UncompiledTransition

A type alias for a transition (PatternName, regex_pattern, TransitionMethod), whose regex pattern has not been compiled into a DFA yet.