From 5026c77dab7d5f1a9fb9932cc9d5aa753a6777d3 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 8 Feb 2014 01:39:13 +0100 Subject: [PATCH 1/2] Remove query expressions from absform documentation It was put back by error on a conflict hiccup when introducing named funs. --- erts/doc/src/absform.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 835a4fc692f0..037bacc0b89c 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -303,13 +303,6 @@ is a function clause then Rep(E) = . - If E is , - where each is a generator or a filter, then - Rep(E) = . - For Rep(W), see below. - If E is , a Mnesia record access - inside a query, then - Rep(E) = . If E is , then Rep(E) = , i.e., parenthesized expressions cannot be distinguished from their bodies. From a1a90b1fdcae5d6cbebd2d71fc0ff6275c1463a9 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Sat, 8 Feb 2014 01:39:57 +0100 Subject: [PATCH 2/2] Document abstract format of type-related trees --- erts/doc/src/absform.xml | 170 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml index 037bacc0b89c..ae657163d5ba 100644 --- a/erts/doc/src/absform.xml +++ b/erts/doc/src/absform.xml @@ -80,6 +80,28 @@ If F is a record declaration , then Rep(F) = . For Rep(V), see below. + If F is a type attribute (i.e. or + ) + where each + is a type variable, then Rep(F) = + . + For Rep(T), see below. + If F is a type spec (i.e. or + ) + , + where each is a fun type clause with an + argument sequence of the same length , then + Rep(F) = + . + For Rep(Tc_i), see below. + If F is a type spec (i.e. or + ) + , + where each is a fun type clause with an + argument sequence of the same length , then + Rep(F) = + . + For Rep(Tc_i), see below. If F is a wild attribute , then Rep(F) = .

@@ -89,6 +111,139 @@ Rep(F) = . +
+ Type clauses + + If T is a fun type clause + Ret]]>, where each + and are types, then + Rep(T) = + . + + If T is a fun type clause , where + is a fun type clause and is + a type guard sequence, then Rep(T) = + . + +
+ +
+ Type guards +

A type guard sequence Gs is a non-empty sequence of type guards + where each is a + type guard and Rep(Gs) = + .

+

A type guard is one of the following + alternatives:

+ + If G is a constraint , where + is an atom and each is a + type, then Rep(G) = + . + + If G is a constraint , + where is a variable and + is a type, then Rep(G) = + . + +
+ +
+ Types + + If T is a type definition , + where is a variable and + is a type, then Rep(T) = + . + If T is a type union , + where each is a type, then Rep(T) = + . + If T is a type range , + where and are types, then + Rep(T) = . + If T is a binary operation , + where is an arithmetic or bitwise binary operator + and and are types, then + Rep(T) = . + If T is , where is an + arithmetic or bitwise unary operator and is a + type, then Rep(T) = . + If T is a fun type , then Rep(T) = + . + If T is a parenthesized type , then + Rep(T) = , i.e. parenthesized + types are distinguished from their bodies. It should be noted though + that parenthesized types that are immediate subtrees of operator + expressions and binary types are peeled off. + If T is a the universal type , then Rep(T) = + . + If T is a variable , then Rep(T) = + , where is an atom + with a printname consisting of the same characters as + . + If T is an atomic literal L and L is not a string literal, then + Rep(T) = Rep(L). + If T is a tuple or map type (i.e. + or ), then Rep(T) = + . + If T is a type , where each + is a type, then Rep(T) = + . + If T is a remote type , where + each is a type and and + , then Rep(T) = + . + + If T is the nil type , then Rep(T) = + . + If T is a list type , where + is a type, then Rep(T) = + . + If T is a non-empty list type , where + is a type, then Rep(T) = + . + If T is a map type , where each + is a map pair type, then Rep(T) = + . + If T is a map pair type V]]>, where + and are types, + then Rep(T) = + . + If T is a tuple type , where + each is a type, then Rep(T) = + . + If T is a record type , where + is an atom, then Rep(T) = + . + If T is a record type , + where is an atom, then Rep(T) = + . + + If T is a record field type , + where is an atom, then Rep(T) = + . + If T is a binary type >]]>, then Rep(T) = + . + + If T is a binary type >]]>, where + is a type, then Rep(T) = + . + If T is a binary type >]]>, + where is a type, then Rep(T) = + . + If T is a binary type >]]>, + where and is a type, then + Rep(T) = + . + If T is a fun type Ret)]]>, then + Rep(T) = + . + If T is a fun type , where + is a fun type clause, then Rep(T) = + . + +
+
Record fields

Each field in a record declaration may have an optional @@ -98,6 +253,21 @@ Rep(V) = . If V is , then Rep(V) = . + If V is , where is + an atom and is a type and it does not contain + syntactically, then Rep(V) = + . + Note that if is an annotated type, it will be wrapped in + parentheses. + If V is , where is + an atom and is a type, then Rep(V) = + . + + If V is , where + is an atom, is an expression and + is a type, then Rep(V) = + . +