Chromium Code Reviews| Index: dart/lib/compiler/implementation/scanner/scanner.dart |
| diff --git a/dart/lib/compiler/implementation/scanner/scanner.dart b/dart/lib/compiler/implementation/scanner/scanner.dart |
| index 2dd4d38891b8ceed534189afce0409ad42be88c2..c6c5f2fd28af96c0540e3d974f7e5432a49d47a5 100644 |
| --- a/dart/lib/compiler/implementation/scanner/scanner.dart |
| +++ b/dart/lib/compiler/implementation/scanner/scanner.dart |
| @@ -33,6 +33,13 @@ class AbstractScanner<T extends SourceString> implements Scanner { |
| abstract void appendGt(PrecedenceInfo info, String value); |
| abstract void appendGtGt(PrecedenceInfo info, String value); |
| abstract void appendGtGtGt(PrecedenceInfo info, String value); |
| + |
| + /** |
| + * We call this method to discard '<' from the "grouping" stack |
| + * (maintained by subclasses). That we don't create groups for stuff |
| + * like "a = b < c, d = e > f" is used by |
| + * [PartialParser.skipExpression]. |
| + */ |
|
Lasse Reichstein Nielsen
2012/06/15 13:59:14
So you call this when you recognize something that
ahe
2012/06/19 11:02:42
Done.
|
| abstract void discardOpenLt(); |
| // TODO(ahe): Move this class to implementation. |
| @@ -143,6 +150,7 @@ class AbstractScanner<T extends SourceString> implements Scanner { |
| if (next === $SEMICOLON) { |
| appendPrecedenceToken(SEMICOLON_INFO); |
| + // Type parameters and arguments cannot contain semicolon. |
| discardOpenLt(); |
| return advance(); |
| } |
| @@ -341,6 +349,11 @@ class AbstractScanner<T extends SourceString> implements Scanner { |
| int tokenizeEquals(int next) { |
| // = == === |
| + |
| + // Type parameters and arguments cannot contain any token that |
| + // starts with '='. |
| + discardOpenLt(); |
| + |
| next = advance(); |
| if (next === $EQ) { |
| return select($EQ, EQ_EQ_EQ_INFO, EQ_EQ_INFO); |