Add getLiteralStringDef and simplify with it

This commit is contained in:
Joseph C. Sible 2020-02-09 21:36:38 -05:00
parent f8648e5465
commit 4d92a2e15c
4 changed files with 12 additions and 8 deletions

View file

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