Skip to content

Commit de5b672

Browse files
committed
---
yaml --- r: 15675 b: refs/heads/try c: bde5a84 h: refs/heads/master i: 15673: 2f7ef49 15671: bf060bb v: v3
1 parent b64c0e8 commit de5b672

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 8ab9efe262d20be8efc90535aeaf4ed9af47f400
5+
refs/heads/try: bde5a842ce286508e503694b2cac0251600e25be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/librustsyntax/parse/parser.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,13 @@ fn parse_lit(p: parser) -> ast::lit {
508508
}
509509

510510
fn parse_path_without_tps(p: parser) -> @ast::path {
511+
parse_path_without_tps_(p, parse_ident, parse_ident)
512+
}
513+
514+
fn parse_path_without_tps_(
515+
p: parser, parse_ident: fn(parser) -> ast::ident,
516+
parse_last_ident: fn(parser) -> ast::ident) -> @ast::path {
517+
511518
let lo = p.span.lo;
512519
let global = eat(p, token::MOD_SEP);
513520
let mut ids = [];
@@ -516,10 +523,11 @@ fn parse_path_without_tps(p: parser) -> @ast::path {
516523
p.look_ahead(2u) != token::LT
517524
&& p.look_ahead(1u) == token::MOD_SEP;
518525

519-
ids += [parse_ident(p)];
520526
if is_not_last {
527+
ids += [parse_ident(p)];
521528
expect(p, token::MOD_SEP);
522529
} else {
530+
ids += [parse_last_ident(p)];
523531
break;
524532
}
525533
}
@@ -528,12 +536,7 @@ fn parse_path_without_tps(p: parser) -> @ast::path {
528536
}
529537

530538
fn parse_value_path(p: parser) -> @ast::path {
531-
let pt = parse_path_without_tps(p);
532-
let last_word = vec::last(pt.idents);
533-
if is_restricted_keyword(p, last_word) {
534-
p.fatal("found " + last_word + " in expression position");
535-
}
536-
pt
539+
parse_path_without_tps_(p, parse_ident, parse_value_ident)
537540
}
538541

539542
fn parse_path_with_tps(p: parser, colons: bool) -> @ast::path {

0 commit comments

Comments
 (0)