mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-16 10:03:08 -07:00
Control Flow Graph / Data Flow Analysis support
This commit is contained in:
parent
7946bf5657
commit
f77a545282
17 changed files with 2909 additions and 135 deletions
|
@ -27,6 +27,7 @@ import ShellCheck.AST
|
|||
import ShellCheck.ASTLib hiding (runTests)
|
||||
import ShellCheck.Data
|
||||
import ShellCheck.Interface
|
||||
import ShellCheck.Prelude
|
||||
|
||||
import Control.Applicative ((<*), (*>))
|
||||
import Control.Monad
|
||||
|
@ -210,7 +211,7 @@ getNextIdSpanningTokenList list =
|
|||
-- Get the span covered by an id
|
||||
getSpanForId :: Monad m => Id -> SCParser m (SourcePos, SourcePos)
|
||||
getSpanForId id =
|
||||
Map.findWithDefault (error "Internal error: no position for id. Please report!") id <$>
|
||||
Map.findWithDefault (error $ pleaseReport "no parser span for id") id <$>
|
||||
getMap
|
||||
|
||||
-- Create a new id with the same span as an existing one
|
||||
|
@ -1918,7 +1919,7 @@ readPendingHereDocs = do
|
|||
-- The end token is just a prefix
|
||||
skipLine
|
||||
| hasTrailer ->
|
||||
error "ShellCheck bug, please report (here doc trailer)."
|
||||
error $ pleaseReport "unexpected heredoc trailer"
|
||||
|
||||
-- The following cases assume no trailing text:
|
||||
| dashed == Undashed && (not $ null leadingSpace) -> do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue