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>
This commit is contained in:
parent
e67448d397
commit
0a34a3f0f5
2 changed files with 24 additions and 8 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue