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

Side by Side Diff: pkg/analyzer/lib/src/dart/scanner/scanner.dart

Issue 2928773003: more fixes for fasta analyzer integration (Closed)
Patch Set: Created 3 years, 6 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 | « no previous file | pkg/analyzer/test/generated/scanner_test.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) 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 130
131 @override 131 @override
132 void reportError( 132 void reportError(
133 ScannerErrorCode errorCode, int offset, List<Object> arguments) { 133 ScannerErrorCode errorCode, int offset, List<Object> arguments) {
134 _errorListener 134 _errorListener
135 .onError(new AnalysisError(source, offset, 1, errorCode, arguments)); 135 .onError(new AnalysisError(source, offset, 1, errorCode, arguments));
136 } 136 }
137 137
138 @override 138 @override
139 void setSourceStart(int line, int column) { 139 void setSourceStart(int line, int column) {
140 lineStarts.removeAt(0);
141 int offset = _readerOffset; 140 int offset = _readerOffset;
142 if (line < 1 || column < 1 || offset < 0 || (line + column - 2) >= offset) { 141 if (line < 1 || column < 1 || offset < 0 || (line + column - 2) >= offset) {
143 return; 142 return;
144 } 143 }
144 lineStarts.removeAt(0);
145 for (int i = 2; i < line; i++) { 145 for (int i = 2; i < line; i++) {
146 lineStarts.add(1); 146 lineStarts.add(1);
147 } 147 }
148 lineStarts.add(offset - column + 1); 148 lineStarts.add(offset - column + 1);
149 } 149 }
150 150
151 @override 151 @override
152 Token get tail { 152 Token get tail {
153 throw 'unsupported operation'; 153 throw 'unsupported operation';
154 } 154 }
(...skipping 29 matching lines...) Expand all
184 } while (!token.isEof); 184 } while (!token.isEof);
185 } 185 }
186 return firstToken; 186 return firstToken;
187 } 187 }
188 188
189 @override 189 @override
190 set preserveComments(bool preserveComments) { 190 set preserveComments(bool preserveComments) {
191 this._preserveComments = preserveComments; 191 this._preserveComments = preserveComments;
192 } 192 }
193 } 193 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/scanner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698