Commit Graph

1472 Commits (f7d20f161ae2103d376bd7432c1c7ba2b64023dc)

Author SHA1 Message Date
Benoit Vaugon 484950d84b support for hexadecimal float notation in (scanf '%F') 2015-11-28 17:32:31 +01:00
Jeremie Dimino d3b60c8dce Use the extension_constructor type in Obj
Rename Obj.extension_slot to Obj.extension_constructor as well
2015-11-27 17:57:41 +00:00
Richard W.M. Jones da02953570 arg: Allow flags such as --flag=arg as well as --flag arg.
Allow flags to be followed directly by their argument, separated by an '='
sign.  This is consistent with what GNU getopt_long and many other
command line parsing libraries allow.

Fix for the following issue:
http://caml.inria.fr/mantis/view.php?id=5197
2015-11-25 22:18:47 +01:00
Richard W.M. Jones d431b5bbd6 arg: Add no_arg and get_arg helper functions.
The no_arg function in this patch is a no-op.  It will do something
useful in the followups.

The get_arg function simple checks the next position on the command
line exists and returns that argument or raises a Arg.Missing.

This patch should introduce no functional change, it is simply code
refactoring.

In particular, this should not change the treatment of Arg.current
(see: http://caml.inria.fr/mantis/view.php?id=5197#c11147)
2015-11-25 22:14:36 +01:00
alainfrisch e02650addb Doc (catenate -> concatenate, which is more common and coherent with other doc strings). 2015-11-24 16:05:30 +01:00
Hezekiah M. Carty 0fedfc1b74 Document that ( @ ) is not tail recursive
See http://caml.inria.fr/mantis/view.php?id=7057 for the initial report.

Text copied from [List.append]'s documentation comment.
2015-11-24 09:51:31 -05:00
ygrek c1d82c7650 make Stack.length constant-time 2015-11-22 12:15:29 -08:00
iguer fd163982d7 update the doc of Map.(add, remove, filter) 2015-11-22 18:29:16 +01:00
iguer d689a686b9 Map.add x y m returns the original map if x is already bound to a value that is physically equal to y in m 2015-11-22 18:29:16 +01:00
iguer 37159fbc42 Map.filter returns the original map when the given predicate satisfies all the bindings of the map 2015-11-22 18:29:16 +01:00
iguer 81ca324ef3 Map.remove returns the original map when the binding to be removed is not present in the map 2015-11-22 18:29:15 +01:00
Xavier Leroy 0c5e862a3e GPR#268: Hexadecimal notation for floating-point numbers
Merge of branch 'hex-float'.

- Add support in byterun/floats.c for conversions between floats and strings in hex notation. We cannot rely on the C standard library here because Microsoft consistently fails at supporting hex notation as standardized in C99. Instead, the conversions are implemented from scratch.
- Add support in the lexer so that hex float literals are recognized in OCaml sources.
- Add support in formats. The ISO C99 format letters for hex floats are %a and %A, but %a is already taken. I chose %h and %H, which are rejected today as bad formats (hence no backward incompatibility) and don't mean anything in C either (h is a modifier, not a format letter).
- Add support in printf. All the trimmings are there in the implementation of %h and %H, including sign modifier and fixed precision.
- Benoit Vaugon contributed support in scanf.

Resolved conflicts:
	boot/ocamlc
	boot/ocamldep
	boot/ocamllex
	parsing/lexer.mll
2015-11-19 10:37:20 +01:00
pierreweis b96972b159 Deprecating invariant non-compliant and error prone fscanf and kfscanf functions. 2015-11-12 19:14:02 +01:00
pierreweis 09479a70a9 Better documentation, in particular for Scanning.in_channel value usage. 2015-11-12 18:43:37 +01:00
pierreweis dcaa6946e7 Adding a tag for depecated tabbing boxes. 2015-11-12 18:37:52 +01:00
Xavier Leroy b09f3ff9b1 Merge pull request #280 from mshinwell/parallel-make-fixes
Fix stdlib dependencies for .p.cmx
2015-11-11 10:29:59 +01:00
Damien Doligez 7cb9a80744 simplify .gitignore; remove .ignore files and tools/setignore; adjust tools/check-typo 2015-11-06 16:25:05 +01:00
François Bobot 203c444fd4 Make `Pervasives.ldexp` unboxed and noalloc 2015-11-05 13:07:03 +01:00
François Bobot 3c76d0678d Make `Sys.time` unboxed and noalloc 2015-11-05 13:07:03 +01:00
Mark Shinwell 248328024b fix stdlib dependencies for .p.cmx 2015-11-04 11:04:34 +00:00
alainfrisch 364f1cb79f Merge branch 'trunk' of github.com:ocaml/ocaml into unbox_classify_float 2015-11-03 21:03:07 +01:00
Jeremie Dimino 665176d77a Switch a few externals to [@@unboxed]
Switched the following functions:
- {Nativeint,Int32,Int64}.{of,to}_float
- Int{32,64}.float_of_bits
- Int{32,64}.bits_of_float
2015-11-03 17:20:05 +00:00
Gabriel Scherer b2e81d7800 Merge pull request #267 from yallop/faster-ifprintf
A more efficient implementation of ifprintf
2015-10-31 16:54:40 +01:00
alainfrisch 96c3a3da75 Avoid boxing floats when calling Pervasives.classify_float. 2015-10-28 16:43:35 +01:00
alainfrisch a127e661b2 Code cleanup: replace let-binding of type unit with sequence. 2015-10-27 11:28:36 +01:00
Jeremy Yallop 19301282d5 Use make_iprintf to build Format.ikfprintf and Format.ifprintf. 2015-10-27 00:02:45 +00:00
Jeremy Yallop e999c68622 Use make_iprintf to build Printf.ikfprintf and Printf.ifprintf. 2015-10-27 00:02:45 +00:00
Jeremy Yallop 1644284d0f Add make_iprintf (make_printf optimised for ifprintf) to CamlinternalFormat. 2015-10-27 00:02:45 +00:00
Mark Shinwell 4b4d8a150a Fix compilation error for GPR#238 merge 2015-10-26 10:41:53 +00:00
Mark Shinwell f6538a8abe Merge pull request #238 from chambart/less_unsafe_CamlinternalOO
GPR#238: Make CamlinternalOO a bit less unsafe
2015-10-26 09:47:40 +00:00
Gabriel Scherer 8afbaa5747 New representation for queues, avoiding Obj.magic
(Jérémie Dimino)

- use inline-records to avoid using Obj.magic while keeping
  indirections to the minumum
- change the representation from a cyclic list to a simply-linked
  list. The drawback is one more word per queue, but it makes the
  implementation clearer

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16545 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-25 13:39:07 +00:00
Alain Frisch d813aea23b Remove dead code.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16516 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-16 17:04:56 +00:00
Alain Frisch a21eaeaa40 GPR#254: @ocaml.arg_on_literal_pattern attribute on constructors
to warn when the argument is matches against a constant pattern.
This attributes is applied on predefined exception constructors
which take an purely informational (with no stability guarantee)
message.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16502 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-15 12:30:10 +00:00
Gabriel Scherer 5882fdea22 General translation of french comments
(user 'octachron')

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16474 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:38 +00:00
Gabriel Scherer b82ef62532 Remove out of date comment of Stream
(Pierre Chambart)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16472 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:34 +00:00
Gabriel Scherer 1640764c12 Rename type data' to cell in Stream
(Pierre Chambart)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16471 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:33 +00:00
Gabriel Scherer d4ff2bccc1 Remove last Obj.magic in Stream
(Pierre Chambart)

Turn Stream.data into a GADT to ensure that streams built with the
Sbuffio constructor are char streams.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16470 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:32 +00:00
Gabriel Scherer 2ac862f27d Make Stream a less unsafe
(Pierre Chambart)

Stream used to modify blocks allocated as immutable. This Get rid of
most Obj module invocations in this module.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16469 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 20:41:30 +00:00
Damien Doligez 3397e7ff16 GPR#243: Faster test suite
(Xavier Leroy)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16466 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-09 15:45:37 +00:00
Jérémie Dimino 1b219582a0 Replace uses of "float" by [@@unboxed] [@@noalloc]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16456 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:24 +00:00
Jérémie Dimino 62b89a3a5c Replace uses of "noalloc" by [@@noalloc]
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16455 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-06 10:58:22 +00:00
Alain Frisch 12f6a53937 GPR#250: Check for negative start element in Array.sub.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16450 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-10-05 09:02:05 +00:00
Pierre Weis b16b6dea44 Missing newlines after autodoc comments
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16445 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-24 19:03:47 +00:00
Pierre Weis b710ec0a85 Documentation deeply revisited. New phrasing: line splitting versus line
breaking, consistent usage of splitting and split; simpler explanation for
break hints and new documentation for pretty-printing boxes.

Tabulation boxes get deprecated: this mechanism does not interact nicely with
the rest of the pretty-printing engine and should be completely revisited...


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16444 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-24 19:02:09 +00:00
Pierre Weis 36ab801e6f A second attempt to memoize Scanning.from_in_channel using weak pointers.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16443 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-24 18:31:11 +00:00
Pierre Weis 8024d28dc1 Module Weak is used in module Scanf. It is now linked just after module Hashtbl.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16431 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-21 17:18:09 +00:00
Pierre Weis 5485362404 Scanning.from_channel now uses a weak hash table to record in_channel -> scanbuf associations. This should prevent memory leaks in program that intensively call Scanf.fscanf.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16430 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-21 17:17:04 +00:00
Pierre Weis e02d472aa4 Renaming: flush_buf_formatter into flush_buffer_formatter.
flush_str_formatter rewritten using flush_buffer_formatter.

Consistent naming of pretty-printer formatter as ppf not strange x or o
parameters.

Function ksprintf purposedly defines a new continuation embedding the old
one.

Function asprintf rewritten in a more natural way; spurious pp_flush_queue
deleted in the conitnuation, since it is already done via following
flush_buffer_formatter call.

Indent.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@16429 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2015-09-21 17:08:11 +00:00
Pierre Chambart 162a29f816 Change static to dynamic checks in camlinternalOO 2015-09-21 16:19:45 +02:00
Pierre Chambart 0b067c9531 Clean cruft from camlinternalOO 2015-09-21 16:16:00 +02:00