diff options
author | Pierre Weis <Pierre.Weis@inria.fr> | 2002-07-11 22:39:26 +0000 |
---|---|---|
committer | Pierre Weis <Pierre.Weis@inria.fr> | 2002-07-11 22:39:26 +0000 |
commit | 4865d98f29e1f648c7b45a9304dff12604d6abb8 (patch) | |
tree | 6d992b3662d0b63d418a151f6576687ca7cf1223 /stdlib/scanf.mli | |
parent | 67c2312c8db5544c67d80c483904731c7eb256a2 (diff) |
Errors in documentation + the error continuation now takes as argument
the exception that was raised during scanning instead of a string
explaining the problem + proper end of file detection.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4992 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'stdlib/scanf.mli')
-rw-r--r-- | stdlib/scanf.mli | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/stdlib/scanf.mli b/stdlib/scanf.mli index 49c6d9965..b8d46ac0e 100644 --- a/stdlib/scanf.mli +++ b/stdlib/scanf.mli @@ -57,10 +57,13 @@ val bscanf : Raise [Scanf.Scan_failure] if the given input does not match the format. + Raise [End_of_file] if the end of input is encountered while scanning + and the input matches the given format so far. + The format is a character string which contains three types of objects: - plain characters, which are simply matched with the - input channel, + characters of the input, - conversion specifications, each of which causes reading and conversion of one argument for [f], - scanning indications to specify boundaries of tokens and the @@ -132,9 +135,9 @@ val scanf : ('a, Scanning.scanbuf, 'b) format -> 'a -> 'b;; val kscanf : Scanning.scanbuf -> ('a, 'b, 'c) format -> 'a -> - (Scanning.scanbuf -> string -> 'c) -> 'c;; + (Scanning.scanbuf -> exn -> 'c) -> 'c;; (** Same as {!Scanf.bscanf}, but takes an additional function argument [ef] that is called in case of error: if the scanning process or some convertion fails, the scanning function aborts and applies the - scanning buffer and a string that explains the error to the error + scanning buffer and the exception that aborted evaluation to the error continuation [ef]. *) |