diff options
author | pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-04-27 16:43:27 +0000 |
---|---|---|
committer | pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2012-04-27 16:43:27 +0000 |
commit | 591aefbf015cf30912bf5ade76feb000bb12cdd5 (patch) | |
tree | 97336604c80df384c0fb4d3a6654945caca2e882 /parsing | |
parent | a1a3e3b84bc7dac2ae1ddae1770adde914732315 (diff) |
Partial revert of r15148 in order to compile with Camlp4
+ comment correction
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15253 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'parsing')
-rw-r--r-- | parsing/lexer.ml4 | 3 | ||||
-rw-r--r-- | parsing/tok.ml | 4 | ||||
-rw-r--r-- | parsing/tok.mli | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/parsing/lexer.ml4 b/parsing/lexer.ml4 index 46dd516be..61ff69ba7 100644 --- a/parsing/lexer.ml4 +++ b/parsing/lexer.ml4 @@ -94,6 +94,9 @@ module Error = struct | UnsupportedUnicode x -> Printf.sprintf "Unsupported Unicode character (0x%x)" x) + (* Require to fix the Camlp4 signature *) + let print ppf x = Pp.pp_with ppf (Pp.str (to_string x)) + end open Error diff --git a/parsing/tok.ml b/parsing/tok.ml index 69fcca98d..52d56c4dd 100644 --- a/parsing/tok.ml +++ b/parsing/tok.ml @@ -45,6 +45,10 @@ let match_keyword kwd = function | KEYWORD kwd' when kwd = kwd' -> true | _ -> false +(* Needed to fix Camlp4 signature. + Cannot use Pp because of silly Tox -> Compat -> Pp dependency *) +let print ppf tok = Format.pp_print_string ppf (to_string tok) + (** For camlp5, conversion from/to [Plexing.pattern], and a match function analoguous to [Plexing.default_match] *) diff --git a/parsing/tok.mli b/parsing/tok.mli index d3c178b5a..7c685a67c 100644 --- a/parsing/tok.mli +++ b/parsing/tok.mli @@ -21,6 +21,8 @@ type t = val extract_string : t -> string val to_string : t -> string +(* Needed to fit Camlp4 signature *) +val print : Format.formatter -> t -> unit val match_keyword : string -> t -> bool (** for camlp5 *) val of_pattern : string*string -> t |