From bc688a7abf7f0d04429885084ed14bdf32b2d087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Fri, 7 Oct 2022 12:24:19 +0200 Subject: Parse multiple consecutive record selectors --- src/Parser.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Parser.hs') diff --git a/src/Parser.hs b/src/Parser.hs index 517aa27..35f28c5 100644 --- a/src/Parser.hs +++ b/src/Parser.hs @@ -260,10 +260,10 @@ someExpr = join inner "expression" maybe err return $ listToMaybe $ catMaybes $ map (\(SomeBinOp op) -> SomeExpr <$> applyBinOp op e f) ops recordSelector :: Operator TestParser (TestParser SomeExpr) - recordSelector = Postfix $ do + recordSelector = Postfix $ fmap (foldl1 (flip (.))) $ some $ do void $ osymbol "." off <- stateOffset <$> getParserState - VarName m <- varName + m <- identifier return $ \p -> do SomeExpr e <- p let err = parseError $ FancyError off $ S.singleton $ ErrorFail $ T.unpack $ T.concat -- cgit v1.2.3