Skip to content

Commit 1a9b18b

Browse files
committed
---
yaml --- r: 1375 b: refs/heads/master c: f951b52 h: refs/heads/master i: 1373: 3dfb176 1371: 01d0ad6 1367: 9c6a4ff 1359: d38dc89 1343: 213144a v: v3
1 parent 9363f16 commit 1a9b18b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-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: 277334890dabd85c1015da666e2700dfe9950e2d
2+
refs/heads/master: f951b52e91c5c0487ad4d3a5454b193f15146d6a

trunk/src/comp/middle/fold.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ type ast_fold[ENV] =
160160
(fn(&ENV e, &span sp,
161161
ann a) -> @pat) fold_pat_wild,
162162

163+
(fn(&ENV e, &span sp,
164+
@ast.lit lit, ann a) -> @pat) fold_pat_lit,
165+
163166
(fn(&ENV e, &span sp,
164167
ident i, def_id did, ann a) -> @pat) fold_pat_bind,
165168

@@ -421,6 +424,9 @@ fn fold_pat[ENV](&ENV env, ast_fold[ENV] fld, @ast.pat p) -> @ast.pat {
421424

422425
alt (p.node) {
423426
case (ast.pat_wild(?t)) { ret fld.fold_pat_wild(env_, p.span, t); }
427+
case (ast.pat_lit(?lt, ?t)) {
428+
ret fld.fold_pat_lit(env_, p.span, lt, t);
429+
}
424430
case (ast.pat_bind(?id, ?did, ?t)) {
425431
ret fld.fold_pat_bind(env_, p.span, id, did, t);
426432
}
@@ -1122,6 +1128,10 @@ fn identity_fold_pat_wild[ENV](&ENV e, &span sp, ann a) -> @pat {
11221128
ret @respan(sp, ast.pat_wild(a));
11231129
}
11241130

1131+
fn identity_fold_pat_lit[ENV](&ENV e, &span sp, @ast.lit lit, ann a) -> @pat {
1132+
ret @respan(sp, ast.pat_lit(lit, a));
1133+
}
1134+
11251135
fn identity_fold_pat_bind[ENV](&ENV e, &span sp, ident i, def_id did, ann a)
11261136
-> @pat {
11271137
ret @respan(sp, ast.pat_bind(i, did, a));
@@ -1373,6 +1383,7 @@ fn new_identity_fold[ENV]() -> ast_fold[ENV] {
13731383
fold_decl_item = bind identity_fold_decl_item[ENV](_,_,_),
13741384

13751385
fold_pat_wild = bind identity_fold_pat_wild[ENV](_,_,_),
1386+
fold_pat_lit = bind identity_fold_pat_lit[ENV](_,_,_,_),
13761387
fold_pat_bind = bind identity_fold_pat_bind[ENV](_,_,_,_,_),
13771388
fold_pat_tag = bind identity_fold_pat_tag[ENV](_,_,_,_,_,_),
13781389

0 commit comments

Comments
 (0)