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

Side by Side Diff: pkg/front_end/lib/src/fasta/scanner/array_based_scanner.dart

Issue 2738313002: rename fasta.Token.value --> lexeme (Closed)
Patch Set: merge Created 3 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 fasta.scanner.array_based_scanner; 5 library fasta.scanner.array_based_scanner;
6 6
7 import 'error_token.dart' show ErrorToken; 7 import 'error_token.dart' show ErrorToken;
8 8
9 import 'keyword.dart' show Keyword; 9 import 'keyword.dart' show Keyword;
10 10
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 * Notifies on [$LF] characters in multi-line comments or strings. 118 * Notifies on [$LF] characters in multi-line comments or strings.
119 * 119 *
120 * This method is used by the scanners to track line breaks and create the 120 * This method is used by the scanners to track line breaks and create the
121 * [lineStarts] map. 121 * [lineStarts] map.
122 */ 122 */
123 void lineFeedInMultiline() { 123 void lineFeedInMultiline() {
124 lineStarts.add(stringOffset + 1); 124 lineStarts.add(stringOffset + 1);
125 } 125 }
126 126
127 /** 127 /**
128 * Appends a token that begins a new group, represented by [value]. 128 * Appends a token that begins a new group, represented by [info].
129 * Group begin tokens are '{', '(', '[' and '${'. 129 * Group begin tokens are '{', '(', '[' and '${'.
130 */ 130 */
131 void appendBeginGroup(PrecedenceInfo info) { 131 void appendBeginGroup(PrecedenceInfo info) {
132 Token token = new BeginGroupToken(info, tokenStart); 132 Token token = new BeginGroupToken(info, tokenStart);
133 appendToken(token); 133 appendToken(token);
134 134
135 // { ( [ ${ cannot appear inside a type parameters / arguments. 135 // { ( [ ${ cannot appear inside a type parameters / arguments.
136 if (!identical(info.kind, LT_TOKEN)) discardOpenLt(); 136 if (!identical(info.kind, LT_TOKEN)) discardOpenLt();
137 groupingStack = groupingStack.prepend(token); 137 groupingStack = groupingStack.prepend(token);
138 } 138 }
139 139
140 /** 140 /**
141 * Appends a token that begins an end group, represented by [value]. 141 * Appends a token that begins an end group, represented by [info].
142 * It handles the group end tokens '}', ')' and ']'. The tokens '>' and 142 * It handles the group end tokens '}', ')' and ']'. The tokens '>' and
143 * '>>' are handled separately bo [appendGt] and [appendGtGt]. 143 * '>>' are handled separately bo [appendGt] and [appendGtGt].
144 */ 144 */
145 int appendEndGroup(PrecedenceInfo info, int openKind) { 145 int appendEndGroup(PrecedenceInfo info, int openKind) {
146 assert(!identical(openKind, LT_TOKEN)); // openKind is < for > and >> 146 assert(!identical(openKind, LT_TOKEN)); // openKind is < for > and >>
147 discardBeginGroupUntil(openKind); 147 discardBeginGroupUntil(openKind);
148 appendPrecedenceToken(info); 148 appendPrecedenceToken(info);
149 Token close = tail; 149 Token close = tail;
150 if (groupingStack.isEmpty) { 150 if (groupingStack.isEmpty) {
151 return advance(); 151 return advance();
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 * something which cannot possibly be part of a type parameter/argument 265 * something which cannot possibly be part of a type parameter/argument
266 * list, like the '=' in the above example. 266 * list, like the '=' in the above example.
267 */ 267 */
268 void discardOpenLt() { 268 void discardOpenLt() {
269 while (!groupingStack.isEmpty && 269 while (!groupingStack.isEmpty &&
270 identical(groupingStack.head.kind, LT_TOKEN)) { 270 identical(groupingStack.head.kind, LT_TOKEN)) {
271 groupingStack = groupingStack.tail; 271 groupingStack = groupingStack.tail;
272 } 272 }
273 } 273 }
274 } 274 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/scanner/abstract_scanner.dart ('k') | pkg/front_end/lib/src/fasta/scanner/error_token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698