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

Unified Diff: frog/leg/scanner/parser.dart

Issue 9284022: Operators. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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
« no previous file with comments | « frog/leg/scanner/class_element_parser.dart ('k') | frog/leg/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/scanner/parser.dart
===================================================================
--- frog/leg/scanner/parser.dart (revision 3645)
+++ frog/leg/scanner/parser.dart (working copy)
@@ -554,7 +554,7 @@
return token;
}
}
- } else {
+ } else if (token.stringValue !== 'operator') {
final Token peek = peekAfterType(token);
if (isGetOrSet(peek) && isIdentifier(peek.next)) {
// type? get identifier
@@ -574,7 +574,7 @@
Token getOrSet = findGetOrSet(token);
if (token === getOrSet) token = token.next;
Token peek = peekAfterType(token);
- if (isIdentifier(peek)) {
+ if (isIdentifier(peek) && token.stringValue !== 'operator') {
// Skip type.
token = peek;
}
@@ -692,7 +692,11 @@
token = parseReturnTypeOpt(token);
if (getOrSet === token) token = token.next;
listener.beginFunctionName(token);
- token = parseIdentifier(token);
+ if (optional('operator', token)) {
+ token = parseOperatorName(token);
+ } else {
+ token = parseIdentifier(token);
+ }
token = parseQualifiedRestOpt(token);
listener.endFunctionName(token);
token = parseFormalParameters(token);
« no previous file with comments | « frog/leg/scanner/class_element_parser.dart ('k') | frog/leg/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698