Add a few code comments
parent
6724760f40
commit
af227a797d
|
@ -287,6 +287,8 @@ layoutBriDocM = \case
|
||||||
case mDP of
|
case mDP of
|
||||||
Nothing -> pure ()
|
Nothing -> pure ()
|
||||||
Just (y, x) ->
|
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)
|
layoutMoveToCommentPos y (if shouldRestoreIndent then x else 0)
|
||||||
layoutBriDocM bd
|
layoutBriDocM bd
|
||||||
BDNonBottomSpacing _ bd -> layoutBriDocM bd
|
BDNonBottomSpacing _ bd -> layoutBriDocM bd
|
||||||
|
|
|
@ -173,6 +173,8 @@ layoutSetCommentCol = do
|
||||||
unless (Data.Maybe.isJust $ _lstate_commentCol state)
|
unless (Data.Maybe.isJust $ _lstate_commentCol state)
|
||||||
$ mSet state { _lstate_commentCol = Just col }
|
$ 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
|
layoutMoveToCommentPos
|
||||||
:: ( MonadMultiWriter Text.Builder.Builder m
|
:: ( MonadMultiWriter Text.Builder.Builder m
|
||||||
, MonadMultiState LayoutState m
|
, MonadMultiState LayoutState m
|
||||||
|
|
|
@ -88,7 +88,13 @@ data LayoutState = LayoutState
|
||||||
-- move-to-DP at a start of a comment.
|
-- move-to-DP at a start of a comment.
|
||||||
-- Necessary because some keyword DPs
|
-- Necessary because some keyword DPs
|
||||||
-- are relative to the last non-comment
|
-- 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
|
lstate_baseY :: LayoutState -> Int
|
||||||
|
|
Loading…
Reference in New Issue