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

Unified Diff: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/FormalParameter.java

Issue 11316019: Move ParameterKind so it can be used in the element model (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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
Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/FormalParameter.java
===================================================================
--- editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/FormalParameter.java (revision 14967)
+++ editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/FormalParameter.java (working copy)
@@ -13,6 +13,8 @@
*/
package com.google.dart.engine.ast;
+import com.google.dart.engine.utilities.dart.ParameterKind;
scheglov 2012/11/16 03:25:26 Hm... Can we keep all AST parts in "ast" package a
Brian Wilkerson 2012/11/16 15:55:02 Not without duplicating code, which I am loath to
+
/**
* The abstract class {@code FormalParameter} defines the behavior of objects representing a
* parameter to a function.
@@ -26,40 +28,6 @@
*/
public abstract class FormalParameter extends ASTNode {
/**
- * The enumeration {@code ParameterKind} defines the different kinds of parameters. There are two
- * basic kinds of parameters: required and optional. Optional parameters are further divided into
- * two kinds: positional optional and named optional.
- */
- public enum ParameterKind {
- REQUIRED(false),
- POSITIONAL(true),
- NAMED(true);
-
- /**
- * A flag indicating whether this is an optional parameter.
- */
- private boolean isOptional;
-
- /**
- * Initialize a newly created kind with the given state.
- *
- * @param isOptional {@code true} if this is an optional parameter
- */
- private ParameterKind(boolean isOptional) {
- this.isOptional = isOptional;
- }
-
- /**
- * Return {@code true} if this is an optional parameter.
- *
- * @return {@code true} if this is an optional parameter
- */
- public boolean isOptional() {
- return isOptional;
- }
- }
-
- /**
* Return the kind of this parameter.
*
* @return the kind of this parameter

Powered by Google App Engine
This is Rietveld 408576698