Do less panicking in general

This commit is contained in:
Jonas Schievink 2016-02-19 14:43:13 +01:00
parent 3a872782d3
commit 11e0ba4340
3 changed files with 24 additions and 2 deletions

View file

@ -120,6 +120,10 @@ pub fn parse_expr_from_source_str<'a>(name: String,
p.parse_expr()
}
/// Parses an item.
///
/// Returns `Ok(Some(item))` when successful, `Ok(None)` when no item was found, and`Err`
/// when a syntax error occurred.
pub fn parse_item_from_source_str<'a>(name: String,
source: String,
cfg: ast::CrateConfig,