Add the interner to parse_sess.
This commit is contained in:
parent
85ded92736
commit
1e36d216be
9 changed files with 47 additions and 104 deletions
|
|
@ -508,8 +508,7 @@ fn build_session(sopts: @session::options,
|
|||
}
|
||||
|
||||
fn build_session_(
|
||||
sopts: @session::options,
|
||||
codemap: codemap::codemap,
|
||||
sopts: @session::options, cm: codemap::codemap,
|
||||
demitter: diagnostic::emitter,
|
||||
span_diagnostic_handler: diagnostic::span_handler
|
||||
) -> session {
|
||||
|
|
@ -523,14 +522,9 @@ fn build_session_(
|
|||
@{targ_cfg: target_cfg,
|
||||
opts: sopts,
|
||||
cstore: cstore,
|
||||
parse_sess: @{
|
||||
cm: codemap,
|
||||
mut next_id: 1,
|
||||
span_diagnostic: span_diagnostic_handler,
|
||||
mut chpos: 0u,
|
||||
mut byte_pos: 0u
|
||||
},
|
||||
codemap: codemap,
|
||||
parse_sess:
|
||||
parse::new_parse_sess_special_handler(span_diagnostic_handler, cm),
|
||||
codemap: cm,
|
||||
// For a library crate, this is always none
|
||||
mut main_fn: none,
|
||||
span_diagnostic: span_diagnostic_handler,
|
||||
|
|
|
|||
|
|
@ -1018,20 +1018,6 @@ fn decode_item_ast(par_doc: ebml::doc) -> @ast::item {
|
|||
@ast::deserialize_item(d)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
fn new_parse_sess() -> parse::parse_sess {
|
||||
let cm = codemap::new_codemap();
|
||||
let handler = diagnostic::mk_handler(option::none);
|
||||
let sess = @{
|
||||
cm: cm,
|
||||
mut next_id: 1,
|
||||
span_diagnostic: diagnostic::mk_span_handler(handler, cm),
|
||||
mut chpos: 0u,
|
||||
mut byte_pos: 0u
|
||||
};
|
||||
ret sess;
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
iface fake_ext_ctxt {
|
||||
fn cfg() -> ast::crate_cfg;
|
||||
|
|
@ -1044,7 +1030,7 @@ type fake_session = ();
|
|||
#[cfg(test)]
|
||||
impl of fake_ext_ctxt for fake_session {
|
||||
fn cfg() -> ast::crate_cfg { [] }
|
||||
fn parse_sess() -> parse::parse_sess { new_parse_sess() }
|
||||
fn parse_sess() -> parse::parse_sess { parse::new_parse_sess(none) }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue