Skip to content
This repository

Small fix for function declaration parsing #27

Merged
merged 1 commit into from almost 3 years ago

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

Showing 1 unique commit by 1 author.

Sep 02, 2011
Alejandro Serrano serras Fix bug on Function declaration parsing. ae1affc
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
@@ -48,12 +48,15 @@ else if (type.equals("class"))
48 48 else if (type.equals("instance"))
49 49 return Collections.<Declaration>singleton(new Instance(o));
50 50 else if (type.equals("signature")){
51   - Collection<Declaration> ret=new ArrayList<Declaration>();
52   - JSONArray arr=o.optJSONArray("name");
53   - if (arr!=null){
54   - for (int a=0;a<arr.length();a++){
55   - ret.add(new Function(arr.getString(a),o));
  51 + Collection<Declaration> ret = new ArrayList<Declaration>();
  52 + JSONArray arr = o.optJSONArray("name");
  53 + if (arr != null){
  54 + for (int a = 0; a < arr.length(); a++){
  55 + ret.add(new Function(arr.getString(a), o));
56 56 }
  57 + } else {
  58 + String name = o.getString("name");
  59 + ret.add(new Function(name, o));
57 60 }
58 61 return ret;
59 62 } else if (type.equals("type"))
2  net.sf.eclipsefp.haskell.browser/src/net/sf/eclipsefp/haskell/browser/items/Function.java
@@ -22,7 +22,7 @@ public Function(String doc, String name, String signature) {
22 22 this.signature = signature;
23 23 }
24 24
25   - public Function(String name,JSONObject o) throws JSONException {
  25 + public Function(String name, JSONObject o) throws JSONException {
26 26 this.setDoc(o);
27 27 this.setType(DeclarationType.FUNCTION);
28 28 this.setName(name);

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.