about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-03-22 18:01:08 -0700
committerBrian Anderson <banderson@mozilla.com>2012-03-29 14:42:31 -0700
commit442d0a783ad28abe821d64a20e15a789254707ed (patch)
treec4caab6e67f1296b9a674b195938a37752eb0eff
parent15947f8b193126234b2712beca739bc6c4abbf43 (diff)
downloadrust-442d0a783ad28abe821d64a20e15a789254707ed.tar.gz
rust-442d0a783ad28abe821d64a20e15a789254707ed.zip
rustc: Move attr, parse, print to rustsyntax
-rw-r--r--src/librustsyntax/attr.rs (renamed from src/rustc/front/attr.rs)7
-rw-r--r--src/librustsyntax/parse/eval.rs (renamed from src/rustc/syntax/parse/eval.rs)14
-rw-r--r--src/librustsyntax/parse/parser.rs (renamed from src/rustc/syntax/parse/parser.rs)2
-rw-r--r--src/librustsyntax/print/pp.rs (renamed from src/rustc/syntax/print/pp.rs)0
-rw-r--r--src/librustsyntax/print/pprust.rs (renamed from src/rustc/syntax/print/pprust.rs)4
-rw-r--r--src/librustsyntax/rustsyntax.rc10
-rw-r--r--src/rustc/front.rs6
-rw-r--r--src/rustc/rustc.rc9
-rw-r--r--src/rustc/syntax.rs8
-rw-r--r--src/rustc/syntax/parse.rs7
10 files changed, 32 insertions, 35 deletions
diff --git a/src/rustc/front/attr.rs b/src/librustsyntax/attr.rs
index cc41957a021..3736c2f374e 100644
--- a/src/rustc/front/attr.rs
+++ b/src/librustsyntax/attr.rs
@@ -3,8 +3,7 @@
 import std::map;
 import std::map::hashmap;
 import either::either;
-import syntax::{ast, ast_util};
-import driver::diagnostic::span_handler;
+import diagnostic::span_handler;
 
 export attr_meta;
 export attr_metas;
@@ -169,10 +168,10 @@ fn eq(a: @ast::meta_item, b: @ast::meta_item) -> bool {
 
 fn contains(haystack: [@ast::meta_item], needle: @ast::meta_item) -> bool {
     #debug("looking for %s",
-           syntax::print::pprust::meta_item_to_str(*needle));
+           print::pprust::meta_item_to_str(*needle));
     for item: @ast::meta_item in haystack {
         #debug("looking in %s",
-               syntax::print::pprust::meta_item_to_str(*item));
+               print::pprust::meta_item_to_str(*item));
         if eq(item, needle) { #debug("found it!"); ret true; }
     }
     #debug("found it not :(");
diff --git a/src/rustc/syntax/parse/eval.rs b/src/librustsyntax/parse/eval.rs
index b56f26230b9..42187ad9c7c 100644
--- a/src/rustc/syntax/parse/eval.rs
+++ b/src/librustsyntax/parse/eval.rs
@@ -1,9 +1,7 @@
-import front::attr;
-import syntax::ast;
-import syntax::parse::token;
-import syntax::parse::parser::{parser, new_parser_from_file,
-                               parse_inner_attrs_and_next,
-                               parse_mod_items, SOURCE_FILE};
+import attr;
+import parser::{parser, new_parser_from_file,
+                parse_inner_attrs_and_next,
+                parse_mod_items, SOURCE_FILE};
 
 export eval_crate_directives_to_mod;
 
@@ -109,8 +107,8 @@ fn eval_crate_directive(cx: ctx, cdir: @ast::crate_directive, prefix: str,
         let m0 = parse_mod_items(p0, token::EOF, first_item_outer_attrs);
 
         let i =
-            syntax::parse::parser::mk_item(p0, cdir.span.lo, cdir.span.hi, id,
-                                           ast::item_mod(m0), mod_attrs);
+            parser::mk_item(p0, cdir.span.lo, cdir.span.hi, id,
+                            ast::item_mod(m0), mod_attrs);
         // Thread defids, chpos and byte_pos through the parsers
         cx.sess.chpos = p0.reader.chpos;
         cx.sess.byte_pos = cx.sess.byte_pos + p0.reader.pos;
diff --git a/src/rustc/syntax/parse/parser.rs b/src/librustsyntax/parse/parser.rs
index 0ef54e09993..7d3d30d1a2f 100644
--- a/src/rustc/syntax/parse/parser.rs
+++ b/src/librustsyntax/parse/parser.rs
@@ -6,9 +6,7 @@ import codemap::{span,fss_none};
 import util::interner;
 import ast::{node_id, spanned};
 import ast_util::{mk_sp, ident_to_path};
-import front::attr;
 import lexer::reader;
-import driver::diagnostic;
 
 enum restriction {
     UNRESTRICTED,
diff --git a/src/rustc/syntax/print/pp.rs b/src/librustsyntax/print/pp.rs
index f116bab4fe4..f116bab4fe4 100644
--- a/src/rustc/syntax/print/pp.rs
+++ b/src/librustsyntax/print/pp.rs
diff --git a/src/rustc/syntax/print/pprust.rs b/src/librustsyntax/print/pprust.rs
index a1c118c3144..1a4780f78ae 100644
--- a/src/rustc/syntax/print/pprust.rs
+++ b/src/librustsyntax/print/pprust.rs
@@ -1,9 +1,9 @@
 import parse::lexer;
-import syntax::codemap::codemap;
+import codemap::codemap;
 import pp::{break_offset, word, printer,
             space, zerobreak, hardbreak, breaks, consistent,
             inconsistent, eof};
-import driver::diagnostic;
+import diagnostic;
 
 // The ps is stored here to prevent recursive type.
 enum ann_node {
diff --git a/src/librustsyntax/rustsyntax.rc b/src/librustsyntax/rustsyntax.rc
index 081f31f7b00..1a321f91554 100644
--- a/src/librustsyntax/rustsyntax.rc
+++ b/src/librustsyntax/rustsyntax.rc
@@ -6,6 +6,7 @@
 
 use std;
 
+mod attr;
 mod diagnostic;
 mod codemap;
 mod ast;
@@ -16,6 +17,13 @@ mod util {
     mod interner;
 }
 mod parse {
-    mod token;
+    mod eval;
     mod lexer;
+    mod parser;
+    mod token;
+}
+
+mod print {
+    mod pp;
+    mod pprust;
 }
\ No newline at end of file
diff --git a/src/rustc/front.rs b/src/rustc/front.rs
new file mode 100644
index 00000000000..f94decc900b
--- /dev/null
+++ b/src/rustc/front.rs
@@ -0,0 +1,6 @@
+import rustsyntax::attr;
+export attr;
+
+export config;
+export test;
+export core_inject;
diff --git a/src/rustc/rustc.rc b/src/rustc/rustc.rc
index d161eeb78db..837a28e5d00 100644
--- a/src/rustc/rustc.rc
+++ b/src/rustc/rustc.rc
@@ -70,10 +70,6 @@ mod middle {
 
 
 mod syntax {
-    mod parse {
-        mod parser;
-        mod eval;
-    }
     mod ext {
         mod base;
         mod expand;
@@ -88,14 +84,9 @@ mod syntax {
         mod log_syntax;
         mod auto_serialize;
     }
-    mod print {
-        mod pprust;
-        mod pp;
-    }
 }
 
 mod front {
-    mod attr;
     mod config;
     mod test;
     mod core_inject;
diff --git a/src/rustc/syntax.rs b/src/rustc/syntax.rs
index 4eb6021127f..a11734a2858 100644
--- a/src/rustc/syntax.rs
+++ b/src/rustc/syntax.rs
@@ -14,13 +14,17 @@ export visit;
 import rustsyntax::fold;
 export fold;
 
+import rustsyntax::print;
+export print;
+
+import rustsyntax::parse;
+export parse;
+
 export ast;
 export ast_util;
 export visit;
 export fold;
-export parse;
 export ext;
-export print;
 export util;
 
 mod util {
diff --git a/src/rustc/syntax/parse.rs b/src/rustc/syntax/parse.rs
deleted file mode 100644
index 5fffd171dd7..00000000000
--- a/src/rustc/syntax/parse.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-import rustsyntax::parse::token;
-export token;
-
-import rustsyntax::parse::lexer;
-export lexer;
-
-export parser;
\ No newline at end of file