| 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 package com.google.dart.compiler; | 5 package com.google.dart.compiler; |
| 6 | 6 |
| 7 import com.google.common.collect.Lists; | 7 import com.google.common.collect.Lists; |
| 8 import com.google.common.collect.Maps; | 8 import com.google.common.collect.Maps; |
| 9 import com.google.common.collect.Sets; | 9 import com.google.common.collect.Sets; |
| 10 import com.google.common.collect.Sets.SetView; | 10 import com.google.common.collect.Sets.SetView; |
| (...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 852 String srcCode; | 852 String srcCode; |
| 853 boolean failed = true; | 853 boolean failed = true; |
| 854 try { | 854 try { |
| 855 try { | 855 try { |
| 856 srcCode = CharStreams.toString(r); | 856 srcCode = CharStreams.toString(r); |
| 857 failed = false; | 857 failed = false; |
| 858 } finally { | 858 } finally { |
| 859 Closeables.close(r, failed); | 859 Closeables.close(r, failed); |
| 860 } | 860 } |
| 861 | 861 |
| 862 // auto-magically define "assert" function | 862 // auto-magically define function to use instead of "assert" statement |
| 863 if (dartSrc.getUri().toString().equals("dart://core/object.dart")) { | 863 if (dartSrc.getUri().toString().equals("dart://core/object.dart")) { |
| 864 srcCode += "\nvoid assert(x) {}"; | 864 srcCode += "\nvoid " + Elements.ASSERT_FUNCTION_NAME + "(x) {}"; |
| 865 } | 865 } |
| 866 | 866 |
| 867 // inject "Type" type from 1.0 M1 specification | 867 // inject "Type" type from 1.0 M1 specification |
| 868 // remove once it will be added into SDK | 868 // remove once it will be added into SDK |
| 869 // http://code.google.com/p/dart/issues/detail?id=3368 | 869 // http://code.google.com/p/dart/issues/detail?id=3368 |
| 870 if (dartSrc.getUri().toString().equals("dart://core/object.dart")) { | 870 if (dartSrc.getUri().toString().equals("dart://core/object.dart")) { |
| 871 srcCode += "\nclass Type {}"; | 871 srcCode += "\nclass Type {}"; |
| 872 } | 872 } |
| 873 | 873 |
| 874 DartParser parser = new DartParser(dartSrc, srcCode, diet, libraryPrefix
es, context, | 874 DartParser parser = new DartParser(dartSrc, srcCode, diet, libraryPrefix
es, context, |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 return br.readLine(); | 1392 return br.readLine(); |
| 1393 } finally { | 1393 } finally { |
| 1394 br.close(); | 1394 br.close(); |
| 1395 } | 1395 } |
| 1396 } | 1396 } |
| 1397 } catch (Throwable e) { | 1397 } catch (Throwable e) { |
| 1398 } | 1398 } |
| 1399 return null; | 1399 return null; |
| 1400 } | 1400 } |
| 1401 } | 1401 } |
| OLD | NEW |