Move functions from syntax::ast to syntax::ast_util

This leaves syntax::ast just defining the AST, which strikes me as somewhat
nicer
This commit is contained in:
Brian Anderson 2011-08-21 21:44:41 -07:00
parent a3affaa20f
commit 152cbaade7
33 changed files with 358 additions and 314 deletions

View file

@ -125,9 +125,11 @@ fn node_span(node: &ast_node) -> codemap::span {
#[cfg(test)]
mod test {
import syntax::ast_util;
#[test]
fn test_node_span_item() {
let expected: codemap::span = mk_sp(20u, 30u);
let expected: codemap::span = ast_util::mk_sp(20u, 30u);
let node =
node_item(@{ident: "test",
attrs: [],
@ -139,7 +141,7 @@ mod test {
#[test]
fn test_node_span_obj_ctor() {
let expected: codemap::span = mk_sp(20u, 30u);
let expected: codemap::span = ast_util::mk_sp(20u, 30u);
let node =
node_obj_ctor(@{ident: "test",
attrs: [],
@ -151,7 +153,7 @@ mod test {
#[test]
fn test_node_span_native_item() {
let expected: codemap::span = mk_sp(20u, 30u);
let expected: codemap::span = ast_util::mk_sp(20u, 30u);
let node =
node_native_item(@{ident: "test",
attrs: [],
@ -163,7 +165,7 @@ mod test {
#[test]
fn test_node_span_expr() {
let expected: codemap::span = mk_sp(20u, 30u);
let expected: codemap::span = ast_util::mk_sp(20u, 30u);
let node = node_expr(@{id: 0, node: expr_break, span: expected});
assert (node_span(node) == expected);
}