Skip to content

Commit 0273c9e

Browse files
committed
---
yaml --- r: 22583 b: refs/heads/master c: b71a882 h: refs/heads/master i: 22581: bc8da53 22579: e0a228e 22575: 88dc75a v: v3
1 parent 0d46fcc commit 0273c9e

File tree

13 files changed

+48
-132
lines changed

13 files changed

+48
-132
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d61d7b59791703325d476942bafa5f2d218552f7
2+
refs/heads/master: b71a8827e3a17720508b7edebdc2c13358179e59
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/Makefile.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,6 @@ ifneq ($(wildcard $(CFG_GIT)),)
136136
ifneq ($(wildcard $(CFG_GIT_DIR)),)
137137
CFG_VERSION += $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
138138
--pretty=format:'(%h %ci)')
139-
CFG_VER_HASH = $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
140-
--pretty=format:'%H')
141139
endif
142140
endif
143141

trunk/doc/rust.css

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ body {
22
padding: 1em;
33
margin: 0;
44
font-family: "Helvetica Neue", Helvetica, sans-serif;
5-
background-color: white;
6-
color: black;
75
}
86

97
body {
@@ -60,22 +58,6 @@ h1.title {
6058
background-position: right;
6159
}
6260

63-
#versioninfo {
64-
position: fixed;
65-
bottom: 0px;
66-
right: 0px;
67-
68-
background-color: white;
69-
border-left: solid 1px black;
70-
border-top: solid 1px black;
71-
padding: 0.5em;
72-
}
73-
74-
a.lessimportant {
75-
color: gray;
76-
font-size: 60%;
77-
}
78-
7961
blockquote {
8062
color: black;
8163
border-left: solid 1px silver;

trunk/doc/version_info_template.html

Lines changed: 0 additions & 10 deletions
This file was deleted.

trunk/mk/docs.mk

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ doc/rust.css: rust.css
2121
$(Q)cp -a $< $@ 2> /dev/null
2222

2323
DOCS += doc/rust.html
24-
doc/rust.html: rust.md doc/version_info.html doc/rust.css
24+
doc/rust.html: rust.md doc/version.md doc/rust.css
2525
@$(call E, pandoc: $@)
2626
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
2727
"$(CFG_PANDOC)" \
@@ -30,7 +30,6 @@ doc/rust.html: rust.md doc/version_info.html doc/rust.css
3030
--number-sections \
3131
--from=markdown --to=html \
3232
--css=rust.css \
33-
--include-before-body=doc/version_info.html \
3433
--output=$@
3534
endif
3635

@@ -73,13 +72,12 @@ doc/rust.pdf: doc/rust.tex
7372
else
7473

7574
DOCS += doc/tutorial.html
76-
doc/tutorial.html: tutorial.md doc/version_info.html doc/rust.css
75+
doc/tutorial.html: tutorial.md doc/rust.css
7776
@$(call E, pandoc: $@)
7877
$(Q)$(CFG_NODE) $(S)doc/prep.js --highlight $< | \
7978
$(CFG_PANDOC) --standalone --toc \
8079
--section-divs --number-sections \
8180
--from=markdown --to=html --css=rust.css \
82-
--include-before-body=doc/version_info.html \
8381
--output=$@
8482

8583
endif
@@ -147,12 +145,6 @@ doc/version.md: $(MKFILE_DEPS) rust.md
147145
@$(call E, version-stamp: $@)
148146
$(Q)echo "$(CFG_VERSION)" >$@
149147

150-
doc/version_info.html: version_info_template.html
151-
@$(call E, version-info: $@)
152-
sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
153-
$(CFG_VER_HASH) | head --bytes=8)/;\
154-
s/STAMP/$(CFG_VER_HASH)/;" $< >$@
155-
156148
GENERATED += doc/version.md
157149

158150
docs: $(DOCS)

trunk/src/libcore/core.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import option::{some, none};
66
import option = option::option;
77
import path = path::path;
8-
import tuple::extensions;
8+
import tuple::{extensions, tuple_ops, extended_tuple_ops};
99
import str::{extensions, str_slice, unique_str};
1010
import vec::extensions;
1111
import vec::{const_vector, copyable_vector, immutable_vector};
@@ -40,6 +40,7 @@ export str_slice, unique_str;
4040
export const_vector, copyable_vector, immutable_vector;
4141
export immutable_copyable_vector, iter_trait_extensions, vec_concat;
4242
export base_iter, copyable_iter, extended_iter;
43+
export tuple_ops, extended_tuple_ops;
4344
export ptr;
4445

4546
// Export the log levels as global constants. Higher levels mean

trunk/src/libcore/tuple.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
//! Operations on tuples
22
3+
trait tuple_ops<T,U> {
4+
pure fn first() -> T;
5+
pure fn second() -> U;
6+
pure fn swap() -> (U, T);
7+
}
38

4-
impl extensions <T:copy, U:copy> for (T, U) {
9+
impl extensions <T:copy, U:copy> of tuple_ops<T,U> for (T, U) {
510

611
/// Return the first element of self
712
pure fn first() -> T {
@@ -23,7 +28,14 @@ impl extensions <T:copy, U:copy> for (T, U) {
2328

2429
}
2530

26-
impl extensions<A: copy, B: copy> for (&[A], &[B]) {
31+
trait extended_tuple_ops<A,B> {
32+
fn zip() -> ~[(A, B)];
33+
fn map<C>(f: fn(A, B) -> C) -> ~[C];
34+
}
35+
36+
impl extensions<A: copy, B: copy> of extended_tuple_ops<A,B>
37+
for (&[A], &[B]) {
38+
2739
fn zip() -> ~[(A, B)] {
2840
let (a, b) = self;
2941
vec::zip(a, b)
@@ -35,7 +47,9 @@ impl extensions<A: copy, B: copy> for (&[A], &[B]) {
3547
}
3648
}
3749

38-
impl extensions<A: copy, B: copy> for (~[A], ~[B]) {
50+
impl extensions<A: copy, B: copy> of extended_tuple_ops<A,B>
51+
for (~[A], ~[B]) {
52+
3953
fn zip() -> ~[(A, B)] {
4054
let (a, b) = self;
4155
vec::zip(a, b)

trunk/src/libsyntax/ext/base.rs

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -244,43 +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))];
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-
node: ast::expr_vec(args, ast::m_imm), span: sp});
282-
}
283-
284247
//
285248
// Local Variables:
286249
// mode: rust

trunk/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,

trunk/src/libsyntax/ext/pipes/ast_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl ast_builder of ext_ctxt_ast_builder for ext_ctxt {
202202
span: empty_span()}
203203
}
204204

205-
fn ty_nil() -> @ast::ty {
205+
fn ty_nil_ast_builder() -> @ast::ty {
206206
@{id: self.next_id(),
207207
node: ast::ty_nil,
208208
span: empty_span()}

trunk/src/libsyntax/ext/pipes/pipec.rs

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,21 @@ import ast_builder::ast_builder;
2222
import ast_builder::methods;
2323
import ast_builder::path;
2424

25-
impl compile for message {
25+
trait gen_send {
26+
fn gen_send(cx: ext_ctxt) -> @ast::item;
27+
}
28+
29+
trait to_type_decls {
30+
fn to_type_decls(cx: ext_ctxt) -> ~[@ast::item];
31+
fn to_endpoint_decls(cx: ext_ctxt, dir: direction) -> ~[@ast::item];
32+
}
33+
34+
trait gen_init {
35+
fn gen_init(cx: ext_ctxt) -> @ast::item;
36+
fn compile(cx: ext_ctxt) -> @ast::item;
37+
}
38+
39+
impl compile of gen_send for message {
2640
fn gen_send(cx: ext_ctxt) -> @ast::item {
2741
#debug("pipec: gen_send");
2842
alt self {
@@ -80,7 +94,7 @@ impl compile for message {
8094

8195
let args_ast = vec::append(
8296
~[cx.arg_mode(@~"pipe",
83-
cx.ty_path(path(this.data_name())
97+
cx.ty_path_ast_builder(path(this.data_name())
8498
.add_tys(cx.ty_vars(this.ty_params))),
8599
ast::by_copy)],
86100
args_ast);
@@ -104,20 +118,20 @@ impl compile for message {
104118

105119
cx.item_fn_poly(self.name(),
106120
args_ast,
107-
cx.ty_nil(),
121+
cx.ty_nil_ast_builder(),
108122
self.get_params(),
109123
cx.expr_block(body))
110124
}
111125
}
112126
}
113127

114128
fn to_ty(cx: ext_ctxt) -> @ast::ty {
115-
cx.ty_path_ast_builder(path(self.name)
116-
.add_tys(cx.ty_vars(self.ty_params)))
129+
cx.ty_path_ast_builder(path(self.name())
130+
.add_tys(cx.ty_vars(self.get_params())))
117131
}
118132
}
119133

120-
impl compile for state {
134+
impl compile of to_type_decls for state {
121135
fn to_type_decls(cx: ext_ctxt) -> ~[@ast::item] {
122136
#debug("pipec: to_type_decls");
123137
// This compiles into two different type declarations. Say the
@@ -144,7 +158,7 @@ impl compile for state {
144158
};
145159

146160
vec::append_one(tys,
147-
cx.ty_path((dir + next_name)
161+
cx.ty_path_ast_builder((dir + next_name)
148162
.add_tys(next_tys)))
149163
}
150164
none { tys }
@@ -184,7 +198,7 @@ impl compile for state {
184198
}
185199
}
186200

187-
impl compile for protocol {
201+
impl compile of gen_init for protocol {
188202
fn gen_init(cx: ext_ctxt) -> @ast::item {
189203
let start_state = self.states[0];
190204

@@ -303,19 +317,3 @@ impl parse_utils of ext_ctxt_parse_utils for ext_ctxt {
303317
}
304318
}
305319

306-
trait two_vector_utils<A, B> {
307-
fn zip() -> ~[(A, B)];
308-
fn map<C>(f: fn(A, B) -> C) -> ~[C];
309-
}
310-
311-
impl methods<A: copy, B: copy> of two_vector_utils<A, B> for (~[A], ~[B]) {
312-
fn zip() -> ~[(A, B)] {
313-
let (a, b) = self;
314-
vec::zip(a, b)
315-
}
316-
317-
fn map<C>(f: fn(A, B) -> C) -> ~[C] {
318-
let (a, b) = self;
319-
vec::map2(a, b, f)
320-
}
321-
}

trunk/src/libsyntax/ext/pipes/proto.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import dvec::{dvec, extensions};
33

44
import ast::{ident};
55

6-
import ast_builder::{path, methods, ast_builder};
6+
import ast_builder::{path, methods, ast_builder, append_types};
77

88
enum direction {
99
send, recv
@@ -78,7 +78,8 @@ impl methods for state {
7878
}
7979

8080
fn to_ty(cx: ext_ctxt) -> @ast::ty {
81-
cx.ty_path(path(self.name).add_tys(cx.ty_vars(self.ty_params)))
81+
cx.ty_path_ast_builder
82+
(path(self.name).add_tys(cx.ty_vars(self.ty_params)))
8283
}
8384
}
8485

trunk/src/libsyntax/ext/tt/earley_parser.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,16 +101,6 @@ enum parse_result {
101101
failure(codemap::span, ~str)
102102
}
103103
104-
fn parse_or_else(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader,
105-
ms: ~[matcher]) -> hashmap<ident, @arb_depth> {
106-
alt parse(sess, cfg, rdr, ms) {
107-
success(m) { m }
108-
failure(sp, str) {
109-
sess.span_diagnostic.span_fatal(sp, str);
110-
}
111-
}
112-
}
113-
114104
fn parse(sess: parse_sess, cfg: ast::crate_cfg, rdr: reader, ms: ~[matcher])
115105
-> parse_result {
116106
let mut cur_eis = ~[];

0 commit comments

Comments
 (0)