mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-09-30 16:59:20 +08:00
Allow parsing arbitrary coproc names (fixes #3048)
This commit is contained in:
@@ -559,8 +559,12 @@ getModifiedVariables t =
|
||||
T_FdRedirect _ ('{':var) op -> -- {foo}>&2 modifies foo
|
||||
[(t, t, takeWhile (/= '}') var, DataString SourceInteger) | not $ isClosingFileOp op]
|
||||
|
||||
T_CoProc _ name _ ->
|
||||
[(t, t, fromMaybe "COPROC" name, DataArray SourceInteger)]
|
||||
T_CoProc _ Nothing _ ->
|
||||
[(t, t, "COPROC", DataArray SourceInteger)]
|
||||
|
||||
T_CoProc _ (Just token) _ -> do
|
||||
name <- maybeToList $ getLiteralString token
|
||||
[(t, t, name, DataArray SourceInteger)]
|
||||
|
||||
--Points to 'for' rather than variable
|
||||
T_ForIn id str [] _ -> [(t, t, str, DataString SourceExternal)]
|
||||
|
Reference in New Issue
Block a user