summaryrefslogtreecommitdiffstats
path: root/stdlib
AgeCommit message (Collapse)Author
2014-05-12move code from pervasives.ml to camlinternalFormat.mlGabriel Scherer
This simplifies the charset-handling code, as camlinternalFormat is allowed to depend on Bytes and String instead of re-importing the needed primitives. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14837 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12simplification in bprint_char_setGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14836 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12charset-parsing: require that '%' be written '%%' in charsets, as per the ↵Gabriel Scherer
documentation git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14835 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12implement (^^) correctly wrt. string_of_format (Thanks to Pierre Weis)Gabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14834 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12printf behavior of %{..%}Gabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14833 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12minor strengthening of the typing of %{...%} formatsGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14832 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12some characters were not allowed in charsetsGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14831 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12accept and ignore '+' and '-' before precision integersGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14830 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12allow incompatible or unsupported numeric formatting flagsGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14829 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12fix printing bug: (Printf.printf "% 04d" 3) => "00 3"Gabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14828 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12parse the ignore flag before all othersGabriel Scherer
The legacy implementation doesn't support "%+_", "%-_" etc. which were accepted by Benoît's patches. This creates a discrepancy (though not a regression) that is not necessarily desirable (and in any case makes fuzz-testing for difference return non-bugs). Long-term, I think that we're good with the previous, simpler structure where "_" must always be the first flag. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14827 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12introduce type aliases for simple padding and precision typesGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14825 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12Add support for ignored scan_get_counter formats (%_[nlNL])Gabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14820 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12when passed to Printf, %l%n%L should be interepreted as %u, not %dGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14818 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12allows some more ignored formatsGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14817 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12ignore more incompatible flagsGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14816 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12disable incompatible flags in legacy modeGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14815 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12some benine meaningless formats were previously ignoredGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14814 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12sets up a 'legacy mode'Gabriel Scherer
When the OCAML_LEGACY_FORMAT environment variable is set, the compiler will try to emulate the behaviour of the previous implementation of format. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14813 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12second part of Benoît Vaugon's format+gadts patchGabriel Scherer
To finish the bootstrap cycle, run: make library-cross make promote make partialclean make core make library-cross make promote-cross make partialclean make ocamlc ocamllex ocamltools make library-cross make promote make partialclean make core make compare git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14810 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12convert Benoît's first patch to bytes/stringGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14807 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-12first part of Benoît Vaugon's format-gadts patchGabriel Scherer
After applying this patch, you should run: make library-cross make promote-cross make partialclean make ocamlc ocamllex ocamltools and then immediately apply the following patches until the "second part of Benoît Vaugon's format+gadts patch"; the bootstrap cycle is not finished yet. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14806 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10Reformulation of the user-facing slot-access APIGabriel Scherer
- The internal [backtrace_slot] type is not exposed anymore, instead accessors function return orthogonal information (is_raise, location). This is both more extensible and more user-friendly. - The [raw_backtrace_slot] is exposed separately as a low-level type that most users should never use. The unsafety of marshalling is documented. Instead of defining [raw_backtrace = raw_backtrace_slot array], I kept [raw_backtrace] an abstract type with [length] and [get] functions for random-access. This should allow us to change the implementation in the future to be more robust wrt. marshalling (boxing the trace in a Custom block, or even possibly the raw slots at access time). git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14784 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10expose Printexc.format_backtrace_slot to facilitate testingGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14781 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-10Printexc: OCaml-friendly access to individual backtrace slotsGabriel Scherer
(Patch by Jacques-Henri Jourdan) There are several changes: - `raw_backtrace` is no longer an abstract type, but rather an `raw_backtrace_slot array`, where `raw_backtrace_slot` is a new abstract type. `raw_backtrace_slot` elements are hashable and comparable. At runtime, values of this type contain either a bytecode pointer or a frame_descr pointer. In order to prevent the GC from walking through this pointer, the low-order bit is set to 1 when stored in the array. - The old `loc_info` type is know public, renamed into `backtrace_slot`: type backtrace_slot = | Known_location of bool (* is_raise *) * string (* filename *) * int (* line number *) * int (* start char *) * int (* end char *) | Unknown_location of bool (*is_raise*) - new primitive : val convert_raw_backtrace_slot: raw_backtrace_slot -> backtrace_slot Rather than returning an option, it raises Failure when it is not possible to get the debugging information. It seems more idiomatic, especially because the exceptional case cannot appear only for a part of the executable. - the caml_convert_raw_backtrace primitive is removed; it is more difficult to implement in the C side because of the new exception interface described above. - In the bytecode runtime, the events are no longer deserialized once for each conversion, but once and for all at the first conversion, and stored in a global array (*outside* the OCaml heap), sorted by program counter value. I believe this information should not take much memory in practice (it uses the same order of magnitude memory as the bytecode executable). It also makes location lookup much more efficient, as a dichomoty is used instead of linear search as previously. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14776 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-05change -trans-mod to -no-alias-deps, and update messageJacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14738 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-04PR#5584: merge open extensible types, extension-patch-4.0.2Jacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14737 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-03stdlib/map: Add some usage exemple in the documentation.Gabriel Scherer
(Patch by Nicolas Braud-Santoni) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14730 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-05-01safe-string: documentation fixes and add a couple of functions in Pervasives ↵Damien Doligez
and Digest git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14721 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-30document __LOC__ in pervasives.mliFabrice Le Fessant
Also removes __FILE_OF__ and __MODULE_OF__, since they are not more precise than __FILE__ and __MODULE__ git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14715 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-29merge branch "safe-string"Damien Doligez
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14705 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-23#6119: document that the set of values contained in a closure is not ↵Alain Frisch
specified and how this impacts marshaling references captured in closures, for instance. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14670 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-23Fix doc for unmarshaled exception values and structural comparison.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14669 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-19[minor] documentation typo in HashtblGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14647 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-19[minor] improvement over the Hashtbl docGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14646 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-19an example of functor application for HashtblGabriel Scherer
(Patch by Simon Cruanes) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14644 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-18PR#5941: add Printexc.set_uncaught_exception_handlerJérémie Dimino
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14643 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-18minor clean-upsDamien Doligez
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14642 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-17merge COMPFLAGS and OPTCOMPFLAGSDamien Doligez
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14621 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-15[whitespace] bring threads/pervasives.ml closer to stdlib/pervasives.mlGabriel Scherer
(report by Hugo Heuzard) git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14604 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12fix some of the whitespace problems in the sourceDamien Doligez
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14582 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12remove broken link in doc commentDamien Doligez
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14579 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-12fix wrong type name: string --> usage_msgDamien Doligez
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14578 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-10Add %loc_* primitives and corresponding values in PervasivesFabrice Le Fessant
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14571 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-07PR#6358: obey DESTDIR in install targetsGabriel Scherer
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14536 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-21#PR6269 Optimized string matchingLuc Maranget
Noticed that I had to bootstrap to test on ARM, so I commit a new bootstrap compiler. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14479 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-20Pervasives: define [min_int] and [max_int] without assuming that integers ↵Gabriel Scherer
are either 31 or 63 bits. (Patch by Jérôme Vouillon) Js_of_ocaml has 32 bit integers. Currently, it patches the bytecode, just to get the correct values for [min_int] and [max_int]. It would be simpler if this was not necessary. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14477 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-10Fix PR#6307Jacques Garrigue
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14451 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-07#5779: Revert change on camlinternalOO.Alain Frisch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14449 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-07use -bin-annot when buildingMark Shinwell
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14448 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02