summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Grammar/Parser.y
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2016-04-07 13:32:14 +0000
committerhallgren <hallgren@chalmers.se>2016-04-07 13:32:14 +0000
commit65e675d8e2fc530997b3209e6ab84760be5a0a65 (patch)
treef3d0fb3cac137a8a1e9e493960bff9f3bfdb8f05 /src/compiler/GF/Grammar/Parser.y
parentc130d28ae34b6ca5db06de21a2207433cca19884 (diff)
Lexer.x & Parser.y: add a partial parser for terms
Lexer.x: Change the parser monad type P to allow the remaining input to be returned after a partial parse. Add function runPartial :: P t -> String -> Either (Posn, String) (String, t) Parser.y: Add a partial parser pTerm for nonterminal Exp1. Re-export runPartial.
Diffstat (limited to 'src/compiler/GF/Grammar/Parser.y')
-rw-r--r--src/compiler/GF/Grammar/Parser.y4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/GF/Grammar/Parser.y b/src/compiler/GF/Grammar/Parser.y
index 9f2e7c95a..9377bd7d5 100644
--- a/src/compiler/GF/Grammar/Parser.y
+++ b/src/compiler/GF/Grammar/Parser.y
@@ -2,9 +2,10 @@
{
{-# OPTIONS -fno-warn-overlapping-patterns #-}
module GF.Grammar.Parser
- ( P, runP
+ ( P, runP, runPartial
, pModDef
, pModHeader
+ , pTerm
, pExp
, pTopDef
, pBNFCRules
@@ -30,6 +31,7 @@ import PGF(mkCId)
%name pModDef ModDef
%name pTopDef TopDef
%partial pModHeader ModHeader
+%partial pTerm Exp1
%name pExp Exp
%name pBNFCRules ListCFRule
%name pEBNFRules ListEBNFRule