diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2022-10-07 12:24:19 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2022-10-07 18:27:33 +0200 |
commit | bc688a7abf7f0d04429885084ed14bdf32b2d087 (patch) | |
tree | 85109ca699c68b5d0a3c6f74c2c88be48ab32c33 /src | |
parent | 23f206cf1fa9e4e9398aba47707024368c13ca60 (diff) |
Parse multiple consecutive record selectors
Diffstat (limited to 'src')
-rw-r--r-- | src/Parser.hs | 4 |
1 files changed, 2 insertions, 2 deletions
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 |