Commit 6781a9fe authored by Camil Staps's avatar Camil Staps 🍃

Clean.Parse.Comments: single-line comments are only attributed to...

Clean.Parse.Comments: single-line comments are only attributed to constructors/record fields when they are on the same line, or when they are on the next line and in column <= 8
parent ab18299b
Pipeline #34301 passed with stage
in 1 minute and 57 seconds
......@@ -322,9 +322,14 @@ instance children ParsedConstructor where children pc = Children (tl [pc])
| not (singleLineAbove elem) && column < 4
= Just False
= pos elem >>= \p -> case p of
FunPos _ ln _ -> Just (if multiline (>) (if (singleLineAbove elem) (>=) (<=)) ln line)
LinePos _ ln -> Just (if multiline (>) (if (singleLineAbove elem) (>=) (<=)) ln line)
FunPos _ ln _ -> Just (if multiline (>) (if (singleLineAbove elem) (>=) eq_or_one_less) ln line)
LinePos _ ln -> Just (if multiline (>) (if (singleLineAbove elem) (>=) eq_or_one_less) ln line)
_ -> Nothing
where
eq_or_one_less a b
| column <= 8 // probably meant for the thing a line above
= a==b || a+1==b
= a==b
// If true, single-line documentation should be given above the element.
class singleLineAbove a :: !a -> Bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment