Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Unified Diff: runtime/vm/parser.cc

Issue 40863002: Handle metadata with type literals or qualified identifiers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/lib/mirrors/metadata_with_type_literal_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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");
« no previous file with comments | « no previous file | tests/lib/mirrors/metadata_with_type_literal_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698