Modernized a few type names in rustc and syntax
This commit is contained in:
parent
617850131b
commit
539f37925c
115 changed files with 1316 additions and 1311 deletions
|
@ -10,7 +10,7 @@
|
|||
|
||||
use ast;
|
||||
use codemap;
|
||||
use codemap::{Pos, span};
|
||||
use codemap::{Pos, Span};
|
||||
use codemap::{ExpnInfo, NameAndSpan};
|
||||
use ext::base::*;
|
||||
use ext::base;
|
||||
|
@ -27,7 +27,7 @@ use std::result;
|
|||
// a given file into the current one.
|
||||
|
||||
/* line!(): expands to the current line number */
|
||||
pub fn expand_line(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
||||
pub fn expand_line(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
|
||||
-> base::MacResult {
|
||||
base::check_zero_tts(cx, sp, tts, "line!");
|
||||
|
||||
|
@ -38,7 +38,7 @@ pub fn expand_line(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
|||
}
|
||||
|
||||
/* col!(): expands to the current column number */
|
||||
pub fn expand_col(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
||||
pub fn expand_col(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
|
||||
-> base::MacResult {
|
||||
base::check_zero_tts(cx, sp, tts, "col!");
|
||||
|
||||
|
@ -50,7 +50,7 @@ pub fn expand_col(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
|||
/* file!(): expands to the current filename */
|
||||
/* The filemap (`loc.file`) contains a bunch more information we could spit
|
||||
* out if we wanted. */
|
||||
pub fn expand_file(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
||||
pub fn expand_file(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
|
||||
-> base::MacResult {
|
||||
base::check_zero_tts(cx, sp, tts, "file!");
|
||||
|
||||
|
@ -60,13 +60,13 @@ pub fn expand_file(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
|||
base::MRExpr(cx.expr_str(topmost.call_site, filename))
|
||||
}
|
||||
|
||||
pub fn expand_stringify(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
||||
pub fn expand_stringify(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
|
||||
-> base::MacResult {
|
||||
let s = pprust::tts_to_str(tts, get_ident_interner());
|
||||
base::MRExpr(cx.expr_str(sp, s.to_managed()))
|
||||
}
|
||||
|
||||
pub fn expand_mod(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
||||
pub fn expand_mod(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
|
||||
-> base::MacResult {
|
||||
base::check_zero_tts(cx, sp, tts, "module_path!");
|
||||
base::MRExpr(cx.expr_str(sp,
|
||||
|
@ -76,7 +76,7 @@ pub fn expand_mod(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
|||
// include! : parse the given file as an expr
|
||||
// This is generally a bad idea because it's going to behave
|
||||
// unhygienically.
|
||||
pub fn expand_include(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
||||
pub fn expand_include(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
|
||||
-> base::MacResult {
|
||||
let file = get_single_str_from_tts(cx, sp, tts, "include!");
|
||||
let p = parse::new_sub_parser_from_file(
|
||||
|
@ -86,7 +86,7 @@ pub fn expand_include(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
|||
}
|
||||
|
||||
// include_str! : read the given file, insert it as a literal string expr
|
||||
pub fn expand_include_str(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
||||
pub fn expand_include_str(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
|
||||
-> base::MacResult {
|
||||
let file = get_single_str_from_tts(cx, sp, tts, "include_str!");
|
||||
let res = io::read_whole_file_str(&res_rel_file(cx, sp, &Path(file)));
|
||||
|
@ -100,7 +100,7 @@ pub fn expand_include_str(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
|||
}
|
||||
}
|
||||
|
||||
pub fn expand_include_bin(cx: @ExtCtxt, sp: span, tts: &[ast::token_tree])
|
||||
pub fn expand_include_bin(cx: @ExtCtxt, sp: Span, tts: &[ast::token_tree])
|
||||
-> base::MacResult {
|
||||
let file = get_single_str_from_tts(cx, sp, tts, "include_bin!");
|
||||
match io::read_whole_file(&res_rel_file(cx, sp, &Path(file))) {
|
||||
|
@ -142,7 +142,7 @@ fn topmost_expn_info(expn_info: @codemap::ExpnInfo) -> @codemap::ExpnInfo {
|
|||
|
||||
// resolve a file-system path to an absolute file-system path (if it
|
||||
// isn't already)
|
||||
fn res_rel_file(cx: @ExtCtxt, sp: codemap::span, arg: &Path) -> Path {
|
||||
fn res_rel_file(cx: @ExtCtxt, sp: codemap::Span, arg: &Path) -> Path {
|
||||
// NB: relative paths are resolved relative to the compilation unit
|
||||
if !arg.is_absolute {
|
||||
let cu = Path(cx.codemap().span_to_filename(sp));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue