yamlet
Safe HaskellNone
LanguageGHC2021

Yamlet.Internal.Comments

Description

Attachment of comments and empty lines to the nodes of a document.

The rules are in the documentation of Yamlet.Syntax. The parser skips comments, so this module finds them again in the input, outside of the scalars, and gives each one to a node.

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

Synopsis

Documentation

attachComments :: Env -> Bool -> Bool -> Int -> Maybe Int -> Int -> Int -> Document -> (Document, [Line]) Source #

Attach the comments of a document, and return the lines at its end that belong to the next document. The flags tell if the document is the first one and if another one follows it. The indices are the start of the lines that belong to the document, its --- marker, the end of its root and its end.

gapEnd :: Env -> Int -> Int Source #

The start of the first line from the index that is empty or has more than a comment or a ... marker. The index is the start of a line.

linesAbove :: [Line] -> [Document] -> [Document] Source #

The documents with the lines above the first one.