Commit Graph

95 Commits (4e8b7a4808f928e6dba47a2bb768c83dbd426d2d)

Author SHA1 Message Date
Damien Doligez 776a8d59b7 suppression support MacOS9
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6074 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-01-16 15:24:03 +00:00
Damien Doligez 5a678d29f5 depollution suite (PR#1914 et PR#1956)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6045 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-01-01 16:42:43 +00:00
Pierre Weis 819496a447 Main function has been simplified.
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
2003-11-30 22:13:03 +00:00
Pierre Weis a11df076b9 Scanning char ranges was far too inefficient (due to repetitive
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
2003-10-27 08:21:04 +00:00
Pierre Weis fab3b6b071 More documentation about fscanf (due to private bug report from
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
2003-07-15 07:25:09 +00:00
Pierre Weis 9cad9931a1 Suite au PR#1745 %F lit un flottant au format token Caml.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5685 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-07-14 10:04:25 +00:00
Pierre Weis 139cf32a6f Width field of %c conversion is dynamically checked and must be 0 or 1.
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
2003-07-07 11:13:21 +00:00
Damien Doligez b37e53cef1 PR#1675, voir aussi PR#1438
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5641 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-07-01 16:30:12 +00:00
Pierre Weis 2b7e706ab8 Suppression code mort.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5565 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-05-14 17:07:22 +00:00
Pierre Weis f1217b8bc7 Begin_of_input -> beginning_of_input.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5561 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-05-14 06:30:04 +00:00
Pierre Weis e3c25d1b24 Correcting the bug of large buffering when scanning files.
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
2003-04-25 10:21:21 +00:00
Pierre Weis 1f955eb17e Format %S now understands continuation newlines (\\\n).
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5412 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-03-02 23:03:15 +00:00
Pierre Weis 1b16545057 better treatment of %n
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5353 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-12-16 16:17:41 +00:00
Pierre Weis 422967d82b Introducing the skip facility for scanf.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5320 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-12-09 07:13:29 +00:00
Pierre Weis 831a3d7f5c Bufferized input from channels.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5319 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-12-08 21:28:23 +00:00
Pierre Weis 9deb0370fa Exporting stdib
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5315 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-12-08 15:16:09 +00:00
Pierre Weis 9fd8825b8d adding C-like %n format for scanf. For printf %n is an alias fr %i.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5313 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-12-08 13:52:02 +00:00
Pierre Weis 6df4c2b6de Introducing (and using) string and string format coercions.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5211 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-10-31 10:00:02 +00:00
Pierre Weis 03625b7620 Export de end_of_input.
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
2002-10-30 23:46:21 +00:00
Pierre Weis 27c443e152 Bug in the scanning of characters at end of file (
sscanf "" "%[^\n\r]\n" must succeed and return the empty string).


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5169 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-10-10 10:08:18 +00:00
Pierre Weis e42e2b9266 Revised semantics of @c: the c character is now skipped by default.
This behaviour is documented.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5162 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-10-08 06:46:15 +00:00
Pierre Weis 51eb3bad54 A lot of modifications: provision for unsigned numbers in binary
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
2002-10-07 12:20:07 +00:00
Pierre Weis a96f8f0e87 Formats %B and %F.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5119 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-09-05 10:38:11 +00:00
Pierre Weis 6c15753d0f Revu le traitement de %S (les @c ne sont pas nécessaires vus les
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
2002-07-28 21:29:42 +00:00
Xavier Leroy 6970e8c7fa Identifier %x et %X; bug parsing entiers octal et hexa (PR#1260); 8 n'est pas un chiffre octal. Signe: Damien & Xavier
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5041 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-07-25 15:24:58 +00:00
Pierre Weis 4865d98f29 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
2002-07-11 22:39:26 +00:00
Pierre Weis de4faabfce Exception Scan_failure gets a string argument only.
Failure exception is no more trapped for each convertion: it is
trapped instead in the main scanning loop.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4958 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-06-27 09:20:25 +00:00
Pierre Weis 17db5ace3e Introducing kscanf, the scanning function with an additional error continuation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4950 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-06-26 09:32:27 +00:00
Pierre Weis 0505570e3b Introducing a specific exception for formatted input functions.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4922 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-06-12 08:31:21 +00:00
Pierre Weis 2b74c8d0bd Le module Scanning est intégré dans Scanf.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4849 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-27 22:00:09 +00:00
Pierre Weis 817e451e48 Meilleurs messages d'erreur.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4843 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-27 08:51:23 +00:00
Pierre Weis b55d7dad58 Suppression de l'argument spc dans la fonction scan (le coeur de
fscanf): les espaces sont sautés lorsqu'on rencontre un espace dans la
chaîne de format.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4841 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-27 07:08:05 +00:00
Pierre Weis e9e7213c0c Implementation of escapes in Chars and Strings.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4828 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-20 19:19:15 +00:00
Pierre Weis f13bd42464 Getting rid of one more Obj.magic :)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4806 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-12 18:41:07 +00:00
Pierre Weis 79eb51807f Getting rid of 2 Obj.magic(s). (By the way string_of_format =
%identity is safe.)
Adding formats C and S.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4803 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-12 17:57:36 +00:00
Pierre Weis d4b9ac8c8c Simplification + correcting scanning of booleans.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4802 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-11 12:06:22 +00:00
Pierre Weis 8c712bd5a9 Some bad_format where bad_input.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4800 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-09 21:07:44 +00:00
Pierre Weis 1bac650af9 Better evaluation strategy for scanf: before calling the function argument
scanning is saturated.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4799 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-09 19:37:07 +00:00
Pierre Weis c00140c75d Completing implementation of char sets into scanf.ml.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4798 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-09 18:26:44 +00:00
Pierre Weis d4fefff6fa Documentation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4795 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-08 13:51:09 +00:00
Pierre Weis ba34bd8a63 Simplying once more.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4790 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-07 16:34:26 +00:00
Pierre Weis 8f79254242 Simplifying scanning of integers.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4789 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-07 16:31:33 +00:00
Pierre Weis 4912200a02 Reading nativeint int32 and int64 values.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4788 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-07 16:28:19 +00:00
Pierre Weis adf2b507bf Functions incompletely called.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4787 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-07 14:47:28 +00:00
Pierre Weis 01ca2d9ec2 Introducing a ``scanf'' facility in Objective Caml.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4780 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-05-07 07:41:12 +00:00