summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErlang/OTP <otp@erlang.org>2023-04-25 17:08:49 +0200
committerErlang/OTP <otp@erlang.org>2023-04-25 17:08:49 +0200
commit986e97058e9cca8d541f05d64a236bcd2d77d3ee (patch)
treefbab90c34347a0d1889db7d2cde4f8b4be713e3b
parent23eaeeaf27c3a355393bdfac90c193c690c165e0 (diff)
parent6f9420c414fd80bd035c39acaf33d6b619475085 (diff)
downloaderlang-986e97058e9cca8d541f05d64a236bcd2d77d3ee.tar.gz
Merge branch 'bjorn/stdlib/erl_parse/GH-6956/OTP-18506' into maint-25
* bjorn/stdlib/erl_parse/GH-6956/OTP-18506: erl_parse: Update types
-rw-r--r--lib/stdlib/src/erl_parse.yrl12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl
index f97ea99e60..6228c5857a 100644
--- a/lib/stdlib/src/erl_parse.yrl
+++ b/lib/stdlib/src/erl_parse.yrl
@@ -661,6 +661,7 @@ Erlang code.
-type abstract_expr() :: af_literal()
| af_match(abstract_expr())
+ | af_maybe_match()
| af_variable()
| af_tuple(abstract_expr())
| af_nil()
@@ -687,7 +688,9 @@ Erlang code.
| af_local_fun()
| af_remote_fun()
| af_fun()
- | af_named_fun().
+ | af_named_fun()
+ | af_maybe()
+ | af_maybe_else().
-type af_record_update(T) :: {'record',
anno(),
@@ -830,6 +833,9 @@ Erlang code.
-type af_map_pattern() ::
{'map', anno(), [af_assoc_exact(af_pattern())]}.
+-type af_maybe() :: {'maybe', anno(), af_body()}.
+-type af_maybe_else() :: {'maybe', anno(), af_body(), {'else', anno(), af_clause_seq()}}.
+
-type abstract_type() :: af_annotated_type()
| af_atom()
| af_bitstring_type()
@@ -940,6 +946,8 @@ Erlang code.
-type af_match(T) :: {'match', anno(), af_pattern(), T}.
+-type af_maybe_match() :: {'maybe_match', anno(), af_pattern(), abstract_expr()}.
+
-type af_variable() :: {'var', anno(), atom()}. % | af_anon_variable()
%-type af_anon_variable() :: {'var', anno(), '_'}.
@@ -965,7 +973,7 @@ Erlang code.
-type binary_op() :: '/' | '*' | 'div' | 'rem' | 'band' | 'and' | '+' | '-'
| 'bor' | 'bxor' | 'bsl' | 'bsr' | 'or' | 'xor' | '++'
| '--' | '==' | '/=' | '=<' | '<' | '>=' | '>' | '=:='
- | '=/='.
+ | '=/=' | '!'.
-type af_unary_op(T) :: {'op', anno(), unary_op(), T}.