diff options
| author | John Clements <clements@racket-lang.org> | 2013-05-16 17:42:08 -0700 |
|---|---|---|
| committer | John Clements <clements@racket-lang.org> | 2013-05-20 11:49:21 -0700 |
| commit | fc4f304ef9916d691166592b3e49998594535c57 (patch) | |
| tree | 0ffb6923b5bc5f54e44c8ee254d40bd20759c806 /src/libsyntax/parse | |
| parent | b621820dc4727677f14bee0ac5e2fa5e424ed22e (diff) | |
| download | rust-fc4f304ef9916d691166592b3e49998594535c57.tar.gz rust-fc4f304ef9916d691166592b3e49998594535c57.zip | |
hygiene infrastructure.
- added a hash table to memoize rename and mark operations. - added rename, mark, and resolve fold fns
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 7aff9f6745c..0a9e16f8f7c 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -346,21 +346,16 @@ mod test { use std::serialize::Encodable; use std; use core::io; - use core::option::Option; use core::option::Some; use core::option::None; - use core::int; - use core::num::NumCast; - use codemap::{CodeMap, span, BytePos, spanned}; + use codemap::{span, BytePos, spanned}; use opt_vec; use ast; use abi; - use ast_util::mk_ident; + use ast_util::new_ident; use parse::parser::Parser; - use parse::token::{ident_interner, mk_ident_interner, mk_fresh_ident_interner}; - use diagnostic::{span_handler, mk_span_handler, mk_handler, Emitter}; use util::parser_testing::{string_to_tts_and_sess,string_to_parser}; - use util::parser_testing::{string_to_crate, string_to_expr, string_to_item}; + use util::parser_testing::{string_to_expr, string_to_item}; use util::parser_testing::{string_to_stmt}; // map a string to tts, return the tt without its parsesess @@ -384,7 +379,7 @@ mod test { // convert a vector of uints to a vector of ast::idents fn ints_to_idents(ids: ~[uint]) -> ~[ast::ident] { - ids.map(|u| mk_ident(*u)) + ids.map(|u| new_ident(*u)) } #[test] fn path_exprs_1 () { @@ -393,7 +388,7 @@ mod test { callee_id:2, node:ast::expr_path(@ast::Path {span:sp(0,1), global:false, - idents:~[mk_ident(100)], + idents:~[new_ident(100)], rp:None, types:~[]}), span:sp(0,1)}) @@ -456,7 +451,7 @@ mod test { node:ast::expr_path( @ast::Path{span:sp(7,8), global:false, - idents:~[mk_ident(103)], + idents:~[new_ident(103)], rp:None, types:~[] }), @@ -474,7 +469,7 @@ mod test { @ast::Path{ span:sp(0,1), global:false, - idents:~[mk_ident(101)], + idents:~[new_ident(101)], rp:None, types: ~[]}), span: sp(0,1)}, @@ -495,7 +490,7 @@ mod test { @ast::Path{ span:sp(0,1), global:false, - idents:~[mk_ident(101)], + idents:~[new_ident(101)], rp: None, types: ~[]}, None // no idea @@ -514,7 +509,7 @@ mod test { span:sp(4,4), // this is bizarre... // check this in the original parser? global:false, - idents:~[mk_ident(105)], + idents:~[new_ident(105)], rp: None, types: ~[]}, 2), @@ -524,7 +519,7 @@ mod test { @ast::Path{ span:sp(0,1), global:false, - idents:~[mk_ident(101)], + idents:~[new_ident(101)], rp: None, types: ~[]}, None // no idea @@ -540,7 +535,7 @@ mod test { // assignment order of the node_ids. assert_eq!(string_to_item(@~"fn a (b : int) { b; }"), Some( - @ast::item{ident:mk_ident(100), + @ast::item{ident:new_ident(100), attrs:~[], id: 10, // fixme node: ast::item_fn(ast::fn_decl{ @@ -550,7 +545,7 @@ mod test { node: ast::ty_path(@ast::Path{ span:sp(10,13), global:false, - idents:~[mk_ident(106)], + idents:~[new_ident(106)], rp: None, types: ~[]}, 2), @@ -561,7 +556,7 @@ mod test { @ast::Path{ span:sp(6,7), global:false, - idents:~[mk_ident(101)], + idents:~[new_ident(101)], rp: None, types: ~[]}, None // no idea @@ -592,7 +587,7 @@ mod test { @ast::Path{ span:sp(17,18), global:false, - idents:~[mk_ident(101)], + idents:~[new_ident(101)], rp:None, types: ~[]}), span: sp(17,18)}, |
