diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-05-10 11:11:39 +0200 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-05-10 19:28:24 +0200 |
commit | 61f79019be6082c3ebabd503c322fb2edb05a99a (patch) | |
tree | 646aaa9d5fbf289354f86f2b912a234fca7b6c20 /grammar | |
parent | 946a3d4a800ae1f459cb67cc15c9e6ec44fb3f94 (diff) |
AlistNsep token now accepts an arbitrary separator.
Diffstat (limited to 'grammar')
-rw-r--r-- | grammar/q_util.ml4 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/grammar/q_util.ml4 b/grammar/q_util.ml4 index 05c94394d..53330429d 100644 --- a/grammar/q_util.ml4 +++ b/grammar/q_util.ml4 @@ -61,11 +61,13 @@ let mlexpr_of_option f = function let mlexpr_of_ident id = <:expr< Names.Id.of_string $str:id$ >> +let symbol_of_string s = <:expr< Extend.Atoken (CLexer.terminal $str:s$) >> + let rec mlexpr_of_prod_entry_key f = function | Ulist1 s -> <:expr< Extend.Alist1 $mlexpr_of_prod_entry_key f s$ >> - | Ulist1sep (s,sep) -> <:expr< Extend.Alist1sep $mlexpr_of_prod_entry_key f s$ $str:sep$ >> + | Ulist1sep (s,sep) -> <:expr< Extend.Alist1sep $mlexpr_of_prod_entry_key f s$ $symbol_of_string sep$ >> | Ulist0 s -> <:expr< Extend.Alist0 $mlexpr_of_prod_entry_key f s$ >> - | Ulist0sep (s,sep) -> <:expr< Extend.Alist0sep $mlexpr_of_prod_entry_key f s$ $str:sep$ >> + | Ulist0sep (s,sep) -> <:expr< Extend.Alist0sep $mlexpr_of_prod_entry_key f s$ $symbol_of_string sep$ >> | Uopt s -> <:expr< Extend.Aopt $mlexpr_of_prod_entry_key f s$ >> | Uentry e -> <:expr< Extend.Aentry $f e$ >> | Uentryl (e, l) -> |