yamlet
Safe HaskellNone
LanguageGHC2021

Yamlet.Internal.Parser.Scan

Description

Scans of the input around an index, outside of the parser monad.

This module is intended for internal use only, and may change without warning in subsequent releases.

Synopsis

Documentation

isBom :: Env -> Int -> Bool Source #

skipBoms :: Env -> Int -> Int Source #

skipSpaces :: Env -> Int -> Int Source #

skipWhites :: Env -> Int -> Int Source #

breakEnd :: Env -> Int -> Int Source #

The index after the line break at the index.

isStartOfLine :: Env -> Int -> Bool Source #

lineStartAt :: Env -> Int -> Int Source #

The start of the line that contains the index.

previousLineStart :: Env -> Int -> Int Source #

The start of the line above the line that starts at the index, which is not the first line.

lineEndAt :: Env -> Int -> Int Source #

The index of the line break that ends the line of the index, or the end of the input.

nextLineStart :: Env -> Int -> Int Source #

The start of the line below the line of the index, or the end of the input.

contentLineAbove :: Env -> Int -> Maybe Int Source #

The start of the closest line above the line that starts at the index with content other than a comment. Byte order marks at the start of a line do not count as content.

markerLength :: Int Source #

The number of characters of a --- or ... marker.

isMarker :: Env -> Int -> Bool Source #

A --- or ... marker at the start of a line.

isStartMarker :: Env -> Int -> Bool Source #

A --- marker at the start of a line.

isEndMarker :: Env -> Int -> Bool Source #

A ... marker at the start of a line.

startsPrefix :: Env -> Int -> Bool Source #

A byte order mark at the start of a line. Outside a quoted scalar, it starts the prefix of the next document, so the content of a document ends before it.

bomBeforeContent :: Env -> Int -> Bool Source #

Byte order marks at the index before something other than a document marker or a directive. Such marks at the start of a line inside a document are an error.

canEndFlowNode :: Env -> Int -> Bool Source #

A quoted scalar or a flow collection can end before the index: white space, a comment, a line break, the end of the input, a colon or the end of a flow entry follows.

fitsKey :: Env -> Int -> Int -> Bool Source #

The input between the indices fits in an implicit key.