syntax: use lookahead to distinguish inner and outer attributes, instead of passing the latter around.
This commit is contained in:
@@ -58,14 +58,14 @@ pub fn string_to_expr (source_str : String) -> P<ast::Expr> {
|
||||
/// Parse a string, return an item
|
||||
pub fn string_to_item (source_str : String) -> Option<P<ast::Item>> {
|
||||
with_error_checking_parse(source_str, |p| {
|
||||
p.parse_item(Vec::new())
|
||||
p.parse_item()
|
||||
})
|
||||
}
|
||||
|
||||
/// Parse a string, return a stmt
|
||||
pub fn string_to_stmt(source_str : String) -> P<ast::Stmt> {
|
||||
with_error_checking_parse(source_str, |p| {
|
||||
p.parse_stmt(Vec::new())
|
||||
p.parse_stmt().unwrap()
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user