mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 21:41:34 -07:00
Fix issue #1724
(bash: missing support for 'builtin' keyword) Now shellcheck looks for the arguments to 'builtin' to determine read/written variables. A change in the parser makes sure that assignments are parsed correctly in commands that start with 'builtin'.
This commit is contained in:
parent
60f75e5b8a
commit
0e0de94045
4 changed files with 14 additions and 2 deletions
|
@ -567,9 +567,11 @@ getReferencedVariableCommand _ = []
|
|||
-- VariableName :: String, -- The variable name, i.e. foo
|
||||
-- VariableValue :: DataType -- A description of the value being assigned, i.e. "Literal string with value foo"
|
||||
-- )
|
||||
getModifiedVariableCommand base@(T_SimpleCommand _ _ (T_NormalWord _ (T_Literal _ x:_):rest)) =
|
||||
getModifiedVariableCommand base@(T_SimpleCommand id cmdPrefix (T_NormalWord _ (T_Literal _ x:_):rest)) =
|
||||
filter (\(_,_,s,_) -> not ("-" `isPrefixOf` s)) $
|
||||
case x of
|
||||
"builtin" ->
|
||||
getModifiedVariableCommand $ T_SimpleCommand id cmdPrefix rest
|
||||
"read" ->
|
||||
let params = map getLiteral rest
|
||||
readArrayVars = getReadArrayVariables rest
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue