From cafe9d0ed404e940a1f039e25053f11f47e88973 Mon Sep 17 00:00:00 2001 From: Seiichi Uchida Date: Tue, 19 Jun 2018 14:04:16 +0900 Subject: Do not consume semicolon twice while parsing local statement --- src/libsyntax/parse/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 530094e22f2..3500deedde9 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4700,7 +4700,7 @@ impl<'a> Parser<'a> { if macro_legacy_warnings && self.token != token::Semi { self.warn_missing_semicolon(); } else { - self.expect_one_of(&[token::Semi], &[])?; + self.expect_one_of(&[], &[token::Semi])?; } } _ => {} -- cgit 1.4.1-3-g733a5 From 2dcafef621f464e61d7e649ae854d416d704a7c3 Mon Sep 17 00:00:00 2001 From: jeb Date: Wed, 20 Jun 2018 08:19:05 -1000 Subject: make `parse_seq_to_before_end`, `mk_mac_expr`, and `parse_optional_str` public in libsyntax --- src/libsyntax/parse/parser.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 1735951da2f..818a176ee65 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1037,7 +1037,7 @@ impl<'a> Parser<'a> { /// Parse a sequence, not including the closing delimiter. The function /// f must consume tokens until reaching the next separator or /// closing bracket. - fn parse_seq_to_before_end(&mut self, + pub fn parse_seq_to_before_end(&mut self, ket: &token::Token, sep: SeqSep, f: F) @@ -2108,7 +2108,7 @@ impl<'a> Parser<'a> { ExprKind::AssignOp(binop, lhs, rhs) } - fn mk_mac_expr(&mut self, span: Span, m: Mac_, attrs: ThinVec) -> P { + pub fn mk_mac_expr(&mut self, span: Span, m: Mac_, attrs: ThinVec) -> P { P(Expr { id: ast::DUMMY_NODE_ID, node: ExprKind::Mac(codemap::Spanned {node: m, span: span}), @@ -7212,7 +7212,7 @@ impl<'a> Parser<'a> { }) } - fn parse_optional_str(&mut self) -> Option<(Symbol, ast::StrStyle, Option)> { + pub fn parse_optional_str(&mut self) -> Option<(Symbol, ast::StrStyle, Option)> { let ret = match self.token { token::Literal(token::Str_(s), suf) => (s, ast::StrStyle::Cooked, suf), token::Literal(token::StrRaw(s, n), suf) => (s, ast::StrStyle::Raw(n), suf), -- cgit 1.4.1-3-g733a5