Skip to content

Commit 2584410

Browse files
committed
---
yaml --- r: 36682 b: refs/heads/try2 c: 9a4c669 h: refs/heads/master v: v3
1 parent 0637fb7 commit 2584410

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+273
-1977
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0138d87f8f1b9f9614e439deb14cbaabad6d104c
8+
refs/heads/try2: 9a4c669867765d42bdd13fc09eb9a32b7a667a43
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/doc/rust.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -847,25 +847,10 @@ fn main() {
847847

848848
Like items, `use` declarations are private to the containing module, by default.
849849
Also like items, a `use` declaration can be public, if qualified by the `pub` keyword.
850-
Such a `use` declaration serves to _re-export_ a name.
851850
A public `use` declaration can therefore be used to _redirect_ some public name to a different target definition,
852851
even a definition with a private canonical path, inside a different module.
853852
If a sequence of such redirections form a cycle or cannot be unambiguously resolved, they represent a compile-time error.
854853

855-
An example of re-exporting:
856-
~~~~
857-
mod quux {
858-
mod foo {
859-
pub fn bar() { }
860-
pub fn baz() { }
861-
}
862-
863-
pub use foo::*;
864-
}
865-
~~~~
866-
867-
In this example, the module `quux` re-exports all of the public names defined in `foo`.
868-
869854
### Functions
870855

871856
A _function item_ defines a sequence of [statements](#statements) and an optional final [expression](#expressions), along with a name and a set of parameters.

branches/try2/src/librustc/middle/astencode.rs

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,8 @@ fn decode_item_ast(par_doc: ebml::Doc) -> @ast::item {
10331033
trait fake_ext_ctxt {
10341034
fn cfg() -> ast::crate_cfg;
10351035
fn parse_sess() -> parse::parse_sess;
1036+
fn call_site() -> span;
1037+
fn ident_of(st: ~str) -> ast::ident;
10361038
}
10371039

10381040
#[cfg(test)]
@@ -1042,6 +1044,16 @@ type fake_session = parse::parse_sess;
10421044
impl fake_session: fake_ext_ctxt {
10431045
fn cfg() -> ast::crate_cfg { ~[] }
10441046
fn parse_sess() -> parse::parse_sess { self }
1047+
fn call_site() -> span {
1048+
codemap::span {
1049+
lo: codemap::BytePos(0),
1050+
hi: codemap::BytePos(0),
1051+
expn_info: None
1052+
}
1053+
}
1054+
fn ident_of(st: ~str) -> ast::ident {
1055+
self.interner.intern(@st)
1056+
}
10451057
}
10461058

10471059
#[cfg(test)]
@@ -1050,7 +1062,8 @@ fn mk_ctxt() -> fake_ext_ctxt {
10501062
}
10511063

10521064
#[cfg(test)]
1053-
fn roundtrip(in_item: @ast::item) {
1065+
fn roundtrip(in_item: Option<@ast::item>) {
1066+
let in_item = in_item.get();
10541067
let bytes = do io::with_bytes_writer |wr| {
10551068
let ebml_w = writer::Serializer(wr);
10561069
encode_item_ast(ebml_w, in_item);
@@ -1074,45 +1087,45 @@ fn roundtrip(in_item: @ast::item) {
10741087
#[test]
10751088
fn test_basic() {
10761089
let ext_cx = mk_ctxt();
1077-
roundtrip(#ast[item]{
1090+
roundtrip(quote_item!(
10781091
fn foo() {}
1079-
});
1092+
));
10801093
}
10811094

10821095
#[test]
10831096
fn test_smalltalk() {
10841097
let ext_cx = mk_ctxt();
1085-
roundtrip(#ast[item]{
1098+
roundtrip(quote_item!(
10861099
fn foo() -> int { 3 + 4 } // first smalltalk program ever executed.
1087-
});
1100+
));
10881101
}
10891102

10901103
#[test]
10911104
fn test_more() {
10921105
let ext_cx = mk_ctxt();
1093-
roundtrip(#ast[item]{
1106+
roundtrip(quote_item!(
10941107
fn foo(x: uint, y: uint) -> uint {
10951108
let z = x + y;
10961109
return z;
10971110
}
1098-
});
1111+
));
10991112
}
11001113

11011114
#[test]
11021115
fn test_simplification() {
11031116
let ext_cx = mk_ctxt();
1104-
let item_in = ast::ii_item(#ast[item] {
1117+
let item_in = ast::ii_item(quote_item!(
11051118
fn new_int_alist<B: Copy>() -> alist<int, B> {
11061119
fn eq_int(&&a: int, &&b: int) -> bool { a == b }
11071120
return {eq_fn: eq_int, mut data: ~[]};
11081121
}
1109-
});
1122+
).get());
11101123
let item_out = simplify_ast(item_in);
1111-
let item_exp = ast::ii_item(#ast[item] {
1124+
let item_exp = ast::ii_item(quote_item!(
11121125
fn new_int_alist<B: Copy>() -> alist<int, B> {
11131126
return {eq_fn: eq_int, mut data: ~[]};
11141127
}
1115-
});
1128+
).get());
11161129
match (item_out, item_exp) {
11171130
(ast::ii_item(item_out), ast::ii_item(item_exp)) => {
11181131
assert pprust::item_to_str(item_out, ext_cx.parse_sess().interner)

branches/try2/src/libsyntax/ast.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -831,24 +831,10 @@ enum matcher_ {
831831

832832
type mac = spanned<mac_>;
833833

834-
type mac_arg = Option<@expr>;
835-
836-
#[auto_serialize]
837-
#[auto_deserialize]
838-
type mac_body_ = {span: span};
839-
840-
type mac_body = Option<mac_body_>;
841-
842834
#[auto_serialize]
843835
#[auto_deserialize]
844836
enum mac_ {
845-
mac_invoc(@path, mac_arg, mac_body), // old macro-invocation
846837
mac_invoc_tt(@path,~[token_tree]), // new macro-invocation
847-
mac_ellipsis, // old pattern-match (obsolete)
848-
849-
// the span is used by the quoter/anti-quoter ...
850-
mac_aq(span /* span of quote */, @expr), // anti-quote
851-
mac_var(uint)
852838
}
853839

854840
type lit = spanned<lit_>;

branches/try2/src/libsyntax/ext/auto_serialize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ priv impl ext_ctxt {
309309
fn lambda(blk: ast::blk) -> @ast::expr {
310310
let ext_cx = self;
311311
let blk_e = self.expr(blk.span, ast::expr_block(blk));
312-
#ast{ || $(blk_e) }
312+
quote_expr!( || $blk_e )
313313
}
314314

315315
fn blk(span: span, stmts: ~[@ast::stmt]) -> ast::blk {

0 commit comments

Comments
 (0)