on master help sign in
Support '!' at REPL
commite4343cb473801159376a45d97b04b98c3741b7bd authorEdwin Brady <ecb10@st-andrews.ac.uk> dateSat 19 Oct 2013, 13:27 (13 years ago) parentc48303e
2 files changed+5−5
src/Idris/AbsSyntaxTree.hs+4−4 src/Idris/ParseExpr.hs+1−1
src/Idris/AbsSyntaxTree.hs+4−4
@@ -960,7 +960,7 @@ prettyImp impl = prettySe 10
960960 prettySe p (PApp _ (PRef _ f) [])
961961 | not impl = pretty f
962962 prettySe p (PAppBind _ (PRef _ f) [])
963− | not impl = pretty f <+> text "!"
963+ | not impl = text "!" <+> pretty f
964964 prettySe p (PApp _ (PRef _ op@(UN (f:_))) args)
965965 | length (getExps args) == 2 && (not impl) && (not $ isAlpha f) =
966966 let [l, r] = getExps args in
@@ -1147,7 +1147,7 @@ showImp ist impl colour tm = se 10 [] tm where
11471147 se p bnd (PApp _ hd@(PRef _ f) [])
11481148 | not impl = se p bnd hd
11491149 se p bnd (PAppBind _ hd@(PRef _ f) [])
1150− | not impl = se p bnd hd ++ "!"
1150+ | not impl = "!" ++ se p bnd hd
11511151 se p bnd (PApp _ op@(PRef _ (UN (f:_))) args)
11521152 | length (getExps args) == 2 && not impl && not (isAlpha f)
11531153 = let [l, r] = getExps args in
@@ -1158,8 +1158,8 @@ showImp ist impl colour tm = se 10 [] tm where
11581158 else concatMap (seArg bnd) args
11591159 se p bnd (PAppBind _ f as)
11601160 = let args = getExps as in
1161− bracket p 1 $ se 1 bnd f ++ "!" ++ if impl then concatMap (sArg bnd) as
1162− else concatMap (seArg bnd) args
1161+ "!" ++ (bracket p 1 $ se 1 bnd f ++ if impl then concatMap (sArg bnd) as
1162+ else concatMap (seArg bnd) args)
11631163 se p bnd (PCase _ scr opts) = "case " ++ se 10 bnd scr ++ " of " ++ showSep " | " (map sc opts)
11641164 where sc (l, r) = se 10 bnd l ++ " => " ++ se 10 bnd r
11651165 se p bnd (PHidden tm) = "." ++ se 0 bnd tm
src/Idris/ParseExpr.hs+1−1
@@ -48,7 +48,7 @@ fullExpr :: SyntaxInfo -> IdrisParser PTerm
4848fullExpr syn = do x <- expr syn
4949 eof
5050 i <- get
51− return $ desugar syn i x
51+ return $ debindApp syn (desugar syn i x)
5252
5353
5454{- |Parses an expression