| 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 library fasta.parser.parser; | 5 library fasta.parser.parser; |
| 6 | 6 |
| 7 import '../fasta_codes.dart' show FastaCode, FastaMessage; | 7 import '../fasta_codes.dart' show FastaCode, FastaMessage; |
| 8 | 8 |
| 9 import '../fasta_codes.dart' as fasta; | 9 import '../fasta_codes.dart' as fasta; |
| 10 | 10 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 /// that couldn't be implemented in the Dart language and needed to be | 273 /// that couldn't be implemented in the Dart language and needed to be |
| 274 /// implemented in JavaScript or C++, respectively. An example of the syntax | 274 /// implemented in JavaScript or C++, respectively. An example of the syntax |
| 275 /// extension used by the Dart VM is: | 275 /// extension used by the Dart VM is: |
| 276 /// | 276 /// |
| 277 /// nativeFunction() native "NativeFunction"; | 277 /// nativeFunction() native "NativeFunction"; |
| 278 /// | 278 /// |
| 279 /// When attempting to parse this function, the parser eventually calls | 279 /// When attempting to parse this function, the parser eventually calls |
| 280 /// [parseFunctionBody]. This method will report an unrecoverable error to the | 280 /// [parseFunctionBody]. This method will report an unrecoverable error to the |
| 281 /// listener with the code [fasta.codeExpectedFunctionBody]. The listener can | 281 /// listener with the code [fasta.codeExpectedFunctionBody]. The listener can |
| 282 /// then look at the error code and the token and use the methods in | 282 /// then look at the error code and the token and use the methods in |
| 283 /// [native_support.dart](native_support.dart) to parse the native syntax. | 283 /// [dart_vm_native.dart](dart_vm_native.dart) to parse the native syntax. |
| 284 /// | 284 /// |
| 285 /// #### Implementation of Diet Parsing | 285 /// #### Implementation of Diet Parsing |
| 286 /// | 286 /// |
| 287 /// We call it _diet_ _parsing_ when the parser skips parts of a file. Both | 287 /// We call it _diet_ _parsing_ when the parser skips parts of a file. Both |
| 288 /// dart2js and the Dart VM have been relying on this from early on as it allows | 288 /// dart2js and the Dart VM have been relying on this from early on as it allows |
| 289 /// them to more quickly compile small programs that use small parts of big | 289 /// them to more quickly compile small programs that use small parts of big |
| 290 /// libraries. It's also become an integrated part of how Fasta builds up | 290 /// libraries. It's also become an integrated part of how Fasta builds up |
| 291 /// outlines before starting to parse method bodies. | 291 /// outlines before starting to parse method bodies. |
| 292 /// | 292 /// |
| 293 /// When looking through this parser, you'll find a number of unused methods | 293 /// When looking through this parser, you'll find a number of unused methods |
| (...skipping 3855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4149 return reportUnrecoverableError( | 4149 return reportUnrecoverableError( |
| 4150 token, () => code.format(uri, token.charOffset, string)); | 4150 token, () => code.format(uri, token.charOffset, string)); |
| 4151 } | 4151 } |
| 4152 } | 4152 } |
| 4153 | 4153 |
| 4154 typedef FastaMessage NoArgument(Uri uri, int charOffset); | 4154 typedef FastaMessage NoArgument(Uri uri, int charOffset); |
| 4155 | 4155 |
| 4156 typedef FastaMessage TokenArgument(Uri uri, int charOffset, Token token); | 4156 typedef FastaMessage TokenArgument(Uri uri, int charOffset, Token token); |
| 4157 | 4157 |
| 4158 typedef FastaMessage StringArgument(Uri uri, int charOffset, String string); | 4158 typedef FastaMessage StringArgument(Uri uri, int charOffset, String string); |
| OLD | NEW |