Inline Cursor #
InlineCursor steps through the lines of an InlineSource with drop1, skipping the gaps between
lines that contain block markers and removed indentation. InlineContext is the reader state of the
inline parser.
A cursor into an InlineSource, analogous to a slice of a String. It consists of the current
position, the end of the input, and the index of the line that contains the current position. A
parser that is given a cursor reads the text from the current position to the end of the input and
nothing else.
- source : InlineSource s
The source that is being tokenized.
- line : Nat
The index in
source.linesof the line that containsstartPos, orsource.lines.sizeif it is not contained in any line. - startPos : s.Pos
The position of the next character to read.
- stopPos : s.Pos
The position after the last character that the cursor may read.
It is at most the end of the last line of
source. It is before the end of the last line when the cursor is limited to a part of the source, such as the text between a pair of brackets.
Instances For
Equations
A cursor at startPos whose input ends at stopPos.
Equations
Instances For
Whether the input has been fully consumed.
Instances For
The character at the cursor, or the default character if no input remains.
Instances For
The input after the cursor, as a subslice.
Equations
- cur.toSubslice = Lean.Markdown.subsliceClamped cur.startPos cur.stopPos
Instances For
The character at the cursor as a subslice, if input remains.
Equations
Instances For
Advances the cursor by one character. At the end of a line, the cursor moves to the start of the next line, skipping the gap between them.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Parses a line ending, which is \r\n, \r, or \n (CommonMark §2.1), at cur. Returns the
ending as a subslice together with the cursor after it. The ending stops at the end of the input,
so a \r just before it is a line ending by itself.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Advances past the characters at the start of cur that satisfy p.
If cur begins with c, returns that character as a subslice together with cur advanced past it.
Equations
Instances For
Advances past a sequence of cs at the start of cur. Returns the cursor after the sequence and
its length.
Equations
Instances For
Information needed during parsing the inline contents of a block.
- refs : RefTable s
The link reference definitions of the entire document.
- src : InlineSource s
The content to be parsed.
- extensions : Extensions
The non-standard Markdown extensions that are enabled.
Instances For
The link reference definitions of the entire document.
Equations
- Lean.Markdown.refTable = do let __do_lift ← read pure __do_lift.refs
Instances For
The content to be parsed.
Equations
- Lean.Markdown.inlineSource = do let __do_lift ← read pure __do_lift.src
Instances For
The non-standard Markdown extensions that are enabled.
Equations
- Lean.Markdown.extensions = do let __do_lift ← read pure __do_lift.extensions