syntax: use lookahead to distinguish inner and outer attributes, instead of passing the latter around.

This commit is contained in:
Eduard Burtescu
2015-03-13 11:34:51 +02:00
parent 79dd393a4f
commit 9889aae13e
11 changed files with 325 additions and 512 deletions

View File

@@ -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()
})
}