aboutsummaryrefslogtreecommitdiffstats
path: root/lib/syntax_tools/src/erl_syntax.erl
AgeCommit message (Collapse)Author
2017-04-07syntax_tools: Fix Syntax Tools regarding Unicode atomsHans Bolinder
2016-11-23Update Syntax Tools license headersRichard Carlsson
This makes it clear that Apache 2.0 applies, without dropping the old LGPL licensing, and makes all the Syntax Tools file headers look the same as upstream.
2016-06-09syntax_tools: Correct typesHans Bolinder
2016-05-09syntax_tools: Add support for new map type syntaxHans Bolinder
The pretty-printing of `...' in map types is complex. The representation of `...' can be changed before OTP 19.
2016-05-09syntax_tools: Correct types and specsHans Bolinder
2016-05-09syntax_tools: Add support for types and specsHans Bolinder
In particular, types and specs can be pretty-printed. There are issues with macros (left behind by epp_dodger). Typed record fields are handled. Fields are represented by triples instead of two-tuples, which is an incompatible change. Some attributes (-export_type, -spec, -type, &c) have been given meaning in recent time, but the set of wild attributes (see Barklund's spec) is not changed.
2015-09-15syntax_tools: Use the erl_anno module a bit moreHans Bolinder
2014-12-22Remove support for Mnemosyne rulesRichard Carlsson
2014-12-22Remove support for mnemosyne-style record field accessRichard Carlsson
(The support in erl_parse got removed when 'packages' were removed, since the dot notation was overlaid on the existing mnemosyne access syntax.)
2014-10-27Merge branch 'maint'Björn-Egil Dahlberg
2014-10-24syntax_tools: Teach Maps to erl_syntaxBjörn-Egil Dahlberg
Affected functions: * erl_syntax:abstract/1 * erl_syntax:concrete/1 * erl_syntax:is_leaf/1 * erl_syntax:is_literal/1
2014-10-24syntax_tools: Fix is_literal/1 for binaryBjörn-Egil Dahlberg
2014-05-14Merge branch 'maint'Björn-Egil Dahlberg
2014-05-09Fix reverting map in syntax_toolsRoland Karlsson
There was a copy-paste bug in erl_syntax when running e.g. erl_syntax:revert_forms, affecting maps. Instead of getting Key/Value you got Key/Key in the resulting abstract form.
2014-04-28[syntax_tools] Let erl_syntax:concrete() accept the F/A syntaxHans Bolinder
Note: `arity_qualifier` nodes are recognized. This is to follow The Erlang Parser when it comes to wild attributes: both {F, A} and F/A are recognized, which makes it possible to turn wild attributes into recognized attributes without at the same time making it impossible to compile files using the new syntax with the old version of the Erlang Compiler.
2014-04-28Introduce the attribute -optional_callbacks in the context of behavioursHans Bolinder
2014-02-24syntax_tools: Fix broken doc links for MapsBjörn-Egil Dahlberg
2014-02-08Mention map trees in erl_syntax:type/1 documentationAnthony Ramine
2014-01-31Complete support of maps in erl_syntaxAnthony Ramine
map_expr/1 map_expr/2 map_expr_argument/1 map_expr_fields/1 map_field_assoc/2 map_field_assoc_name/1 map_field_assoc_value/1 map_field_exact/2 map_field_exact_name/1 map_field_exact_value/1
2014-01-29Fix representation of named funs in syntax_toolsAnthony Ramine
A named fun's name is a variable name, its type in syntax_tools is named_fun_expr.
2014-01-28edoc,syntax_tools: Teach Map understandingBjörn-Egil Dahlberg
2014-01-2717.0 anchor and broken links fixesLukas Larsson
2014-01-21Merge branch 'maint'Magnus Lidén
2014-01-21Fix reverting of local implicit funs in erl_syntaxAnthony Ramine
This partially reverts 290dc2b08a2f92157ac5358fba815f4dbb32f8f2 in which implicit funs were mistakenly thought to be using abstract terms for their name and arity.
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-11-11Fix reverting of implicit funsAnthony Ramine
Implicit funs parts in plain AST are no longer in concrete form since Erlang/OTP R15.
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-09syntax_tools: Remove support for packagesBjörn Gustavsson
2013-01-02[syntax_tools] Introduce Unicode support for Erlang source filesHans Bolinder
Not complete. Unicode in wild attribute doesn't work. No support for Unicode regarding Igor stubs.
2012-08-29Used previous resolutionFredrik Gustafsson
2012-08-08make list_suffix/1 and list_prefix/1 handle erl_parse() cons sequencesRichard Carlsson
2012-08-08modernized and cleaned up edoc documentationRichard Carlsson
2012-08-08removed obsolete @spec annotations and fixed some -spec and -type annotationsRichard Carlsson
2012-08-08preserve line numbers when reverting representationRichard Carlsson
2012-08-08updated author e-mailRichard Carlsson
2012-08-08removed CVS keywords from source filesRichard Carlsson
2012-01-05syntax_tools: Remove warnings of missing typesBjörn-Egil Dahlberg
* Just remove the warnings, not fixing the actual problem.
2012-01-05syntax_tools: Suppress warning of unused variableBjörn-Egil Dahlberg
2012-01-05Revert "syntax_tool: Add missing type information"Björn-Egil Dahlberg
This reverts commit 38ee7a20cfdc22ead35b4711a086babcf6b3069b.
2012-01-03syntax_tool: Add missing type informationBjörn-Egil Dahlberg
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
2010-10-26syntax_tools: Fix an erroneous type and strengthen some specsKostis Sagonas
The declaration of the stubDescriptop() type in 'igor' was erroneous, both in the -type and in the published documentation of the module. While fixing this some specs where strengthened and used a remote type to refer to ordsets:ordset(T). Consequently, this patch depends on the ordsets module exporting the ordset/1 type.
2010-06-03syntax_tools: Add declarations for exported typesKostis Sagonas
2010-02-14syntax_tools: Add types and specs for most exported functionsKostis Sagonas
While at it, consistently replace "bool()" with "boolean()" in the Edoc specs.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP