summaryrefslogtreecommitdiff
path: root/lex/parser.mly
diff options
context:
space:
mode:
Diffstat (limited to 'lex/parser.mly')
-rw-r--r--lex/parser.mly13
1 files changed, 9 insertions, 4 deletions
diff --git a/lex/parser.mly b/lex/parser.mly
index b42cced949..f0742e38e4 100644
--- a/lex/parser.mly
+++ b/lex/parser.mly
@@ -49,7 +49,7 @@ let as_cset = function
%token <string> Tstring
%token <Syntax.location> Taction
%token Trule Tparse Tparse_shortest Tand Tequal Tend Tor Tunderscore Teof
- Tlbracket Trbracket
+ Tlbracket Trbracket Trefill
%token Tstar Tmaybe Tplus Tlparen Trparen Tcaret Tdash Tlet Tas Tsharp
%right Tas
@@ -65,10 +65,11 @@ let as_cset = function
%%
lexer_definition:
- header named_regexps Trule definition other_definitions header Tend
+ header named_regexps refill_handler Trule definition other_definitions header Tend
{ {header = $1;
- entrypoints = $4 :: List.rev $5;
- trailer = $6} }
+ refill_handler = $3;
+ entrypoints = $5 :: List.rev $6;
+ trailer = $7} }
;
header:
Taction
@@ -89,6 +90,10 @@ other_definitions:
| /*epsilon*/
{ [] }
;
+refill_handler:
+ | Trefill Taction { Some $2 }
+ | /*empty*/ { None }
+;
definition:
Tident arguments Tequal Tparse entry
{ {name=$1 ; shortest=false ; args=$2 ; clauses=$5} }