syntax::codemap: Add static DUMMY_SP

It replaces `dummy_sp()`.
This commit is contained in:
klutzy 2014-01-01 15:53:22 +09:00
parent db204b20ab
commit 9cdad685a3
21 changed files with 94 additions and 97 deletions

View file

@ -12,7 +12,7 @@ use abi::AbiSet;
use ast::{P, Ident};
use ast;
use ast_util;
use codemap::{Span, respan, dummy_sp};
use codemap::{Span, respan, DUMMY_SP};
use ext::base::ExtCtxt;
use ext::quote::rt::*;
use fold::ast_fold;
@ -321,7 +321,7 @@ impl AstBuilder for ExtCtxt {
fn ty_option(&self, ty: P<ast::Ty>) -> P<ast::Ty> {
self.ty_path(
self.path_all(dummy_sp(),
self.path_all(DUMMY_SP,
true,
~[
self.ident_of("std"),
@ -348,7 +348,7 @@ impl AstBuilder for ExtCtxt {
P(ast::Ty {
id: ast::DUMMY_NODE_ID,
node: ast::ty_nil,
span: dummy_sp(),
span: DUMMY_SP,
})
}
@ -361,13 +361,13 @@ impl AstBuilder for ExtCtxt {
// incorrect code.
fn ty_vars(&self, ty_params: &OptVec<ast::TyParam>) -> ~[P<ast::Ty>] {
opt_vec::take_vec(
ty_params.map(|p| self.ty_ident(dummy_sp(), p.ident)))
ty_params.map(|p| self.ty_ident(DUMMY_SP, p.ident)))
}
fn ty_vars_global(&self, ty_params: &OptVec<ast::TyParam>) -> ~[P<ast::Ty>] {
opt_vec::take_vec(
ty_params.map(|p| self.ty_path(
self.path_global(dummy_sp(), ~[p.ident]), None)))
self.path_global(DUMMY_SP, ~[p.ident]), None)))
}
fn strip_bounds(&self, generics: &Generics) -> Generics {

View file

@ -1279,12 +1279,12 @@ mod test {
// make a MetaWord outer attribute with the given name
fn make_dummy_attr(s: @str) -> ast::Attribute {
Spanned {
span:codemap::dummy_sp(),
span:codemap::DUMMY_SP,
node: Attribute_ {
style: AttrOuter,
value: @Spanned {
node: MetaWord(s),
span: codemap::dummy_sp(),
span: codemap::DUMMY_SP,
},
is_sugared_doc: false,
}

View file

@ -11,7 +11,7 @@
use ast::{Ident, matcher_, matcher, match_tok, match_nonterminal, match_seq};
use ast::{tt_delim};
use ast;
use codemap::{Span, Spanned, dummy_sp};
use codemap::{Span, Spanned, DUMMY_SP};
use ext::base::{AnyMacro, ExtCtxt, MacResult, MRAny, MRDef, MacroDef};
use ext::base::{NormalTT, SyntaxExpanderTTTrait};
use ext::base;
@ -109,7 +109,7 @@ fn generic_extension(cx: &ExtCtxt,
}
// Which arm's failure should we report? (the one furthest along)
let mut best_fail_spot = dummy_sp();
let mut best_fail_spot = DUMMY_SP;
let mut best_fail_msg = ~"internal error: ran no matchers";
let s_d = cx.parse_sess().span_diagnostic;
@ -178,7 +178,7 @@ pub fn add_new_extension(cx: &mut ExtCtxt,
fn ms(m: matcher_) -> matcher {
Spanned {
node: m.clone(),
span: dummy_sp()
span: DUMMY_SP
}
}

View file

@ -10,7 +10,7 @@
use ast;
use ast::{token_tree, tt_delim, tt_tok, tt_seq, tt_nonterminal,Ident};
use codemap::{Span, dummy_sp};
use codemap::{Span, DUMMY_SP};
use diagnostic::SpanHandler;
use ext::tt::macro_parser::{named_match, matched_seq, matched_nonterminal};
use parse::token::{EOF, INTERPOLATED, IDENT, Token, nt_ident};
@ -66,7 +66,7 @@ pub fn new_tt_reader(sp_diag: @mut SpanHandler,
repeat_len: ~[],
/* dummy values, never read: */
cur_tok: EOF,
cur_span: dummy_sp()
cur_span: DUMMY_SP
};
tt_next_token(r); /* get cur_tok and cur_span set up */
return r;