mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 05:21:34 -07:00
Make end pos non-optional
This commit is contained in:
parent
b9a9eb2529
commit
4111ce8fde
3 changed files with 11 additions and 14 deletions
|
@ -39,13 +39,10 @@ import Control.Monad
|
|||
import Test.QuickCheck.All
|
||||
|
||||
tokenToPosition startMap (TokenComment id c) = fromMaybe fail $ do
|
||||
position <- maybePosition
|
||||
endPosition <- maybeEndPosition <|> maybePosition
|
||||
return $ PositionedComment position endPosition c
|
||||
span <- Map.lookup id startMap
|
||||
return $ PositionedComment (fst span) (snd span) c
|
||||
where
|
||||
fail = error "Internal shellcheck error: id doesn't exist. Please report!"
|
||||
maybePosition = fmap fst $ Map.lookup id startMap
|
||||
maybeEndPosition = join $ fmap snd $ Map.lookup id startMap
|
||||
|
||||
checkScript :: Monad m => SystemInterface m -> CheckSpec -> m CheckResult
|
||||
checkScript sys spec = do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue