@@ -914,7 +914,7 @@ TypeExpr ::= ConstraintList? Expr;
914typeExpr :: SyntaxInfo -> IdrisParser PTerm
914typeExpr :: SyntaxInfo -> IdrisParser PTerm
915typeExpr syn = do cs <- if implicitAllowed syn then constraintList syn else return []
915typeExpr syn = do cs <- if implicitAllowed syn then constraintList syn else return []
916 sc <- expr (allowConstr syn)
916 sc <- expr (allowConstr syn)
917− return (bindList (PPi constraint) cs sc)
917+ return (bindList (\r -> PPi (constraint { pcount = r })) cs sc)
918 <?> "type signature"
918 <?> "type signature"
920{- | Parses a lambda expression
920{- | Parses a lambda expression
@@ -941,7 +941,7 @@ lambda syn = do lchar '\\' <?> "lambda expression"
941 ((do xt <- try $ tyOptDeclList (disallowImp syn)
941 ((do xt <- try $ tyOptDeclList (disallowImp syn)
942 fc <- getFC
942 fc <- getFC
943 sc <- lambdaTail
943 sc <- lambdaTail
944− return (bindList (PLam fc) xt sc))
944+ return (bindList (\r -> PLam fc) xt sc))
946 (do ps <- sepBy (do fc <- getFC
946 (do ps <- sepBy (do fc <- getFC
947 e <- simpleExpr (disallowImp (syn { inPattern = True }))
947 e <- simpleExpr (disallowImp (syn { inPattern = True }))
@@ -1078,7 +1078,7 @@ explicitPi opts st syn
1078 = do xt <- try (lchar '(' *> typeDeclList syn <* lchar ')')
1078 = do xt <- try (lchar '(' *> typeDeclList syn <* lchar ')')
1079 binder <- bindsymbol opts st syn
1079 binder <- bindsymbol opts st syn
1080 sc <- expr (allowConstr syn)
1080 sc <- expr (allowConstr syn)
1081− return (bindList (PPi binder) xt sc)
1081+ return (bindList (\r -> PPi (binder { pcount = r })) xt sc)
1083autoImplicit opts st syn
1083autoImplicit opts st syn
1084 = do kw <- reservedFC "auto"
1084 = do kw <- reservedFC "auto"
@@ -1088,8 +1088,8 @@ autoImplicit opts st syn
1088 symbol "->"
1088 symbol "->"
1089 sc <- expr (allowConstr syn)
1089 sc <- expr (allowConstr syn)
1090 highlightP kw AnnKeyword
1090 highlightP kw AnnKeyword
1091− return (bindList (PPi
1091+ return (bindList (\r -> PPi
1092− (TacImp [] Dynamic (PTactics [ProofSearch True True 100 Nothing [] []]) RigW)) xt sc)
1092+ (TacImp [] Dynamic (PTactics [ProofSearch True True 100 Nothing [] []]) r)) xt sc)
1094defaultImplicit opts st syn = do
1094defaultImplicit opts st syn = do
1095 kw <- reservedFC "default"
1095 kw <- reservedFC "default"
@@ -1102,7 +1102,7 @@ defaultImplicit opts st syn = do
1102 symbol "->"
1102 symbol "->"
1103 sc <- expr (allowConstr syn)
1103 sc <- expr (allowConstr syn)
1104 highlightP kw AnnKeyword
1104 highlightP kw AnnKeyword
1105− return (bindList (PPi (TacImp [] Dynamic script RigW)) xt sc)
1105+ return (bindList (\r -> PPi (TacImp [] Dynamic script r)) xt sc)
1107normalImplicit opts st syn = do
1107normalImplicit opts st syn = do
1108 xt <- typeDeclList syn <* lchar '}'
1108 xt <- typeDeclList syn <* lchar '}'
@@ -1115,15 +1115,15 @@ normalImplicit opts st syn = do
1115 constraint)
1115 constraint)
1116 else (Imp opts st False (Just (Impl False False False)) True RigW,
1116 else (Imp opts st False (Just (Impl False False False)) True RigW,
1117 Imp opts st False (Just (Impl True False False)) True RigW)
1117 Imp opts st False (Just (Impl True False False)) True RigW)
1118− return (bindList (PPi im) xt
1118+ return (bindList (\r -> PPi (im { pcount = r })) xt
1119− (bindList (PPi cl) cs sc))
1119+ (bindList (\r -> PPi (cl { pcount = r })) cs sc))
1121constraintPi opts st syn =
1121constraintPi opts st syn =
1122 do cs <- constraintList1 syn
1122 do cs <- constraintList1 syn
1123 sc <- expr syn
1123 sc <- expr syn
1124 if implicitAllowed syn
1124 if implicitAllowed syn
1125− then return (bindList (PPi constraint) cs sc)
1125+ then return (bindList (\r -> PPi constraint { pcount = r }) cs sc)
1126− else return (bindList (PPi (Imp opts st False (Just (Impl True False False)) True RigW))
1126+ else return (bindList (\r -> PPi (Imp opts st False (Just (Impl True False False)) True r))
1129implicitPi opts st syn =
1129implicitPi opts st syn =
@@ -1181,11 +1181,11 @@ ConstraintList ::=
1184−constraintList :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)]
1184+constraintList :: SyntaxInfo -> IdrisParser [(RigCount, Name, FC, PTerm)]
1185constraintList syn = try (constraintList1 syn)
1185constraintList syn = try (constraintList1 syn)
1186 <|> return []
1186 <|> return []
1188−constraintList1 :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)]
1188+constraintList1 :: SyntaxInfo -> IdrisParser [(RigCount, Name, FC, PTerm)]
1189constraintList1 syn = try (do lchar '('
1189constraintList1 syn = try (do lchar '('
1190 tys <- sepBy1 nexpr (lchar ',')
1190 tys <- sepBy1 nexpr (lchar ',')
1191 lchar ')'
1191 lchar ')'
@@ -1193,13 +1193,13 @@ constraintList1 syn = try (do lchar '('
1193 return tys)
1193 return tys)
1194 <|> try (do t <- opExpr (disallowImp syn)
1194 <|> try (do t <- opExpr (disallowImp syn)
1195 reservedOp "=>"
1195 reservedOp "=>"
1196− return [(defname, NoFC, t)])
1196+ return [(RigW, defname, NoFC, t)])
1197 <?> "type constraint list"
1197 <?> "type constraint list"
1198 where nexpr = try (do (n, fc) <- name; lchar ':'
1198 where nexpr = try (do (n, fc) <- name; lchar ':'
1199 e <- expr (disallowImp syn)
1199 e <- expr (disallowImp syn)
1200− return (n, fc, e))
1200+ return (RigW, n, fc, e))
1201 <|> do e <- expr (disallowImp syn)
1201 <|> do e <- expr (disallowImp syn)
1202− return (defname, NoFC, e)
1202+ return (RigW, defname, NoFC, e)
1203 defname = sMN 0 "constraint"
1203 defname = sMN 0 "constraint"
1205{- | Parses a type declaration list
1205{- | Parses a type declaration list
@@ -1217,16 +1217,18 @@ FunctionSignatureList ::=
1220−typeDeclList :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)]
1220+typeDeclList :: SyntaxInfo -> IdrisParser [(RigCount, Name, FC, PTerm)]
1221−typeDeclList syn = try (sepBy1 (do (x, xfc) <- fnName
1221+typeDeclList syn = try (sepBy1 (do rig <- option RigW (do lchar '1'
1222 lchar ':'
1224 lchar ':'
1223 t <- typeExpr (disallowImp syn)
1225 t <- typeExpr (disallowImp syn)
1224− return (x, xfc, t))
1226+ return (rig, x, xfc, t))
1225 (lchar ','))
1227 (lchar ','))
1226 <|> do ns <- sepBy1 name (lchar ',')
1228 <|> do ns <- sepBy1 name (lchar ',')
1227 lchar ':'
1229 lchar ':'
1228 t <- typeExpr (disallowImp syn)
1230 t <- typeExpr (disallowImp syn)
1229− return (map (\(x, xfc) -> (x, xfc, t)) ns)
1231+ return (map (\(x, xfc) -> (RigW, x, xfc, t)) ns)
1230 <?> "type declaration list"
1232 <?> "type declaration list"
1232{- | Parses a type declaration list with optional parameters
1234{- | Parses a type declaration list with optional parameters
@@ -1241,11 +1243,11 @@ TypeOptDeclList ::=
1241NameOrPlaceHolder ::= Name | '_';
1243NameOrPlaceHolder ::= Name | '_';
1244−tyOptDeclList :: SyntaxInfo -> IdrisParser [(Name, FC, PTerm)]
1246+tyOptDeclList :: SyntaxInfo -> IdrisParser [(RigCount, Name, FC, PTerm)]
1245tyOptDeclList syn = sepBy1 (do (x, fc) <- nameOrPlaceholder
1247tyOptDeclList syn = sepBy1 (do (x, fc) <- nameOrPlaceholder
1246 t <- option Placeholder (do lchar ':'
1248 t <- option Placeholder (do lchar ':'
1247 expr syn)
1249 expr syn)
1248− return (x, fc, t))
1250+ return (RigW, x, fc, t))
1249 (lchar ',')
1251 (lchar ',')
1250 <?> "type declaration list"
1252 <?> "type declaration list"
1251 where nameOrPlaceholder :: IdrisParser (Name, FC)
1253 where nameOrPlaceholder :: IdrisParser (Name, FC)