| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 analyzer.src.dart.scanner.scanner; | 5 library analyzer.src.dart.scanner.scanner; |
| 6 | 6 |
| 7 import 'package:analyzer/error/error.dart'; | 7 import 'package:analyzer/error/error.dart'; |
| 8 import 'package:analyzer/error/listener.dart'; | 8 import 'package:analyzer/error/listener.dart'; |
| 9 import 'package:analyzer/src/dart/error/syntactic_errors.dart'; | 9 import 'package:analyzer/src/dart/error/syntactic_errors.dart'; |
| 10 import 'package:analyzer/src/dart/scanner/reader.dart'; | 10 import 'package:analyzer/src/dart/scanner/reader.dart'; |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 throw 'No generic method comment support in Fasta'; | 148 throw 'No generic method comment support in Fasta'; |
| 149 } | 149 } |
| 150 fasta.ScannerResult result = | 150 fasta.ScannerResult result = |
| 151 fasta.scanString(_contents, includeComments: _preserveComments); | 151 fasta.scanString(_contents, includeComments: _preserveComments); |
| 152 // fasta pretends there is an additional line at EOF | 152 // fasta pretends there is an additional line at EOF |
| 153 lineStarts | 153 lineStarts |
| 154 .addAll(result.lineStarts.sublist(1, result.lineStarts.length - 1)); | 154 .addAll(result.lineStarts.sublist(1, result.lineStarts.length - 1)); |
| 155 fasta.Token token = result.tokens; | 155 fasta.Token token = result.tokens; |
| 156 // The default recovery strategy used by scanString | 156 // The default recovery strategy used by scanString |
| 157 // places all error tokens at the head of the stream. | 157 // places all error tokens at the head of the stream. |
| 158 while (token.info == TokenType.BAD_INPUT) { | 158 while (token.type == TokenType.BAD_INPUT) { |
| 159 translateErrorToken(token, reportError); | 159 translateErrorToken(token, reportError); |
| 160 token = token.next; | 160 token = token.next; |
| 161 } | 161 } |
| 162 firstToken = token; | 162 firstToken = token; |
| 163 return firstToken; | 163 return firstToken; |
| 164 } | 164 } |
| 165 | 165 |
| 166 @override | 166 @override |
| 167 set preserveComments(bool preserveComments) { | 167 set preserveComments(bool preserveComments) { |
| 168 this._preserveComments = preserveComments; | 168 this._preserveComments = preserveComments; |
| 169 } | 169 } |
| 170 } | 170 } |
| OLD | NEW |