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

Unified Diff: pkg/front_end/lib/src/fasta/scanner/token.dart

Issue 2837473002: merge fasta.PrecedenceInfo into analyzer.TokenType (Closed)
Patch Set: rebase Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/scanner/token.dart
diff --git a/pkg/front_end/lib/src/fasta/scanner/token.dart b/pkg/front_end/lib/src/fasta/scanner/token.dart
index 07d9afb3ae341e197df7fb74bd9dbdcd3efd25ff..a3e91fa9126044ce5f53578a6f33148b0f8e9b19 100644
--- a/pkg/front_end/lib/src/fasta/scanner/token.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/token.dart
@@ -5,15 +5,10 @@
library fasta.scanner.token;
import '../../scanner/token.dart' as analyzer;
+import '../../scanner/token.dart' show TokenType;
import 'precedence.dart'
- show
- AS_INFO,
- BAD_INPUT_INFO,
- EOF_INFO,
- IS_INFO,
- KEYWORD_INFO,
- PrecedenceInfo;
+ show AS_INFO, BAD_INPUT_INFO, EOF_INFO, IS_INFO, KEYWORD_INFO;
import 'token_constants.dart' show IDENTIFIER_TOKEN;
@@ -66,7 +61,7 @@ abstract class Token implements analyzer.TokenWithComment {
*
* Defined as getter to save a field in the [KeywordToken] subclass.
*/
- PrecedenceInfo get info;
+ TokenType get info;
/**
* The string represented by this token, a substring of the source code.
@@ -80,7 +75,7 @@ abstract class Token implements analyzer.TokenWithComment {
* token. For [StringToken]s this method returns [:null:].
*
* For [SymbolToken]s and [KeywordToken]s, the string value is a compile-time
- * constant originating in the [PrecedenceInfo] or in the [Keyword] instance.
+ * constant originating in the [TokenType] or in the [Keyword] instance.
* This allows testing for keywords and symbols using [:identical:], e.g.,
* [:identical('class', token.value):].
*
@@ -249,7 +244,7 @@ abstract class Token implements analyzer.TokenWithComment {
* Also used for end of file with EOF_INFO.
*/
class SymbolToken extends Token {
- final PrecedenceInfo info;
+ final TokenType info;
SymbolToken(this.info, int charOffset) : super(charOffset);
@@ -289,7 +284,7 @@ class SymbolToken extends Token {
* then it will insert an synthetic ')'.
*/
class SyntheticSymbolToken extends SymbolToken {
- SyntheticSymbolToken(PrecedenceInfo info, int charOffset)
+ SyntheticSymbolToken(TokenType info, int charOffset)
: super(info, charOffset);
@override
@@ -314,8 +309,7 @@ class BeginGroupToken extends SymbolToken
implements analyzer.BeginTokenWithComment {
Token endGroup;
- BeginGroupToken(PrecedenceInfo info, int charOffset)
- : super(info, charOffset);
+ BeginGroupToken(TokenType info, int charOffset) : super(info, charOffset);
@override
analyzer.Token get endToken => endGroup;
@@ -337,7 +331,7 @@ class KeywordToken extends Token implements analyzer.KeywordTokenWithComment {
KeywordToken(this.keyword, int charOffset) : super(charOffset);
- PrecedenceInfo get info => keyword.info;
+ TokenType get info => keyword.info;
String get lexeme => keyword.syntax;
@@ -401,7 +395,7 @@ class StringToken extends Token implements analyzer.StringTokenWithComment {
var /* String | LazySubtring */ valueOrLazySubstring;
- final PrecedenceInfo info;
+ final TokenType info;
/**
* Creates a non-lazy string token. If [canonicalize] is true, the string
@@ -500,7 +494,7 @@ class StringToken extends Token implements analyzer.StringTokenWithComment {
*/
class SyntheticStringToken extends StringToken
implements analyzer.SyntheticStringToken {
- SyntheticStringToken(PrecedenceInfo info, String value, int offset)
+ SyntheticStringToken(TokenType info, String value, int offset)
: super._(info, value, offset);
@override
@@ -523,7 +517,7 @@ class CommentToken extends StringToken implements analyzer.CommentToken {
* is canonicalized before the token is created.
*/
CommentToken.fromSubstring(
- PrecedenceInfo info, String data, int start, int end, int charOffset,
+ TokenType info, String data, int start, int end, int charOffset,
{bool canonicalize: false})
: super.fromSubstring(info, data, start, end, charOffset,
canonicalize: canonicalize);
@@ -531,18 +525,18 @@ class CommentToken extends StringToken implements analyzer.CommentToken {
/**
* Creates a non-lazy comment token.
*/
- CommentToken.fromString(PrecedenceInfo info, String lexeme, int charOffset)
+ CommentToken.fromString(TokenType info, String lexeme, int charOffset)
: super.fromString(info, lexeme, charOffset);
/**
* Creates a lazy string token. If [asciiOnly] is false, the byte array
* is passed through a UTF-8 decoder.
*/
- CommentToken.fromUtf8Bytes(PrecedenceInfo info, List<int> data, int start,
- int end, bool asciiOnly, int charOffset)
+ CommentToken.fromUtf8Bytes(TokenType info, List<int> data, int start, int end,
+ bool asciiOnly, int charOffset)
: super.fromUtf8Bytes(info, data, start, end, asciiOnly, charOffset);
- CommentToken._(PrecedenceInfo info, valueOrLazySubstring, int charOffset)
+ CommentToken._(TokenType info, valueOrLazySubstring, int charOffset)
: super._(info, valueOrLazySubstring, charOffset);
@override
@@ -575,7 +569,7 @@ class DartDocToken extends CommentToken
* is canonicalized before the token is created.
*/
DartDocToken.fromSubstring(
- PrecedenceInfo info, String data, int start, int end, int charOffset,
+ TokenType info, String data, int start, int end, int charOffset,
{bool canonicalize: false})
: super.fromSubstring(info, data, start, end, charOffset,
canonicalize: canonicalize);
@@ -584,11 +578,11 @@ class DartDocToken extends CommentToken
* Creates a lazy string token. If [asciiOnly] is false, the byte array
* is passed through a UTF-8 decoder.
*/
- DartDocToken.fromUtf8Bytes(PrecedenceInfo info, List<int> data, int start,
- int end, bool asciiOnly, int charOffset)
+ DartDocToken.fromUtf8Bytes(TokenType info, List<int> data, int start, int end,
+ bool asciiOnly, int charOffset)
: super.fromUtf8Bytes(info, data, start, end, asciiOnly, charOffset);
- DartDocToken._(PrecedenceInfo info, valueOrLazySubstring, int charOffset)
+ DartDocToken._(TokenType info, valueOrLazySubstring, int charOffset)
: super._(info, valueOrLazySubstring, charOffset);
@override
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/string_scanner.dart ('k') | pkg/front_end/lib/src/fasta/scanner/utf8_bytes_scanner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698