pText :: Lexer Text
pText = do
    _ <- char '\"'
    Text.pack <$> loop []
  where
    loop :: [Char] -> Lexer [Char]
    loop !acc = do
        next <- anySingle
        case next of
            -- Check for double double quotes. If it's a single double quote,
            -- it's the end of the string.
            '\"' -> try (doubleQuote acc) <|> pure (reverse acc)
            c    -> loop (c : acc)
    doubleQuote :: [Char] -> Lexer [Char]
    doubleQuote !acc = char '\"' >> loop ('\"' : acc)
pText :: Lexer Text
pText = do
    _ <- char '\"'
    Text.pack <$> loop []
  where
    loop :: [Char] -> Lexer [Char]
    loop !acc = do
        next <- anySingle
        case next of
            -- Check for double double quotes. If it's a single double quote,
            -- it's the end of the string.
            '\"' -> try (doubleQuote acc) <|> pure (reverse acc)
            c    -> loop (c : acc)
    doubleQuote :: [Char] -> Lexer [Char]
    doubleQuote !acc = char '\"' >> loop ('\"' : acc)
pText = do
    _ <- char '\"'
    Text.pack <$> loop []
  where
    loop :: [Char] -> Lexer [Char]
    loop !acc = do
        next <- anySingle
        case next of
            -- Check for double double quotes. If it's a single double quote,
            -- it's the end of the string.
            '\"' -> try (doubleQuote acc) <|> pure (reverse acc)
            c    -> loop (c : acc)
    doubleQuote :: [Char] -> Lexer [Char]
    doubleQuote !acc = char '\"' >> loop ('\"' : acc)