aboutsummaryrefslogtreecommitdiff
path: root/src/boot/fe/ast.ml
diff options
context:
space:
mode:
authorRoy Frostig <[email protected]>2010-06-25 00:47:23 -0700
committerRoy Frostig <[email protected]>2010-06-25 00:47:23 -0700
commit241305caab232b04666704dc6853c41312cd283a (patch)
tree9a8cd9ef0573d15477927afb02620c723745ddcf /src/boot/fe/ast.ml
parentRearrange pexp-custom stuff a bit. (diff)
downloadrust-241305caab232b04666704dc6853c41312cd283a.tar.xz
rust-241305caab232b04666704dc6853c41312cd283a.zip
Resolve and typecheck patterns in pattern alt redux. This time featuring way more correctness.
Diffstat (limited to 'src/boot/fe/ast.ml')
-rw-r--r--src/boot/fe/ast.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/boot/fe/ast.ml b/src/boot/fe/ast.ml
index 09037510..770b57bf 100644
--- a/src/boot/fe/ast.ml
+++ b/src/boot/fe/ast.ml
@@ -299,9 +299,14 @@ and domain =
DOMAIN_local
| DOMAIN_thread
+(*
+ * PAT_tag uses lval for the tag constructor so that we can reuse our lval
+ * resolving machinery. The lval is restricted during parsing to have only
+ * named components.
+ *)
and pat =
PAT_lit of lit
- | PAT_tag of ((name identified) * (pat array))
+ | PAT_tag of (lval * (pat array))
| PAT_slot of ((slot identified) * ident)
| PAT_wild
@@ -331,6 +336,7 @@ and lval_component =
| COMP_atom of atom
+(* identifying the name_base here is sufficient to identify the full lval *)
and lval =
LVAL_base of name_base identified
| LVAL_ext of (lval * lval_component)