mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 21:41:34 -07:00
Merge pull request #1826 from josephcsible/nofromjust
Use the Identity monad to avoid unnecessary uses of fromJust
This commit is contained in:
commit
d0beac6d0b
5 changed files with 20 additions and 16 deletions
|
@ -801,7 +801,7 @@ isVariableName (x:r) = isVariableStartChar x && all isVariableChar r
|
|||
isVariableName _ = False
|
||||
|
||||
getVariablesFromLiteralToken token =
|
||||
getVariablesFromLiteral (fromJust $ 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