Skip to content

Commit

Permalink
add constant, abstract, and final to methods and variables.
Browse files Browse the repository at this point in the history
R=alanknight@google.com

Review URL: https://codereview.chromium.org//19771019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@25318 260f80e4-7a28-3924-810f-c04153c831b5
  • Loading branch information
janicejl committed Jul 22, 2013
1 parent 9c4fef7 commit d674a4c
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions pkg/docgen/lib/docgen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ Map<String, Variable> _getVariables(Map<String, VariableMirror> mirrorMap,
if (includePrivate || !mirror.isPrivate) {
_currentMember = mirror;
data[mirrorName] = new Variable(mirrorName, mirror.isFinal,
mirror.isStatic, mirror.type.qualifiedName, _getComment(mirror),
_getAnnotations(mirror), mirror.qualifiedName);
mirror.isStatic, mirror.isConst, mirror.type.qualifiedName,
_getComment(mirror), _getAnnotations(mirror), mirror.qualifiedName);
}
});
return data;
Expand All @@ -328,10 +328,10 @@ Map<String, Map<String, Method>> _getMethods

mirrorMap.forEach((String mirrorName, MethodMirror mirror) {
if (includePrivate || !mirror.isPrivate) {
var method = new Method(mirrorName, mirror.isStatic,
mirror.returnType.qualifiedName, _getComment(mirror),
_getParameters(mirror.parameters), _getAnnotations(mirror),
mirror.qualifiedName);
var method = new Method(mirrorName, mirror.isStatic, mirror.isAbstract,
mirror.isConstConstructor, mirror.returnType.qualifiedName,
_getComment(mirror), _getParameters(mirror.parameters),
_getAnnotations(mirror), mirror.qualifiedName);
_currentMember = mirror;
if (mirror.isSetter) {
setters[mirrorName] = method;
Expand Down Expand Up @@ -577,21 +577,23 @@ class Variable extends Indexable {

bool isFinal;
bool isStatic;
bool isConst;
String type;

/// List of the meta annotations on the variable.
List<String> annotations;

Variable(String name, this.isFinal, this.isStatic, this.type, String comment,
this.annotations, String qualifiedName) : super(name, comment,
qualifiedName);
Variable(String name, this.isFinal, this.isStatic, this.isConst, this.type,
String comment, this.annotations, String qualifiedName) : super(name,
comment, qualifiedName);

/// Generates a map describing the [Variable] object.
Map toMap() => {
'name': name,
'comment': comment,
'final': isFinal.toString(),
'static': isStatic.toString(),
'constant': isConst.toString(),
'type': type,
'annotations': new List.from(annotations)
};
Expand All @@ -606,20 +608,25 @@ class Method extends Indexable {
Map<String, Parameter> parameters;

bool isStatic;
bool isAbstract;
bool isConst;
String returnType;

/// List of the meta annotations on the method.
List<String> annotations;

Method(String name, this.isStatic, this.returnType, String comment,
this.parameters, this.annotations, String qualifiedName)
Method(String name, this.isStatic, this.isAbstract, this.isConst,
this.returnType, String comment, this.parameters, this.annotations,
String qualifiedName)
: super(name, comment, qualifiedName);

/// Generates a map describing the [Method] object.
Map toMap() => {
'name': name,
'comment': comment,
'static': isStatic.toString(),
'abstract': isAbstract.toString(),
'constant': isConst.toString(),
'return': returnType,
'parameters': recurseMap(parameters),
'annotations': new List.from(annotations)
Expand Down

0 comments on commit d674a4c

Please sign in to comment.