diff options
| author | Pierre-Marie Pédrot | 2019-04-01 12:51:16 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2019-04-01 12:51:16 +0200 |
| commit | d16633368ba33d05bcae3e98b1e05efc5f530206 (patch) | |
| tree | 4cd4f1c348a7e0a5d90a91c2b9a61ab91672cb73 /gramlib/plexing.ml | |
| parent | 4c3f4d105a32cc7661ae714fe4e25619e32bc84c (diff) | |
| parent | d8d3b7a8251b874c436ac11b881cf4fb5f991784 (diff) | |
Merge PR #9815: Multiple payload types in tokens
Reviewed-by: ppedrot
Ack-by: proux01
Diffstat (limited to 'gramlib/plexing.ml')
| -rw-r--r-- | gramlib/plexing.ml | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/gramlib/plexing.ml b/gramlib/plexing.ml index 6da06f147f..e881ab3350 100644 --- a/gramlib/plexing.ml +++ b/gramlib/plexing.ml @@ -2,15 +2,17 @@ (* plexing.ml,v *) (* Copyright (c) INRIA 2007-2017 *) -type pattern = string * string option - type location_function = int -> Loc.t type 'te lexer_func = ?loc:Loc.t -> char Stream.t -> 'te Stream.t * location_function -type 'te lexer = - { tok_func : 'te lexer_func; - tok_using : pattern -> unit; - tok_removing : pattern -> unit; - tok_match : pattern -> 'te -> string; - tok_text : pattern -> string; - } +module type Lexer = sig + type te + type 'c pattern + val tok_pattern_eq : 'a pattern -> 'b pattern -> ('a, 'b) Util.eq option + val tok_pattern_strings : 'c pattern -> string * string option + val tok_func : te lexer_func + val tok_using : 'c pattern -> unit + val tok_removing : 'c pattern -> unit + val tok_match : 'c pattern -> te -> 'c + val tok_text : 'c pattern -> string +end |
