mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-09 12:08:38 +08: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:
committed by
Benjamin Gordon
parent
0358090b3c
commit
aa3b709b5d
@@ -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"
|
||||
|
Reference in New Issue
Block a user