syntax: Publically expose printing where clauses, and add attr_to_string
This commit is contained in:
parent
588d37c653
commit
951db77267
2 changed files with 5 additions and 1 deletions
|
|
@ -3855,7 +3855,7 @@ impl<'a> Parser<'a> {
|
|||
/// ```
|
||||
/// where T : Trait<U, V> + 'b, 'a : 'b
|
||||
/// ```
|
||||
fn parse_where_clause(&mut self) -> PResult<ast::WhereClause> {
|
||||
pub fn parse_where_clause(&mut self) -> PResult<ast::WhereClause> {
|
||||
let mut where_clause = WhereClause {
|
||||
id: ast::DUMMY_NODE_ID,
|
||||
predicates: Vec::new(),
|
||||
|
|
|
|||
|
|
@ -352,6 +352,10 @@ pub fn stmt_to_string(stmt: &ast::Stmt) -> String {
|
|||
$to_string(|s| s.print_stmt(stmt))
|
||||
}
|
||||
|
||||
pub fn attr_to_string(attr: &ast::Attr) -> String {
|
||||
$to_string(|s| s.print_attribute(attr))
|
||||
}
|
||||
|
||||
pub fn item_to_string(i: &ast::Item) -> String {
|
||||
$to_string(|s| s.print_item(i))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue