comments only

This commit is contained in:
John Clements
2014-06-27 16:11:18 -07:00
parent e3361bcbc2
commit 04ced031ad
2 changed files with 3 additions and 1 deletions

View File

@@ -30,6 +30,7 @@ use std::collections::HashMap;
// change the semantics--everything here is immutable--but // change the semantics--everything here is immutable--but
// it should cut down on memory use *a lot*; applying a mark // it should cut down on memory use *a lot*; applying a mark
// to a tree containing 50 identifiers would otherwise generate // to a tree containing 50 identifiers would otherwise generate
// 50 new contexts
pub struct SCTable { pub struct SCTable {
table: RefCell<Vec<SyntaxContext_>>, table: RefCell<Vec<SyntaxContext_>>,
mark_memo: RefCell<HashMap<(SyntaxContext,Mrk),SyntaxContext>>, mark_memo: RefCell<HashMap<(SyntaxContext,Mrk),SyntaxContext>>,
@@ -160,7 +161,7 @@ fn with_resolve_table_mut<T>(op: |&mut ResolveTable| -> T) -> T {
} }
// Resolve a syntax object to a name, per MTWT. // Resolve a syntax object to a name, per MTWT.
// adding memoization to possibly resolve 500+ seconds in resolve for librustc (!) // adding memoization to resolve 500+ seconds in resolve for librustc (!)
fn resolve_internal(id: Ident, fn resolve_internal(id: Ident,
table: &SCTable, table: &SCTable,
resolve_table: &mut ResolveTable) -> Name { resolve_table: &mut ResolveTable) -> Name {

View File

@@ -114,6 +114,7 @@ pub enum Nonterminal {
NtPat( Gc<ast::Pat>), NtPat( Gc<ast::Pat>),
NtExpr(Gc<ast::Expr>), NtExpr(Gc<ast::Expr>),
NtTy( P<ast::Ty>), NtTy( P<ast::Ty>),
// see IDENT, above, for meaning of bool in NtIdent:
NtIdent(Box<ast::Ident>, bool), NtIdent(Box<ast::Ident>, bool),
NtMeta(Gc<ast::MetaItem>), // stuff inside brackets for attributes NtMeta(Gc<ast::MetaItem>), // stuff inside brackets for attributes
NtPath(Box<ast::Path>), NtPath(Box<ast::Path>),