mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-06 13:01:39 -07:00
Track whether braces were present in T_DollarBraced
References of the form $var and ${var} both map to the same structure in the AST, which prevents any later analysis functions from distinguishing them. In preparation for adding checks that need this info, add a Bool to T_DollarBraced that tracks whether the braces were seen at parsing time and update all references so that this change is a no-op.
This commit is contained in:
parent
0358090b3c
commit
aa3b709b5d
7 changed files with 33 additions and 34 deletions
|
@ -232,7 +232,7 @@ checkBashisms = ForShell [Sh, Dash] $ \t -> do
|
|||
bashism t@(TA_Variable id str _) | isBashVariable str =
|
||||
warnMsg id $ str ++ " is"
|
||||
|
||||
bashism t@(T_DollarBraced id token) = do
|
||||
bashism t@(T_DollarBraced id _ token) = do
|
||||
mapM_ check expansion
|
||||
when (isBashVariable var) $
|
||||
warnMsg id $ var ++ " is"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue