@@ -1,5 +1,5 @@
11{-# LANGUAGE GeneralizedNewtypeDeriving, ConstraintKinds, PatternGuards, TupleSections #-}
2−module Idris.ParseExpr where
2+module Idris.Parser.Expr where
33
44import Prelude hiding (pi)
55
@@ -12,8 +12,8 @@ import qualified Text.Parser.Char as Chr
1212import qualified Text.Parser.Token.Highlight as Hi
1313
1414import Idris.AbsSyntax
15−import Idris.ParseHelpers
16−import Idris.ParseOps
15+import Idris.Parser.Helpers
16+import Idris.Parser.Ops
1717import Idris.DSL
1818
1919import Idris.Core.TT
@@ -161,7 +161,7 @@ extension syn ns rules =
161161 extensionSymbol (Symbol s) = do fc <- symbolFC s
162162 highlightP fc AnnKeyword
163163 return Nothing
164−
164+
165165 flatten :: PTerm -> PTerm -- flatten application
166166 flatten (PApp fc (PApp _ f as) bs) = flatten (PApp fc f (as ++ bs))
167167 flatten t = t
@@ -252,7 +252,7 @@ updateSynMatch = update
252252
253253 updTacImp ns (TacImp o st scr) = TacImp o st (update ns scr)
254254 updTacImp _ x = x
255−
255+
256256 dropn :: Name -> [(Name, a)] -> [(Name, a)]
257257 dropn n [] = []
258258 dropn n ((x,t) : xs) | n == x = xs
@@ -476,7 +476,7 @@ bracketed' open syn =
476476 <|> try (do l <- simpleExpr syn
477477 op <- option Nothing (do o <- operator
478478 lchar ')'
479− return (Just o))
479+ return (Just o))
480480 fc0 <- getFC
481481 case op of
482482 Nothing -> bracketedExpr syn open l
@@ -584,7 +584,7 @@ runElab syn = do (FC fn (sl, sc) kwEnd) <- try (lchar '%' *> reservedFC "runElab
584584 return $ PRunElab fc tm (syn_namespace syn)
585585 <?> "new-style tactics expression"
586586
587−{- | Parses a disambiguation expression
587+{- | Parses a disambiguation expression
588588Disamb ::=
589589 '%' 'disamb' NameList Expr
590590 ;
@@ -1006,7 +1006,7 @@ Pi' ::=
10061006@
10071007 -}
10081008
1009−bindsymbol opts st syn
1009+bindsymbol opts st syn
10101010 = do symbol "->"
10111011 return (Exp opts st False)
10121012
@@ -1015,7 +1015,7 @@ explicitPi opts st syn
10151015 binder <- bindsymbol opts st syn
10161016 sc <- expr syn
10171017 return (bindList (PPi binder) xt sc)
1018−
1018+
10191019autoImplicit opts st syn
10201020 = do kw <- reservedFC "auto"
10211021 when (st == Static) $ fail "auto implicits can not be static"
@@ -1025,7 +1025,7 @@ autoImplicit opts st syn
10251025 sc <- expr syn
10261026 highlightP kw AnnKeyword
10271027 return (bindList (PPi
1028− (TacImp [] Dynamic (PTactics [ProofSearch True True 100 Nothing [] []]))) xt sc)
1028+ (TacImp [] Dynamic (PTactics [ProofSearch True True 100 Nothing [] []]))) xt sc)
10291029
10301030defaultImplicit opts st syn = do
10311031 kw <- reservedFC "default"
@@ -1051,7 +1051,7 @@ normalImplicit opts st syn = do
10511051 constraint)
10521052 else (Imp opts st False (Just (Impl False False)),
10531053 Imp opts st False (Just (Impl True False)))
1054− return (bindList (PPi im) xt
1054+ return (bindList (PPi im) xt
10551055 (bindList (PPi cl) cs sc))
10561056
10571057implicitPi opts st syn =
@@ -1443,7 +1443,7 @@ data TacticArg = NameTArg -- ^ Names: n1, n2, n3, ... n
14431443-- https://github.com/idris-lang/Idris-dev/issues/1766
14441444-- | A list of available tactics and their argument requirements
14451445tactics :: [([String], Maybe TacticArg, SyntaxInfo -> IdrisParser PTactic)]
1446−tactics =
1446+tactics =
14471447 [ (["intro"], Nothing, const $ -- FIXME syntax for intro (fresh name)
14481448 do ns <- sepBy (spaced (fst <$> name)) (lchar ','); return $ Intro ns)
14491449 , noArgs ["intros"] Intros
@@ -1527,7 +1527,7 @@ tactics =
15271527 imp :: IdrisParser Bool
15281528 imp = do lchar '?'; return False
15291529 <|> do lchar '_'; return True
1530−
1530+
15311531
15321532tactic :: SyntaxInfo -> IdrisParser PTactic
15331533tactic syn = choice [ do choice (map reserved names); parser syn
@@ -1550,4 +1550,3 @@ fullTactic :: SyntaxInfo -> IdrisParser PTactic
15501550fullTactic syn = do t <- tactic syn
15511551 eof
15521552 return t
1553−