Skip to content

Commit 325a602

Browse files
committed
---
yaml --- r: 23004 b: refs/heads/master c: 517ad98 h: refs/heads/master v: v3
1 parent 1ce320c commit 325a602

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 4544c015b3bd45b18612ede3e0c091ec3ee27e8a
2+
refs/heads/master: 517ad983f9f5ac7f805dd15cf6c6a156e02e3ec8
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/src/libsyntax/ext/tt/macro_rules.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ fn add_new_extension(cx: ext_ctxt, sp: span, name: ident,
7373
~[rhs]);
7474
let p = parser(cx.parse_sess(), cx.cfg(),
7575
trncbr as reader, SOURCE_FILE);
76-
return mr_expr(p.parse_expr());
76+
let e = p.parse_expr();
77+
return mr_expr(e);
7778
}
7879
failure(sp, msg) => if sp.lo >= best_fail_spot.lo {
7980
best_fail_spot = sp;

trunk/src/libsyntax/parse/parser.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import print::pprust::expr_to_str;
33
import result::result;
44
import either::{either, left, right};
55
import std::map::{hashmap, str_hash};
6-
import token::{can_begin_expr, is_ident, is_plain_ident, INTERPOLATED};
6+
import token::{can_begin_expr, is_ident, is_ident_or_path, is_plain_ident,
7+
INTERPOLATED};
78
import codemap::{span,fss_none};
89
import util::interner;
910
import ast_util::{spanned, respan, mk_sp, ident_to_path, operator_prec};
@@ -1748,7 +1749,7 @@ class parser {
17481749
}
17491750
}
17501751
tok => {
1751-
if !is_ident(tok) ||
1752+
if !is_ident_or_path(tok) ||
17521753
self.is_keyword(~"true") || self.is_keyword(~"false") {
17531754
let val = self.parse_expr_res(RESTRICT_NO_BAR_OP);
17541755
if self.eat_keyword(~"to") {

trunk/src/libsyntax/parse/token.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,13 @@ pure fn is_ident(t: token) -> bool {
262262
alt t { IDENT(_, _) => true, _ => false }
263263
}
264264

265+
pure fn is_ident_or_path(t: token) -> bool {
266+
alt t {
267+
IDENT(_, _) | INTERPOLATED(nt_path(*)) => true,
268+
_ => false
269+
}
270+
}
271+
265272
pure fn is_plain_ident(t: token) -> bool {
266273
alt t { IDENT(_, false) => true, _ => false }
267274
}

0 commit comments

Comments
 (0)