File tree Expand file tree Collapse file tree 3 files changed +32
-1
lines changed
branches/dist-snap/src/libsyntax/ext/pipes Expand file tree Collapse file tree 3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9
9
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10
- refs/heads/dist-snap: c28af2625870b2117e73fc8bee83a1704cff7414
10
+ refs/heads/dist-snap: b97fe9835430553c0b566cf1f5687e6c7403821b
11
11
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
12
12
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -91,9 +91,22 @@ trait ext_ctxt_ast_builder {
91
91
+params : ~[ ast:: ty_param ] ) -> @ast:: item ;
92
92
fn item_ty ( name : ident , ty : @ast:: ty ) -> @ast:: item ;
93
93
fn ty_vars ( +ty_params : ~[ ast:: ty_param ] ) -> ~[ @ast:: ty ] ;
94
+ fn ty_field_imm ( name : ident , ty : @ast:: ty ) -> ast:: ty_field ;
95
+ fn ty_rec ( +~[ ast:: ty_field ] ) -> @ast:: ty ;
94
96
}
95
97
96
98
impl ast_builder of ext_ctxt_ast_builder for ext_ctxt {
99
+ fn ty_field_imm ( name : ident , ty : @ast:: ty ) -> ast:: ty_field {
100
+ { node : { ident : name, mt : { ty: ty, mutbl : ast:: m_imm } } ,
101
+ span: empty_span ( ) }
102
+ }
103
+
104
+ fn ty_rec ( +fields : ~[ ast:: ty_field ] ) -> @ast:: ty {
105
+ @{ id: self . next_id ( ) ,
106
+ node: ast:: ty_rec ( fields) ,
107
+ span: empty_span ( ) }
108
+ }
109
+
97
110
fn ty_param ( id : ast:: ident , +bounds : ~[ ast:: ty_param_bound ] )
98
111
-> ast:: ty_param
99
112
{
Original file line number Diff line number Diff line change @@ -204,6 +204,7 @@ impl compile of to_type_decls for state {
204
204
205
205
impl compile of gen_init for protocol {
206
206
fn gen_init ( cx : ext_ctxt ) -> @ast:: item {
207
+ #debug ( "gen_init" ) ;
207
208
let start_state = self . states [ 0 ] ;
208
209
209
210
let body = alt start_state. dir {
@@ -237,6 +238,23 @@ impl compile of gen_init for protocol {
237
238
server_states += s. to_endpoint_decls ( cx, recv) ;
238
239
}
239
240
241
+ if self . is_bounded ( ) {
242
+ vec:: push (
243
+ items,
244
+ cx. item_ty (
245
+ @~"buffer",
246
+ cx. ty_rec (
247
+ ( copy self . states ) . map_to_vec (
248
+ |s| cx. ty_field_imm (
249
+ s. name ,
250
+ cx. ty_path_ast_builder (
251
+ ( path ( @~"pipes")
252
+ + @~"packet")
253
+ . add_ty (
254
+ cx. ty_path_ast_builder (
255
+ path ( s. name ) ) ) ) ) ) ) ) )
256
+ }
257
+
240
258
vec:: push ( items,
241
259
cx. item_mod ( @~"client",
242
260
client_states) ) ;
You can’t perform that action at this time.
0 commit comments