Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Small fix for function declaration parsing #27

Merged
merged 1 commit into from

2 participants

Alejandro Serrano JP Moresmau
Alejandro Serrano

No description provided.

JP Moresmau JPMoresmau merged commit e4a96cb into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 2, 2011
  1. Alejandro Serrano
This page is out of date. Refresh to see the latest.
13 net.sf.eclipsefp.haskell.browser/src/net/sf/eclipsefp/haskell/browser/items/Declaration.java
View
@@ -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"))
2  net.sf.eclipsefp.haskell.browser/src/net/sf/eclipsefp/haskell/browser/items/Function.java
View
@@ -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);
Something went wrong with that request. Please try again.