@@ -42,8 +42,10 @@ allowImp syn = syn { implicitAllowed = True }
42disallowImp :: SyntaxInfo -> SyntaxInfo
42disallowImp :: SyntaxInfo -> SyntaxInfo
43disallowImp syn = syn { implicitAllowed = False }
43disallowImp syn = syn { implicitAllowed = False }
45−{- | Parses an expression as a whole
45+{-| Parses an expression as a whole
46 FullExpr ::= Expr EOF_t;
47 FullExpr ::= Expr EOF_t;
48fullExpr :: SyntaxInfo -> IdrisParser PTerm
50fullExpr :: SyntaxInfo -> IdrisParser PTerm
49fullExpr syn = do x <- expr syn
51fullExpr syn = do x <- expr syn
@@ -53,7 +55,9 @@ fullExpr syn = do x <- expr syn
55{- |Parses an expression
57{- |Parses an expression
56 Expr ::= Expr';
59 Expr ::= Expr';
58expr :: SyntaxInfo -> IdrisParser PTerm
62expr :: SyntaxInfo -> IdrisParser PTerm
59expr syn = do i <- get
63expr syn = do i <- get
@@ -61,10 +65,10 @@ expr syn = do i <- get
62{- | Parses either an internally defined expression or
66{- | Parses either an internally defined expression or
63 a user-defined one
67 a user-defined one
65Expr' ::= "External (User-defined) Syntax"
69Expr' ::= "External (User-defined) Syntax"
66 | InternalExpr;
70 | InternalExpr;
69expr' :: SyntaxInfo -> IdrisParser PTerm
73expr' :: SyntaxInfo -> IdrisParser PTerm
70expr' syn = try (externalExpr syn)
74expr' syn = try (externalExpr syn)
@@ -92,7 +96,7 @@ simpleExternalExpr syn = do i <- get
92 _ -> False
96 _ -> False
93 isSimple _ = False
97 isSimple _ = False
95−{- | Tries to parse a user-defined expression given a list of syntactic extensions -}
99+{- | Tries to parse a user-defined expression given a list of syntactic extensions -}
96extensions :: SyntaxInfo -> [Syntax] -> IdrisParser PTerm
100extensions :: SyntaxInfo -> [Syntax] -> IdrisParser PTerm
97extensions syn rules = choice (map (try . extension syn) (filter isValid rules))
101extensions syn rules = choice (map (try . extension syn) (filter isValid rules))
98 <?> "user-defined expression"
102 <?> "user-defined expression"
@@ -160,8 +164,8 @@ extension syn (Rule ssym ptm _)
160 update ns (PGoal fc r n sc) = PGoal fc (update ns r) n (update ns sc)
164 update ns (PGoal fc r n sc) = PGoal fc (update ns r) n (update ns sc)
161 update ns t = t
165 update ns t = t
163−{- |Parses a (normal) built-in expression
167+{- | Parses a (normal) built-in expression
165InternalExpr ::=
169InternalExpr ::=
167 | MatchApp
171 | MatchApp
@@ -173,8 +177,9 @@ InternalExpr ::=
174 | RewriteTerm
178 | RewriteTerm
176− | DoBlock
180+ | DoBlock
179internalExpr :: SyntaxInfo -> IdrisParser PTerm
184internalExpr :: SyntaxInfo -> IdrisParser PTerm
180internalExpr syn =
185internalExpr syn =
@@ -193,8 +198,10 @@ internalExpr syn =
193 <?> "expression"
198 <?> "expression"
195{- | Parses a case expression
200{- | Parses a case expression
196CaseExpr ::=
202CaseExpr ::=
197 'case' Expr 'of' OpenBlock CaseOption+ CloseBlock;
203 'case' Expr 'of' OpenBlock CaseOption+ CloseBlock;
199caseExpr :: SyntaxInfo -> IdrisParser PTerm
206caseExpr :: SyntaxInfo -> IdrisParser PTerm
200caseExpr syn = do reserved "case"; fc <- getFC
207caseExpr syn = do reserved "case"; fc <- getFC
@@ -204,9 +211,11 @@ caseExpr syn = do reserved "case"; fc <- getFC
204 <?> "case expression"
211 <?> "case expression"
206{- | Parses a case in a case expression
213{- | Parses a case in a case expression
207CaseOption ::=
215CaseOption ::=
208 Expr '=>' Expr Terminator
216 Expr '=>' Expr Terminator
211caseOption :: SyntaxInfo -> IdrisParser (PTerm, PTerm)
220caseOption :: SyntaxInfo -> IdrisParser (PTerm, PTerm)
212caseOption syn = do lhs <- expr (syn { inPattern = True })
221caseOption syn = do lhs <- expr (syn { inPattern = True })
@@ -215,9 +224,11 @@ caseOption syn = do lhs <- expr (syn { inPattern = True })
215 <?> "case option"
224 <?> "case option"
217{- | Parses a proof block
226{- | Parses a proof block
218ProofExpr ::=
228ProofExpr ::=
219 'proof' OpenBlock Tactic'* CloseBlock
229 'proof' OpenBlock Tactic'* CloseBlock
222proofExpr :: SyntaxInfo -> IdrisParser PTerm
233proofExpr :: SyntaxInfo -> IdrisParser PTerm
223proofExpr syn = do reserved "proof"
234proofExpr syn = do reserved "proof"
@@ -225,10 +236,12 @@ proofExpr syn = do reserved "proof"
225 return $ PProof ts
236 return $ PProof ts
226 <?> "proof block"
237 <?> "proof block"
228−{- | Parses a tactics block
239+{- | Parses a tactics block
229TacticsExpr :=
241TacticsExpr :=
230 'tactics' OpenBlock Tactic'* CloseBlock
242 'tactics' OpenBlock Tactic'* CloseBlock
233tacticsExpr :: SyntaxInfo -> IdrisParser PTerm
246tacticsExpr :: SyntaxInfo -> IdrisParser PTerm
234tacticsExpr syn = do reserved "tactics"
247tacticsExpr syn = do reserved "tactics"
@@ -236,7 +249,8 @@ tacticsExpr syn = do reserved "tactics"
236 return $ PTactics ts
249 return $ PTactics ts
237 <?> "tactics block"
250 <?> "tactics block"
239−{- | Parses a simple expresion
252+{- | Parses a simple expression
240SimpleExpr ::=
254SimpleExpr ::=
241 '![' Term ']'
255 '![' Term ']'
242 | '?' Name
256 | '?' Name
@@ -257,6 +271,7 @@ SimpleExpr ::=
258 | {- External (User-defined) Simple Expression -}
272 | {- External (User-defined) Simple Expression -}
261simpleExpr :: SyntaxInfo -> IdrisParser PTerm
276simpleExpr :: SyntaxInfo -> IdrisParser PTerm
262simpleExpr syn =
277simpleExpr syn =
@@ -296,7 +311,8 @@ simpleExpr syn =
296 <?> "expression"
311 <?> "expression"
299−{- |Parses the rest of an expression in braces
314+{- |Parses the rest of an expression in braces
300Bracketed ::=
316Bracketed ::=
302 | Expr ')'
318 | Expr ')'
@@ -306,6 +322,7 @@ Bracketed ::=
306 | Expr Operator ')'
322 | Expr Operator ')'
307 | Name ':' Expr '**' Expr ')'
323 | Name ':' Expr '**' Expr ')'
310bracketed :: SyntaxInfo -> IdrisParser PTerm
327bracketed :: SyntaxInfo -> IdrisParser PTerm
311bracketed syn =
328bracketed syn =
@@ -378,15 +395,17 @@ modifyConst syn fc (PConstant (BI x))
378modifyConst syn fc x = x
395modifyConst syn fc x = x
380{- | Parses a list literal expression e.g. [1,2,3]
397{- | Parses a list literal expression e.g. [1,2,3]
381ListExpr ::=
399ListExpr ::=
382 '[' ExprList? ']'
400 '[' ExprList? ']'
385ExprList ::=
404ExprList ::=
387 | Expr ',' ExprList
406 | Expr ',' ExprList
391listExpr :: SyntaxInfo -> IdrisParser PTerm
410listExpr :: SyntaxInfo -> IdrisParser PTerm
392listExpr syn = do lchar '['; fc <- getFC; xs <- sepBy (expr syn) (lchar ','); lchar ']'
411listExpr syn = do lchar '['; fc <- getFC; xs <- sepBy (expr syn) (lchar ','); lchar ']'
@@ -399,22 +418,26 @@ listExpr syn = do lchar '['; fc <- getFC; xs <- sepBy (expr syn) (lchar ','); lc
401{- | Parses an alternative expression
420{- | Parses an alternative expression
402 Alt ::= '(|' Expr_List '|)';
422 Alt ::= '(|' Expr_List '|)';
404 Expr_List ::=
424 Expr_List ::=
406 | Expr' ',' Expr_List
426 | Expr' ',' Expr_List
409alt :: SyntaxInfo -> IdrisParser PTerm
430alt :: SyntaxInfo -> IdrisParser PTerm
410alt syn = do symbol "(|"; alts <- sepBy1 (expr' syn) (lchar ','); symbol "|)"
431alt syn = do symbol "(|"; alts <- sepBy1 (expr' syn) (lchar ','); symbol "|)"
411 return (PAlternative False alts)
432 return (PAlternative False alts)
413{- | Parses a possibly hidden simple expression
434{- | Parses a possibly hidden simple expression
414HSimpleExpr ::=
436HSimpleExpr ::=
415 '.' SimpleExpr
437 '.' SimpleExpr
416 | SimpleExpr
438 | SimpleExpr
419hsimpleExpr :: SyntaxInfo -> IdrisParser PTerm
442hsimpleExpr :: SyntaxInfo -> IdrisParser PTerm
420hsimpleExpr syn =
443hsimpleExpr syn =
@@ -425,9 +448,11 @@ hsimpleExpr syn =
425 <?> "expression"
448 <?> "expression"
427{- | Parses a matching application expression
450{- | Parses a matching application expression
428MatchApp ::=
452MatchApp ::=
429 SimpleExpr '<==' FnName
453 SimpleExpr '<==' FnName
432matchApp :: SyntaxInfo -> IdrisParser PTerm
457matchApp :: SyntaxInfo -> IdrisParser PTerm
433matchApp syn = do ty <- simpleExpr syn
458matchApp syn = do ty <- simpleExpr syn
@@ -452,9 +477,11 @@ unifyLog syn = do lchar '%'; reserved "unifyLog";
452 <?> "unification log expression"
477 <?> "unification log expression"
454{- | Parses a no implicits expression
479{- | Parses a no implicits expression
455NoImplicits ::=
481NoImplicits ::=
456 '%' 'noImplicits' SimpleExpr
482 '%' 'noImplicits' SimpleExpr
459noImplicits :: SyntaxInfo -> IdrisParser PTerm
486noImplicits :: SyntaxInfo -> IdrisParser PTerm
460noImplicits syn = do lchar '%'; reserved "noImplicits";
487noImplicits syn = do lchar '%'; reserved "noImplicits";
@@ -463,10 +490,12 @@ noImplicits syn = do lchar '%'; reserved "noImplicits";
463 <?> "no implicits expression"
490 <?> "no implicits expression"
465{- | Parses a function application expression
492{- | Parses a function application expression
467 'mkForeign' Arg Arg*
495 'mkForeign' Arg Arg*
468 | SimpleExpr Arg+
496 | SimpleExpr Arg+
471app :: SyntaxInfo -> IdrisParser PTerm
500app :: SyntaxInfo -> IdrisParser PTerm
472app syn = do f <- reserved "mkForeign"
501app syn = do f <- reserved "mkForeign"
@@ -500,12 +529,14 @@ app syn = do f <- reserved "mkForeign"
500 = desugar (syn { dsl_info = d }) i (getTm a)
529 = desugar (syn { dsl_info = d }) i (getTm a)
501 dslify i t = t
530 dslify i t = t
503−{- |Parses a function argument
532+{-| Parses a function argument
505 ImplicitArg
535 ImplicitArg
506 | ConstraintArg
536 | ConstraintArg
507 | SimpleExpr
537 | SimpleExpr
510arg :: SyntaxInfo -> IdrisParser PArg
541arg :: SyntaxInfo -> IdrisParser PArg
511arg syn = implicitArg syn
542arg syn = implicitArg syn
@@ -514,10 +545,12 @@ arg syn = implicitArg syn
514 return (pexp e)
545 return (pexp e)
515 <?> "function argument"
546 <?> "function argument"
517−{- |Parses an implicit function argument
548+{-| Parses an implicit function argument
518ImplicitArg ::=
550ImplicitArg ::=
519 '{' Name ('=' Expr)? '}'
551 '{' Name ('=' Expr)? '}'
522implicitArg :: SyntaxInfo -> IdrisParser PArg
555implicitArg :: SyntaxInfo -> IdrisParser PArg
523implicitArg syn = do lchar '{'
556implicitArg syn = do lchar '{'
@@ -529,10 +562,12 @@ implicitArg syn = do lchar '{'
529 return (pimp n v False)
562 return (pimp n v False)
530 <?> "implicit function argument"
563 <?> "implicit function argument"
532−{- |Parses a constraint argument (for selecting a named type class instance)
565+{-| Parses a constraint argument (for selecting a named type class instance)
533−ConstraintArg ::=
567+> ConstraintArg ::=
534− '@{' Expr '}'
568+> '@{' Expr '}'
537constraintArg :: SyntaxInfo -> IdrisParser PArg
572constraintArg :: SyntaxInfo -> IdrisParser PArg
538constraintArg syn = do symbol "@{"
573constraintArg syn = do symbol "@{"
@@ -542,18 +577,22 @@ constraintArg syn = do symbol "@{"
542 <?> "constraint argument"
577 <?> "constraint argument"
545−{- |Parses a record field setter expression
580+{-| Parses a record field setter expression
546RecordType ::=
582RecordType ::=
547 'record' '{' FieldTypeList '}';
583 'record' '{' FieldTypeList '}';
549FieldTypeList ::=
586FieldTypeList ::=
550 FieldType
587 FieldType
551 | FieldType ',' FieldTypeList
588 | FieldType ',' FieldTypeList
554FieldType ::=
592FieldType ::=
555 FnName '=' Expr
593 FnName '=' Expr
558recordType :: SyntaxInfo -> IdrisParser PTerm
597recordType :: SyntaxInfo -> IdrisParser PTerm
559recordType syn
598recordType syn
@@ -580,17 +619,21 @@ recordType syn
580 applyAll fc ((n, e) : es) x
619 applyAll fc ((n, e) : es) x
581 = applyAll fc es (PApp fc (PRef fc (mkType n)) [pexp e, pexp x])
620 = applyAll fc es (PApp fc (PRef fc (mkType n)) [pexp e, pexp x])
583−{- |Creates setters for record types on necessary functions -}
622+-- | Creates setters for record types on necessary functions
584mkType :: Name -> Name
623mkType :: Name -> Name
585mkType (UN n) = UN ("set_" ++ n)
624mkType (UN n) = UN ("set_" ++ n)
586mkType (MN 0 n) = MN 0 ("set_" ++ n)
625mkType (MN 0 n) = MN 0 ("set_" ++ n)
587mkType (NS n s) = NS (mkType n) s
626mkType (NS n s) = NS (mkType n) s
589−{- |Parses a type signature
628+{- | Parses a type signature
590TypeSig ::=
630TypeSig ::=
593TypeExpr ::= ConstraintList? Expr;
635TypeExpr ::= ConstraintList? Expr;
595typeExpr :: SyntaxInfo -> IdrisParser PTerm
638typeExpr :: SyntaxInfo -> IdrisParser PTerm
596typeExpr syn = do cs <- if implicitAllowed syn then constraintList syn else return []
639typeExpr syn = do cs <- if implicitAllowed syn then constraintList syn else return []
@@ -598,15 +641,19 @@ typeExpr syn = do cs <- if implicitAllowed syn then constraintList syn else retu
598 return (bindList (PPi constraint) (map (\x -> (MN 0 "c", x)) cs) sc)
641 return (bindList (PPi constraint) (map (\x -> (MN 0 "c", x)) cs) sc)
599 <?> "type signature"
642 <?> "type signature"
601−{- |Parses a lambda expression
644+{- | Parses a lambda expression
602Lambda ::=
646Lambda ::=
603 '\\' TypeOptDeclList '=>' Expr
647 '\\' TypeOptDeclList '=>' Expr
604 | '\\' SimpleExprList '=>' Expr
648 | '\\' SimpleExprList '=>' Expr
606SimpleExprList ::=
652SimpleExprList ::=
607 SimpleExpr
653 SimpleExpr
608 | SimpleExpr ',' SimpleExprList
654 | SimpleExpr ',' SimpleExprList
611lambda :: SyntaxInfo -> IdrisParser PTerm
658lambda :: SyntaxInfo -> IdrisParser PTerm
612lambda syn = do lchar '\\'
659lambda syn = do lchar '\\'
@@ -628,10 +675,12 @@ lambda syn = do lchar '\\'
628 (PCase fc (PRef fc (MN i "lamp"))
675 (PCase fc (PRef fc (MN i "lamp"))
629 [(x, pmList xs sc)])
676 [(x, pmList xs sc)])
631−{- |Parses a term rewrite expression
678+{- | Parses a term rewrite expression
632RewriteTerm ::=
680RewriteTerm ::=
633 'rewrite' Expr ('==>' Expr)? 'in' Expr
681 'rewrite' Expr ('==>' Expr)? 'in' Expr
636rewriteTerm :: SyntaxInfo -> IdrisParser PTerm
685rewriteTerm :: SyntaxInfo -> IdrisParser PTerm
637rewriteTerm syn = do reserved "rewrite"
686rewriteTerm syn = do reserved "rewrite"
@@ -645,6 +694,7 @@ rewriteTerm syn = do reserved "rewrite"
645 <?> "term rewrite expression"
694 <?> "term rewrite expression"
647{- |Parses a let binding
696{- |Parses a let binding
649 'let' Name TypeSig'? '=' Expr 'in' Expr
699 'let' Name TypeSig'? '=' Expr 'in' Expr
650| 'let' Expr' '=' Expr' 'in' Expr
700| 'let' Expr' '=' Expr' 'in' Expr
@@ -652,6 +702,7 @@ Let ::=
652TypeSig' ::=
702TypeSig' ::=
653 ':' Expr'
703 ':' Expr'
656let_ :: SyntaxInfo -> IdrisParser PTerm
707let_ :: SyntaxInfo -> IdrisParser PTerm
657let_ syn = try (do reserved "let"; n <- name;
708let_ syn = try (do reserved "let"; n <- name;
@@ -666,10 +717,13 @@ let_ syn = try (do reserved "let"; n <- name;
666 return (PCase fc v [(pat, sc)]))
717 return (PCase fc v [(pat, sc)]))
667 <?> "let binding"
718 <?> "let binding"
669−{- |Parses a quote goal
720+{- | Parses a quote goal
670QuoteGoal ::=
723QuoteGoal ::=
671 'quoteGoal' Name 'by' Expr 'in' Expr
724 'quoteGoal' Name 'by' Expr 'in' Expr
674quoteGoal :: SyntaxInfo -> IdrisParser PTerm
728quoteGoal :: SyntaxInfo -> IdrisParser PTerm
675quoteGoal syn = do reserved "quoteGoal"; n <- name;
729quoteGoal syn = do reserved "quoteGoal"; n <- name;
@@ -681,13 +735,15 @@ quoteGoal syn = do reserved "quoteGoal"; n <- name;
681 return (PGoal fc r n sc)
735 return (PGoal fc r n sc)
682 <?> "quote goal expression"
736 <?> "quote goal expression"
684−{- |Parses a dependent type signature
738+{- | Parses a dependent type signature
686 '|'? Static? '(' TypeDeclList ')' DocComment '->' Expr
741 '|'? Static? '(' TypeDeclList ')' DocComment '->' Expr
687 | '|'? Static? '{' TypeDeclList '}' '->' Expr
742 | '|'? Static? '{' TypeDeclList '}' '->' Expr
688 | '{' 'auto' TypeDeclList '}' '->' Expr
743 | '{' 'auto' TypeDeclList '}' '->' Expr
689 | '{' 'default' TypeDeclList '}' '->' Expr
744 | '{' 'default' TypeDeclList '}' '->' Expr
693pi :: SyntaxInfo -> IdrisParser PTerm
749pi :: SyntaxInfo -> IdrisParser PTerm
@@ -729,10 +785,13 @@ pi syn =
729 <?> "dependent type signature"
785 <?> "dependent type signature"
731{- | Parses a type constraint list
787{- | Parses a type constraint list
732ConstraintList ::=
790ConstraintList ::=
733 '(' Expr_List ')' '=>'
791 '(' Expr_List ')' '=>'
734 | Expr '=>'
792 | Expr '=>'
737constraintList :: SyntaxInfo -> IdrisParser [PTerm]
796constraintList :: SyntaxInfo -> IdrisParser [PTerm]
738constraintList syn = try (do lchar '('
797constraintList syn = try (do lchar '('
@@ -746,16 +805,20 @@ constraintList syn = try (do lchar '('
746 <|> return []
805 <|> return []
747 <?> "type constraint list"
806 <?> "type constraint list"
749−{- |Parses a type declaration list
808+{- | Parses a type declaration list
750TypeDeclList ::=
810TypeDeclList ::=
751 FunctionSignatureList
811 FunctionSignatureList
752 | NameList TypeSig
812 | NameList TypeSig
755FunctionSignatureList ::=
817FunctionSignatureList ::=
756 Name TypeSig
818 Name TypeSig
757 | Name TypeSig ',' FunctionSignatureList
819 | Name TypeSig ',' FunctionSignatureList
760typeDeclList :: SyntaxInfo -> IdrisParser [(Name, PTerm)]
823typeDeclList :: SyntaxInfo -> IdrisParser [(Name, PTerm)]
761typeDeclList syn = try (sepBy1 (do x <- fnName
824typeDeclList syn = try (sepBy1 (do x <- fnName
@@ -769,13 +832,17 @@ typeDeclList syn = try (sepBy1 (do x <- fnName
769 return (map (\x -> (x, t)) ns)
832 return (map (\x -> (x, t)) ns)
770 <?> "type declaration list"
833 <?> "type declaration list"
772−{- |Parses a type declaration list with optional parameters
835+{- | Parses a type declaration list with optional parameters
773TypeOptDeclList ::=
837TypeOptDeclList ::=
774 NameOrPlaceholder TypeSig?
838 NameOrPlaceholder TypeSig?
775 | NameOrPlaceholder TypeSig? ',' TypeOptDeclList
839 | NameOrPlaceholder TypeSig? ',' TypeOptDeclList
778NameOrPlaceHolder ::= Name | '_';
844NameOrPlaceHolder ::= Name | '_';
780tyOptDeclList :: SyntaxInfo -> IdrisParser [(Name, PTerm)]
847tyOptDeclList :: SyntaxInfo -> IdrisParser [(Name, PTerm)]
781tyOptDeclList syn = sepBy1 (do x <- nameOrPlaceholder
848tyOptDeclList syn = sepBy1 (do x <- nameOrPlaceholder
@@ -790,13 +857,17 @@ tyOptDeclList syn = sepBy1 (do x <- nameOrPlaceholder
790 return (MN 0 "underscore")
857 return (MN 0 "underscore")
791 <?> "name or placeholder"
858 <?> "name or placeholder"
793−{- |Parses a list comprehension
860+{- | Parses a list comprehension
794Comprehension ::= '[' Expr '|' DoList ']';
862Comprehension ::= '[' Expr '|' DoList ']';
796DoList ::=
866DoList ::=
798 | Do ',' DoList
868 | Do ',' DoList
801comprehension :: SyntaxInfo -> IdrisParser PTerm
872comprehension :: SyntaxInfo -> IdrisParser PTerm
802comprehension syn
873comprehension syn
@@ -815,12 +886,16 @@ comprehension syn
815 [pexp e])
886 [pexp e])
816 addGuard x = x
887 addGuard x = x
818−{- |Parses a do-block
889+{- | Parses a do-block
819Do' ::= Do KeepTerminator;
891Do' ::= Do KeepTerminator;
821DoBlock ::=
895DoBlock ::=
822 'do' OpenBlock Do'+ CloseBlock
896 'do' OpenBlock Do'+ CloseBlock
825doBlock :: SyntaxInfo -> IdrisParser PTerm
900doBlock :: SyntaxInfo -> IdrisParser PTerm
826doBlock syn
901doBlock syn
@@ -829,7 +904,8 @@ doBlock syn
829 return (PDoBlock ds)
904 return (PDoBlock ds)
830 <?> "do block"
905 <?> "do block"
832−{- |Parses an expression inside a do block
907+{- | Parses an expression inside a do block
834 'let' Name TypeSig'? '=' Expr
910 'let' Name TypeSig'? '=' Expr
835 | 'let' Expr' '=' Expr
911 | 'let' Expr' '=' Expr
@@ -837,6 +913,7 @@ Do ::=
837 | Expr' '<-' Expr
913 | Expr' '<-' Expr
841do_ :: SyntaxInfo -> IdrisParser PDo
918do_ :: SyntaxInfo -> IdrisParser PDo
@@ -869,8 +946,10 @@ do_ syn
869 return (DoExp fc e)
946 return (DoExp fc e)
870 <?> "do block expression"
947 <?> "do block expression"
872−{- |Parses an expression in idiom brackets
949+{- | Parses an expression in idiom brackets
873Idiom ::= '[|' Expr '|]';
951Idiom ::= '[|' Expr '|]';
875idiom :: SyntaxInfo -> IdrisParser PTerm
954idiom :: SyntaxInfo -> IdrisParser PTerm
@@ -882,6 +961,8 @@ idiom syn
882 <?> "expression in idiom brackets"
961 <?> "expression in idiom brackets"
884{- |Parses a constant or literal expression
963{- |Parses a constant or literal expression
885Constant ::=
966Constant ::=
886 'Integer'
967 'Integer'
@@ -902,6 +983,7 @@ Constant ::=
902 | String_t
983 | String_t
906constant :: IdrisParser Core.TT.Const
988constant :: IdrisParser Core.TT.Const
907constant = do reserved "Integer";return (AType (ATInt ITBig))
989constant = do reserved "Integer";return (AType (ATInt ITBig))
@@ -924,17 +1006,22 @@ constant = do reserved "Integer";return (AType (ATInt ITBig))
924 <|> try (do c <- charLiteral; return $ Ch c)
1006 <|> try (do c <- charLiteral; return $ Ch c)
925 <?> "constant or literal"
1007 <?> "constant or literal"
927−{- |Parses a static modifier
1009+{- | Parses a static modifier
928Static ::=
1012Static ::=
929 '[' static ']'
1013 '[' static ']'
932static :: IdrisParser Static
1017static :: IdrisParser Static
933static = do lchar '['; reserved "static"; lchar ']'; return Static
1018static = do lchar '['; reserved "static"; lchar ']'; return Static
934 <|> return Dynamic
1019 <|> return Dynamic
935 <?> "static modifier"
1020 <?> "static modifier"
937−{- | Parses a tactic script
1022+{- | Parses a tactic script
938Tactic ::= 'intro' NameList?
1025Tactic ::= 'intro' NameList?
939 | 'intros'
1026 | 'intros'
940 | 'refine' Name Imp+
1027 | 'refine' Name Imp+
@@ -968,7 +1055,7 @@ TacticSeq ::=
968 Tactic ';' Tactic
1055 Tactic ';' Tactic
969 | Tactic ';' TacticSeq
1056 | Tactic ';' TacticSeq
974tactic :: SyntaxInfo -> IdrisParser PTactic
1061tactic :: SyntaxInfo -> IdrisParser PTactic
@@ -1041,7 +1128,7 @@ tactic syn = do reserved "intro"; ns <- sepBy (indentPropHolds gtProp *> name) (
1041 mergeSeq [t] = t
1128 mergeSeq [t] = t
1042 mergeSeq (t:ts) = TSeq t (mergeSeq ts)
1129 mergeSeq (t:ts) = TSeq t (mergeSeq ts)
1044−{- | Parses a tactic as a whole -}
1131+-- | Parses a tactic as a whole
1045fullTactic :: SyntaxInfo -> IdrisParser PTactic
1132fullTactic :: SyntaxInfo -> IdrisParser PTactic
1046fullTactic syn = do t <- tactic syn
1133fullTactic syn = do t <- tactic syn