From b21f71c1bb79d3979505ad6ad1e496472b38c6b9 Mon Sep 17 00:00:00 2001
From: Hans Bolinder
Date: Thu, 17 Dec 2015 12:41:44 +0100
Subject: stdlib: Update erl_parse(3)
Calls to map_anno(), fold_anno(), and mapfold_anno() with lists of
erl_parse trees have been replaced. Those functions accept lists of
erl_parse trees, but it was not the intention when the functions were
introduced, and it is not documented.
---
lib/stdlib/doc/src/erl_parse.xml | 120 ++++++++++++++++++++++++---------------
1 file changed, 73 insertions(+), 47 deletions(-)
(limited to 'lib/stdlib/doc/src')
diff --git a/lib/stdlib/doc/src/erl_parse.xml b/lib/stdlib/doc/src/erl_parse.xml
index 0938b5dec3..13be488c33 100644
--- a/lib/stdlib/doc/src/erl_parse.xml
+++ b/lib/stdlib/doc/src/erl_parse.xml
@@ -4,7 +4,7 @@
- 19962015
+ 19962016
Ericsson AB. All Rights Reserved.
@@ -44,20 +44,32 @@
-
- Parse tree for Erlang clause.
+ abstract_clause()
+
+ Abstract form of an Erlang clause.
-
- Parse tree for Erlang expression.
+ abstract_expr()
+
+ Abstract form of an Erlang expression.
-
- Parse tree for Erlang form.
+ abstract_form()
+
+ Abstract form of an Erlang form.
+
+ abstract_type()
+
+ Abstract form of an Erlang type.
+
+
+
+
+
@@ -180,7 +192,7 @@
Converts the Erlang data structure Data into an
abstract form of type AbsTerm.
The Line option is the line that will
- be assigned to each node of the abstract form.
+ be assigned to each node of AbsTerm.
The Encoding option is used for
selecting which integer lists will be considered
as strings. The default is to use the encoding returned by
@@ -196,47 +208,53 @@
- Map a function over the annotations of an abstract form
+ Map a function over the annotations of a erl_parse tree
- Modifies the abstract form Abstr by applying
- Fun on every collection of annotations of the
- abstract form. The abstract form is traversed in a
- depth-first, left-to-right, fashion.
+
Modifies the erl_parse tree Abstr
+ by applying Fun on each collection of
+ annotations of the nodes of the erl_parse tree. The
+ erl_parse tree is traversed in a depth-first,
+ left-to-right, fashion.
- Fold a function over the annotations of an abstract form
+ Fold a function over the annotations of a erl_parse tree
- Updates an accumulator by applying Fun on
- every collection of annotations of the abstract form
- Abstr. The first call to Fun has
- AccIn as argument, and the returned accumulator
- AccOut is passed to the next call, and so on.
- The final value of the accumulator is returned. The abstract
- form is traversed in a depth-first, left-to-right, fashion.
+
Updates an accumulator by applying Fun on
+ each collection of annotations of the erl_parse tree
+ Abstr. The first call to
+ Fun has AccIn as
+ argument, and the returned accumulator
+ AccOut is passed to the next call, and
+ so on. The final value of the accumulator is returned. The
+ erl_parse tree is traversed in a depth-first, left-to-right,
+ fashion.
- Map and fold a function over the annotations of an abstract form
+ Map and fold a function over the annotations of a
+ erl_parse tree
- Modifies the abstract form Abstr by applying
- Fun on every collection of annotations of the
- abstract form, while at the same time updating an
- accumulator. The first call to Fun has
- AccIn as second argument, and the returned
- accumulator AccOut is passed to the next call,
- and so on. The modified abstract form as well as the the
- final value of the accumulator is returned. The abstract
- form is traversed in a depth-first, left-to-right, fashion.
+
Modifies the erl_parse tree Abstr
+ by applying Fun on each collection of
+ annotations of the nodes of the erl_parse tree, while
+ at the same time updating an accumulator. The first call to
+ Fun has AccIn as
+ second argument, and the returned accumulator
+ AccOut is passed to the next call, and
+ so on. The modified erl_parse tree as well as the the
+ final value of the accumulator are returned. The
+ erl_parse tree is traversed in a depth-first,
+ left-to-right, fashion.
@@ -246,12 +264,15 @@
Create new annotations
- Creates an abstract form from a term which has the same
- structure as an abstract form, but locations where the
- abstract form has annotations. For each location, erl_anno:new/1 is
- called, and the annotations replace the location.
+
Assumes that Term is a term with the same
+ structure as a erl_parse tree, but with locations where a
+ erl_parse tree has collections of annotations.
+ Returns a erl_parse tree where each location L
+ has been replaced by the value returned by erl_anno:new(L).
+ The term Term is traversed in a
+ depth-first, left-to-right, fashion.
@@ -261,12 +282,14 @@
Return annotations as terms
- Assumes that Term is a term with the same
- structure as an abstract form, but with terms, T say, on
- those places where an abstract form has annotations. Returns
- an abstract form where every term T has been replaced by the
- value returned by calling erl_anno:from_term(T). The
- term Term is traversed in a depth-first,
+
Assumes that Term is a term with the same
+ structure as a erl_parse tree, but with terms,
+ T say, where a erl_parse tree has collections
+ of annotations. Returns a erl_parse tree where each
+ term T has been replaced by the value returned by
+
+ erl_anno:from_term(T). The term
+ Term is traversed in a depth-first,
left-to-right, fashion.
@@ -277,10 +300,13 @@
Return the representation of annotations
- Returns a term where every collection of annotations Anno of
- Abstr has been replaced by the term returned by
- calling erl_anno:to_term(Anno). The abstract form is
- traversed in a depth-first, left-to-right, fashion.
+
Returns a term where each collection of annotations
+ Anno of the nodes of the erl_parse tree
+ Abstr has been replaced by the term
+ returned by
+ erl_anno:to_term(Anno). The
+ erl_parse tree is traversed in a depth-first,
+ left-to-right, fashion.
--
cgit v1.2.3