Change ast::meta_name_value to accept any literal, not just string

This isn't useful for much of anything yet, since metadata::encoder doesn't
know how to handle the non-string variants.

Issue #611
This commit is contained in:
Brian Anderson 2011-07-05 17:01:23 -07:00
parent 8261d2e6fb
commit 2cb129355b
10 changed files with 94 additions and 51 deletions

View file

@ -2172,17 +2172,9 @@ fn parse_meta_item(&parser p) -> @ast::meta_item {
alt (p.peek()) {
case (token::EQ) {
p.bump();
alt (p.peek()) {
case (token::LIT_STR(?s)) {
p.bump();
auto value = p.get_str(s);
auto hi = p.get_hi_pos();
ret @spanned(lo, hi, ast::meta_name_value(ident, value));
}
case (_) {
p.fatal("Metadata items must be string literals");
}
}
auto lit = parse_lit(p);
auto hi = p.get_hi_pos();
ret @spanned(lo, hi, ast::meta_name_value(ident, lit));
}
case (token::LPAREN) {
auto inner_items = parse_meta_seq(p);