Skip to content

Commit 06e5c49

Browse files
committed
---
yaml --- r: 31447 b: refs/heads/dist-snap c: 2fc2e2d h: refs/heads/master i: 31445: f94d71a 31443: 013b5db 31439: c8a6c75 v: v3
1 parent 34eff03 commit 06e5c49

File tree

9 files changed

+48
-106
lines changed

9 files changed

+48
-106
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 97422f0f0fdcbdd17a769fa9588e76b8bf8a5bdf
10+
refs/heads/dist-snap: 2fc2e2d5ea6401e352d79a9bac085c9961162696
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/libcore/dlist.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class dlist_root<T> {
2626
self.size = 0; self.hd = none; self.tl = none;
2727
}
2828
drop {
29-
/* FIXME (#????) This doesn't work during task failure - the box
29+
/* FIXME (#3039) This doesn't work during task failure - the box
3030
* annihilator might have killed some of our nodes already. This will
3131
* be safe to uncomment when the box annihilator is safer. As is,
3232
* this makes test_dlist_cyclic_link below crash the runtime.

branches/dist-snap/src/libcore/future.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ fn from_value<A>(+val: A) -> future<A> {
6060
})
6161
}
6262

63-
macro_rules! move{
64-
{$x:expr} => { unsafe { let y <- *ptr::addr_of($x); y } }
63+
fn macros() {
64+
#macro[
65+
[#move[x],
66+
unsafe { let y <- *ptr::addr_of(x); y }]
67+
];
6568
}
6669

6770
fn from_port<A:send>(-port: future_pipe::client::waiting<A>) -> future<A> {
@@ -78,7 +81,7 @@ fn from_port<A:send>(-port: future_pipe::client::waiting<A>) -> future<A> {
7881
port_ <-> *port;
7982
let port = option::unwrap(port_);
8083
alt recv(port) {
81-
future_pipe::completed(data) { move!{data} }
84+
future_pipe::completed(data) { #move(data) }
8285
}
8386
}
8487
}

branches/dist-snap/src/libsyntax/ext/base.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -244,44 +244,6 @@ fn get_mac_body(cx: ext_ctxt, sp: span, args: ast::mac_body)
244244
}
245245
}
246246

247-
fn tt_args_to_original_flavor(cx: ext_ctxt, sp: span, arg: ~[ast::token_tree])
248-
-> ast::mac_arg {
249-
import ast::{matcher, matcher_, mtc_tok, mtc_rep, mtc_bb};
250-
import parse::lexer::{new_tt_reader, tt_reader_as_reader, reader};
251-
import tt::earley_parser::{parse_or_else, seq, leaf};
252-
253-
// these spans won't matter, anyways
254-
fn ms(m: matcher_) -> matcher {
255-
{node: m, span: {lo: 0u, hi: 0u, expn_info: none}}
256-
}
257-
258-
let argument_gram = ~[ms(mtc_rep(~[
259-
ms(mtc_bb(@~"arg",@~"expr", 0u))
260-
], some(parse::token::COMMA), true, 0u, 1u))];
261-
262-
let arg_reader = new_tt_reader(cx.parse_sess().span_diagnostic,
263-
cx.parse_sess().interner, none, arg);
264-
let args =
265-
alt parse_or_else(cx.parse_sess(), cx.cfg(), arg_reader as reader,
266-
argument_gram).get(@~"arg") {
267-
@seq(s, _) {
268-
do s.map() |lf| {
269-
alt lf {
270-
@leaf(parse::token::w_expr(arg)) {
271-
arg /* whew! list of exprs, here we come! */
272-
}
273-
_ { fail ~"badly-structured parse result"; }
274-
}
275-
}
276-
}
277-
_ { fail ~"badly-structured parse result"; }
278-
};
279-
280-
ret some(@{id: parse::next_node_id(cx.parse_sess()),
281-
callee_id: parse::next_node_id(cx.parse_sess()),
282-
node: ast::expr_vec(args, ast::m_imm), span: sp});
283-
}
284-
285247
//
286248
// Local Variables:
287249
// mode: rust

branches/dist-snap/src/libsyntax/ext/expand.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,7 @@ fn expand_expr(exts: hashmap<~str, syntax_extension>, cx: ext_ctxt,
8181
cx.bt_pop();
8282

8383
(fully_expanded, s)
84-
}
85-
some(normal({expander: exp, span: exp_sp})) {
86-
//convert the new-style invoc for the old-style macro
87-
let arg = base::tt_args_to_original_flavor(cx, pth.span,
88-
tts);
89-
let expanded = exp(cx, mac.span, arg, none);
9084

91-
cx.bt_push(expanded_from({call_site: s,
92-
callie: {name: *extname, span: exp_sp}}));
93-
//keep going, outside-in
94-
let fully_expanded = fld.fold_expr(expanded).node;
95-
cx.bt_pop();
96-
97-
(fully_expanded, s)
9885
}
9986
_ {
10087
cx.span_fatal(pth.span,

branches/dist-snap/src/libsyntax/ext/tt/earley_parser.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,6 @@ enum parse_result {
110110
failure(codemap::span, ~str)
111111
}
112112
113-
fn parse_or_else(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader,
114-
ms: ~[matcher]) -> hashmap<ident, @arb_depth> {
115-
alt parse(sess, cfg, rdr, ms) {
116-
success(m) { m }
117-
failure(sp, str) {
118-
sess.span_diagnostic.span_fatal(sp, str);
119-
}
120-
}
121-
}
122-
123113
fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher])
124114
-> parse_result {
125115
let mut cur_eis = ~[];

branches/dist-snap/src/libsyntax/parse/parser.rs

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -101,43 +101,52 @@ enum class_contents { ctor_decl(fn_decl, ~[attribute], blk, codemap::span),
101101
type arg_or_capture_item = either<arg, capture_item>;
102102
type item_info = (ident, item_, option<~[attribute]>);
103103

104+
fn dummy() {
104105

105-
/* The expr situation is not as complex as I thought it would be.
106-
The important thing is to make sure that lookahead doesn't balk
107-
at ACTUALLY tokens */
108-
macro_rules! maybe_whole_expr{
109-
{$p:expr} => { alt copy $p.token {
110-
ACTUALLY(token::w_expr(e)) {
111-
$p.bump();
112-
ret pexpr(e);
113-
}
114-
ACTUALLY(token::w_path(pt)) {
115-
$p.bump();
116-
ret $p.mk_pexpr($p.span.lo, $p.span.lo,
117-
expr_path(pt));
118-
}
119-
_ {}
120-
}}
121-
}
122-
123-
macro_rules! maybe_whole {
124-
{$p:expr, $constructor:path} => { alt copy $p.token {
125-
ACTUALLY($constructor(x)) { $p.bump(); ret x; }
126-
_ {}
127-
}}
128-
}
129106

130-
/* ident is handled by common.rs */
131107

132-
fn dummy() {
133-
/* we will need this to bootstrap maybe_whole! */
108+
#macro[[#maybe_whole_item[p],
109+
alt copy p.token {
110+
ACTUALLY(token::w_item(i)) { p.bump(); ret i; }
111+
_ {} }]];
112+
#macro[[#maybe_whole_block[p],
113+
alt copy p.token {
114+
ACTUALLY(token::w_block(b)) { p.bump(); ret b; }
115+
_ {} }]];
116+
#macro[[#maybe_whole_stmt[p],
117+
alt copy p.token {
118+
ACTUALLY(token::w_stmt(s)) { p.bump(); ret s; }
119+
_ {} }]];
120+
#macro[[#maybe_whole_pat[p],
121+
alt copy p.token {
122+
ACTUALLY(token::w_pat(pt)) { p.bump(); ret pt; }
123+
_ {} }]];
124+
/* The expr situation is not as complex as I thought it would be.
125+
The important thing is to make sure that lookahead doesn't balk
126+
at ACTUALLY tokens */
127+
#macro[[#maybe_whole_expr_pexpr[p], /* ack! */
128+
alt copy p.token {
129+
ACTUALLY(token::w_expr(e)) {
130+
p.bump();
131+
ret pexpr(e);
132+
}
133+
ACTUALLY(token::w_path(pt)) {
134+
p.bump();
135+
ret p.mk_pexpr(p.span.lo, p.span.lo,
136+
expr_path(pt));
137+
}
138+
_ {} }]];
139+
#macro[[#maybe_whole_ty[p],
140+
alt copy p.token {
141+
ACTUALLY(token::w_ty(t)) { p.bump(); ret t; }
142+
_ {} }]];
143+
/* ident is handled by common.rs */
134144
#macro[[#maybe_whole_path[p],
135145
alt p.token {
136146
ACTUALLY(token::w_path(pt)) { p.bump(); ret pt; }
137147
_ {} }]];
138148
}
139149

140-
141150
class parser {
142151
let sess: parse_sess;
143152
let cfg: crate_cfg;
@@ -725,7 +734,7 @@ class parser {
725734
}
726735
727736
fn parse_bottom_expr() -> pexpr {
728-
maybe_whole_expr!{self};
737+
#maybe_whole_expr_pexpr[self];
729738
let lo = self.span.lo;
730739
let mut hi = self.span.hi;
731740

branches/dist-snap/src/snapshots.txt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
S 2012-07-26 5805616
2-
macos-i386 cded3df1c96da88a593438b3c473b0c0e2acf211
3-
macos-x86_64 2eade230d378daff7ee4eac7c2922df2c4b71277
4-
freebsd-x86_64 9190485b8b86dcfb33e4ee14bb5954d55cb92a8b
5-
linux-i386 fbb14d21652f49b1eb741e926ba6d7a96436556b
6-
linux-x86_64 fbd5dc14d4e99feee3c6086dd3ad11145507ba34
7-
winnt-i386 bab3360e67c7e6b333d9f514bbd922a79359e6a3
8-
91
S 2012-07-16 0e42004
102
macos-i386 67616307e5498327bcf4f0c13287e7f9f4439c1c
113
macos-x86_64 f3348eb9314895ffa71056fad8c1f79d8d45b161
@@ -761,7 +753,7 @@ S 2011-09-01 6972f07
761753
winnt-i386 b0248e68346a1724c673a2fa5bc5a73eda2d821f
762754

763755
S 2011-09-01 91ea257
764-
linux-i386 dcea4ce8001eaba3e3b2c404a147fbad47defe96
756+
linux-i386 dcea4ce8001eaba3e3b2c404a147fbad47defe96
765757
macos-i386 0807e3a7c2c88dbf459a2a78601403090d38c01d
766758
winnt-i386 03d0fd04f6b080d9f601bb1a3711c98f9eab2490
767759

branches/dist-snap/src/test/run-pass/macro-by-example-1.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ fn main() {
99

1010
fn add(a: int, b: int) -> int { ret a + b; }
1111

12-
assert(#apply[add, [1, 15]] == 16);
13-
assert(apply!{add, [1, 15]} == 16);
12+
assert (#apply[add, [1, 15]] == 16);
1413
assert(apply_tt!{add, (1, 15)} == 16);
1514
}

0 commit comments

Comments
 (0)