| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 package com.google.dart.compiler.parser; | 5 package com.google.dart.compiler.parser; |
| 6 | 6 |
| 7 import com.google.common.annotations.VisibleForTesting; | 7 import com.google.common.annotations.VisibleForTesting; |
| 8 import com.google.common.collect.ImmutableSet; | 8 import com.google.common.collect.ImmutableSet; |
| 9 import com.google.common.io.CharStreams; | 9 import com.google.common.io.CharStreams; |
| 10 import com.google.dart.compiler.DartCompilationError; | 10 import com.google.dart.compiler.DartCompilationError; |
| (...skipping 2202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2213 * | identifier | 2213 * | identifier |
| 2214 * ; | 2214 * ; |
| 2215 * | 2215 * |
| 2216 * fieldFormalParameter | 2216 * fieldFormalParameter |
| 2217 * : finalVarOrType? THIS '.' identifier | 2217 * : finalVarOrType? THIS '.' identifier |
| 2218 * ; | 2218 * ; |
| 2219 * </pre> | 2219 * </pre> |
| 2220 */ | 2220 */ |
| 2221 private DartExpression parseParameterName() { | 2221 private DartExpression parseParameterName() { |
| 2222 beginParameterName(); | 2222 beginParameterName(); |
| 2223 if (optional(Token.THIS)) { | 2223 if (match(Token.THIS)) { |
| 2224 beginThisExpression(); | 2224 beginThisExpression(); |
| 2225 expect(Token.THIS); |
| 2226 DartThisExpression thisExpression = done(DartThisExpression.get()); |
| 2225 expect(Token.PERIOD); | 2227 expect(Token.PERIOD); |
| 2226 return done(new DartPropertyAccess(done(DartThisExpression.get()), parseId
entifier())); | 2228 return done(new DartPropertyAccess(thisExpression, parseIdentifier())); |
| 2227 } | 2229 } |
| 2228 return done(parseIdentifier()); | 2230 return done(parseIdentifier()); |
| 2229 } | 2231 } |
| 2230 | 2232 |
| 2231 /** | 2233 /** |
| 2232 * Validates that given {@link DartParameter}s have no default values, or mark
s existing default | 2234 * Validates that given {@link DartParameter}s have no default values, or mark
s existing default |
| 2233 * values with given {@link ErrorCode}. | 2235 * values with given {@link ErrorCode}. |
| 2234 */ | 2236 */ |
| 2235 private void validateNoDefaultParameterValues(List<DartParameter> parameters, | 2237 private void validateNoDefaultParameterValues(List<DartParameter> parameters, |
| 2236 ErrorCode errorCode) { | 2238 ErrorCode errorCode) { |
| (...skipping 3000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5237 private void reportError(DartNode node, ErrorCode errorCode, Object... argumen
ts) { | 5239 private void reportError(DartNode node, ErrorCode errorCode, Object... argumen
ts) { |
| 5238 if (node != null) { | 5240 if (node != null) { |
| 5239 reportError(new DartCompilationError(node, errorCode, arguments)); | 5241 reportError(new DartCompilationError(node, errorCode, arguments)); |
| 5240 } | 5242 } |
| 5241 } | 5243 } |
| 5242 | 5244 |
| 5243 private boolean currentlyParsingToplevel() { | 5245 private boolean currentlyParsingToplevel() { |
| 5244 return !(isParsingInterface || isTopLevelAbstract || isParsingClass); | 5246 return !(isParsingInterface || isTopLevelAbstract || isParsingClass); |
| 5245 } | 5247 } |
| 5246 } | 5248 } |
| OLD | NEW |