diff options
| author | klutzy <klutzytheklutzy@gmail.com> | 2014-01-01 15:53:22 +0900 |
|---|---|---|
| committer | klutzy <klutzytheklutzy@gmail.com> | 2014-01-01 19:51:35 +0900 |
| commit | 9cdad685a39fd826174a6cbcd283ad2dee41e175 (patch) | |
| tree | 5993d9e64b91a1d66672634cbc4b24962e54980d /src/libsyntax/ext | |
| parent | db204b20ab5ed7f27027a95c76c6d6e74eb443d6 (diff) | |
| download | rust-9cdad685a39fd826174a6cbcd283ad2dee41e175.tar.gz rust-9cdad685a39fd826174a6cbcd283ad2dee41e175.zip | |
syntax::codemap: Add static DUMMY_SP
It replaces `dummy_sp()`.
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/build.rs | 10 | ||||
| -rw-r--r-- | src/libsyntax/ext/expand.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/macro_rules.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax/ext/tt/transcribe.rs | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/src/libsyntax/ext/build.rs b/src/libsyntax/ext/build.rs index e5f20950412..1a3513ab81c 100644 --- a/src/libsyntax/ext/build.rs +++ b/src/libsyntax/ext/build.rs @@ -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 { diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs index eb07353cda3..be336128275 100644 --- a/src/libsyntax/ext/expand.rs +++ b/src/libsyntax/ext/expand.rs @@ -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, } diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index ae9bbdadf2c..05d402a2ba2 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -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 } } diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index fc7d3d2b40c..cbce5fb16cb 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -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; |
