pLValue :: Parser (LValue :~ SrcPos)
pLValue = try arrayItem <|> try recordField <|> variable
  where
    arrayItem = withAnnotation $ do
      arr <- identifier
      ix <- brackets pExpression
      return (LArray arr ix)

    variable = withAnnotation (LVariable <$> identifier)

    recordField = withAnnotation $ do
      base <- identifier
      dot
      field <- identifier
      return (LField base field)
pLValue :: Parser (LValue :~ SrcPos)
pLValue = try arrayItem <|> try recordField <|> variable
  where
    arrayItem = withAnnotation $ do
      arr <- identifier
      ix <- brackets pExpression
      return (LArray arr ix)

    variable = withAnnotation (LVariable <$> identifier)

    recordField = withAnnotation $ do
      base <- identifier
      dot
      field <- identifier
      return (LField base field)
pLValue = try arrayItem <|> try recordField <|> variable
  where
    arrayItem = withAnnotation $ do
      arr <- identifier
      ix <- brackets pExpression
      return (LArray arr ix)

    variable = withAnnotation (LVariable <$> identifier)

    recordField = withAnnotation $ do
      base <- identifier
      dot
      field <- identifier
      return (LField base field)