mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-08 05:51:09 -07:00
Add getLiteralStringDef and simplify with it
This commit is contained in:
parent
f8648e5465
commit
4d92a2e15c
4 changed files with 12 additions and 8 deletions
|
@ -806,7 +806,7 @@ isVariableName (x:r) = isVariableStartChar x && all isVariableChar r
|
|||
isVariableName _ = False
|
||||
|
||||
getVariablesFromLiteralToken token =
|
||||
getVariablesFromLiteral (runIdentity $ getLiteralStringExt (const $ return " ") token)
|
||||
getVariablesFromLiteral (getLiteralStringDef " " token)
|
||||
|
||||
-- Try to get referenced variables from a literal string like "$foo"
|
||||
-- Ignores tons of cases like arithmetic evaluation and array indices.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue