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

Side by Side Diff: pkg/js_ast/lib/src/builder.dart

Issue 1140703006: dart2js: Construct the entire output as a single AST before printing. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Comments Created 5 years, 7 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/dart2js_incremental/lib/caching_compiler.dart ('k') | pkg/js_ast/lib/src/printer.dart » ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // Utilities for building JS ASTs at runtime. Contains a builder class 5 // Utilities for building JS ASTs at runtime. Contains a builder class
6 // and a parser that parses part of the language. 6 // and a parser that parses part of the language.
7 7
8 part of js_ast; 8 part of js_ast;
9 9
10 10
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 } 322 }
323 323
324 /// Creates a literal js string from [value]. 324 /// Creates a literal js string from [value].
325 /// 325 ///
326 /// Note that this function only puts quotes around [value]. It does not do 326 /// Note that this function only puts quotes around [value]. It does not do
327 /// any escaping, so use only when you can guarantee that [value] does not 327 /// any escaping, so use only when you can guarantee that [value] does not
328 /// contain newlines or backslashes. For escaping the string use 328 /// contain newlines or backslashes. For escaping the string use
329 /// [escapedString]. 329 /// [escapedString].
330 LiteralString string(String value) => new LiteralString('"$value"'); 330 LiteralString string(String value) => new LiteralString('"$value"');
331 331
332 LiteralString name(String name) => new LiteralString(name);
333
334 LiteralNumber number(num value) => new LiteralNumber('$value'); 332 LiteralNumber number(num value) => new LiteralNumber('$value');
335 333
336 LiteralBool boolean(bool value) => new LiteralBool(value); 334 LiteralBool boolean(bool value) => new LiteralBool(value);
337 335
338 ArrayInitializer numArray(Iterable<int> list) => 336 ArrayInitializer numArray(Iterable<int> list) =>
339 new ArrayInitializer(list.map(number).toList()); 337 new ArrayInitializer(list.map(number).toList());
340 338
341 ArrayInitializer stringArray(Iterable<String> list) => 339 ArrayInitializer stringArray(Iterable<String> list) =>
342 new ArrayInitializer(list.map(string).toList()); 340 new ArrayInitializer(list.map(string).toList());
343 341
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1343 1341
1344 Catch parseCatch() { 1342 Catch parseCatch() {
1345 expectCategory(LPAREN); 1343 expectCategory(LPAREN);
1346 Declaration errorName = parseVariableDeclaration(); 1344 Declaration errorName = parseVariableDeclaration();
1347 expectCategory(RPAREN); 1345 expectCategory(RPAREN);
1348 expectCategory(LBRACE); 1346 expectCategory(LBRACE);
1349 Block body = parseBlock(); 1347 Block body = parseBlock();
1350 return new Catch(errorName, body); 1348 return new Catch(errorName, body);
1351 } 1349 }
1352 } 1350 }
OLDNEW
« no previous file with comments | « pkg/dart2js_incremental/lib/caching_compiler.dart ('k') | pkg/js_ast/lib/src/printer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698