@@ -65,6 +65,7 @@ import System.FilePath
65import System.IO
65import System.IO
68 grammar shortcut notation:
69 grammar shortcut notation:
69 ~CHARSEQ = complement of char sequence (i.e. any character except CHARSEQ)
70 ~CHARSEQ = complement of char sequence (i.e. any character except CHARSEQ)
70 RULE? = optional rule (i.e. RULE or nothing)
71 RULE? = optional rule (i.e. RULE or nothing)
@@ -72,12 +73,16 @@ import System.IO
72 RULE+ = repeated rule with at least one match (i.e. RULE one or more times)
73 RULE+ = repeated rule with at least one match (i.e. RULE one or more times)
73 RULE! = invalid rule (i.e. rule that is not valid in context, report meaningful error in case)
74 RULE! = invalid rule (i.e. rule that is not valid in context, report meaningful error in case)
74 RULE{n} = rule repeated n times
75 RULE{n} = rule repeated n times
77{- * Main grammar -}
79{- * Main grammar -}
79{- | Parses module definition
81{- | Parses module definition
80 ModuleHeader ::= 'module' Identifier_t ';'?;
84 ModuleHeader ::= 'module' Identifier_t ';'?;
82moduleHeader :: IdrisParser [String]
87moduleHeader :: IdrisParser [String]
83moduleHeader = try (do reserved "module"
88moduleHeader = try (do reserved "module"
@@ -92,7 +97,10 @@ moduleHeader = try (do reserved "module"
92 (x, '.':y) -> x : moduleName y
97 (x, '.':y) -> x : moduleName y
94{- | Parses an import statement
99{- | Parses an import statement
95 Import ::= 'import' Identifier_t ';'?;
102 Import ::= 'import' Identifier_t ';'?;
97import_ :: IdrisParser (String, Maybe String, FC)
105import_ :: IdrisParser (String, Maybe String, FC)
98import_ = do fc <- getFC
106import_ = do fc <- getFC
@@ -105,7 +113,10 @@ import_ = do fc <- getFC
105 where toPath = foldl1' (</>) . Spl.splitOn "."
113 where toPath = foldl1' (</>) . Spl.splitOn "."
107{- | Parses program source
115{- | Parses program source
108 Prog ::= Decl* EOF;
118 Prog ::= Decl* EOF;
110prog :: SyntaxInfo -> IdrisParser [PDecl]
121prog :: SyntaxInfo -> IdrisParser [PDecl]
111prog syn = do whiteSpace
122prog syn = do whiteSpace
@@ -115,7 +126,9 @@ prog syn = do whiteSpace
115 let c = (concat decls)
126 let c = (concat decls)
118−{- | Parses a top-level declaration
129+{-| Parses a top-level declaration
@@ -130,6 +143,7 @@ Decl ::=
130 | Transform
143 | Transform
131 | Import!
144 | Import!
134decl :: SyntaxInfo -> IdrisParser [PDecl]
148decl :: SyntaxInfo -> IdrisParser [PDecl]
135decl syn = do notEndBlock
149decl syn = do notEndBlock
@@ -155,6 +169,8 @@ decl syn = do notEndBlock
155 return [d']
169 return [d']
157{- | Parses a top-level declaration with possible syntax sugar
171{- | Parses a top-level declaration with possible syntax sugar
160 | FunDecl'
176 | FunDecl'
@@ -162,6 +178,7 @@ Decl' ::=
163 | SyntaxDecl
179 | SyntaxDecl
166decl' :: SyntaxInfo -> IdrisParser PDecl
183decl' :: SyntaxInfo -> IdrisParser PDecl
167decl' syn = fixity
184decl' syn = fixity
@@ -172,7 +189,10 @@ decl' syn = fixity
172 <?> "declaration"
189 <?> "declaration"
174{- | Parses a syntax extension declaration (and adds the rule to parser state)
191{- | Parses a syntax extension declaration (and adds the rule to parser state)
175 SyntaxDecl ::= SyntaxRule;
194 SyntaxDecl ::= SyntaxRule;
177syntaxDecl :: SyntaxInfo -> IdrisParser PDecl
197syntaxDecl :: SyntaxInfo -> IdrisParser PDecl
178syntaxDecl syn = do s <- syntaxRule syn
198syntaxDecl syn = do s <- syntaxRule syn
@@ -190,17 +210,24 @@ syntaxDecl syn = do s <- syntaxRule syn
190 ename (Keyword n) = Just n
210 ename (Keyword n) = Just n
191 ename _ = Nothing
211 ename _ = Nothing
193−{- | Parses a syntax extension declaration
213+{- | Parses a syntax extension declaration
194−SyntaxRuleOpts ::= 'term' | 'pattern';
216+SyntaxRuleOpts ::= 'term' | 'pattern';
196SyntaxRule ::=
220SyntaxRule ::=
197 SyntaxRuleOpts? 'syntax' SyntaxSym+ '=' TypeExpr Terminator;
221 SyntaxRuleOpts? 'syntax' SyntaxSym+ '=' TypeExpr Terminator;
199SyntaxSym ::= '[' Name_t ']'
225SyntaxSym ::= '[' Name_t ']'
200 | '{' Name_t '}'
226 | '{' Name_t '}'
202 | StringLiteral_t
228 | StringLiteral_t
205syntaxRule :: SyntaxInfo -> IdrisParser Syntax
232syntaxRule :: SyntaxInfo -> IdrisParser Syntax
206syntaxRule syn
233syntaxRule syn
@@ -236,11 +263,14 @@ syntaxRule syn
238{- | Parses a syntax symbol (either binding variable, keyword or expression)
265{- | Parses a syntax symbol (either binding variable, keyword or expression)
239SyntaxSym ::= '[' Name_t ']'
268SyntaxSym ::= '[' Name_t ']'
240 | '{' Name_t '}'
269 | '{' Name_t '}'
242 | StringLiteral_t
271 | StringLiteral_t
245syntaxSym :: IdrisParser SSymbol
275syntaxSym :: IdrisParser SSymbol
246syntaxSym = try (do lchar '['; n <- name; lchar ']'
276syntaxSym = try (do lchar '['; n <- name; lchar ']'
@@ -254,7 +284,10 @@ syntaxSym = try (do lchar '['; n <- name; lchar ']'
254 <?> "syntax symbol"
284 <?> "syntax symbol"
256{- | Parses a function declaration with possible syntax sugar
286{- | Parses a function declaration with possible syntax sugar
257 FunDecl ::= FunDecl';
289 FunDecl ::= FunDecl';
259fnDecl :: SyntaxInfo -> IdrisParser [PDecl]
292fnDecl :: SyntaxInfo -> IdrisParser [PDecl]
260fnDecl syn = try (do notEndBlock
293fnDecl syn = try (do notEndBlock
@@ -263,13 +296,16 @@ fnDecl syn = try (do notEndBlock
263 let d' = fmap (desugar syn i) d
296 let d' = fmap (desugar syn i) d
264 return [d']) <?> "function declaration"
297 return [d']) <?> "function declaration"
266−{- Parses a function declaration
299+{-| Parses a function declaration
267 FunDecl' ::=
302 FunDecl' ::=
268 DocComment_t? FnOpts* Accessibility? FnOpts* FnName TypeSig Terminator
303 DocComment_t? FnOpts* Accessibility? FnOpts* FnName TypeSig Terminator
269 | Postulate
304 | Postulate
270 | Pattern
305 | Pattern
274fnDecl' :: SyntaxInfo -> IdrisParser PDecl
310fnDecl' :: SyntaxInfo -> IdrisParser PDecl
275fnDecl' syn = checkFixity $
311fnDecl' syn = checkFixity $
@@ -313,23 +349,29 @@ fnDecl' syn = checkFixity $
313 | otherwise = return True
349 | otherwise = return True
314 fixityOK _ = return True
350 fixityOK _ = return True
316−{- Parses function options given initial options
352+{-| Parses function options given initial options
317FnOpts ::= 'total'
355FnOpts ::= 'total'
318 | 'partial'
356 | 'partial'
319 | 'implicit'
357 | 'implicit'
320 | '%' 'assert_total'
358 | '%' 'assert_total'
321 | '%' 'error_handler'
359 | '%' 'error_handler'
322− | '%' 'reflection'
360+ | '%' 'reflection'
323 | '%' 'specialise' '[' NameTimesList? ']'
361 | '%' 'specialise' '[' NameTimesList? ']'
326NameTimes ::= FnName Natural?;
366NameTimes ::= FnName Natural?;
328NameTimesList ::=
370NameTimesList ::=
329 NameTimes
371 NameTimes
330 | NameTimes ',' NameTimesList
372 | NameTimes ',' NameTimesList
334-- FIXME: Check compatability for function options (i.e. partal/total)
376-- FIXME: Check compatability for function options (i.e. partal/total)
335fnOpts :: [FnOpt] -> IdrisParser [FnOpt]
377fnOpts :: [FnOpt] -> IdrisParser [FnOpt]
@@ -360,9 +402,11 @@ fnOpts opts
361{- | Parses a postulate
403{- | Parses a postulate
363Postulate ::=
406Postulate ::=
364 DocComment_t? 'postulate' FnOpts* Accesibility? FnOpts* FnName TypeSig Terminator
407 DocComment_t? 'postulate' FnOpts* Accesibility? FnOpts* FnName TypeSig Terminator
367postulate :: SyntaxInfo -> IdrisParser PDecl
411postulate :: SyntaxInfo -> IdrisParser PDecl
368postulate syn = do doc <- try $ do doc <- option "" (docComment '|')
412postulate syn = do doc <- try $ do doc <- option "" (docComment '|')
@@ -388,9 +432,11 @@ postulate syn = do doc <- try $ do doc <- option "" (docComment '|')
389{- | Parses a using declaration
433{- | Parses a using declaration
392 'using' '(' UsingDeclList ')' OpenBlock Decl* CloseBlock
437 'using' '(' UsingDeclList ')' OpenBlock Decl* CloseBlock
395using_ :: SyntaxInfo -> IdrisParser [PDecl]
441using_ :: SyntaxInfo -> IdrisParser [PDecl]
396using_ syn =
442using_ syn =
@@ -402,11 +448,13 @@ using_ syn =
402 return (concat ds)
448 return (concat ds)
403 <?> "using declaration"
449 <?> "using declaration"
405−{- | Parses a parameters declaration
451+{- | Parses a parameters declaration
407Params ::=
454Params ::=
408 'parameters' '(' TypeDeclList ')' OpenBlock Decl* CloseBlock
455 'parameters' '(' TypeDeclList ')' OpenBlock Decl* CloseBlock
411params :: SyntaxInfo -> IdrisParser [PDecl]
459params :: SyntaxInfo -> IdrisParser [PDecl]
412params syn =
460params syn =
@@ -421,9 +469,11 @@ params syn =
422{- | Parses a mutual declaration (for mutually recursive functions)
470{- | Parses a mutual declaration (for mutually recursive functions)
424Mutual ::=
473Mutual ::=
425 'mutual' OpenBlock Decl* CloseBlock
474 'mutual' OpenBlock Decl* CloseBlock
428mutual :: SyntaxInfo -> IdrisParser [PDecl]
478mutual :: SyntaxInfo -> IdrisParser [PDecl]
429mutual syn =
479mutual syn =
@@ -436,11 +486,13 @@ mutual syn =
436 return [PMutual fc (concat ds)]
486 return [PMutual fc (concat ds)]
437 <?> "mutual block"
487 <?> "mutual block"
439−{- | Parses a namespace declaration
489+{-| Parses a namespace declaration
441Namespace ::=
492Namespace ::=
442 'namespace' identifier OpenBlock Decl+ CloseBlock
493 'namespace' identifier OpenBlock Decl+ CloseBlock
445namespace :: SyntaxInfo -> IdrisParser [PDecl]
497namespace :: SyntaxInfo -> IdrisParser [PDecl]
446namespace syn =
498namespace syn =
@@ -451,9 +503,12 @@ namespace syn =
451 return [PNamespace n (concat ds)]
503 return [PNamespace n (concat ds)]
452 <?> "namespace declaration"
504 <?> "namespace declaration"
454−{- |Parses a methods block (for instances)
506+{- | Parses a methods block (for instances)
455 InstanceBlock ::= 'where' OpenBlock FnDecl* CloseBlock
509 InstanceBlock ::= 'where' OpenBlock FnDecl* CloseBlock
457instanceBlock :: SyntaxInfo -> IdrisParser [PDecl]
512instanceBlock :: SyntaxInfo -> IdrisParser [PDecl]
458instanceBlock syn = do reserved "where"
513instanceBlock syn = do reserved "where"
459 openBlock
514 openBlock
@@ -462,16 +517,20 @@ instanceBlock syn = do reserved "where"
462 return (concat ds)
517 return (concat ds)
463 <?> "instance block"
518 <?> "instance block"
465−{- |Parses a methods and instances block (for type classes)
520+{- | Parses a methods and instances block (for type classes)
467MethodOrInstance ::=
523MethodOrInstance ::=
469 | Instance
525 | Instance
472ClassBlock ::=
530ClassBlock ::=
473 'where' OpenBlock MethodOrInstance* CloseBlock
531 'where' OpenBlock MethodOrInstance* CloseBlock
476classBlock :: SyntaxInfo -> IdrisParser [PDecl]
535classBlock :: SyntaxInfo -> IdrisParser [PDecl]
477classBlock syn = do reserved "where"
536classBlock syn = do reserved "where"
@@ -481,16 +540,20 @@ classBlock syn = do reserved "where"
481 return (concat ds)
540 return (concat ds)
482 <?> "class block"
541 <?> "class block"
484−{- |Parses a type class declaration
543+{-| Parses a type class declaration
486ClassArgument ::=
546ClassArgument ::=
488 | '(' Name ':' Expr ')'
548 | '(' Name ':' Expr ')'
492 DocComment_t? Accessibility? 'class' ConstraintList? Name ClassArgument* ClassBlock?
554 DocComment_t? Accessibility? 'class' ConstraintList? Name ClassArgument* ClassBlock?
495class_ :: SyntaxInfo -> IdrisParser [PDecl]
558class_ :: SyntaxInfo -> IdrisParser [PDecl]
496class_ syn = do (doc, acc) <- try (do
559class_ syn = do (doc, acc) <- try (do
@@ -511,13 +574,17 @@ class_ syn = do (doc, acc) <- try (do
511 <|> do i <- name;
574 <|> do i <- name;
512 return (i, PType)
575 return (i, PType)
514−{- |Parses a type class instance declaration
577+{- | Parses a type class instance declaration
516 Instance ::=
580 Instance ::=
517 'instance' InstanceName? ConstraintList? Name SimpleExpr* InstanceBlock?
581 'instance' InstanceName? ConstraintList? Name SimpleExpr* InstanceBlock?
520− InstanceName ::= '[' Name ']';
586+InstanceName ::= '[' Name ']';
522instance_ :: SyntaxInfo -> IdrisParser [PDecl]
589instance_ :: SyntaxInfo -> IdrisParser [PDecl]
523instance_ syn = do reserved "instance"; fc <- getFC
590instance_ syn = do reserved "instance"; fc <- getFC
@@ -538,20 +605,27 @@ instance_ syn = do reserved "instance"; fc <- getFC
540{- | Parses a using declaration list
607{- | Parses a using declaration list
541UsingDeclList ::=
610UsingDeclList ::=
542 UsingDeclList'
611 UsingDeclList'
543 | NameList TypeSig
612 | NameList TypeSig
546UsingDeclList' ::=
617UsingDeclList' ::=
547 UsingDecl
618 UsingDecl
548 | UsingDecl ',' UsingDeclList'
619 | UsingDecl ',' UsingDeclList'
551NameList ::=
624NameList ::=
553 | Name ',' NameList
626 | Name ',' NameList
556usingDeclList :: SyntaxInfo -> IdrisParser [Using]
630usingDeclList :: SyntaxInfo -> IdrisParser [Using]
557usingDeclList syn
631usingDeclList syn
@@ -563,10 +637,13 @@ usingDeclList syn
563 <?> "using declaration list"
637 <?> "using declaration list"
565{- |Parses a using declaration
639{- |Parses a using declaration
566UsingDecl ::=
642UsingDecl ::=
567 FnName TypeSig
643 FnName TypeSig
568 | FnName FnName+
644 | FnName FnName+
571usingDecl :: SyntaxInfo -> IdrisParser Using
648usingDecl :: SyntaxInfo -> IdrisParser Using
572usingDecl syn = try (do x <- fnName
649usingDecl syn = try (do x <- fnName
@@ -578,8 +655,11 @@ usingDecl syn = try (do x <- fnName
578 return (UConstraint c xs)
655 return (UConstraint c xs)
579 <?> "using declaration"
656 <?> "using declaration"
581−{- | Parse a clause with patterns
658+{- | Parse a clause with patterns
582Pattern ::= Clause;
661Pattern ::= Clause;
584pattern :: SyntaxInfo -> IdrisParser PDecl
664pattern :: SyntaxInfo -> IdrisParser PDecl
585pattern syn = do fc <- getFC
665pattern syn = do fc <- getFC
@@ -588,7 +668,10 @@ pattern syn = do fc <- getFC
588 <?> "pattern"
668 <?> "pattern"
590{- | Parse a constant applicative form declaration
670{- | Parse a constant applicative form declaration
591− CAF ::= 'let' FnName '=' Expr Terminator;
673+CAF ::= 'let' FnName '=' Expr Terminator;
593caf :: SyntaxInfo -> IdrisParser PDecl
676caf :: SyntaxInfo -> IdrisParser PDecl
594caf syn = do reserved "let"
677caf syn = do reserved "let"
@@ -601,7 +684,10 @@ caf syn = do reserved "let"
601 <?> "constant applicative form declaration"
684 <?> "constant applicative form declaration"
603{- | Parse an argument expression
686{- | Parse an argument expression
604− ArgExpr ::= HSimpleExpr | {- In Pattern External (User-defined) Expression -};
689+ArgExpr ::= HSimpleExpr | {- In Pattern External (User-defined) Expression -};
606argExpr :: SyntaxInfo -> IdrisParser PTerm
692argExpr :: SyntaxInfo -> IdrisParser PTerm
607argExpr syn = let syn' = syn { inPattern = True } in
693argExpr syn = let syn' = syn { inPattern = True } in
@@ -609,12 +695,17 @@ argExpr syn = let syn' = syn { inPattern = True } in
609 <?> "argument expression"
695 <?> "argument expression"
611{- | Parse a right hand side of a function
697{- | Parse a right hand side of a function
612RHS ::= '=' Expr
700RHS ::= '=' Expr
613 | '?=' RHSName? Expr
701 | '?=' RHSName? Expr
614 | 'impossible'
702 | 'impossible'
617RHSName ::= '{' FnName '}';
707RHSName ::= '{' FnName '}';
619rhs :: SyntaxInfo -> Name -> IdrisParser PTerm
710rhs :: SyntaxInfo -> Name -> IdrisParser PTerm
620rhs syn n = do lchar '='; expr syn
711rhs syn n = do lchar '='; expr syn
@@ -637,16 +728,28 @@ rhs syn n = do lchar '='; expr syn
637 addLet nm r = (PLet (sUN "value") Placeholder r (PMetavar nm))
728 addLet nm r = (PLet (sUN "value") Placeholder r (PMetavar nm))
639{- |Parses a function clause
730{- |Parses a function clause
640RHSOrWithBlock ::= RHS WhereOrTerminator
733RHSOrWithBlock ::= RHS WhereOrTerminator
641 | 'with' SimpleExpr OpenBlock FnDecl+ CloseBlock
734 | 'with' SimpleExpr OpenBlock FnDecl+ CloseBlock
643Clause ::= WExpr+ RHSOrWithBlock
739Clause ::= WExpr+ RHSOrWithBlock
644 | SimpleExpr '<==' FnName RHS WhereOrTerminator
740 | SimpleExpr '<==' FnName RHS WhereOrTerminator
645 | ArgExpr Operator ArgExpr WExpr* RHSOrWithBlock {- Except "=" and "?=" operators to avoid ambiguity -}
741 | ArgExpr Operator ArgExpr WExpr* RHSOrWithBlock {- Except "=" and "?=" operators to avoid ambiguity -}
646 | FnName ConstraintArg* ImplicitOrArgExpr* WExpr* RHSOrWithBlock
742 | FnName ConstraintArg* ImplicitOrArgExpr* WExpr* RHSOrWithBlock
648ImplicitOrArgExpr ::= ImplicitArg | ArgExpr;
747ImplicitOrArgExpr ::= ImplicitArg | ArgExpr;
649−WhereOrTerminator ::= WhereBlock | Terminator;
751+WhereOrTerminator ::= WhereBlock | Terminator;
651clause :: SyntaxInfo -> IdrisParser PClause
754clause :: SyntaxInfo -> IdrisParser PClause
652clause syn
755clause syn
@@ -775,17 +878,23 @@ clause syn
775 fillLHSD n c a (PClauses fc o fn cs) = PClauses fc o fn (map (fillLHS n c a) cs)
878 fillLHSD n c a (PClauses fc o fn cs) = PClauses fc o fn (map (fillLHS n c a) cs)
776 fillLHSD n c a x = x
879 fillLHSD n c a x = x
778−{- |Parses with pattern
881+{-| Parses with pattern
779− WExpr ::= '|' Expr';
884+WExpr ::= '|' Expr';
781wExpr :: SyntaxInfo -> IdrisParser PTerm
887wExpr :: SyntaxInfo -> IdrisParser PTerm
782wExpr syn = do lchar '|'
888wExpr syn = do lchar '|'
783 expr' syn
889 expr' syn
784 <?> "with pattern"
890 <?> "with pattern"
786−{- |Parses a where block
892+{- | Parses a where block
787WhereBlock ::= 'where' OpenBlock Decl+ CloseBlock;
895WhereBlock ::= 'where' OpenBlock Decl+ CloseBlock;
789whereBlock :: Name -> SyntaxInfo -> IdrisParser ([PDecl], [(Name, Name)])
898whereBlock :: Name -> SyntaxInfo -> IdrisParser ([PDecl], [(Name, Name)])
790whereBlock n syn
899whereBlock n syn
791 = do reserved "where"
900 = do reserved "where"
@@ -795,6 +904,8 @@ whereBlock n syn
795 <?> "where block"
904 <?> "where block"
797{- |Parses a code generation target language name
906{- |Parses a code generation target language name
798Codegen ::= 'C'
909Codegen ::= 'C'
800 | 'JavaScript'
911 | 'JavaScript'
@@ -802,6 +913,7 @@ Codegen ::= 'C'
803 | 'Bytecode'
914 | 'Bytecode'
806codegen_ :: IdrisParser Codegen
918codegen_ :: IdrisParser Codegen
807codegen_ = do reserved "C"; return ViaC
919codegen_ = do reserved "C"; return ViaC
@@ -813,13 +925,18 @@ codegen_ = do reserved "C"; return ViaC
813 <?> "code generation language"
925 <?> "code generation language"
815{- |Parses a compiler directive
927{- |Parses a compiler directive
816StringList ::=
929StringList ::=
818 | String ',' StringList
931 | String ',' StringList
821Directive ::= '%' Directive';
936Directive ::= '%' Directive';
823Directive' ::= 'lib' CodeGen String_t
940Directive' ::= 'lib' CodeGen String_t
824 | 'link' CodeGen String_t
941 | 'link' CodeGen String_t
825 | 'flag' CodeGen String_t
942 | 'flag' CodeGen String_t
@@ -834,6 +951,7 @@ Directive' ::= 'lib' CodeGen String_t
834 | 'language' 'TypeProviders'
951 | 'language' 'TypeProviders'
835 | 'language' 'ErrorReflection'
952 | 'language' 'ErrorReflection'
838directive :: SyntaxInfo -> IdrisParser [PDecl]
956directive :: SyntaxInfo -> IdrisParser [PDecl]
839directive syn = do try (lchar '%' *> reserved "lib"); cgn <- codegen_; lib <- stringLiteral;
957directive syn = do try (lchar '%' *> reserved "lib"); cgn <- codegen_; lib <- stringLiteral;
@@ -893,15 +1011,22 @@ pLangExt = (reserved "TypeProviders" >> return TypeProviders)
893 <|> (reserved "ErrorReflection" >> return ErrorReflection)
1011 <|> (reserved "ErrorReflection" >> return ErrorReflection)
895{- | Parses a totality
1013{- | Parses a totality
896Totality ::= 'partial' | 'total'
1016Totality ::= 'partial' | 'total'
898totality :: IdrisParser Bool
1020totality :: IdrisParser Bool
900 = do reserved "total"; return True
1022 = do reserved "total"; return True
901 <|> do reserved "partial"; return False
1023 <|> do reserved "partial"; return False
903−{- | Parses a type provider
1025+{- | Parses a type provider
904Provider ::= '%' 'provide' '(' FnName TypeSig ')' 'with' Expr;
1028Provider ::= '%' 'provide' '(' FnName TypeSig ')' 'with' Expr;
906provider :: SyntaxInfo -> IdrisParser [PDecl]
1031provider :: SyntaxInfo -> IdrisParser [PDecl]
907provider syn = do try (lchar '%' *> reserved "provide");
1032provider syn = do try (lchar '%' *> reserved "provide");
@@ -913,7 +1038,10 @@ provider syn = do try (lchar '%' *> reserved "provide");
913 <?> "type provider"
1038 <?> "type provider"
915{- | Parses a transform
1040{- | Parses a transform
916Transform ::= '%' 'transform' Expr '==>' Expr
1043Transform ::= '%' 'transform' Expr '==>' Expr
918transform :: SyntaxInfo -> IdrisParser [PDecl]
1046transform :: SyntaxInfo -> IdrisParser [PDecl]
919transform syn = do try (lchar '%' *> reserved "transform")
1047transform syn = do try (lchar '%' *> reserved "transform")