mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-07 21:41:34 -07:00
Use the Identity monad to avoid unnecessary uses of fromJust
This commit is contained in:
parent
61b073d507
commit
aaffe38198
4 changed files with 10 additions and 7 deletions
|
@ -806,7 +806,7 @@ isVariableName (x:r) = isVariableStartChar x && all isVariableChar r
|
|||
isVariableName _ = False
|
||||
|
||||
getVariablesFromLiteralToken token =
|
||||
getVariablesFromLiteral (fromJust $ getLiteralStringExt (const $ return " ") token)
|
||||
getVariablesFromLiteral (runIdentity $ getLiteralStringExt (const $ return " ") 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