diff options
| author | Graydon Hoare <[email protected]> | 2010-08-16 13:02:46 -0700 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2010-08-16 13:02:46 -0700 |
| commit | 7e62aa68018c94bcfc3fd6beab90cf7b87f91cbf (patch) | |
| tree | ad8091a45871afa2685ec65f6c841fb0c942becf /src/boot/fe/item.ml | |
| parent | Evil solution to the problem of importing the same opaque from two different ... (diff) | |
| download | rust-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.ml | 14 |
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 |