definition:
|
checkModuleHeader' :: SpanInfo -> SpanInfo -> ExportSpec -> Int -> CSM ()
checkModuleHeader' si spanInfoIdent exp _ = case si of
(SpanInfo _ ((Span start@(Position modL modC) _):(Span _ end@(Position wheL _):_))) ->
unless (modL == wheL) -- one line
(if (checkExportLines exp) -- aligment exports lines
then (if (not (modL == (getLi (getSpanInfo exp))) && (getLi spanInfoIdent == modL)) -- 'module' and module name in one line
then
(if wheL == (getEndLi (getSpanInfo exp)) -- where formatting
then (unless ((getCol (getSpanInfo exp)) == (modC + 2)) -- exports indentation
(report (Message (Span start end)
(colorizeKey "module exports" <+> text "wrong indentation")
( text "indent by 2 from"
<+> colorizeKey "module <modulename>")
)
)
)
else
(report (Message (Span start end)
(colorizeKey "where" <+> text "wrong formatting")
( text "write keyword"
<+> colorizeKey "where"
<+> text "and last line of exports in one line" )
)
)
)
else
(report (Message (Span start end)
(colorizeKey "module <modulename> (...)" <+> text "wrong formatting")
( text "if not fitting header in one line: break after"
<+> colorizeKey "module <modulename>"
<> text ", write keyword"
<+> colorizeKey "module"
<+> text "and name of module in one line" )
)
)
)
else
(report (Message (Span start end)
(colorizeKey "module exports" <+> text "wrong alignment")
( text "start lines with commata or braces, align these" )
)
)
)
_ -> return ()
|
demand:
|
argument 1
|
deterministic:
|
deterministic operation
|
documentation:
|
-- Check formatting of module header.
|
failfree:
|
(_, _, _, _)
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{({SpanInfo},_,_,_) |-> _ || ({NoSpanInfo},_,_,_) |-> _}
|
name:
|
checkModuleHeader'
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
Curry.SpanInfo.SpanInfo -> Curry.SpanInfo.SpanInfo -> Curry.Types.ExportSpec
-> Prelude.Int
-> 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
|