aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/io_lib.erl
AgeCommit message (Collapse)Author
2019-02-14stdlib: Optimize formatted printing of termsHans Bolinder
Try calling iolist_size() before calling string:length(). The reason is that calls to string:length/1 are slow when the argument is not a list of integers (or contains UNICODE).
2018-08-20stdlib: Improve error handling in module io_libHans Bolinder
2018-04-25stdlib: Modify the printing of map associations with wWpPHans Bolinder
Use the same depth for all (printed) elements of a map. Since the order of keys can vary when printing a map--maps:iterator/1 and maps:next/1 are used--it is more consistent to print all associations with the same depth. If the associations printed are limited by the depth, the selection of associations is arbitrary, as before.
2018-04-25stdlib: Introduce characters limit of formated stringsHans Bolinder
Inspiration from module lager_format. Also some improvements of Unicode handling. io_lib:format/3 and io_lib:fwrite/3 are new functions. The representation of the options is a list, but we are considering using a map instead. If we change, it will happen after Erlang/OTP 21.0-rc1 is released.
2018-04-25stdlib: Modify ~w/~W when number of characters is limitedHans Bolinder
A bug fix: limited maps end with "...", not "...=>...". A modification: wW separate pairs with " => ", not "=>". When the output is limited on number of characters, the term is balanced by wW the same way as is done with pP (see commit bc38638).
2018-04-25stdlib: io_lib{_pretty}: Avoid tuple_to_list when possibleHans Bolinder
2018-04-25stdlib: Introduce characters limit of formatted stringsHans Bolinder
The name of the io_lib_pretty:print/2 option 'max_chars' is changed to 'line_max_chars' (used by module shell only). The new option for limiting the number of returned characters of io_lib_pretty:print() is called 'chars_limit'.
2018-03-08stdlib: Improve io_lib:limit_term/2Hans Bolinder
Improve handling of maps. Addendum to b57e890.
2018-01-23Merge branch 'maint'Hans Bolinder
* maint: kernel: Correct contracts and a bug in group_history stdlib: Correct contracts dialyzer: Optimize handling of a lot of warnings Conflicts: lib/kernel/src/erl_boot_server.erl
2018-01-22stdlib: Correct contractsHans Bolinder
2017-11-20stdlib: Make io_lib and io_lib_pretty use maps iteratorLukas Larsson
2017-05-18stdlib: Add io_lib:limit_term/2Hans Bolinder
The term returned by io_lib:limit_term(Term, Depth) should return the same string if substituted for Term in io_lib:format("~P", [Term, Depth]) or io_lib:format("~W", [Term, Depth]).
2017-04-24stdlib: Add Unicode modifier t to control sequences w and WHans Bolinder
As of the introduction of Unicode characters in atoms, the control sequences 'w' and 'W' can return non-Latin-1 characters, unless some measure is taken. This commit makes sure that '~w' and '~W' always return Latin-1 characters, or bytes, which can be output to ports or written to raw files. The Unicode translation modifier 't' is needed to return non-Latin-1 characters.
2017-04-07stdlib: Add function to io_lib to handle Unicode atomsHans Bolinder
2017-02-14Fixed typos in lib/stdlibAndrew Dryga
2016-04-28Enhance map specs in erts, stdlib, runtime_toolsMagnus Lång
Using the new type syntax, we can specify which keys are required, and which are optional in a way Dialyzer could use.
2016-03-15update copyright-yearHenrik Nord
2015-06-18Change license text to APLv2Bruce Yinhe
2015-03-19stdlib: Remove obsolete hashmap references in io_libBjörn-Egil Dahlberg
2015-03-12stdlib: Enable io_lib:format/* for hamt mapsBjörn-Egil Dahlberg
This is a commit to enable printouts of hashmaps during development and will be enhanced once hashmaps are in place.
2015-03-10Make the scanned form of the io_lib format strings available for processingRichard Carlsson
This adds three new functions to io_lib - scan_format/2, unscan_format/1, and build_text/1 - which expose the parsed form of the format control sequences to make it possible to easily modify or filter the input to io_lib:format/2. This can e.g. be used in order to replace unbounded-size control sequences like ~w or ~p with corresponding depth-limited ~W and ~P before doing the actual formatting.
2014-01-28erts,stdlib: Change map module name to mapsBjörn-Egil Dahlberg
Name conforms to EEP.
2014-01-28stdlib: Update printing to handle MapsBjörn-Egil Dahlberg
2013-10-14Merge branch 'maint'Fredrik Gustafsson
2013-09-12Remove ^L characters hidden randomly in the code. Not those used in text ↵Pierre Fenoll
files as delimiters. While working on a tool that processes Erlang code and testing it against this repo, I found out about those little sneaky 0xff. I thought it may be of help to other people build such tools to remove non-conforming-to-standard characters.
2013-08-22Merge branch 'maint'Hans Bolinder
* maint: Correct the specifications of io_lib:fread/2,3
2013-08-21Correct the specifications of io_lib:fread/2,3Hans Bolinder
Thanks to Chris King and Kostis Sagonas for pinpointing the bug.
2013-04-19Remove the "coding: utf-8" comment from all Erlang source filesHans Bolinder
2013-02-18Correct misspelled comments and space at lin endsPatrik Nyblom
2013-02-18Add usage of and spec for io:printable_range/0Patrik Nyblom
This makes both io:format("~tp", ...) and the shell honor the +pc setting and also reverts the shell to the old behaviour of only interpreting latin1 strings as "strings" by default. +pc unicode turns on the R16A behaviour. Doing io:format("~tp~n", [[1024,1025]]). will show you the difference when starting with +pc unicode.
2013-01-25Extend char() to Unicode charactersHans Bolinder
The code related to the introduction of unicode_string() and unicode_char() has been removed. The types char() and string() have been extended to include Unicode characters. In fact char() was changed some time ago; this commit is about cleaning up the documentation and introduce better names for some functions.
2013-01-25[stdlib] Fix a contract bugHans Bolinder
Also minor corrections of the docs of io(3)
2013-01-09Prepare OTP files for Unicode as default encodingHans Bolinder
2013-01-02Make sure the Erlang shell prompt can handle UnicodeHans Bolinder
2013-01-02Improve and correct contracts and types of the IO modulesHans Bolinder
2013-01-02[stdlib, kernel] Introduce Unicode support for Erlang source filesHans Bolinder
Expect modifications, additions and corrections. There is a kludge in file_io_server and erl_scan:continuation_location() that's not so pleasing.
2012-10-18Merge branch 'at/binary-depth-printing'Henrik Nord
* at/binary-depth-printing: Fix printing the empty binary at depth 1 with ~W OTP-10504
2012-09-27Refine a few opaque typesHans Bolinder
2012-09-19Fix printing the empty binary at depth 1 with ~WAndrew Thompson
A case clause ordering problem is causing the empty binary to be printed as <<...>> rather than the correct <<>> when using ~W with a depth of 1. Add new tests to verify correct behaviour.
2011-08-31Improve and correct types and specifications in Kernel and STDLIBHans Bolinder
Running Dialyzer on the test suites revealed a few type errors.
2011-07-05Correct the contract of io_lib:fread/2,3Hans Bolinder
2011-05-12Types and specifications have been modified and addedHans Bolinder
2010-06-03stdlib: Add declarations for exported typesKostis Sagonas
2010-02-10OTP-8418 user.erl (used in oldshell) is updated to handle unicode inPatrik Nyblom
prompt strings (io:get_line/{1,2}). io_lib is also updated to format prompts with the 't' modifier (i.e. ~ts instead of ~s).
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP