| 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 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 1483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1494 next = _reader.advance(); | 1494 next = _reader.advance(); |
| 1495 ++nesting; | 1495 ++nesting; |
| 1496 } | 1496 } |
| 1497 } else if (next == 0xD) { | 1497 } else if (next == 0xD) { |
| 1498 next = _reader.advance(); | 1498 next = _reader.advance(); |
| 1499 if (next == 0xA) { | 1499 if (next == 0xA) { |
| 1500 next = _reader.advance(); | 1500 next = _reader.advance(); |
| 1501 } | 1501 } |
| 1502 recordStartOfLine(); | 1502 recordStartOfLine(); |
| 1503 } else if (next == 0xA) { | 1503 } else if (next == 0xA) { |
| 1504 next = _reader.advance(); |
| 1504 recordStartOfLine(); | 1505 recordStartOfLine(); |
| 1505 next = _reader.advance(); | |
| 1506 } else { | 1506 } else { |
| 1507 next = _reader.advance(); | 1507 next = _reader.advance(); |
| 1508 } | 1508 } |
| 1509 } | 1509 } |
| 1510 } | 1510 } |
| 1511 | 1511 |
| 1512 int _tokenizeMultiLineRawString(int quoteChar, int start) { | 1512 int _tokenizeMultiLineRawString(int quoteChar, int start) { |
| 1513 int next = _reader.advance(); | 1513 int next = _reader.advance(); |
| 1514 outer: while (next != -1) { | 1514 outer: while (next != -1) { |
| 1515 while (next != quoteChar) { | 1515 while (next != quoteChar) { |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2003 Token previous; | 2003 Token previous; |
| 2004 | 2004 |
| 2005 /** | 2005 /** |
| 2006 * The next token in the token stream. | 2006 * The next token in the token stream. |
| 2007 */ | 2007 */ |
| 2008 Token _next; | 2008 Token _next; |
| 2009 | 2009 |
| 2010 /** | 2010 /** |
| 2011 * Initialize a newly created token to have the given [type] and [offset]. | 2011 * Initialize a newly created token to have the given [type] and [offset]. |
| 2012 */ | 2012 */ |
| 2013 Token(this.type, int offset) { | 2013 Token(this.type, this.offset); |
| 2014 this.offset = offset; | |
| 2015 } | |
| 2016 | 2014 |
| 2017 /** | 2015 /** |
| 2018 * Return the offset from the beginning of the file to the character after the | 2016 * Return the offset from the beginning of the file to the character after the |
| 2019 * last character of the token. | 2017 * last character of the token. |
| 2020 */ | 2018 */ |
| 2021 int get end => offset + length; | 2019 int get end => offset + length; |
| 2022 | 2020 |
| 2023 /** | 2021 /** |
| 2024 * Return `true` if this token represents an operator. | 2022 * Return `true` if this token represents an operator. |
| 2025 */ | 2023 */ |
| (...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2664 CommentToken get precedingComments => _precedingComment; | 2662 CommentToken get precedingComments => _precedingComment; |
| 2665 | 2663 |
| 2666 void set precedingComments(CommentToken comment) { | 2664 void set precedingComments(CommentToken comment) { |
| 2667 _precedingComment = comment; | 2665 _precedingComment = comment; |
| 2668 _setCommentParent(_precedingComment); | 2666 _setCommentParent(_precedingComment); |
| 2669 } | 2667 } |
| 2670 | 2668 |
| 2671 @override | 2669 @override |
| 2672 Token copy() => new TokenWithComment(type, offset, precedingComments); | 2670 Token copy() => new TokenWithComment(type, offset, precedingComments); |
| 2673 } | 2671 } |
| OLD | NEW |