From 0efcc41abdd4c99790a8ac258dcb312a0ca46146 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Sat, 11 May 2024 15:25:03 -0500 Subject: [PATCH] yet more comments --- src/swarm-lang/Swarm/Language/Syntax.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/swarm-lang/Swarm/Language/Syntax.hs b/src/swarm-lang/Swarm/Language/Syntax.hs index 91695a3a4..d6d882e66 100644 --- a/src/swarm-lang/Swarm/Language/Syntax.hs +++ b/src/swarm-lang/Swarm/Language/Syntax.hs @@ -1156,9 +1156,10 @@ data CommentType = LineComment | BlockComment data CommentSituation = StandaloneComment | SuffixComment deriving (Eq, Ord, Read, Show, Enum, Bounded, Generic, Data, ToJSON, FromJSON) --- | A comment is retained as some text + its original 'SrcLoc'. --- While parsing we record all comments out-of-band, for later --- re-insertion when formatting code. +-- | A comment is retained as some text plus metadata (source +-- location, comment type, + comment situation). While parsing we +-- record all comments out-of-band, for later re-insertion into the +-- AST. data Comment = Comment { commentSrcLoc :: SrcLoc , commentType :: CommentType @@ -1191,7 +1192,7 @@ makeLenses ''Syntax' noLoc :: Term -> Syntax noLoc = Syntax mempty --- | Match an untyped term without its 'SrcLoc'. +-- | Match an untyped term without annotations. pattern STerm :: Term -> Syntax pattern STerm t <- Syntax _ t