aboutsummaryrefslogtreecommitdiff
path: root/src/boot/fe
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-09-20 20:19:22 -0700
committerGraydon Hoare <[email protected]>2010-09-20 20:19:22 -0700
commitc17964c06d24300e5f9073f0b7ab4ffaffd78a89 (patch)
tree7996174fc01f36e5434dd57c68b323c7806025bf /src/boot/fe
parentAdd issue #163 testcase to str-append testcase. (diff)
downloadrust-c17964c06d24300e5f9073f0b7ab4ffaffd78a89.tar.xz
rust-c17964c06d24300e5f9073f0b7ab4ffaffd78a89.zip
Use name_base in plval base.
Diffstat (limited to 'src/boot/fe')
-rw-r--r--src/boot/fe/ast.ml11
-rw-r--r--src/boot/fe/cexp.ml2
-rw-r--r--src/boot/fe/pexp.ml13
3 files changed, 8 insertions, 18 deletions
diff --git a/src/boot/fe/ast.ml b/src/boot/fe/ast.ml
index efb64e50..54c48f7d 100644
--- a/src/boot/fe/ast.ml
+++ b/src/boot/fe/ast.ml
@@ -348,8 +348,7 @@ and pexp' =
| PEXP_custom of name * (pexp array) * (string option)
and plval =
- PLVAL_ident of ident
- | PLVAL_app of (ident * (ty array))
+ PLVAL_base of name_base
| PLVAL_ext_name of (pexp * name_component)
| PLVAL_ext_pexp of (pexp * pexp)
| PLVAL_ext_deref of pexp
@@ -555,8 +554,7 @@ let sane_name (n:name) : bool =
let rec plval_is_atomic (plval:plval) : bool =
match plval with
- PLVAL_ident _
- | PLVAL_app _ -> true
+ PLVAL_base _ -> true
| PLVAL_ext_name (p, _) ->
pexp_is_atomic p
@@ -1039,10 +1037,7 @@ and fmt_pexp (ff:Format.formatter) (pexp:pexp) : unit =
and fmt_plval (ff:Format.formatter) (plval:plval) : unit =
match plval with
- PLVAL_ident id -> fmt_ident ff id
- | PLVAL_app (id, tys) ->
- fmt_ident ff id;
- fmt_bracketed_arr_sep "[" "]" "," fmt_ty ff tys
+ PLVAL_base nb -> fmt_name_base ff nb
| PLVAL_ext_name (pexp, nc) ->
fmt_pexp ff pexp;
diff --git a/src/boot/fe/cexp.ml b/src/boot/fe/cexp.ml
index ac05105e..5ec17418 100644
--- a/src/boot/fe/cexp.ml
+++ b/src/boot/fe/cexp.ml
@@ -520,7 +520,7 @@ and eval_pexp (env:env) (exp:Ast.pexp) : pval =
| _ -> bug () "Unexpected unop in Cexp.eval_pexp"
end
- | Ast.PEXP_lval (Ast.PLVAL_ident ident) ->
+ | Ast.PEXP_lval (Ast.PLVAL_base (Ast.BASE_ident ident)) ->
begin
match ltab_search !(env.env_bindings) ident with
None -> raise (err (Printf.sprintf "no binding for '%s' found"
diff --git a/src/boot/fe/pexp.ml b/src/boot/fe/pexp.ml
index 58a64474..ec4053c6 100644
--- a/src/boot/fe/pexp.ml
+++ b/src/boot/fe/pexp.ml
@@ -559,13 +559,13 @@ and parse_bottom_pexp (ps:pstate) : Ast.pexp =
(Some COMMA) parse_ty) ps
in
let bpos = lexpos ps in
- span ps apos bpos (Ast.PEXP_lval (Ast.PLVAL_app (i, tys)))
+ span ps apos bpos (Ast.PEXP_lval (Ast.PLVAL_base (Ast.BASE_app (i, tys))))
end
| _ ->
begin
let bpos = lexpos ps in
- span ps apos bpos (Ast.PEXP_lval (Ast.PLVAL_ident i))
+ span ps apos bpos (Ast.PEXP_lval (Ast.PLVAL_base (Ast.BASE_ident i)))
end
end
@@ -960,13 +960,8 @@ let rec desugar_lval (ps:pstate) (pexp:Ast.pexp)
let (apos, bpos) = (s.lo, s.hi) in
match pexp.node with
- Ast.PEXP_lval (Ast.PLVAL_ident ident) ->
- let nb = span ps apos bpos (Ast.BASE_ident ident) in
- ([||], Ast.LVAL_base nb)
-
- | Ast.PEXP_lval (Ast.PLVAL_app (ident, tys)) ->
- let nb = span ps apos bpos (Ast.BASE_app (ident, tys)) in
- ([||], Ast.LVAL_base nb)
+ Ast.PEXP_lval (Ast.PLVAL_base nb) ->
+ ([||], Ast.LVAL_base (span ps apos bpos nb))
| Ast.PEXP_lval (Ast.PLVAL_ext_name (base_pexp, comp)) ->
let (base_stmts, base_atom) = desugar_expr_atom ps base_pexp in