Add a few code comments

api
Lennart Spitzner 2019-12-20 01:20:07 +01:00
parent 6724760f40
commit af227a797d
3 changed files with 11 additions and 1 deletions

View File

@ -287,6 +287,8 @@ layoutBriDocM = \case
case mDP of
Nothing -> pure ()
Just (y, x) ->
-- we abuse this, as we probably will print the KW next, which is
-- _not_ a comment..
layoutMoveToCommentPos y (if shouldRestoreIndent then x else 0)
layoutBriDocM bd
BDNonBottomSpacing _ bd -> layoutBriDocM bd

View File

@ -173,6 +173,8 @@ layoutSetCommentCol = do
unless (Data.Maybe.isJust $ _lstate_commentCol state)
$ mSet state { _lstate_commentCol = Just col }
-- This is also used to move to non-comments in a couple of places. Seems
-- to be harmless so far..
layoutMoveToCommentPos
:: ( MonadMultiWriter Text.Builder.Builder m
, MonadMultiState LayoutState m

View File

@ -88,7 +88,13 @@ data LayoutState = LayoutState
-- move-to-DP at a start of a comment.
-- Necessary because some keyword DPs
-- are relative to the last non-comment
-- entity (for some reason)
-- entity (for some reason).
-- This is not very strictly reset to 0,
-- so we might in some cases get "artifacts"
-- from previous document elements.
-- But the worst effect at the moment would
-- be that we introduce less newlines on
-- moveToKWDP, which seems harmless enough.
}
lstate_baseY :: LayoutState -> Int