Adding a function scan_format that scan a string to directely return a format4
value.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7324 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
The type of the resulting format is dynamically checked and should be
the type of the template format which is the second argument.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7061 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
present in the input (in this case the token spreads to the end of
file, as specified, and this is not an error!).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6946 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
'\t'): the delimitor should not be skipped. This way
sscanf "hello\n" "%s\n" (fun s -> s) = "hello"
(not exception End_of_file !)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6942 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
conversions in format strings.
Static and dynamic messages about wrong format strings are now very
similar in printf.ml, scanf.ml, and typecore.ml.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6802 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
More documentation and some code rewriting in Scanf.ml; push the
special case for ranges of length 3 to make_setp.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6108 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Bug corrected in (negative) range scanning.
Line numbers are counted for you in next_char.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5984 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
analysis of the char ranges and the repetitive computation of the
corresponding characteristic function); hence, analysis and creation
of char range predicates has been completely rewritten.
Char range predicates now use bit strings instead of vectors;
predicate computation is a memo function such that scanning ranges is
no more just a matter of expensive predicate calculation (performed
again and again for each scanf call). In addition, trivial and very
common char ranges (one, two, or threee characters only) are treated
specially and more efficiently.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5884 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Roberto). An unused function is suppressed. The Objective Caml `_'
convention for numbers is used and documented.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5690 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
The function end_of_input was wrong in case of a buffer for which both
beginning_of_input and end_of_input conditions were true (e.g. in case
of an empty string or an empty file).
Better error reporting for characters out of the given range.
Reminiscent of the printf semantics, %! matches the end of input
condition.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5662 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Introduction of two new functions Scanning.from_file and
Scanning.from_file_bin to alleviate this problem.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5506 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Implementation de la semantique des espaces conforme a la doc (seul le
caractère 32 est reconnu pour appeler skip_spaces).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5207 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
notation + addition of a new ``bof'' field in input buffers to detect that
no chars have ever been read + careful check and debugging of reading
from empty buffers + code review. Addition of stdib for reading from stdin.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5160 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
guillemets délimiteurs).
Revu le traitement des blancs en fin de fichier et les formats à
indication de scanning erronées (format terminé par @).
Revu le type de kscanf.
Revu la documentation des indications de scanning.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5051 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02