Skip to content

Commit c04f4a8

Browse files
brsongraydon
authored andcommitted
---
yaml --- r: 1637 b: refs/heads/master c: a3cca65 h: refs/heads/master i: 1635: deffa5e v: v3
1 parent 19c347c commit c04f4a8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 292dac644f3f8a84db9f97bf1978f9e9c56e7881
2+
refs/heads/master: a3cca65f6d77d9d7d27b3ace84da4730030ffd59

trunk/src/comp/middle/fold.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ type ast_fold[ENV] =
6767
&option.t[def] d) -> @ty) fold_ty_path,
6868

6969
(fn(&ENV e, &span sp, @ty t) -> @ty) fold_ty_mutable,
70+
(fn(&ENV e, &span sp, @ty t) -> @ty) fold_ty_chan,
71+
(fn(&ENV e, &span sp, @ty t) -> @ty) fold_ty_port,
7072

7173
// Expr folds.
7274
(fn(&ENV e, &span sp,
@@ -386,6 +388,16 @@ fn fold_ty[ENV](&ENV env, ast_fold[ENV] fld, @ty t) -> @ty {
386388
case (ast.ty_fn(?proto, ?inputs, ?output)) {
387389
ret fold_ty_fn(env_, fld, t.span, proto, inputs, output);
388390
}
391+
392+
case (ast.ty_chan(?ty)) {
393+
auto ty_ = fold_ty(env, fld, ty);
394+
ret fld.fold_ty_chan(env_, t.span, ty_);
395+
}
396+
397+
case (ast.ty_port(?ty)) {
398+
auto ty_ = fold_ty(env, fld, ty);
399+
ret fld.fold_ty_port(env_, t.span, ty_);
400+
}
389401
}
390402
}
391403

@@ -1083,6 +1095,13 @@ fn identity_fold_ty_mutable[ENV](&ENV env, &span sp, @ty t) -> @ty {
10831095
ret @respan(sp, ast.ty_mutable(t));
10841096
}
10851097

1098+
fn identity_fold_ty_chan[ENV](&ENV env, &span sp, @ty t) -> @ty {
1099+
ret @respan(sp, ast.ty_chan(t));
1100+
}
1101+
1102+
fn identity_fold_ty_port[ENV](&ENV env, &span sp, @ty t) -> @ty {
1103+
ret @respan(sp, ast.ty_port(t));
1104+
}
10861105

10871106
// Expr identities.
10881107

@@ -1473,6 +1492,8 @@ fn new_identity_fold[ENV]() -> ast_fold[ENV] {
14731492
fold_ty_fn = bind identity_fold_ty_fn[ENV](_,_,_,_,_),
14741493
fold_ty_path = bind identity_fold_ty_path[ENV](_,_,_,_),
14751494
fold_ty_mutable = bind identity_fold_ty_mutable[ENV](_,_,_),
1495+
fold_ty_chan = bind identity_fold_ty_chan[ENV](_,_,_),
1496+
fold_ty_port = bind identity_fold_ty_port[ENV](_,_,_),
14761497

14771498
fold_expr_vec = bind identity_fold_expr_vec[ENV](_,_,_,_),
14781499
fold_expr_tup = bind identity_fold_expr_tup[ENV](_,_,_,_),

0 commit comments

Comments
 (0)