]> git.lizzy.rs Git - rust.git/commitdiff
syntax: Publically expose printing where clauses, and add attr_to_string
authorErick Tryzelaar <erick.tryzelaar@gmail.com>
Mon, 13 Apr 2015 17:22:15 +0000 (10:22 -0700)
committerErick Tryzelaar <erick.tryzelaar@gmail.com>
Mon, 13 Apr 2015 17:49:34 +0000 (10:49 -0700)
src/libsyntax/parse/parser.rs
src/libsyntax/print/pprust.rs

index a3dd77b8197dc187b8a24d58189a9ba33550cbf5..e45b7c1df91ca69aba6dfb84d00870cc32284eec 100644 (file)
@@ -3855,7 +3855,7 @@ fn forbid_lifetime(&mut self) -> PResult<()> {
     /// ```
     /// 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(),
index 46d196d13fa72f4c9191c872835e0f89ba681dfa..cb743eff36c043078787caee1aa46a4171547a1f 100644 (file)
@@ -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))
 }