From 7e62aa68018c94bcfc3fd6beab90cf7b87f91cbf Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Mon, 16 Aug 2010 13:02:46 -0700 Subject: 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. --- src/boot/fe/item.ml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/boot/fe/item.ml') 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 -- cgit v1.2.3