diff options
| author | Luca Bruno <lucab@debian.org> | 2013-01-19 16:52:06 +0100 |
|---|---|---|
| committer | Luca Bruno <lucab@debian.org> | 2013-03-19 14:02:59 +0100 |
| commit | 0a34a3f0f52cc353bb08efa2005bf92cb7d4921f (patch) | |
| tree | b99c56738c12f6693b2aa37a3d54d1416c7e1be5 /src/libsyntax | |
| parent | e67448d397ed8f468170d6fba95ceae081ece624 (diff) | |
| download | rust-0a34a3f0f52cc353bb08efa2005bf92cb7d4921f.tar.gz rust-0a34a3f0f52cc353bb08efa2005bf92cb7d4921f.zip | |
Make driver::driver::parse_cfgspecs parse any variety of meta_item
All current meta items types (word, name-value, list) are now properly parsed by rustc --cfg command line. Fixes #2399 Signed-off-by: Luca Bruno <lucab@debian.org>
Diffstat (limited to 'src/libsyntax')
| -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, |
