@@ -19,8 +19,6 @@ use parse::token;
1919
2020use  std:: fmt; 
2121use  std:: fmt:: Show ; 
22- use  std:: cell:: RefCell ; 
23- use  collections:: HashMap ; 
2422use  std:: option:: Option ; 
2523use  std:: rc:: Rc ; 
2624use  std:: vec_ng:: Vec ; 
@@ -42,7 +40,10 @@ pub fn P<T: 'static>(value: T) -> P<T> {
4240// macro expansion per Flatt et al., "Macros 
4341// That Work Together" 
4442#[ deriving( Clone ,  Hash ,  TotalEq ,  TotalOrd ,  Show ) ]  
45- pub  struct  Ident  {  name :  Name ,  ctxt :  SyntaxContext  } 
43+ pub  struct  Ident  { 
44+     name :  Name , 
45+     ctxt :  SyntaxContext 
46+ } 
4647
4748impl  Ident  { 
4849    /// Construct an identifier with the given name and an empty context: 
@@ -88,43 +89,9 @@ impl Eq for Ident {
8889// this uint is a reference to a table stored in thread-local 
8990// storage. 
9091pub  type  SyntaxContext  = u32 ; 
91- 
92- // the SCTable contains a table of SyntaxContext_'s. It 
93- // represents a flattened tree structure, to avoid having 
94- // managed pointers everywhere (that caused an ICE). 
95- // the mark_memo and rename_memo fields are side-tables 
96- // that ensure that adding the same mark to the same context 
97- // gives you back the same context as before. This shouldn't 
98- // change the semantics--everything here is immutable--but 
99- // it should cut down on memory use *a lot*; applying a mark 
100- // to a tree containing 50 identifiers would otherwise generate 
101- pub  struct  SCTable  { 
102-     table :  RefCell < Vec < SyntaxContext_ >  > , 
103-     mark_memo :  RefCell < HashMap < ( SyntaxContext , Mrk ) , SyntaxContext > > , 
104-     rename_memo :  RefCell < HashMap < ( SyntaxContext , Ident , Name ) , SyntaxContext > > , 
105- } 
106- 
107- // NB: these must be placed in any SCTable... 
10892pub  static  EMPTY_CTXT  :  SyntaxContext  = 0 ; 
10993pub  static  ILLEGAL_CTXT  :  SyntaxContext  = 1 ; 
11094
111- #[ deriving( Eq ,  Encodable ,  Decodable ,  Hash ) ]  
112- pub  enum  SyntaxContext_  { 
113-     EmptyCtxt , 
114-     Mark  ( Mrk , SyntaxContext ) , 
115-     // flattening the name and syntaxcontext into the rename... 
116-     // HIDDEN INVARIANTS: 
117-     // 1) the first name in a Rename node 
118-     // can only be a programmer-supplied name. 
119-     // 2) Every Rename node with a given Name in the 
120-     // "to" slot must have the same name and context 
121-     // in the "from" slot. In essence, they're all 
122-     // pointers to a single "rename" event node. 
123-     Rename  ( Ident , Name , SyntaxContext ) , 
124-     // actually, IllegalCtxt may not be necessary. 
125-     IllegalCtxt 
126- } 
127- 
12895/// A name is a part of an identifier, representing a string or gensym. It's 
12996/// the result of interning. 
13097pub  type  Name  = u32 ; 
0 commit comments