Skip to content

Commit

Permalink
Rollup merge of rust-lang#51664 - jebrosen:pub_parse_methods2, r=Mark…
Browse files Browse the repository at this point in the history
…-Simulacrum

make more libsyntax methods public

Followup for rust-lang#51502, which was sufficient only for the latest stable release of Rocket. The `master` branch uses a few more. I plan to reimplement the deleted method `parse_seq` in Rocket (see rwf2/Rocket#666), rather than resurrecting it in libsyntax.

r? @Mark-Simulacrum
  • Loading branch information
kennytm authored Jun 22, 2018
2 parents e920d21 + 2dcafef commit bac6cc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,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<T, F>(&mut self,
pub fn parse_seq_to_before_end<T, F>(&mut self,
ket: &token::Token,
sep: SeqSep,
f: F)
Expand Down Expand Up @@ -2117,7 +2117,7 @@ impl<'a> Parser<'a> {
ExprKind::AssignOp(binop, lhs, rhs)
}

fn mk_mac_expr(&mut self, span: Span, m: Mac_, attrs: ThinVec<Attribute>) -> P<Expr> {
pub fn mk_mac_expr(&mut self, span: Span, m: Mac_, attrs: ThinVec<Attribute>) -> P<Expr> {
P(Expr {
id: ast::DUMMY_NODE_ID,
node: ExprKind::Mac(codemap::Spanned {node: m, span: span}),
Expand Down Expand Up @@ -7226,7 +7226,7 @@ impl<'a> Parser<'a> {
})
}

fn parse_optional_str(&mut self) -> Option<(Symbol, ast::StrStyle, Option<ast::Name>)> {
pub fn parse_optional_str(&mut self) -> Option<(Symbol, ast::StrStyle, Option<ast::Name>)> {
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),
Expand Down

0 comments on commit bac6cc9

Please sign in to comment.