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

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

Issue 322603002: New analyzer snapshot. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/sdk.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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.scanner; 8 library engine.scanner;
9 9
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 } 1624 }
1625 1625
1626 int _tokenizeMultiLineString(int quoteChar, int start, bool raw) { 1626 int _tokenizeMultiLineString(int quoteChar, int start, bool raw) {
1627 if (raw) { 1627 if (raw) {
1628 return _tokenizeMultiLineRawString(quoteChar, start); 1628 return _tokenizeMultiLineRawString(quoteChar, start);
1629 } 1629 }
1630 int next = _reader.advance(); 1630 int next = _reader.advance();
1631 while (next != -1) { 1631 while (next != -1) {
1632 if (next == 0x24) { 1632 if (next == 0x24) {
1633 _appendStringToken(TokenType.STRING, _reader.getString(start, -1)); 1633 _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
1634 next = _tokenizeStringInterpolation(start);
1634 _beginToken(); 1635 _beginToken();
1635 next = _tokenizeStringInterpolation(start);
1636 start = _reader.offset; 1636 start = _reader.offset;
1637 continue; 1637 continue;
1638 } 1638 }
1639 if (next == quoteChar) { 1639 if (next == quoteChar) {
1640 next = _reader.advance(); 1640 next = _reader.advance();
1641 if (next == quoteChar) { 1641 if (next == quoteChar) {
1642 next = _reader.advance(); 1642 next = _reader.advance();
1643 if (next == quoteChar) { 1643 if (next == quoteChar) {
1644 _appendStringToken(TokenType.STRING, _reader.getString(start, 0)); 1644 _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
1645 return _reader.advance(); 1645 return _reader.advance();
(...skipping 25 matching lines...) Expand all
1671 } 1671 }
1672 recordStartOfLine(); 1672 recordStartOfLine();
1673 } else if (next == 0xA) { 1673 } else if (next == 0xA) {
1674 recordStartOfLine(); 1674 recordStartOfLine();
1675 next = _reader.advance(); 1675 next = _reader.advance();
1676 } else { 1676 } else {
1677 next = _reader.advance(); 1677 next = _reader.advance();
1678 } 1678 }
1679 } 1679 }
1680 _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []); 1680 _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []);
1681 _appendStringToken(TokenType.STRING, _reader.getString(start, 0)); 1681 if (start == _reader.offset) {
1682 _appendStringTokenWithOffset(TokenType.STRING, "", 1);
1683 } else {
1684 _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
1685 }
1682 return _reader.advance(); 1686 return _reader.advance();
1683 } 1687 }
1684 1688
1685 int _tokenizeMultiply(int next) => _select(0x3D, TokenType.STAR_EQ, TokenType. STAR); 1689 int _tokenizeMultiply(int next) => _select(0x3D, TokenType.STAR_EQ, TokenType. STAR);
1686 1690
1687 int _tokenizeNumber(int next) { 1691 int _tokenizeNumber(int next) {
1688 int start = _reader.offset; 1692 int start = _reader.offset;
1689 while (true) { 1693 while (true) {
1690 next = _reader.advance(); 1694 next = _reader.advance();
1691 if (0x30 <= next && next <= 0x39) { 1695 if (0x30 <= next && next <= 0x39) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 } 1747 }
1744 1748
1745 int _tokenizeSingleLineRawString(int next, int quoteChar, int start) { 1749 int _tokenizeSingleLineRawString(int next, int quoteChar, int start) {
1746 next = _reader.advance(); 1750 next = _reader.advance();
1747 while (next != -1) { 1751 while (next != -1) {
1748 if (next == quoteChar) { 1752 if (next == quoteChar) {
1749 _appendStringToken(TokenType.STRING, _reader.getString(start, 0)); 1753 _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
1750 return _reader.advance(); 1754 return _reader.advance();
1751 } else if (next == 0xD || next == 0xA) { 1755 } else if (next == 0xD || next == 0xA) {
1752 _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []); 1756 _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []);
1753 _appendStringToken(TokenType.STRING, _reader.getString(start, 0)); 1757 _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
1754 return _reader.advance(); 1758 return _reader.advance();
1755 } 1759 }
1756 next = _reader.advance(); 1760 next = _reader.advance();
1757 } 1761 }
1758 _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []); 1762 _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []);
1759 _appendStringToken(TokenType.STRING, _reader.getString(start, 0)); 1763 _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
1760 return _reader.advance(); 1764 return _reader.advance();
1761 } 1765 }
1762 1766
1763 int _tokenizeSingleLineString(int next, int quoteChar, int start) { 1767 int _tokenizeSingleLineString(int next, int quoteChar, int start) {
1764 while (next != quoteChar) { 1768 while (next != quoteChar) {
1765 if (next == 0x5C) { 1769 if (next == 0x5C) {
1766 next = _reader.advance(); 1770 next = _reader.advance();
1767 } else if (next == 0x24) { 1771 } else if (next == 0x24) {
1768 _appendStringToken(TokenType.STRING, _reader.getString(start, -1)); 1772 _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
1773 next = _tokenizeStringInterpolation(start);
1769 _beginToken(); 1774 _beginToken();
1770 next = _tokenizeStringInterpolation(start);
1771 start = _reader.offset; 1775 start = _reader.offset;
1772 continue; 1776 continue;
1773 } 1777 }
1774 if (next <= 0xD && (next == 0xA || next == 0xD || next == -1)) { 1778 if (next <= 0xD && (next == 0xA || next == 0xD || next == -1)) {
1775 _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []); 1779 _reportError(ScannerErrorCode.UNTERMINATED_STRING_LITERAL, []);
1776 _appendStringToken(TokenType.STRING, _reader.getString(start, 0)); 1780 if (start == _reader.offset) {
1781 _appendStringTokenWithOffset(TokenType.STRING, "", 1);
1782 } else if (next == -1) {
1783 _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
1784 } else {
1785 _appendStringToken(TokenType.STRING, _reader.getString(start, -1));
1786 }
1777 return _reader.advance(); 1787 return _reader.advance();
1778 } 1788 }
1779 next = _reader.advance(); 1789 next = _reader.advance();
1780 } 1790 }
1781 _appendStringToken(TokenType.STRING, _reader.getString(start, 0)); 1791 _appendStringToken(TokenType.STRING, _reader.getString(start, 0));
1782 return _reader.advance(); 1792 return _reader.advance();
1783 } 1793 }
1784 1794
1785 int _tokenizeSlashOrComment(int next) { 1795 int _tokenizeSlashOrComment(int next) {
1786 next = _reader.advance(); 1796 next = _reader.advance();
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
1904 * @param message the template used to create the message to be displayed for the error 1914 * @param message the template used to create the message to be displayed for the error
1905 * @param correction the template used to create the correction to be displaye d for the error 1915 * @param correction the template used to create the correction to be displaye d for the error
1906 */ 1916 */
1907 const ScannerErrorCode.con2(String name, int ordinal, this.message, this.corre ction) : super(name, ordinal); 1917 const ScannerErrorCode.con2(String name, int ordinal, this.message, this.corre ction) : super(name, ordinal);
1908 1918
1909 @override 1919 @override
1910 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR; 1920 ErrorSeverity get errorSeverity => ErrorSeverity.ERROR;
1911 1921
1912 @override 1922 @override
1913 ErrorType get type => ErrorType.SYNTACTIC_ERROR; 1923 ErrorType get type => ErrorType.SYNTACTIC_ERROR;
1924
1925 @override
1926 String get uniqueName => "${runtimeType.toString()}.${name}";
1914 } 1927 }
1915 1928
1916 /** 1929 /**
1917 * Instances of the class `StringToken` represent a token whose value is indepen dent of it's 1930 * Instances of the class `StringToken` represent a token whose value is indepen dent of it's
1918 * type. 1931 * type.
1919 */ 1932 */
1920 class StringToken extends Token { 1933 class StringToken extends Token {
1921 /** 1934 /**
1922 * The lexeme represented by this token. 1935 * The lexeme represented by this token.
1923 */ 1936 */
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
2682 * @param precedingComment the first comment in the list of comments that prec ede this token 2695 * @param precedingComment the first comment in the list of comments that prec ede this token
2683 */ 2696 */
2684 TokenWithComment(TokenType type, int offset, this._precedingComment) : super(t ype, offset); 2697 TokenWithComment(TokenType type, int offset, this._precedingComment) : super(t ype, offset);
2685 2698
2686 @override 2699 @override
2687 Token copy() => new TokenWithComment(type, offset, _precedingComment); 2700 Token copy() => new TokenWithComment(type, offset, _precedingComment);
2688 2701
2689 @override 2702 @override
2690 Token get precedingComments => _precedingComment; 2703 Token get precedingComments => _precedingComment;
2691 } 2704 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | pkg/analyzer/lib/src/generated/sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698