aboutsummaryrefslogtreecommitdiff
path: root/src/boot/fe/item.ml
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-08-16 13:02:46 -0700
committerGraydon Hoare <[email protected]>2010-08-16 13:02:46 -0700
commit7e62aa68018c94bcfc3fd6beab90cf7b87f91cbf (patch)
treead8091a45871afa2685ec65f6c841fb0c942becf /src/boot/fe/item.ml
parentEvil solution to the problem of importing the same opaque from two different ... (diff)
downloadrust-7e62aa68018c94bcfc3fd6beab90cf7b87f91cbf.tar.xz
rust-7e62aa68018c94bcfc3fd6beab90cf7b87f91cbf.zip
Absent any deep overhauls to syntax or constant-handling, hack in the ability to project a cexp var binding to a token in the parser. Use it in comp/rustc.rc and comp/lib/llvm.rs.
Diffstat (limited to 'src/boot/fe/item.ml')
-rw-r--r--src/boot/fe/item.ml14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/boot/fe/item.ml b/src/boot/fe/item.ml
index b5a8bb7a..91a0c3dd 100644
--- a/src/boot/fe/item.ml
+++ b/src/boot/fe/item.ml
@@ -786,9 +786,17 @@ and parse_mod_item (ps:pstate) : (Ast.ident * Ast.mod_item) =
EQ ->
begin
bump ps;
- match peek ps with
- LIT_STR s -> (bump ps; s)
- | _ -> raise (unexpected ps)
+ let do_tok t =
+ bump ps;
+ match t with
+ LIT_STR s -> s
+ | _ -> raise (unexpected ps)
+ in
+ match peek ps with
+ IDENT i ->
+ do_tok (ps.pstate_get_cenv_tok ps i)
+ | t ->
+ do_tok t
end
| _ -> ps.pstate_infer_lib_name ident
in