@@ -62,6 +62,7 @@ import System.FilePath
62import System.IO
62import System.IO
65 grammar shortcut notation:
66 grammar shortcut notation:
66 ~CHARSEQ = complement of char sequence (i.e. any character except CHARSEQ)
67 ~CHARSEQ = complement of char sequence (i.e. any character except CHARSEQ)
67 RULE? = optional rule (i.e. RULE or nothing)
68 RULE? = optional rule (i.e. RULE or nothing)
@@ -69,12 +70,16 @@ import System.IO
69 RULE+ = repeated rule with at least one match (i.e. RULE one or more times)
70 RULE+ = repeated rule with at least one match (i.e. RULE one or more times)
70 RULE! = invalid rule (i.e. rule that is not valid in context, report meaningful error in case)
71 RULE! = invalid rule (i.e. rule that is not valid in context, report meaningful error in case)
71 RULE{n} = rule repeated n times
72 RULE{n} = rule repeated n times
74{- * Main grammar -}
76{- * Main grammar -}
76{- | Parses module definition
78{- | Parses module definition
77 ModuleHeader ::= 'module' Identifier_t ';'?;
81 ModuleHeader ::= 'module' Identifier_t ';'?;
79moduleHeader :: IdrisParser [String]
84moduleHeader :: IdrisParser [String]
80moduleHeader = try (do reserved "module"
85moduleHeader = try (do reserved "module"
@@ -89,7 +94,10 @@ moduleHeader = try (do reserved "module"
89 (x, '.':y) -> x : moduleName y
94 (x, '.':y) -> x : moduleName y
91{- | Parses an import statement
96{- | Parses an import statement
92 Import ::= 'import' Identifier_t ';'?;
99 Import ::= 'import' Identifier_t ';'?;
94import_ :: IdrisParser String
102import_ :: IdrisParser String
95import_ = do reserved "import"
103import_ = do reserved "import"
@@ -100,7 +108,10 @@ import_ = do reserved "import"
100 where toPath f = foldl1' (</>) (Spl.splitOn "." f)
108 where toPath f = foldl1' (</>) (Spl.splitOn "." f)
102{- | Parses program source
110{- | Parses program source
103 Prog ::= Decl* EOF;
113 Prog ::= Decl* EOF;
105prog :: SyntaxInfo -> IdrisParser [PDecl]
116prog :: SyntaxInfo -> IdrisParser [PDecl]
106prog syn = do whiteSpace
117prog syn = do whiteSpace
@@ -110,7 +121,9 @@ prog syn = do whiteSpace
110 let c = (concat decls)
121 let c = (concat decls)
113−{- | Parses a top-level declaration
124+{-| Parses a top-level declaration
@@ -125,6 +138,7 @@ Decl ::=
125 | Transform
138 | Transform
126 | Import!
139 | Import!
129decl :: SyntaxInfo -> IdrisParser [PDecl]
143decl :: SyntaxInfo -> IdrisParser [PDecl]
130decl syn = do notEndBlock
144decl syn = do notEndBlock
@@ -150,6 +164,8 @@ decl syn = do notEndBlock
150 return [d']
164 return [d']
152{- | Parses a top-level declaration with possible syntax sugar
166{- | Parses a top-level declaration with possible syntax sugar
155 | FunDecl'
171 | FunDecl'
@@ -157,6 +173,7 @@ Decl' ::=
158 | SyntaxDecl
174 | SyntaxDecl
161decl' :: SyntaxInfo -> IdrisParser PDecl
178decl' :: SyntaxInfo -> IdrisParser PDecl
162decl' syn = fixity
179decl' syn = fixity
@@ -167,7 +184,10 @@ decl' syn = fixity
167 <?> "declaration"
184 <?> "declaration"
169{- | Parses a syntax extension declaration (and adds the rule to parser state)
186{- | Parses a syntax extension declaration (and adds the rule to parser state)
170 SyntaxDecl ::= SyntaxRule;
189 SyntaxDecl ::= SyntaxRule;
172syntaxDecl :: SyntaxInfo -> IdrisParser PDecl
192syntaxDecl :: SyntaxInfo -> IdrisParser PDecl
173syntaxDecl syn = do s <- syntaxRule syn
193syntaxDecl syn = do s <- syntaxRule syn
@@ -185,17 +205,24 @@ syntaxDecl syn = do s <- syntaxRule syn
185 ename (Keyword n) = Just n
205 ename (Keyword n) = Just n
186 ename _ = Nothing
206 ename _ = Nothing
188−{- | Parses a syntax extension declaration
208+{- | Parses a syntax extension declaration
189−SyntaxRuleOpts ::= 'term' | 'pattern';
211+SyntaxRuleOpts ::= 'term' | 'pattern';
191SyntaxRule ::=
215SyntaxRule ::=
192 SyntaxRuleOpts? 'syntax' SyntaxSym+ '=' TypeExpr Terminator;
216 SyntaxRuleOpts? 'syntax' SyntaxSym+ '=' TypeExpr Terminator;
194SyntaxSym ::= '[' Name_t ']'
220SyntaxSym ::= '[' Name_t ']'
195 | '{' Name_t '}'
221 | '{' Name_t '}'
197 | StringLiteral_t
223 | StringLiteral_t
200syntaxRule :: SyntaxInfo -> IdrisParser Syntax
227syntaxRule :: SyntaxInfo -> IdrisParser Syntax
201syntaxRule syn
228syntaxRule syn
@@ -231,11 +258,14 @@ syntaxRule syn
233{- | Parses a syntax symbol (either binding variable, keyword or expression)
260{- | Parses a syntax symbol (either binding variable, keyword or expression)
234SyntaxSym ::= '[' Name_t ']'
263SyntaxSym ::= '[' Name_t ']'
235 | '{' Name_t '}'
264 | '{' Name_t '}'
237 | StringLiteral_t
266 | StringLiteral_t
240syntaxSym :: IdrisParser SSymbol
270syntaxSym :: IdrisParser SSymbol
241syntaxSym = try (do lchar '['; n <- name; lchar ']'
271syntaxSym = try (do lchar '['; n <- name; lchar ']'
@@ -249,7 +279,10 @@ syntaxSym = try (do lchar '['; n <- name; lchar ']'
249 <?> "syntax symbol"
279 <?> "syntax symbol"
251{- | Parses a function declaration with possible syntax sugar
281{- | Parses a function declaration with possible syntax sugar
252 FunDecl ::= FunDecl';
284 FunDecl ::= FunDecl';
254fnDecl :: SyntaxInfo -> IdrisParser [PDecl]
287fnDecl :: SyntaxInfo -> IdrisParser [PDecl]
255fnDecl syn = try (do notEndBlock
288fnDecl syn = try (do notEndBlock
@@ -258,13 +291,16 @@ fnDecl syn = try (do notEndBlock
258 let d' = fmap (desugar syn i) d
291 let d' = fmap (desugar syn i) d
259 return [d']) <?> "function declaration"
292 return [d']) <?> "function declaration"
261−{- Parses a function declaration
294+{-| Parses a function declaration
262 FunDecl' ::=
297 FunDecl' ::=
263 DocComment_t? FnOpts* Accessibility? FnOpts* FnName TypeSig Terminator
298 DocComment_t? FnOpts* Accessibility? FnOpts* FnName TypeSig Terminator
264 | Postulate
299 | Postulate
265 | Pattern
300 | Pattern
269fnDecl' :: SyntaxInfo -> IdrisParser PDecl
305fnDecl' :: SyntaxInfo -> IdrisParser PDecl
270fnDecl' syn = checkFixity $
306fnDecl' syn = checkFixity $
@@ -308,23 +344,29 @@ fnDecl' syn = checkFixity $
308 | otherwise = return True
344 | otherwise = return True
309 fixityOK _ = return True
345 fixityOK _ = return True
311−{- Parses function options given initial options
347+{-| Parses function options given initial options
312FnOpts ::= 'total'
350FnOpts ::= 'total'
313 | 'partial'
351 | 'partial'
314 | 'implicit'
352 | 'implicit'
315 | '%' 'assert_total'
353 | '%' 'assert_total'
316 | '%' 'error_handler'
354 | '%' 'error_handler'
317− | '%' 'reflection'
355+ | '%' 'reflection'
318 | '%' 'specialise' '[' NameTimesList? ']'
356 | '%' 'specialise' '[' NameTimesList? ']'
321NameTimes ::= FnName Natural?;
361NameTimes ::= FnName Natural?;
323NameTimesList ::=
365NameTimesList ::=
324 NameTimes
366 NameTimes
325 | NameTimes ',' NameTimesList
367 | NameTimes ',' NameTimesList
329-- FIXME: Check compatability for function options (i.e. partal/total)
371-- FIXME: Check compatability for function options (i.e. partal/total)
330fnOpts :: [FnOpt] -> IdrisParser [FnOpt]
372fnOpts :: [FnOpt] -> IdrisParser [FnOpt]
@@ -353,9 +395,11 @@ fnOpts opts
354{- | Parses a postulate
396{- | Parses a postulate
356Postulate ::=
399Postulate ::=
357 DocComment_t? 'postulate' FnOpts* Accesibility? FnOpts* FnName TypeSig Terminator
400 DocComment_t? 'postulate' FnOpts* Accesibility? FnOpts* FnName TypeSig Terminator
360postulate :: SyntaxInfo -> IdrisParser PDecl
404postulate :: SyntaxInfo -> IdrisParser PDecl
361postulate syn = do doc <- try $ do doc <- option "" (docComment '|')
405postulate syn = do doc <- try $ do doc <- option "" (docComment '|')
@@ -381,9 +425,11 @@ postulate syn = do doc <- try $ do doc <- option "" (docComment '|')
382{- | Parses a using declaration
426{- | Parses a using declaration
385 'using' '(' UsingDeclList ')' OpenBlock Decl* CloseBlock
430 'using' '(' UsingDeclList ')' OpenBlock Decl* CloseBlock
388using_ :: SyntaxInfo -> IdrisParser [PDecl]
434using_ :: SyntaxInfo -> IdrisParser [PDecl]
389using_ syn =
435using_ syn =
@@ -395,11 +441,13 @@ using_ syn =
395 return (concat ds)
441 return (concat ds)
396 <?> "using declaration"
442 <?> "using declaration"
398−{- | Parses a parameters declaration
444+{- | Parses a parameters declaration
400Params ::=
447Params ::=
401 'parameters' '(' TypeDeclList ')' OpenBlock Decl* CloseBlock
448 'parameters' '(' TypeDeclList ')' OpenBlock Decl* CloseBlock
404params :: SyntaxInfo -> IdrisParser [PDecl]
452params :: SyntaxInfo -> IdrisParser [PDecl]
405params syn =
453params syn =
@@ -414,9 +462,11 @@ params syn =
415{- | Parses a mutual declaration (for mutually recursive functions)
463{- | Parses a mutual declaration (for mutually recursive functions)
417Mutual ::=
466Mutual ::=
418 'mutual' OpenBlock Decl* CloseBlock
467 'mutual' OpenBlock Decl* CloseBlock
421mutual :: SyntaxInfo -> IdrisParser [PDecl]
471mutual :: SyntaxInfo -> IdrisParser [PDecl]
422mutual syn =
472mutual syn =
@@ -429,11 +479,13 @@ mutual syn =
429 return [PMutual fc (concat ds)]
479 return [PMutual fc (concat ds)]
430 <?> "mutual block"
480 <?> "mutual block"
432−{- | Parses a namespace declaration
482+{-| Parses a namespace declaration
434Namespace ::=
485Namespace ::=
435 'namespace' identifier OpenBlock Decl+ CloseBlock
486 'namespace' identifier OpenBlock Decl+ CloseBlock
438namespace :: SyntaxInfo -> IdrisParser [PDecl]
490namespace :: SyntaxInfo -> IdrisParser [PDecl]
439namespace syn =
491namespace syn =
@@ -444,9 +496,12 @@ namespace syn =
444 return [PNamespace n (concat ds)]
496 return [PNamespace n (concat ds)]
445 <?> "namespace declaration"
497 <?> "namespace declaration"
447−{- |Parses a methods block (for instances)
499+{- | Parses a methods block (for instances)
448 InstanceBlock ::= 'where' OpenBlock FnDecl* CloseBlock
502 InstanceBlock ::= 'where' OpenBlock FnDecl* CloseBlock
450instanceBlock :: SyntaxInfo -> IdrisParser [PDecl]
505instanceBlock :: SyntaxInfo -> IdrisParser [PDecl]
451instanceBlock syn = do reserved "where"
506instanceBlock syn = do reserved "where"
452 openBlock
507 openBlock
@@ -455,16 +510,20 @@ instanceBlock syn = do reserved "where"
455 return (concat ds)
510 return (concat ds)
456 <?> "instance block"
511 <?> "instance block"
458−{- |Parses a methods and instances block (for type classes)
513+{- | Parses a methods and instances block (for type classes)
460MethodOrInstance ::=
516MethodOrInstance ::=
462 | Instance
518 | Instance
465ClassBlock ::=
523ClassBlock ::=
466 'where' OpenBlock MethodOrInstance* CloseBlock
524 'where' OpenBlock MethodOrInstance* CloseBlock
469classBlock :: SyntaxInfo -> IdrisParser [PDecl]
528classBlock :: SyntaxInfo -> IdrisParser [PDecl]
470classBlock syn = do reserved "where"
529classBlock syn = do reserved "where"
@@ -474,16 +533,20 @@ classBlock syn = do reserved "where"
474 return (concat ds)
533 return (concat ds)
475 <?> "class block"
534 <?> "class block"
477−{- |Parses a type class declaration
536+{-| Parses a type class declaration
479ClassArgument ::=
539ClassArgument ::=
481 | '(' Name ':' Expr ')'
541 | '(' Name ':' Expr ')'
485 DocComment_t? Accessibility? 'class' ConstraintList? Name ClassArgument* ClassBlock?
547 DocComment_t? Accessibility? 'class' ConstraintList? Name ClassArgument* ClassBlock?
488class_ :: SyntaxInfo -> IdrisParser [PDecl]
551class_ :: SyntaxInfo -> IdrisParser [PDecl]
489class_ syn = do (doc, acc) <- try (do
552class_ syn = do (doc, acc) <- try (do
@@ -504,13 +567,17 @@ class_ syn = do (doc, acc) <- try (do
504 <|> do i <- name;
567 <|> do i <- name;
505 return (i, PType)
568 return (i, PType)
507−{- |Parses a type class instance declaration
570+{- | Parses a type class instance declaration
509 Instance ::=
573 Instance ::=
510 'instance' InstanceName? ConstraintList? Name SimpleExpr* InstanceBlock?
574 'instance' InstanceName? ConstraintList? Name SimpleExpr* InstanceBlock?
513− InstanceName ::= '[' Name ']';
579+InstanceName ::= '[' Name ']';
515instance_ :: SyntaxInfo -> IdrisParser [PDecl]
582instance_ :: SyntaxInfo -> IdrisParser [PDecl]
516instance_ syn = do reserved "instance"; fc <- getFC
583instance_ syn = do reserved "instance"; fc <- getFC
@@ -531,20 +598,27 @@ instance_ syn = do reserved "instance"; fc <- getFC
533{- | Parses a using declaration list
600{- | Parses a using declaration list
534UsingDeclList ::=
603UsingDeclList ::=
535 UsingDeclList'
604 UsingDeclList'
536 | NameList TypeSig
605 | NameList TypeSig
539UsingDeclList' ::=
610UsingDeclList' ::=
540 UsingDecl
611 UsingDecl
541 | UsingDecl ',' UsingDeclList'
612 | UsingDecl ',' UsingDeclList'
544NameList ::=
617NameList ::=
546 | Name ',' NameList
619 | Name ',' NameList
549usingDeclList :: SyntaxInfo -> IdrisParser [Using]
623usingDeclList :: SyntaxInfo -> IdrisParser [Using]
550usingDeclList syn
624usingDeclList syn
@@ -556,10 +630,13 @@ usingDeclList syn
556 <?> "using declaration list"
630 <?> "using declaration list"
558{- |Parses a using declaration
632{- |Parses a using declaration
559UsingDecl ::=
635UsingDecl ::=
560 FnName TypeSig
636 FnName TypeSig
561 | FnName FnName+
637 | FnName FnName+
564usingDecl :: SyntaxInfo -> IdrisParser Using
641usingDecl :: SyntaxInfo -> IdrisParser Using
565usingDecl syn = try (do x <- fnName
642usingDecl syn = try (do x <- fnName
@@ -571,8 +648,11 @@ usingDecl syn = try (do x <- fnName
571 return (UConstraint c xs)
648 return (UConstraint c xs)
572 <?> "using declaration"
649 <?> "using declaration"
574−{- | Parse a clause with patterns
651+{- | Parse a clause with patterns
575Pattern ::= Clause;
654Pattern ::= Clause;
577pattern :: SyntaxInfo -> IdrisParser PDecl
657pattern :: SyntaxInfo -> IdrisParser PDecl
578pattern syn = do fc <- getFC
658pattern syn = do fc <- getFC
@@ -581,7 +661,10 @@ pattern syn = do fc <- getFC
581 <?> "pattern"
661 <?> "pattern"
583{- | Parse a constant applicative form declaration
663{- | Parse a constant applicative form declaration
584− CAF ::= 'let' FnName '=' Expr Terminator;
666+CAF ::= 'let' FnName '=' Expr Terminator;
586caf :: SyntaxInfo -> IdrisParser PDecl
669caf :: SyntaxInfo -> IdrisParser PDecl
587caf syn = do reserved "let"
670caf syn = do reserved "let"
@@ -594,7 +677,10 @@ caf syn = do reserved "let"
594 <?> "constant applicative form declaration"
677 <?> "constant applicative form declaration"
596{- | Parse an argument expression
679{- | Parse an argument expression
597− ArgExpr ::= HSimpleExpr | {- In Pattern External (User-defined) Expression -};
682+ArgExpr ::= HSimpleExpr | {- In Pattern External (User-defined) Expression -};
599argExpr :: SyntaxInfo -> IdrisParser PTerm
685argExpr :: SyntaxInfo -> IdrisParser PTerm
600argExpr syn = let syn' = syn { inPattern = True } in
686argExpr syn = let syn' = syn { inPattern = True } in
@@ -602,12 +688,17 @@ argExpr syn = let syn' = syn { inPattern = True } in
602 <?> "argument expression"
688 <?> "argument expression"
604{- | Parse a right hand side of a function
690{- | Parse a right hand side of a function
605RHS ::= '=' Expr
693RHS ::= '=' Expr
606 | '?=' RHSName? Expr
694 | '?=' RHSName? Expr
607 | 'impossible'
695 | 'impossible'
610RHSName ::= '{' FnName '}';
700RHSName ::= '{' FnName '}';
612rhs :: SyntaxInfo -> Name -> IdrisParser PTerm
703rhs :: SyntaxInfo -> Name -> IdrisParser PTerm
613rhs syn n = do lchar '='; expr syn
704rhs syn n = do lchar '='; expr syn
@@ -630,16 +721,28 @@ rhs syn n = do lchar '='; expr syn
630 addLet nm r = (PLet (sUN "value") Placeholder r (PMetavar nm))
721 addLet nm r = (PLet (sUN "value") Placeholder r (PMetavar nm))
632{- |Parses a function clause
723{- |Parses a function clause
633RHSOrWithBlock ::= RHS WhereOrTerminator
726RHSOrWithBlock ::= RHS WhereOrTerminator
634 | 'with' SimpleExpr OpenBlock FnDecl+ CloseBlock
727 | 'with' SimpleExpr OpenBlock FnDecl+ CloseBlock
636Clause ::= WExpr+ RHSOrWithBlock
732Clause ::= WExpr+ RHSOrWithBlock
637 | SimpleExpr '<==' FnName RHS WhereOrTerminator
733 | SimpleExpr '<==' FnName RHS WhereOrTerminator
638 | ArgExpr Operator ArgExpr WExpr* RHSOrWithBlock {- Except "=" and "?=" operators to avoid ambiguity -}
734 | ArgExpr Operator ArgExpr WExpr* RHSOrWithBlock {- Except "=" and "?=" operators to avoid ambiguity -}
639 | FnName ConstraintArg* ImplicitOrArgExpr* WExpr* RHSOrWithBlock
735 | FnName ConstraintArg* ImplicitOrArgExpr* WExpr* RHSOrWithBlock
641ImplicitOrArgExpr ::= ImplicitArg | ArgExpr;
740ImplicitOrArgExpr ::= ImplicitArg | ArgExpr;
642−WhereOrTerminator ::= WhereBlock | Terminator;
744+WhereOrTerminator ::= WhereBlock | Terminator;
644clause :: SyntaxInfo -> IdrisParser PClause
747clause :: SyntaxInfo -> IdrisParser PClause
645clause syn
748clause syn
@@ -768,17 +871,23 @@ clause syn
768 fillLHSD n c a (PClauses fc o fn cs) = PClauses fc o fn (map (fillLHS n c a) cs)
871 fillLHSD n c a (PClauses fc o fn cs) = PClauses fc o fn (map (fillLHS n c a) cs)
769 fillLHSD n c a x = x
872 fillLHSD n c a x = x
771−{- |Parses with pattern
874+{-| Parses with pattern
772− WExpr ::= '|' Expr';
877+WExpr ::= '|' Expr';
774wExpr :: SyntaxInfo -> IdrisParser PTerm
880wExpr :: SyntaxInfo -> IdrisParser PTerm
775wExpr syn = do lchar '|'
881wExpr syn = do lchar '|'
776 expr' syn
882 expr' syn
777 <?> "with pattern"
883 <?> "with pattern"
779−{- |Parses a where block
885+{- | Parses a where block
780WhereBlock ::= 'where' OpenBlock Decl+ CloseBlock;
888WhereBlock ::= 'where' OpenBlock Decl+ CloseBlock;
782whereBlock :: Name -> SyntaxInfo -> IdrisParser ([PDecl], [(Name, Name)])
891whereBlock :: Name -> SyntaxInfo -> IdrisParser ([PDecl], [(Name, Name)])
783whereBlock n syn
892whereBlock n syn
784 = do reserved "where"
893 = do reserved "where"
@@ -788,6 +897,8 @@ whereBlock n syn
788 <?> "where block"
897 <?> "where block"
790{- |Parses a code generation target language name
899{- |Parses a code generation target language name
791Codegen ::= 'C'
902Codegen ::= 'C'
793 | 'JavaScript'
904 | 'JavaScript'
@@ -795,6 +906,7 @@ Codegen ::= 'C'
796 | 'Bytecode'
907 | 'Bytecode'
799codegen_ :: IdrisParser Codegen
911codegen_ :: IdrisParser Codegen
800codegen_ = do reserved "C"; return ViaC
912codegen_ = do reserved "C"; return ViaC
@@ -806,13 +918,18 @@ codegen_ = do reserved "C"; return ViaC
806 <?> "code generation language"
918 <?> "code generation language"
808{- |Parses a compiler directive
920{- |Parses a compiler directive
809StringList ::=
922StringList ::=
811 | String ',' StringList
924 | String ',' StringList
814Directive ::= '%' Directive';
929Directive ::= '%' Directive';
816Directive' ::= 'lib' CodeGen String_t
933Directive' ::= 'lib' CodeGen String_t
817 | 'link' CodeGen String_t
934 | 'link' CodeGen String_t
818 | 'flag' CodeGen String_t
935 | 'flag' CodeGen String_t
@@ -827,6 +944,7 @@ Directive' ::= 'lib' CodeGen String_t
827 | 'language' 'TypeProviders'
944 | 'language' 'TypeProviders'
828 | 'language' 'ErrorReflection'
945 | 'language' 'ErrorReflection'
831directive :: SyntaxInfo -> IdrisParser [PDecl]
949directive :: SyntaxInfo -> IdrisParser [PDecl]
832directive syn = do try (lchar '%' *> reserved "lib"); cgn <- codegen_; lib <- stringLiteral;
950directive syn = do try (lchar '%' *> reserved "lib"); cgn <- codegen_; lib <- stringLiteral;
@@ -886,15 +1004,22 @@ pLangExt = (reserved "TypeProviders" >> return TypeProviders)
886 <|> (reserved "ErrorReflection" >> return ErrorReflection)
1004 <|> (reserved "ErrorReflection" >> return ErrorReflection)
888{- | Parses a totality
1006{- | Parses a totality
889Totality ::= 'partial' | 'total'
1009Totality ::= 'partial' | 'total'
891totality :: IdrisParser Bool
1013totality :: IdrisParser Bool
893 = do reserved "total"; return True
1015 = do reserved "total"; return True
894 <|> do reserved "partial"; return False
1016 <|> do reserved "partial"; return False
896−{- | Parses a type provider
1018+{- | Parses a type provider
897Provider ::= '%' 'provide' '(' FnName TypeSig ')' 'with' Expr;
1021Provider ::= '%' 'provide' '(' FnName TypeSig ')' 'with' Expr;
899provider :: SyntaxInfo -> IdrisParser [PDecl]
1024provider :: SyntaxInfo -> IdrisParser [PDecl]
900provider syn = do try (lchar '%' *> reserved "provide");
1025provider syn = do try (lchar '%' *> reserved "provide");
@@ -906,7 +1031,10 @@ provider syn = do try (lchar '%' *> reserved "provide");
906 <?> "type provider"
1031 <?> "type provider"
908{- | Parses a transform
1033{- | Parses a transform
909Transform ::= '%' 'transform' Expr '==>' Expr
1036Transform ::= '%' 'transform' Expr '==>' Expr
911transform :: SyntaxInfo -> IdrisParser [PDecl]
1039transform :: SyntaxInfo -> IdrisParser [PDecl]
912transform syn = do try (lchar '%' *> reserved "transform")
1040transform syn = do try (lchar '%' *> reserved "transform")