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

Side by Side Diff: lib/src/codegen/ast_builder.dart

Issue 1840713003: fix to run against latest analyzer (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 4
5 import 'package:analyzer/dart/ast/ast.dart'; 5 import 'package:analyzer/dart/ast/ast.dart';
6 import 'package:analyzer/dart/ast/token.dart'; 6 import 'package:analyzer/dart/ast/token.dart';
7 import 'package:analyzer/src/dart/ast/token.dart'; 7 import 'package:analyzer/src/dart/ast/token.dart';
8 import 'package:analyzer/src/generated/utilities_dart.dart'; 8 import 'package:analyzer/src/generated/utilities_dart.dart';
9 import 'package:logging/logging.dart' as logger; 9 import 'package:logging/logging.dart' as logger;
10 10
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 static BlockFunctionBody blockFunctionBody(Block b) { 518 static BlockFunctionBody blockFunctionBody(Block b) {
519 return new BlockFunctionBody(null, null, b); 519 return new BlockFunctionBody(null, null, b);
520 } 520 }
521 521
522 static ExpressionFunctionBody expressionFunctionBody(Expression body, 522 static ExpressionFunctionBody expressionFunctionBody(Expression body,
523 [bool decl = false]) { 523 [bool decl = false]) {
524 Token semi = (decl) ? new Token(TokenType.SEMICOLON, 0) : null; 524 Token semi = (decl) ? new Token(TokenType.SEMICOLON, 0) : null;
525 return new ExpressionFunctionBody(null, null, body, semi); 525 return new ExpressionFunctionBody(null, null, body, semi);
526 } 526 }
527 527
528 static ExpressionStatement expressionStatement(Expression expression) {
529 Token semi = new Token(TokenType.SEMICOLON, 0);
530 return new ExpressionStatement(expression, semi);
531 }
532
528 static FunctionDeclaration functionDeclaration( 533 static FunctionDeclaration functionDeclaration(
529 TypeName rt, SimpleIdentifier f, FunctionExpression fexp) { 534 TypeName rt, SimpleIdentifier f, FunctionExpression fexp) {
530 return new FunctionDeclaration(null, null, null, rt, null, f, fexp); 535 return new FunctionDeclaration(null, null, null, rt, null, f, fexp);
531 } 536 }
532 537
533 static MethodDeclaration methodDeclaration(TypeName rt, SimpleIdentifier m, 538 static MethodDeclaration methodDeclaration(TypeName rt, SimpleIdentifier m,
534 FormalParameterList fl, FunctionBody body, 539 FormalParameterList fl, FunctionBody body,
535 {bool isStatic: false}) { 540 {bool isStatic: false}) {
536 Token st = isStatic ? new KeywordToken(Keyword.STATIC, 0) : null; 541 Token st = isStatic ? new KeywordToken(Keyword.STATIC, 0) : null;
537 return new MethodDeclaration( 542 return new MethodDeclaration(
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 Label l = new Label(s, new Token(TokenType.COLON, 0)); 590 Label l = new Label(s, new Token(TokenType.COLON, 0));
586 return new NamedExpression(l, e); 591 return new NamedExpression(l, e);
587 } 592 }
588 593
589 static VariableDeclarationStatement variableDeclarationStatement( 594 static VariableDeclarationStatement variableDeclarationStatement(
590 VariableDeclarationList varDecl) { 595 VariableDeclarationList varDecl) {
591 var semi = new Token(TokenType.SEMICOLON, 0); 596 var semi = new Token(TokenType.SEMICOLON, 0);
592 return new VariableDeclarationStatement(varDecl, semi); 597 return new VariableDeclarationStatement(varDecl, semi);
593 } 598 }
594 } 599 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698