aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/erl_pp.erl
AgeCommit message (Collapse)Author
2019-04-12stdlib: Let the Pretty Printer output more on one lineHans Bolinder
Atomic elements such as atoms, '{}', '[]', and '<<>>' are output on the same line in types, structs, lists, &c. In particular types can be more compact, and easier to read. A space is output after comma in tuples, to be more consistent.
2019-04-12stdlib: Add option 'quote_singleton_atom_types' to erl_ppHans Bolinder
The new option can be used by Dialyzer, which has traditionally quoted singleton atom types. The OTP team has decided not to use the convention in OTP documentation, at least not for now. That is why the option is needed. EDoc does not use the new option. Syntax Tools does not have a similar option.
2019-04-08stdlib: Fix a bug concerning exception class 'throw'Hans Bolinder
Since the introduction of the stack trace variable, the Erlang Pretty Printer has left out the exception class 'throw' even when the stack trace variable cannot be left out, which is not correct Erlang code. The fix is to always include the exception class 'throw'. An alternative is to exclude 'throw' exactly when the stack trace variable is '_'.
2019-02-18stdlib: Fix a bug in the Erlang Pretty PrinterHans Bolinder
Long atom names in combination with <c><<>></c> could cause a crash.
2018-06-25stdlib: Add a few uses of erl_annoHans Bolinder
With DEBUG=true in erl_anno, erl_parse, and erl_pp a few (harmless) non-opaque accesses of annotations were found.
2017-09-15Merge branch 'siri/string-new-api'Siri Hansen
* siri/string-new-api: (28 commits) hipe (test): Do not use deprecated functions in string(3) dialyzer (test): Do not use deprecated functions in string(3) eunit (test): Do not use deprecated functions in string(3) system (test): Do not use deprecated functions in string(3) system (test): Do not use deprecated functions in string(3) mnesia (test): Do not use deprecated functions in string(3) Deprecate old string functions observer: Do not use deprecated functions in string(3) common_test: Do not use deprecated functions in string(3) eldap: Do not use deprecated functions in string(3) et: Do not use deprecated functions in string(3) os_mon: Do not use deprecated functions in string(3) debugger: Do not use deprecated functions in string(3) runtime_tools: Do not use deprecated functions in string(3) asn1: Do not use deprecated functions in string(3) compiler: Do not use deprecated functions in string(3) sasl: Do not use deprecated functions in string(3) reltool: Do not use deprecated functions in string(3) kernel: Do not use deprecated functions in string(3) hipe: Do not use deprecated functions in string(3) ... Conflicts: lib/eunit/src/eunit_lib.erl lib/observer/src/crashdump_viewer.erl lib/reltool/src/reltool_target.erl
2017-08-03Remove query keyword residuesbitnitdit
There are still some query residues used as a keyword. Remove them. query was no longer a keyword since the commit 0dc3a29744bed0b7f483ad72e19773dc0982ea50 2012-11-19.
2017-07-06stdlib: Do not use deprecated functions in string(3)Hans Bolinder
2017-04-07stdlib: Fix Erlang pretty printer regarding Unicode atomsHans Bolinder
2017-03-08stdlib: Improve the erl_pp module's debug testsHans Bolinder
2016-06-13stdlib: Let epp handle long file namesHans Bolinder
2016-06-10Merge branch 'hasse/dialyzer/improve_from_form/OTP-13547'Hans Bolinder
* hasse/dialyzer/improve_from_form/OTP-13547: Update primary bootstrap stdlib: Correct types and specs dialyzer: Minor adjustments dialyzer: Suppress unmatched_return for send/2 dialyzer: Improve the translation of forms to types dialyzer: Use a cache when translating forms to types dialyzer: Prepare erl_types:t_from_form() for a cache dialyzer: Optimize erl_types:t_form_form() dialyzer: Correct types syntax_tools: Correct types erts: Correct character repr in doc of the abstract format stdlib: Correct types and specs
2016-06-09Remove support for '...' in Maps typesHans Bolinder
It is possible that '...' is added later (OTP 20.0), but for now we are not sure of all details.
2016-06-09stdlib: Correct types and specsHans Bolinder
2016-04-28stdlib: Add pretty-printing of exact map typesHans Bolinder
2015-12-07stdlib: Correct pretty-printing of map typesHans Bolinder
Add parentheses around annotated type union elements in map pair types. The bug was introduced in Erlang/OTP 18.0.
2015-12-07stdlib: Pretty-print constraints as 'V :: T'Hans Bolinder
Print constraints as 'V :: T' rather than 'is_subtype(V, T)'.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-06-12stdlib: Introduce precedence for operators in typesHans Bolinder
Add new functions erl_parse:type_inop_prec() and erl_parse:type_preop_prec(). Get rid of paren_type used for parentheses in types.
2015-04-30stdlib: Use module erl_annoHans Bolinder
2014-11-20stdlib: remove the last traces of Mnemosyne RulesHans Bolinder
Robert has OK'ed the removal of the token ':-'.
2014-10-01Merge branch 'maint'Björn-Egil Dahlberg
Conflicts: lib/stdlib/src/erl_pp.erl
2014-09-29stdlib: Handle key type expressionsBjörn-Egil Dahlberg
2014-09-22Merge branch 'maint'Björn-Egil Dahlberg
Conflicts: lib/stdlib/src/erl_pp.erl
2014-09-11stdlib: Fix maps type pretty printingBjörn-Egil Dahlberg
Properly align union typed assoc values.
2014-04-29Modify representation of the map typeHans Bolinder
Types are represented by quadruples {type, LINE, Name, Args}, but maps were represented by five-tuples {type, LINE, map_field_assoc, Dom, Range}. Note: this is *not* about the quadruples used for representing expressions, {map_field_assoc,L,K,V}.
2014-04-29Allow more type namesHans Bolinder
product/_, union/_, range/2 as well as tuple/N (N > 0), map/N (N > 0), atom/1, integer/1, binary/2, record/_, and 'fun'/_ can now be used as type names.
2014-04-28Introduce the attribute -optional_callbacks in the context of behavioursHans Bolinder
2014-03-27stdlib: Fix map type listingBjörn-Egil Dahlberg
2014-02-01Support maps in erl_prettyprAnthony Ramine
2013-12-12EEP 37: Funs with namesAnthony Ramine
This adds optional names to fun expressions. A named fun expression is parsed as a tuple `{named_fun,Loc,Name,Clauses}` in erl_parse. If a fun expression has a name, it must be present and be the same in every of its clauses. The function name shadows the environment of the expression shadowing the environment and it is shadowed by the environment of the clauses' arguments. An unused function name triggers a warning unless it is prefixed by _, just as every variable. Variable _ is allowed as a function name. It is not an error to put a named function in a record field default value. When transforming to Core Erlang, the named fun Fun is changed into the following expression: letrec 'Fun'/Arity = fun (Args) -> let <Fun> = 'Fun'/Arity in Case in 'Fun'/Arity where Args is the list of arguments of 'Fun'/Arity and Case the Core Erlang expression corresponding to the clauses of Fun. This transformation allows us to entirely skip any k_var to k_local transformation in the fun's clauses bodies.
2013-05-28Support callback attributes in erl_ppAnthony Ramine
2013-05-16[stdlib] Fix pretty printing of invalid formsHans Bolinder
Thanks to Tomáš Janoušek.
2013-02-18Fix some Unicode issuesHans Bolinder
Also let the Erlang shell use the new function io:printable_range().
2013-02-15[stdlib] Correct handling of Unicode filenamesHans Bolinder
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-16Remove support for the query keyword and query expressionsLoïc Hoguin
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.
2011-11-07EEP-23: Allow variables in fun M:F/ABjörn Gustavsson
Currently, the external fun syntax "fun M:F/A" only supports literals. That is, "fun lists:reverse/1" is allowed but not "fun M:F/A". In many real-life situations, some or all of M, F, A are not known until run-time, and one is forced to either use the undocumented erlang:make_fun/3 BIF or to use a "tuple fun" (which is deprecated). EEP-23 suggests that the parser (erl_parse) should immediately transform "fun M:F/A" to "erlang:make_fun(M, F, A)". We have not followed that approach in this implementation, because we want the abstract code to mirror the source code as closely as possible, and we also consider erlang:make_fun/3 to be an implementation detail that we might want to remove in the future. Instead, we will change the abstract format for "fun M:F/A" (in a way that is not backwards compatible), and while we are at it, we will move the translation from "fun M:F/A" to "erlang:make_fun(M, F, A)" from sys_pre_expand down to the v3_core pass. We will also update the debugger and xref to use the new format. We did consider making the abstract format backward compatible if no variables were used in the fun, but decided against it. Keeping it backward compatible would mean that there would be different abstract formats for the no-variable and variable case, and tools would have to handle both formats, probably forever. Reference: http://www.erlang.org/eeps/eep-0023.html
2011-05-12Types and specifications have been modified and addedHans Bolinder
2011-03-22Fix a bug concerning record field typesHans Bolinder
The default value 'undefined' was added to records field types in such a way that the result was not always a well-formed type. This bug has been fixed. --- erl_pp has since OTP-8150 formatted types so that 'undefined' was removed from union types assigned to record fields. Since one cannot distinguish between 'undefined' added by the parser or supplied by the user, a side effect was that user supplied 'undefined's were also removed. Now the pretty printer shows 'undefined' even if added by the parser. This is a minor issue.
2010-06-02OTP-8664 Erlang parser augmented with operators for integer typesHans Bolinder
Expressions evaluating to integers can now be used in types and function specifications where hitherto only integers were allowed ("Erlang_Integer").
2010-03-09OTP-8501 stdlib: erl_pp no longer quotes atoms in typesHans Bolinder
The erlang pretty printer (erl_pp) no longer quotes atoms in types.
2010-03-02OTP-8473 stdlib: erl_pp bugfix abstract type 'fun'Hans Bolinder
The abstract type 'fun' could not be printed. This bug has been fixed.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP