Commit Graph

71 Commits (b6fa9a252954a61188034279c031ae1910fc8b6d)

Author SHA1 Message Date
Pierre Weis 4c493c3292 Implementing %r.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7719 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2006-11-06 10:19:12 +00:00
Pierre Weis dd25537b69 Defining an abbrev to give a readable type to scanf functions. Using format6. Format_from_string specification changed.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7706 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2006-10-27 09:12:07 +00:00
Pierre Weis 5c04d6cade Bug report 0004119: Issue with Scanf.Scanning.from_file
Bumping the version sub number and date.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7678 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2006-10-04 10:02:01 +00:00
Pierre Weis cf0590146f Code review before adding new typing of format string.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7396 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2006-05-04 12:52:22 +00:00
Pierre Weis a09a711749 Dead code removed. Typos corrected + documentation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7376 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2006-04-05 15:40:03 +00:00
Pierre Weis 176b3c0da8 Module Sformat is internal to printf. Better typing specifications of functions working with format strings.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7374 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2006-04-05 11:49:07 +00:00
Pierre Weis dc068cdbe1 Sscanf_format gets a type consistent with the type of sscanf.
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
2006-01-12 10:18:18 +00:00
Damien Doligez 125ea40d4c fusion 3.09.0 -> 3.09.1
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7307 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2006-01-04 16:55:50 +00:00
Pierre Weis d154852500 Last correction for l, n, L numbers scanning.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7299 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2006-01-03 18:27:32 +00:00
Pierre Weis a3b605a2db New function sscanf_format to read a format from a string.
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
2005-09-20 21:42:44 +00:00
Pierre Weis d21474e7b3 Documentation.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6965 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2005-07-11 14:49:57 +00:00
Pierre Weis 6fae6a771a A subtile bug in scanf: stopper character have not to be always
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
2005-07-02 21:10:04 +00:00
Pierre Weis 4018798e3f A bug in the treatment of (implicit) string delimitors (' ' '\n' '\r'
'\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
2005-07-01 09:02:02 +00:00
Pierre Weis 9bc393e8f2 A major modification: the main invariant has been modified !
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6939 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2005-07-01 08:15:02 +00:00
Pierre Weis ea8c2fdc2a Doc.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6813 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2005-03-11 13:41:25 +00:00
Pierre Weis 280dcb3097 Correcting bug about erroneous erro reporting in case of wrong
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
2005-03-04 14:51:31 +00:00
Pierre Weis 53c525611e Invalid format string error report is more uniform.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6726 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-12-07 06:17:12 +00:00
Damien Doligez 1971a6ba83 changements sur les warnings
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6720 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-11-30 18:57:04 +00:00
Pierre Weis b5c447dba6 Exporting the name_of_input function to get the name of the input
buffer's character source.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6629 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-10-05 06:54:45 +00:00
Pierre Weis 486d45c826 Careful review of meta formats.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6626 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-10-04 20:19:44 +00:00
Pierre Weis b0270c4cf9 Implementation des meta formats.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6621 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-09-22 09:17:21 +00:00
Xavier Leroy 63c1789b5e Fusion des modifs faites sur la branche release jusqu'a la release 3.08.0
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-07-13 12:25:21 +00:00
Pierre Weis d29a2ec4df Wrong treatment of 3 chars long patterns, when a range is specified.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6373 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-06-04 13:27:24 +00:00
Pierre Weis 5873271ba9 Integer conversions are now treated uniformly: End_of_file is raised
hwen end of input is reached before a valid integer has been read.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6183 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-04-01 15:07:02 +00:00
Pierre Weis ff0f8b35ca Better error report.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6145 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-03-10 22:10:54 +00:00
Pierre Weis 177a7a8ce0 Format %F shoudl to be documented on its own.
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
2004-02-04 10:16:25 +00:00
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