@@ -0,0 +1,102 @@
1+{-# OPTIONS_GHC -Wall -fno-warn-unused-do-bind #-}
2+{-# LANGUAGE OverloadedStrings #-}
10+import qualified Data.Text as Text
11+import Data.Text (Text)
14+import qualified Parse.Expression as Expr
15+import qualified Parse.Pattern as Pattern
17+import qualified AST.Pattern as P
18+import qualified Reporting.Annotation as A
28+ | Def (Maybe String) Text
39+parseEntry :: String -> Entry
45+ case run (entryParser source) source of
53+entryParser :: Text -> Parser Entry
56+ [ do keyword "import"
58+ name <- qualifiedCapVar
59+ return (Import (Text.unpack name) source)
61+ , do oneOf (map keyword ["infix","infixl","infixr"])
75+ return (Type (Text.unpack name) source)
77+ , do root <- Expr.rootPattern =<< getPosition
85+ return (Def (Just (Text.unpack name)) source)
90+ return (Def Nothing source)
94+chompArgs :: Parser ()