definition:
|
blankLine :: Decl a -> Decl a -> CSM ()
blankLine decl1 decl2 = do
let sI1@(SpanInfo (Span _ (Position l _)) _) = getSpanInfo decl1
sI2 = getSpanInfo decl2
unless ((getLi sI2) - l > 1) $
if getEndLi sI2 < getEndLi sI1
then report (Message
(getSpan sI2)
(text "Top level declaration is surrounded by another declaration")
(text "Move inner declaration below the surrounding declaration,"
<+>
text "keeping at least one blank line" )
)
else report (Message
(getSpan sI2)
( colorizeKey "Blank Line" <+> text "missing")
( text "leave a"
<+> colorizeKey "blank line"
<+> text "between"
<+> colorizeKey "top level declarations")
)
|
demand:
|
no demanded arguments
|
deterministic:
|
deterministic operation
|
documentation:
|
-- Checks if two different top-level declarations are properly aligned
-- (This check might not work if there are comments in between).
--
-- Two top-level declarations are misaligned if ...
-- (a) one top level declaration is surrounded by the other (missing spatial separation),
-- (b) or there is no blank line between the two declarations.
|
failfree:
|
<FAILING>
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{(_,_) |-> _}
|
name:
|
blankLine
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
Curry.Types.Decl a -> Curry.Types.Decl a
-> Control.Monad.Trans.State.StateT Types.CheckState Data.Functor.Identity.Identity ()
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|