From a46f30f38f0e757e9aa335e1452879db608d8489 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 27 Jun 2014 14:47:26 +0200 Subject: Properly support maps in match_specs --- erts/doc/src/match_spec.xml | 57 ++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 24 deletions(-) (limited to 'erts/doc/src/match_spec.xml') diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml index 334b47d34c..b4cc8e9f78 100644 --- a/erts/doc/src/match_spec.xml +++ b/erts/doc/src/match_spec.xml @@ -76,22 +76,26 @@ { GuardFunction, ConditionExpression, ... } BoolFunction ::= | - | | | - | | | - | | | - | | | - | | | | - | + | | + | | + | | + | | + | | + | | + | | + | | + | | + ConditionExpression ::= ExprMatchVariable | { GuardFunction } | { GuardFunction, ConditionExpression, ... } | TermConstruct ExprMatchVariable ::= MatchVariable (bound in the MatchHead) | | - TermConstruct = {{}} | {{ ConditionExpression, ... }} | - | [ConditionExpression, ...] | NonCompositeTerm | Constant - - NonCompositeTerm ::= term() (not list or tuple) - + TermConstruct = {{}} | {{ ConditionExpression, ... }} | + | [ConditionExpression, ...] | + | #{term() => ConditionExpression, ...} | + NonCompositeTerm | Constant + NonCompositeTerm ::= term() (not list or tuple or map) Constant ::= {, term()} GuardFunction ::= BoolFunction | | @@ -134,22 +138,26 @@ { GuardFunction, ConditionExpression, ... } BoolFunction ::= | - | | | - | | | - | | | - | | | - | | | | - | + | | + | | + | | + | | + | | + | | + | | + | | + | | + ConditionExpression ::= ExprMatchVariable | { GuardFunction } | { GuardFunction, ConditionExpression, ... } | TermConstruct ExprMatchVariable ::= MatchVariable (bound in the MatchHead) | | TermConstruct = {{}} | {{ ConditionExpression, ... }} | - | [ConditionExpression, ...] | NonCompositeTerm | Constant - - NonCompositeTerm ::= term() (not list or tuple) - + | [ConditionExpression, ...] | #{} | + #{term() => ConditionExpression, ...} | NonCompositeTerm | + Constant + NonCompositeTerm ::= term() (not list or tuple or map) Constant ::= {, term()} GuardFunction ::= BoolFunction | | @@ -172,9 +180,10 @@ Functions allowed in all types of match specifications

The different functions allowed in work like this:

-

is_atom, is_float, is_integer, is_list, is_number, is_pid, is_port, is_reference, is_tuple, is_binary, is_function: Like the corresponding guard tests in - Erlang, return or . -

+

is_atom, is_float, is_integer, is_list, is_number, is_pid, is_port, + is_reference, is_tuple, is_map, is_binary, is_function: Like the + corresponding guard tests in Erlang, return or + .

is_record: Takes an additional parameter, which SHALL be the result of )]]>, like in . -- cgit v1.2.3