Chromium Code Reviews| Index: runtime/vm/parser.cc |
| diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc |
| index fbd10686c53669b1b1c0611dcb28a82f702477a5..7c4c28f95437a33c4c593f2a35ed5a704ce3ea23 100644 |
| --- a/runtime/vm/parser.cc |
| +++ b/runtime/vm/parser.cc |
| @@ -855,9 +855,17 @@ RawObject* Parser::ParseMetadata(const Class& cls, intptr_t token_pos) { |
| isolate->set_long_jump_base(&jump); |
| if (setjmp(*jump.Set()) == 0) { |
| const Script& script = Script::Handle(cls.script()); |
| - const Library& lib = Library::Handle(cls.library()); |
| - Parser parser(script, lib, token_pos); |
| - parser.set_current_class(cls); |
| + const Function& func = Function::ZoneHandle(Function::New( |
| + Symbols::Empty(), |
| + RawFunction::kRegularFunction, |
| + true, // is_static |
| + false, // is_const |
| + false, // is_abstract |
| + false, // is_external |
| + cls, |
| + token_pos)); |
| + ParsedFunction* parsed_function = new ParsedFunction(func); |
| + Parser parser(script, parsed_function, token_pos); |
| return parser.EvaluateMetadata(); |
| } else { |
| Error& error = Error::Handle(); |
| @@ -870,7 +878,7 @@ RawObject* Parser::ParseMetadata(const Class& cls, intptr_t token_pos) { |
| return Object::null(); |
| } |
| - |
| +// ZED |
| RawArray* Parser::EvaluateMetadata() { |
| if (CurrentToken() != Token::kAT) { |
| ErrorMsg("Metadata character '@' expected"); |
| @@ -893,6 +901,7 @@ RawArray* Parser::EvaluateMetadata() { |
| expr = ParseNewOperator(Token::kCONST); |
| } else { |
| expr = ParsePrimary(); |
| + expr = ParseSelectors(expr, false); |
|
rmacnak
2013/10/24 18:45:03
Expects a valid current_function.
hausner
2013/10/24 18:54:05
You can't use this function here, or you'd accept
|
| } |
| if (expr->EvalConstExpr() == NULL) { |
| ErrorMsg(expr_pos, "expression must be a compile-time constant"); |