Skip to content

Commit bac6cc9

Browse files
authored
Rollup merge of rust-lang#51664 - jebrosen:pub_parse_methods2, r=Mark-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
2 parents e920d21 + 2dcafef commit bac6cc9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libsyntax/parse/parser.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@ impl<'a> Parser<'a> {
10571057
/// Parse a sequence, not including the closing delimiter. The function
10581058
/// f must consume tokens until reaching the next separator or
10591059
/// closing bracket.
1060-
fn parse_seq_to_before_end<T, F>(&mut self,
1060+
pub fn parse_seq_to_before_end<T, F>(&mut self,
10611061
ket: &token::Token,
10621062
sep: SeqSep,
10631063
f: F)
@@ -2117,7 +2117,7 @@ impl<'a> Parser<'a> {
21172117
ExprKind::AssignOp(binop, lhs, rhs)
21182118
}
21192119

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

7229-
fn parse_optional_str(&mut self) -> Option<(Symbol, ast::StrStyle, Option<ast::Name>)> {
7229+
pub fn parse_optional_str(&mut self) -> Option<(Symbol, ast::StrStyle, Option<ast::Name>)> {
72307230
let ret = match self.token {
72317231
token::Literal(token::Str_(s), suf) => (s, ast::StrStyle::Cooked, suf),
72327232
token::Literal(token::StrRaw(s, n), suf) => (s, ast::StrStyle::Raw(n), suf),

0 commit comments

Comments
 (0)