Fixed crash for ''foo due to unsafe 'last'
This commit is contained in:
parent
652f8a24fa
commit
651bab73de
|
@ -644,7 +644,7 @@ readSingleQuoted = called "single quoted string" $ do
|
|||
let string = concat s
|
||||
return (T_SingleQuoted id string) `attempting` do
|
||||
x <- lookAhead anyChar
|
||||
when (isAlpha x && isAlpha (last string)) $ parseProblemAt pos WarningC "This apostrophe terminated the single quoted string!"
|
||||
when (isAlpha x && not (null string) && isAlpha (last string)) $ parseProblemAt pos WarningC "This apostrophe terminated the single quoted string!"
|
||||
|
||||
readSingleQuotedLiteral = do
|
||||
singleQuote
|
||||
|
|
Loading…
Reference in New Issue