Skip to content

Commit

Permalink
Fix bug on Function declaration parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
serras committed Sep 2, 2011
1 parent a67e452 commit ae1affc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Expand Up @@ -48,12 +48,15 @@ else if (type.equals("class"))
else if (type.equals("instance"))
return Collections.<Declaration>singleton(new Instance(o));
else if (type.equals("signature")){
Collection<Declaration> ret=new ArrayList<Declaration>();
JSONArray arr=o.optJSONArray("name");
if (arr!=null){
for (int a=0;a<arr.length();a++){
ret.add(new Function(arr.getString(a),o));
Collection<Declaration> ret = new ArrayList<Declaration>();
JSONArray arr = o.optJSONArray("name");
if (arr != null){
for (int a = 0; a < arr.length(); a++){
ret.add(new Function(arr.getString(a), o));
}
} else {
String name = o.getString("name");
ret.add(new Function(name, o));
}
return ret;
} else if (type.equals("type"))
Expand Down
Expand Up @@ -22,7 +22,7 @@ public Function(String doc, String name, String signature) {
this.signature = signature;
}

public Function(String name,JSONObject o) throws JSONException {
public Function(String name, JSONObject o) throws JSONException {
this.setDoc(o);
this.setType(DeclarationType.FUNCTION);
this.setName(name);
Expand Down

0 comments on commit ae1affc

Please sign in to comment.