Merge pull request #1826 from josephcsible/nofromjust

Use the Identity monad to avoid unnecessary uses of fromJust
This commit is contained in:
Vidar Holen
2020-02-10 18:05:36 -08:00
committed by GitHub
5 changed files with 20 additions and 16 deletions

View File

@@ -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.