Move everything syntax-related to syntax/, break deps on rest of compiler

src/comp/syntax is currently just a sub-module of rustc, but it will,
in the near future, be its own crate. This includes:

 - The AST data structure
 - The parser
 - The pretty-printer
 - Visit, walk, and fold
 - The syntax extension system
 - Some utility stuff that should be in the stdlib*

*) Stdlib extensions currently require a snapshot before they can be
   used, and the win build is very broken right now. This is temporary
   and will be cleaned up when one of those problems goes away.

A lot of code was moved by this patch, mostly towards a more organized
layout. Some package paths did get longer, and I guess the new layout
will take some getting used to. Sorry about that!

Please try not to re-introduce any dependencies in syntax/ on any of
the other src/comp/ subdirs.
This commit is contained in:
Marijn Haverbeke
2011-07-05 11:48:19 +02:00
parent c59ebf0f01
commit 6fd6fdea93
54 changed files with 1254 additions and 1203 deletions

View File

@@ -1457,7 +1457,7 @@ state obj type_names(std::map::hashmap[TypeRef, str] type_names,
}
fn mk_type_names() -> type_names {
auto nt = util::common::new_str_hash[TypeRef]();
auto nt = syntax::_std::new_str_hash[TypeRef]();
fn hash(&TypeRef t) -> uint {
ret t as uint;
@@ -1519,7 +1519,7 @@ fn type_to_str_inner(type_names names,
case (6) { ret "Label"; }
case (7) {
ret "i" + util::common::istr(llvm::LLVMGetIntTypeWidth(ty)
ret "i" + syntax::_std::istr(llvm::LLVMGetIntTypeWidth(ty)
as int);
}
@@ -1558,7 +1558,7 @@ fn type_to_str_inner(type_names names,
i += 1u;
if (tout as int == ty as int) {
let uint n = vec::len[TypeRef](outer0) - i;
ret "*\\" + util::common::istr(n as int);
ret "*\\" + syntax::_std::istr(n as int);
}
}
ret "*" + type_to_str_inner(names, outer,