Skip to content

Commit 2765811

Browse files
committed
auto merge of #8206 : omasanori/rust/blk-to-block, r=graydon
Just for consistency.
2 parents 39fafd6 + 09efc4e commit 2765811

File tree

6 files changed

+35
-35
lines changed

6 files changed

+35
-35
lines changed

src/libsyntax/ext/build.rs

+26-26
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,12 @@ pub trait AstBuilder {
7676
fn stmt_let(&self, sp: span, mutbl: bool, ident: ast::ident, ex: @ast::expr) -> @ast::stmt;
7777

7878
// blocks
79-
fn blk(&self, span: span, stmts: ~[@ast::stmt], expr: Option<@ast::expr>) -> ast::Block;
80-
fn blk_expr(&self, expr: @ast::expr) -> ast::Block;
81-
fn blk_all(&self, span: span,
82-
view_items: ~[ast::view_item],
83-
stmts: ~[@ast::stmt],
84-
expr: Option<@ast::expr>) -> ast::Block;
79+
fn block(&self, span: span, stmts: ~[@ast::stmt], expr: Option<@ast::expr>) -> ast::Block;
80+
fn block_expr(&self, expr: @ast::expr) -> ast::Block;
81+
fn block_all(&self, span: span,
82+
view_items: ~[ast::view_item],
83+
stmts: ~[@ast::stmt],
84+
expr: Option<@ast::expr>) -> ast::Block;
8585

8686
// expressions
8787
fn expr(&self, span: span, node: ast::expr_) -> @ast::expr;
@@ -105,7 +105,7 @@ pub trait AstBuilder {
105105
fn expr_method_call(&self, span: span,
106106
expr: @ast::expr, ident: ast::ident,
107107
args: ~[@ast::expr]) -> @ast::expr;
108-
fn expr_blk(&self, b: ast::Block) -> @ast::expr;
108+
fn expr_block(&self, b: ast::Block) -> @ast::expr;
109109

110110
fn field_imm(&self, span: span, name: ident, e: @ast::expr) -> ast::Field;
111111
fn expr_struct(&self, span: span, path: ast::Path, fields: ~[ast::Field]) -> @ast::expr;
@@ -387,18 +387,18 @@ impl AstBuilder for @ExtCtxt {
387387
@respan(sp, ast::stmt_decl(@decl, self.next_id()))
388388
}
389389

390-
fn blk(&self, span: span, stmts: ~[@ast::stmt], expr: Option<@expr>) -> ast::Block {
391-
self.blk_all(span, ~[], stmts, expr)
390+
fn block(&self, span: span, stmts: ~[@ast::stmt], expr: Option<@expr>) -> ast::Block {
391+
self.block_all(span, ~[], stmts, expr)
392392
}
393393

394-
fn blk_expr(&self, expr: @ast::expr) -> ast::Block {
395-
self.blk_all(expr.span, ~[], ~[], Some(expr))
394+
fn block_expr(&self, expr: @ast::expr) -> ast::Block {
395+
self.block_all(expr.span, ~[], ~[], Some(expr))
396396
}
397-
fn blk_all(&self,
398-
span: span,
399-
view_items: ~[ast::view_item],
400-
stmts: ~[@ast::stmt],
401-
expr: Option<@ast::expr>) -> ast::Block {
397+
fn block_all(&self,
398+
span: span,
399+
view_items: ~[ast::view_item],
400+
stmts: ~[@ast::stmt],
401+
expr: Option<@ast::expr>) -> ast::Block {
402402
ast::Block {
403403
view_items: view_items,
404404
stmts: stmts,
@@ -474,7 +474,7 @@ impl AstBuilder for @ExtCtxt {
474474
self.expr(span,
475475
ast::expr_method_call(self.next_id(), expr, ident, ~[], args, ast::NoSugar))
476476
}
477-
fn expr_blk(&self, b: ast::Block) -> @ast::expr {
477+
fn expr_block(&self, b: ast::Block) -> @ast::expr {
478478
self.expr(b.span, ast::expr_block(b))
479479
}
480480
fn field_imm(&self, span: span, name: ident, e: @ast::expr) -> ast::Field {
@@ -577,7 +577,7 @@ impl AstBuilder for @ExtCtxt {
577577
ast::arm {
578578
pats: pats,
579579
guard: None,
580-
body: self.blk_expr(expr)
580+
body: self.block_expr(expr)
581581
}
582582
}
583583

@@ -591,8 +591,8 @@ impl AstBuilder for @ExtCtxt {
591591

592592
fn expr_if(&self, span: span,
593593
cond: @ast::expr, then: @ast::expr, els: Option<@ast::expr>) -> @ast::expr {
594-
let els = els.map(|x| self.expr_blk(self.blk_expr(*x)));
595-
self.expr(span, ast::expr_if(cond, self.blk_expr(then), els))
594+
let els = els.map(|x| self.expr_block(self.block_expr(*x)));
595+
self.expr(span, ast::expr_if(cond, self.block_expr(then), els))
596596
}
597597

598598
fn lambda_fn_decl(&self, span: span, fn_decl: ast::fn_decl, blk: ast::Block) -> @ast::expr {
@@ -618,23 +618,23 @@ impl AstBuilder for @ExtCtxt {
618618
}
619619

620620
fn lambda_expr(&self, span: span, ids: ~[ast::ident], expr: @ast::expr) -> @ast::expr {
621-
self.lambda(span, ids, self.blk_expr(expr))
621+
self.lambda(span, ids, self.block_expr(expr))
622622
}
623623
fn lambda_expr_0(&self, span: span, expr: @ast::expr) -> @ast::expr {
624-
self.lambda0(span, self.blk_expr(expr))
624+
self.lambda0(span, self.block_expr(expr))
625625
}
626626
fn lambda_expr_1(&self, span: span, expr: @ast::expr, ident: ast::ident) -> @ast::expr {
627-
self.lambda1(span, self.blk_expr(expr), ident)
627+
self.lambda1(span, self.block_expr(expr), ident)
628628
}
629629

630630
fn lambda_stmts(&self, span: span, ids: ~[ast::ident], stmts: ~[@ast::stmt]) -> @ast::expr {
631-
self.lambda(span, ids, self.blk(span, stmts, None))
631+
self.lambda(span, ids, self.block(span, stmts, None))
632632
}
633633
fn lambda_stmts_0(&self, span: span, stmts: ~[@ast::stmt]) -> @ast::expr {
634-
self.lambda0(span, self.blk(span, stmts, None))
634+
self.lambda0(span, self.block(span, stmts, None))
635635
}
636636
fn lambda_stmts_1(&self, span: span, stmts: ~[@ast::stmt], ident: ast::ident) -> @ast::expr {
637-
self.lambda1(span, self.blk(span, stmts, None), ident)
637+
self.lambda1(span, self.block(span, stmts, None), ident)
638638
}
639639

640640
fn arg(&self, span: span, ident: ast::ident, ty: ast::Ty) -> ast::arg {

src/libsyntax/ext/deriving/encodable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ fn encodable_substructure(cx: @ExtCtxt, span: span,
178178
~[cx.expr_str(span,
179179
cx.str_of(substr.type_ident)),
180180
blk]);
181-
cx.expr_blk(cx.blk(span, ~[me], Some(ret)))
181+
cx.expr_block(cx.block(span, ~[me], Some(ret)))
182182
}
183183

184184
_ => cx.bug("expected Struct or EnumMatching in deriving(Encodable)")

src/libsyntax/ext/deriving/generic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ impl<'self> MethodDef<'self> {
527527

528528
let method_ident = cx.ident_of(self.name);
529529
let fn_decl = cx.fn_decl(args, ret_type);
530-
let body_block = cx.blk_expr(body);
530+
let body_block = cx.block_expr(body);
531531

532532

533533
// Create the method.

src/libsyntax/ext/deriving/to_str.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ fn to_str_substructure(cx: @ExtCtxt, span: span,
7979
}
8080
push(cx.expr_str(span, end));
8181
82-
cx.expr_blk(cx.blk(span, stmts, Some(cx.expr_ident(span, buf))))
82+
cx.expr_block(cx.block(span, stmts, Some(cx.expr_ident(span, buf))))
8383
}
8484
};
8585

src/libsyntax/ext/fmt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,5 +323,5 @@ fn pieces_to_expr(cx: @ExtCtxt, sp: span,
323323
nargs, expected_nargs));
324324
}
325325

326-
cx.expr_blk(cx.blk(fmt_sp, stms, Some(buf())))
326+
cx.expr_block(cx.block(fmt_sp, stms, Some(buf())))
327327
}

src/libsyntax/ext/quote.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -705,11 +705,11 @@ fn expand_tts(cx: @ExtCtxt,
705705
id_ext("tt"),
706706
cx.expr_vec_uniq(sp, ~[]));
707707

708-
cx.expr_blk(
709-
cx.blk_all(sp, uses,
710-
~[stmt_let_sp,
711-
stmt_let_tt] + mk_tts(cx, sp, tts),
712-
Some(cx.expr_ident(sp, id_ext("tt")))))
708+
cx.expr_block(
709+
cx.block_all(sp, uses,
710+
~[stmt_let_sp,
711+
stmt_let_tt] + mk_tts(cx, sp, tts),
712+
Some(cx.expr_ident(sp, id_ext("tt")))))
713713
}
714714

715715
fn expand_parse_call(cx: @ExtCtxt,

0 commit comments

Comments
 (0)