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

Side by Side Diff: pkg/kernel/lib/verifier.dart

Issue 2990783002: Serialize typedef parameters (including function typed ones) to Kernel and use it to resynthesize t… (Closed)
Patch Set: Test for named parameters. Created 3 years, 4 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 unified diff | Download patch
« no previous file with comments | « pkg/kernel/lib/binary/ast_to_binary.dart ('k') | runtime/vm/kernel_binary_flowgraph.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 library kernel.checks; 4 library kernel.checks;
5 5
6 import 'ast.dart'; 6 import 'ast.dart';
7 import 'transformations/flags.dart'; 7 import 'transformations/flags.dart';
8 8
9 void verifyProgram(Program program) { 9 void verifyProgram(Program program) {
10 VerifyingVisitor.check(program); 10 VerifyingVisitor.check(program);
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 330
331 visitVariableDeclaration(VariableDeclaration node) { 331 visitVariableDeclaration(VariableDeclaration node) {
332 var parent = node.parent; 332 var parent = node.parent;
333 if (parent is! Block && 333 if (parent is! Block &&
334 !(parent is Catch && parent.body != node) && 334 !(parent is Catch && parent.body != node) &&
335 !(parent is FunctionNode && parent.body != node) && 335 !(parent is FunctionNode && parent.body != node) &&
336 parent is! FunctionDeclaration && 336 parent is! FunctionDeclaration &&
337 !(parent is ForStatement && parent.body != node) && 337 !(parent is ForStatement && parent.body != node) &&
338 !(parent is ForInStatement && parent.body != node) && 338 !(parent is ForInStatement && parent.body != node) &&
339 parent is! Let && 339 parent is! Let &&
340 parent is! LocalInitializer) { 340 parent is! LocalInitializer &&
341 parent is! Typedef) {
341 problem( 342 problem(
342 node, 343 node,
343 "VariableDeclaration must be a direct child of a Block, " 344 "VariableDeclaration must be a direct child of a Block, "
344 "not ${parent.runtimeType}."); 345 "not ${parent.runtimeType}.");
345 } 346 }
346 visitChildren(node); 347 visitChildren(node);
347 declareVariable(node); 348 declareVariable(node);
348 } 349 }
349 350
350 visitVariableGet(VariableGet node) { 351 visitVariableGet(VariableGet node) {
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 var oldParent = parent; 602 var oldParent = parent;
602 parent = node; 603 parent = node;
603 node.visitChildren(this); 604 node.visitChildren(this);
604 parent = oldParent; 605 parent = oldParent;
605 } 606 }
606 } 607 }
607 608
608 void checkInitializers(Constructor constructor) { 609 void checkInitializers(Constructor constructor) {
609 // TODO(ahe): I'll add more here in other CLs. 610 // TODO(ahe): I'll add more here in other CLs.
610 } 611 }
OLDNEW
« no previous file with comments | « pkg/kernel/lib/binary/ast_to_binary.dart ('k') | runtime/vm/kernel_binary_flowgraph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698