Skip to content

Commit 013b94c

Browse files
committed
---
yaml --- r: 63006 b: refs/heads/snap-stage3 c: 22d21ab h: refs/heads/master v: v3
1 parent a0a8ffc commit 013b94c

File tree

9 files changed

+110
-110
lines changed

9 files changed

+110
-110
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7266981b4cd9a593bf64ba3e91f724f998e18786
4+
refs/heads/snap-stage3: 22d21ab4c28f1023d55ced53746daf7a69b7559d
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ pub fn mangle_internal_name_by_path(ccx: @CrateContext, path: path) -> ~str {
734734
}
735735

736736
pub fn mangle_internal_name_by_seq(ccx: @CrateContext, flav: &str) -> ~str {
737-
return fmt!("%s_%u", flav, (ccx.names)(flav).repr);
737+
return fmt!("%s_%u", flav, (ccx.names)(flav).name);
738738
}
739739

740740

branches/snap-stage3/src/librustc/middle/trans/common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub fn new_namegen(intr: @ident_interner) -> namegen {
6161
let f: @fn(s: &str) -> ident = |prefix| {
6262
intr.gensym(fmt!("%s_%u",
6363
prefix,
64-
intr.gensym(prefix).repr))
64+
intr.gensym(prefix).name))
6565
};
6666
f
6767
}
@@ -1195,7 +1195,7 @@ pub fn C_cstr(cx: @CrateContext, s: @~str) -> ValueRef {
11951195
llvm::LLVMConstString(buf, s.len() as c_uint, False)
11961196
};
11971197
let g =
1198-
str::as_c_str(fmt!("str%u", (cx.names)("str").repr),
1198+
str::as_c_str(fmt!("str%u", (cx.names)("str").name),
11991199
|buf| llvm::LLVMAddGlobal(cx.llmod, val_ty(sc), buf));
12001200
llvm::LLVMSetInitializer(g, sc);
12011201
llvm::LLVMSetGlobalConstant(g, True);
@@ -1287,7 +1287,7 @@ pub fn C_bytes_plus_null(bytes: &[u8]) -> ValueRef {
12871287
pub fn C_shape(ccx: @CrateContext, bytes: ~[u8]) -> ValueRef {
12881288
unsafe {
12891289
let llshape = C_bytes_plus_null(bytes);
1290-
let name = fmt!("shape%u", (ccx.names)("shape").repr);
1290+
let name = fmt!("shape%u", (ccx.names)("shape").name);
12911291
let llglobal = str::as_c_str(name, |buf| {
12921292
llvm::LLVMAddGlobal(ccx.llmod, val_ty(llshape), buf)
12931293
});

branches/snap-stage3/src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2678,7 +2678,7 @@ impl cmp::TotalOrd for bound_region {
26782678
(&ty::br_anon(ref a1), &ty::br_anon(ref a2)) => a1.cmp(a2),
26792679
(&ty::br_anon(*), _) => cmp::Less,
26802680

2681-
(&ty::br_named(ref a1), &ty::br_named(ref a2)) => a1.repr.cmp(&a2.repr),
2681+
(&ty::br_named(ref a1), &ty::br_named(ref a2)) => a1.name.cmp(&a2.name),
26822682
(&ty::br_named(*), _) => cmp::Less,
26832683

26842684
(&ty::br_cap_avoid(ref a1, @ref b1),

branches/snap-stage3/src/libsyntax/ast.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ use core::to_str::ToStr;
2525
use extra::serialize::{Encodable, Decodable, Encoder, Decoder};
2626

2727

28-
// an identifier contains an index into the interner
29-
// table and a SyntaxContext to track renaming and
28+
// an identifier contains a Name (index into the interner
29+
// table) and a SyntaxContext to track renaming and
3030
// macro expansion per Flatt et al., "Macros
3131
// That Work Together"
3232
#[deriving(Eq)]
33-
pub struct ident { repr: Name, ctxt: SyntaxContext }
33+
pub struct ident { name: Name, ctxt: SyntaxContext }
3434

3535
// a SyntaxContext represents a chain of macro-expandings
3636
// and renamings. Each macro expansion corresponds to
@@ -96,7 +96,7 @@ impl<D:Decoder> Decodable<D> for ident {
9696
impl to_bytes::IterBytes for ident {
9797
#[inline(always)]
9898
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) -> bool {
99-
self.repr.iter_bytes(lsb0, f)
99+
self.name.iter_bytes(lsb0, f)
100100
}
101101
}
102102

branches/snap-stage3/src/libsyntax/ast_util.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,8 @@ pub enum Privacy {
620620

621621
// HYGIENE FUNCTIONS
622622

623-
/// Construct an identifier with the given repr and an empty context:
624-
pub fn new_ident(repr: uint) -> ident { ident {repr: repr, ctxt: 0}}
623+
/// Construct an identifier with the given name and an empty context:
624+
pub fn new_ident(name: Name) -> ident { ident {name: name, ctxt: 0}}
625625

626626
/// Extend a syntax context with a given mark
627627
pub fn new_mark (m:Mrk, tail:SyntaxContext,table:&mut SCTable)
@@ -686,14 +686,14 @@ fn idx_push<T>(vec: &mut ~[T], val: T) -> uint {
686686
/// Resolve a syntax object to a name, per MTWT.
687687
pub fn resolve (id : ident, table : &mut SCTable) -> Name {
688688
match table.table[id.ctxt] {
689-
EmptyCtxt => id.repr,
689+
EmptyCtxt => id.name,
690690
// ignore marks here:
691-
Mark(_,subctxt) => resolve (ident{repr:id.repr, ctxt: subctxt},table),
691+
Mark(_,subctxt) => resolve (ident{name:id.name, ctxt: subctxt},table),
692692
// do the rename if necessary:
693-
Rename(ident{repr,ctxt},toname,subctxt) => {
693+
Rename(ident{name,ctxt},toname,subctxt) => {
694694
// this could be cached or computed eagerly:
695-
let resolvedfrom = resolve(ident{repr:repr,ctxt:ctxt},table);
696-
let resolvedthis = resolve(ident{repr:id.repr,ctxt:subctxt},table);
695+
let resolvedfrom = resolve(ident{name:name,ctxt:ctxt},table);
696+
let resolvedthis = resolve(ident{name:id.name,ctxt:subctxt},table);
697697
if ((resolvedthis == resolvedfrom)
698698
&& (marksof (ctxt,resolvedthis,table)
699699
== marksof (subctxt,resolvedthis,table))) {
@@ -777,11 +777,11 @@ mod test {
777777
// convert a list of uints to an @~[ident]
778778
// (ignores the interner completely)
779779
fn uints_to_idents (uints: &~[uint]) -> @~[ident] {
780-
@uints.map(|u|{ ident {repr:*u, ctxt: empty_ctxt} })
780+
@uints.map(|u|{ ident {name:*u, ctxt: empty_ctxt} })
781781
}
782782
783783
fn id (u : uint, s: SyntaxContext) -> ident {
784-
ident{repr:u, ctxt: s}
784+
ident{name:u, ctxt: s}
785785
}
786786
787787
// because of the SCTable, I now need a tidy way of

branches/snap-stage3/src/libsyntax/ext/expand.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn expand_expr(extsbox: @mut SyntaxEnv,
5252
let extname = pth.idents[0];
5353
let extnamestr = get_ident_interner().get(extname);
5454
// leaving explicit deref here to highlight unbox op:
55-
match (*extsbox).find(&extname.repr) {
55+
match (*extsbox).find(&extname.name) {
5656
None => {
5757
cx.span_fatal(
5858
pth.span,
@@ -219,7 +219,7 @@ pub fn expand_item_mac(extsbox: @mut SyntaxEnv,
219219
let extname = pth.idents[0];
220220
let interner = get_ident_interner();
221221
let extnamestr = interner.get(extname);
222-
let expanded = match (*extsbox).find(&extname.repr) {
222+
let expanded = match (*extsbox).find(&extname.name) {
223223
None => cx.span_fatal(pth.span,
224224
fmt!("macro undefined: '%s!'", *extnamestr)),
225225

@@ -317,7 +317,7 @@ pub fn expand_stmt(extsbox: @mut SyntaxEnv,
317317
}
318318
let extname = pth.idents[0];
319319
let extnamestr = get_ident_interner().get(extname);
320-
let (fully_expanded, sp) = match (*extsbox).find(&extname.repr) {
320+
let (fully_expanded, sp) = match (*extsbox).find(&extname.name) {
321321
None =>
322322
cx.span_fatal(pth.span, fmt!("macro undefined: '%s'", *extnamestr)),
323323

@@ -391,7 +391,7 @@ fn renames_to_fold(renames : @mut ~[(ast::ident,ast::Name)]) -> @ast_fold {
391391
let new_ctxt = renames.foldl(id.ctxt,|ctxt,&(from,to)| {
392392
new_rename(from,to,*ctxt,table)
393393
});
394-
ast::ident{repr:id.repr,ctxt:new_ctxt}
394+
ast::ident{name:id.name,ctxt:new_ctxt}
395395
},
396396
.. *afp
397397
};
@@ -697,7 +697,7 @@ pub fn new_ident_renamer(from: ast::ident,
697697
@fn(ast::ident)->ast::ident {
698698
|id : ast::ident|
699699
ast::ident{
700-
repr: id.repr,
700+
name: id.name,
701701
ctxt: new_rename(from,to,id.ctxt,table)
702702
}
703703
}
@@ -709,7 +709,7 @@ pub fn new_ident_marker(mark: uint,
709709
@fn(ast::ident)->ast::ident {
710710
|id : ast::ident|
711711
ast::ident{
712-
repr: id.repr,
712+
name: id.name,
713713
ctxt: new_mark(mark,id.ctxt,table)
714714
}
715715
}
@@ -720,7 +720,7 @@ pub fn new_ident_resolver(table: @mut SCTable) ->
720720
@fn(ast::ident)->ast::ident {
721721
|id : ast::ident|
722722
ast::ident {
723-
repr : resolve(id,table),
723+
name : resolve(id,table),
724724
ctxt : illegal_ctxt
725725
}
726726
}
@@ -848,8 +848,8 @@ mod test {
848848
};
849849
let table = @mut new_sctable();
850850
let a_name = 100; // enforced by testing_interner
851-
let a2_name = sess.interner.gensym("a2").repr;
852-
let renamer = new_ident_renamer(ast::ident{repr:a_name,ctxt:empty_ctxt},
851+
let a2_name = sess.interner.gensym("a2").name;
852+
let renamer = new_ident_renamer(ast::ident{name:a_name,ctxt:empty_ctxt},
853853
a2_name,table);
854854
let renamed_ast = fun_to_ident_folder(renamer).fold_item(item_ast).get();
855855
let resolver = new_ident_resolver(table);

branches/snap-stage3/src/libsyntax/parse/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl Parser {
142142
// true. Otherwise, return false.
143143
pub fn eat_keyword(&self, kw: keywords::Keyword) -> bool {
144144
let is_kw = match *self.token {
145-
token::IDENT(sid, false) => kw.to_ident().repr == sid.repr,
145+
token::IDENT(sid, false) => kw.to_ident().name == sid.name,
146146
_ => false
147147
};
148148
if is_kw { self.bump() }

0 commit comments

Comments
 (0)