Skip to content

Commit 3682ac3

Browse files
committed
---
yaml --- r: 274774 b: refs/heads/stable c: 798974c h: refs/heads/master
1 parent bdd9c14 commit 3682ac3

File tree

8 files changed

+19
-18
lines changed

8 files changed

+19
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: c0221c8897db309a79990367476177b1230bb264
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32-
refs/heads/stable: 019614f03d106324ab50a37746b556c41e66c099
32+
refs/heads/stable: 798974cae58639c174010fd4a6411dcdc860e404
3333
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
3434
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
3535
refs/tags/1.2.0: f557861f822c34f07270347b94b5280de20a597e

branches/stable/src/libsyntax/ast.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// The Rust abstract syntax tree.
1212

13-
pub use self::KleeneOp::*;
1413
pub use self::MacStmtStyle::*;
1514
pub use self::MetaItem_::*;
1615
pub use self::Mutability::*;

branches/stable/src/libsyntax/ext/quote.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -542,11 +542,6 @@ fn mk_tt_path(cx: &ExtCtxt, sp: Span, name: &str) -> P<ast::Expr> {
542542
cx.expr_path(cx.path_global(sp, idents))
543543
}
544544

545-
fn mk_ast_path(cx: &ExtCtxt, sp: Span, name: &str) -> P<ast::Expr> {
546-
let idents = vec!(id_ext("syntax"), id_ext("ast"), id_ext(name));
547-
cx.expr_path(cx.path_global(sp, idents))
548-
}
549-
550545
fn mk_token_path(cx: &ExtCtxt, sp: Span, name: &str) -> P<ast::Expr> {
551546
let idents = vec!(id_ext("syntax"), id_ext("parse"), id_ext("token"), id_ext(name));
552547
cx.expr_path(cx.path_global(sp, idents))
@@ -779,9 +774,16 @@ fn statements_mk_tt(cx: &ExtCtxt, tt: &TokenTree, matcher: bool) -> Vec<P<ast::S
779774
None => cx.expr_none(sp),
780775
};
781776
let e_op = match seq.op {
782-
ast::ZeroOrMore => mk_ast_path(cx, sp, "ZeroOrMore"),
783-
ast::OneOrMore => mk_ast_path(cx, sp, "OneOrMore"),
777+
ast::KleeneOp::ZeroOrMore => "ZeroOrMore",
778+
ast::KleeneOp::OneOrMore => "OneOrMore",
784779
};
780+
let e_op_idents = vec![
781+
id_ext("syntax"),
782+
id_ext("ast"),
783+
id_ext("KleeneOp"),
784+
id_ext(e_op),
785+
];
786+
let e_op = cx.expr_path(cx.path_global(sp, e_op_idents));
785787
let fields = vec![cx.field_imm(sp, id_ext("tts"), e_tts),
786788
cx.field_imm(sp, id_ext("separator"), e_separator),
787789
cx.field_imm(sp, id_ext("op"), e_op),

branches/stable/src/libsyntax/ext/tt/macro_parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ pub fn parse(sess: &ParseSess,
374374
match ei.top_elts.get_tt(idx) {
375375
/* need to descend into sequence */
376376
TokenTree::Sequence(sp, seq) => {
377-
if seq.op == ast::ZeroOrMore {
377+
if seq.op == ast::KleeneOp::ZeroOrMore {
378378
let mut new_ei = ei.clone();
379379
new_ei.match_cur += seq.num_captures;
380380
new_ei.idx += 1;

branches/stable/src/libsyntax/ext/tt/macro_rules.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ pub fn compile<'cx>(cx: &'cx mut ExtCtxt,
248248
TokenTree::Token(DUMMY_SP, token::FatArrow),
249249
TokenTree::Token(DUMMY_SP, match_rhs_tok)],
250250
separator: Some(token::Semi),
251-
op: ast::OneOrMore,
251+
op: ast::KleeneOp::OneOrMore,
252252
num_captures: 2
253253
})),
254254
//to phase into semicolon-termination instead of
@@ -257,7 +257,7 @@ pub fn compile<'cx>(cx: &'cx mut ExtCtxt,
257257
Rc::new(ast::SequenceRepetition {
258258
tts: vec![TokenTree::Token(DUMMY_SP, token::Semi)],
259259
separator: None,
260-
op: ast::ZeroOrMore,
260+
op: ast::KleeneOp::ZeroOrMore,
261261
num_captures: 0
262262
})));
263263

branches/stable/src/libsyntax/ext/tt/transcribe.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub fn new_tt_reader_with_doc_flag<'a>(sp_diag: &'a Handler,
8181
forest: TokenTree::Sequence(DUMMY_SP, Rc::new(ast::SequenceRepetition {
8282
tts: src,
8383
// doesn't matter. This merely holds the root unzipping.
84-
separator: None, op: ast::ZeroOrMore, num_captures: 0
84+
separator: None, op: ast::KleeneOp::ZeroOrMore, num_captures: 0
8585
})),
8686
idx: 0,
8787
dotdotdoted: false,
@@ -257,7 +257,7 @@ pub fn tt_next_token(r: &mut TtReader) -> TokenAndSpan {
257257
}
258258
LisConstraint(len, _) => {
259259
if len == 0 {
260-
if seq.op == ast::OneOrMore {
260+
if seq.op == ast::KleeneOp::OneOrMore {
261261
// FIXME #2887 blame invoker
262262
panic!(r.sp_diag.span_fatal(sp.clone(),
263263
"this must repeat at least once"));

branches/stable/src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2599,11 +2599,11 @@ impl<'a> Parser<'a> {
25992599
match parser.token {
26002600
token::BinOp(token::Star) => {
26012601
parser.bump();
2602-
Ok(Some(ast::ZeroOrMore))
2602+
Ok(Some(ast::KleeneOp::ZeroOrMore))
26032603
},
26042604
token::BinOp(token::Plus) => {
26052605
parser.bump();
2606-
Ok(Some(ast::OneOrMore))
2606+
Ok(Some(ast::KleeneOp::OneOrMore))
26072607
},
26082608
_ => Ok(None)
26092609
}

branches/stable/src/libsyntax/print/pprust.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,8 +1489,8 @@ impl<'a> State<'a> {
14891489
None => {},
14901490
}
14911491
match seq.op {
1492-
ast::ZeroOrMore => word(&mut self.s, "*"),
1493-
ast::OneOrMore => word(&mut self.s, "+"),
1492+
ast::KleeneOp::ZeroOrMore => word(&mut self.s, "*"),
1493+
ast::KleeneOp::OneOrMore => word(&mut self.s, "+"),
14941494
}
14951495
}
14961496
}

0 commit comments

Comments
 (0)