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

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

Issue 1000913004: Fix line info for multi-line strings (issue 22794) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« 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 engine.scanner; 5 library engine.scanner;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'error.dart'; 9 import 'error.dart';
10 import 'java_engine.dart'; 10 import 'java_engine.dart';
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1467 } else { 1467 } else {
1468 next = _reader.advance(); 1468 next = _reader.advance();
1469 } 1469 }
1470 } 1470 }
1471 } 1471 }
1472 1472
1473 int _tokenizeMultiLineRawString(int quoteChar, int start) { 1473 int _tokenizeMultiLineRawString(int quoteChar, int start) {
1474 int next = _reader.advance(); 1474 int next = _reader.advance();
1475 outer: while (next != -1) { 1475 outer: while (next != -1) {
1476 while (next != quoteChar) { 1476 while (next != quoteChar) {
1477 next = _reader.advance();
1478 if (next == -1) { 1477 if (next == -1) {
1479 break outer; 1478 break outer;
1480 } else if (next == 0xD) { 1479 } else if (next == 0xD) {
1481 next = _reader.advance(); 1480 next = _reader.advance();
1482 if (next == 0xA) { 1481 if (next == 0xA) {
1483 next = _reader.advance(); 1482 next = _reader.advance();
1484 } 1483 }
1485 recordStartOfLine(); 1484 recordStartOfLine();
1486 } else if (next == 0xA) { 1485 } else if (next == 0xA) {
1486 next = _reader.advance();
1487 recordStartOfLine(); 1487 recordStartOfLine();
1488 } else {
1488 next = _reader.advance(); 1489 next = _reader.advance();
1489 } 1490 }
1490 } 1491 }
1491 next = _reader.advance(); 1492 next = _reader.advance();
1492 if (next == quoteChar) { 1493 if (next == quoteChar) {
1493 next = _reader.advance(); 1494 next = _reader.advance();
1494 if (next == quoteChar) { 1495 if (next == quoteChar) {
1495 _appendStringToken(TokenType.STRING, _reader.getString(start, 0)); 1496 _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
1496 return _reader.advance(); 1497 return _reader.advance();
1497 } 1498 }
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
2585 CommentToken get precedingComments => _precedingComment; 2586 CommentToken get precedingComments => _precedingComment;
2586 2587
2587 void set precedingComments(CommentToken comment) { 2588 void set precedingComments(CommentToken comment) {
2588 _precedingComment = comment; 2589 _precedingComment = comment;
2589 _setCommentParent(_precedingComment); 2590 _setCommentParent(_precedingComment);
2590 } 2591 }
2591 2592
2592 @override 2593 @override
2593 Token copy() => new TokenWithComment(type, offset, precedingComments); 2594 Token copy() => new TokenWithComment(type, offset, precedingComments);
2594 } 2595 }
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