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

Unified Diff: compiler/java/com/google/dart/compiler/parser/DartParser.java

Issue 10557037: Issue 1197. Support for using 'static' as method name (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/parser/DartParser.java
diff --git a/compiler/java/com/google/dart/compiler/parser/DartParser.java b/compiler/java/com/google/dart/compiler/parser/DartParser.java
index ee69b4128fad2b6b2026f0c1f1edea9424460fb8..83482536987c2e999242fe13d509b9c4fb514bb5 100644
--- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
+++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
@@ -974,7 +974,7 @@ public class DartParser extends CompletionHooksParserBase {
private DartNode parseFieldOrMethod(boolean allowStatic) {
beginClassMember();
Modifiers modifiers = Modifiers.NONE;
- if (optionalPseudoKeyword(STATIC_KEYWORD)) {
+ if (peek(1) != Token.LPAREN && optionalPseudoKeyword(STATIC_KEYWORD)) {
if (!allowStatic) {
reportError(position(), ParserErrorCode.TOP_LEVEL_CANNOT_BE_STATIC);
} else {
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/parser/SyntaxTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698