diff options
| author | bors <bors@rust-lang.org> | 2013-03-19 10:43:24 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-03-19 10:43:24 -0700 |
| commit | 58209910bd70512e4a880bb25ed296dddc48e0b7 (patch) | |
| tree | 874668fcd758e9f3b1badbaa53a9c73a729d2db3 /src/libsyntax/parse | |
| parent | 3c84bac9462ae853b32f55fcaca2613a7e392d41 (diff) | |
| parent | 0a34a3f0f52cc353bb08efa2005bf92cb7d4921f (diff) | |
| download | rust-58209910bd70512e4a880bb25ed296dddc48e0b7.tar.gz rust-58209910bd70512e4a880bb25ed296dddc48e0b7.zip | |
auto merge of #5433 : lucab/rust/lucab/cfgspec, r=graydon
All current meta items types (word, name-value, list) are now properly parsed by rustc --cfg command line. Fixes #2399
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 66a3ae7a2ae..a133befb046 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -139,6 +139,22 @@ pub fn parse_item_from_source_str( maybe_aborted(p.parse_item(attrs),p) } +pub fn parse_meta_from_source_str( + name: ~str, + source: @~str, + +cfg: ast::crate_cfg, + sess: @mut ParseSess +) -> @ast::meta_item { + let p = new_parser_from_source_str( + sess, + cfg, + /*bad*/ copy name, + codemap::FssNone, + source + ); + maybe_aborted(p.parse_meta_item(),p) +} + pub fn parse_stmt_from_source_str( name: ~str, source: @~str, |
