OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
6 * Top level generator object for writing code and keeping track of | 6 * Top level generator object for writing code and keeping track of |
7 * dependencies. | 7 * dependencies. |
8 * | 8 * |
9 * Should have two compilation models, but only one implemented so far. | 9 * Should have two compilation models, but only one implemented so far. |
10 * | 10 * |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 } | 1280 } |
1281 | 1281 |
1282 // We're done! Write the final code. | 1282 // We're done! Write the final code. |
1283 savedWriter.write(writer.text); | 1283 savedWriter.write(writer.text); |
1284 writer = savedWriter; | 1284 writer = savedWriter; |
1285 savedCounters.add(counters); | 1285 savedCounters.add(counters); |
1286 counters = savedCounters; | 1286 counters = savedCounters; |
1287 } | 1287 } |
1288 | 1288 |
1289 MethodMember _makeLambdaMethod(String name, FunctionDefinition func) { | 1289 MethodMember _makeLambdaMethod(String name, FunctionDefinition func) { |
1290 var meth = new MethodMember(name, method.declaringType, func); | 1290 var meth = new MethodMember.lambda(name, method.declaringType, func); |
1291 meth.isLambda = true; | |
1292 meth.enclosingElement = method; | 1291 meth.enclosingElement = method; |
1293 meth._methodData = new MethodData(meth, this); | 1292 meth._methodData = new MethodData(meth, this); |
1294 meth.resolve(); | 1293 meth.resolve(); |
1295 return meth; | 1294 return meth; |
1296 } | 1295 } |
1297 | 1296 |
1298 visitBool(Expression node) { | 1297 visitBool(Expression node) { |
1299 // Boolean conversions in if/while/do/for/conditions require non-null bool. | 1298 // Boolean conversions in if/while/do/for/conditions require non-null bool. |
1300 | 1299 |
1301 // TODO(jmesserly): why do we have this rule? It seems inconsistent with | 1300 // TODO(jmesserly): why do we have this rule? It seems inconsistent with |
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2450 return true; | 2449 return true; |
2451 } | 2450 } |
2452 | 2451 |
2453 } | 2452 } |
2454 | 2453 |
2455 class ReturnKind { | 2454 class ReturnKind { |
2456 static final int IGNORE = 1; | 2455 static final int IGNORE = 1; |
2457 static final int POST = 2; | 2456 static final int POST = 2; |
2458 static final int PRE = 3; | 2457 static final int PRE = 3; |
2459 } | 2458 } |
OLD | NEW |