mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-16 10:03:08 -07:00
Include exit codes in DFA (ref #2541)
This commit is contained in:
parent
819470fa1d
commit
b261ec24f9
2 changed files with 77 additions and 23 deletions
|
@ -651,7 +651,10 @@ build t = do
|
|||
pg <- wordToExactPseudoGlob c
|
||||
return $ pg `pseudoGlobIsSuperSetof` [PGMany]
|
||||
|
||||
T_Condition _ _ op -> build op
|
||||
T_Condition id _ op -> do
|
||||
cond <- build op
|
||||
status <- newNodeRange $ CFSetExitCode id
|
||||
linkRange cond status
|
||||
|
||||
T_CoProc id maybeName t -> do
|
||||
let name = fromMaybe "COPROC" maybeName
|
||||
|
@ -798,7 +801,8 @@ build t = do
|
|||
start <- newStructuralNode
|
||||
hasLastpipe <- reader $ cfLastpipe . cfParameters
|
||||
(leading, last) <- buildPipe hasLastpipe cmds
|
||||
end <- newStructuralNode
|
||||
-- Ideally we'd let this exit code be that of the last command in the pipeline but ok
|
||||
end <- newNodeRange $ CFSetExitCode id
|
||||
|
||||
mapM_ (linkRange start) leading
|
||||
mapM_ (\c -> linkRangeAs CFEFalseFlow c end) leading
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue