JsRender/Gtk.js
authorAlan Knowles <alan@roojs.com>
Tue, 10 Jun 2014 10:23:57 +0000 (18:23 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 10 Jun 2014 10:23:57 +0000 (18:23 +0800)
JsRender/Gtk.js

index 09452b6..f493aa4 100644 (file)
@@ -576,24 +576,20 @@ Gtk = XObject.define(
                     continue;
                 }
                 // function in the format of {type} (args) { .... }
-                
-                var v = item[k].split(/\/*--/);
-                if (v.length < 2) {
-                      strbuilder("\n" + pad + "// skip " + k + " - could not find seperator\n"); 
-                    continue;
-                }
-                var vv = v[1].replace('*/', "");
+                 
+                var vv = item[k];
                 //print(JSON.stringify(vv));Seed.quit();
                 vv = vv.replace(/^\n+/,'');
                 vv = vv.replace(/\n+$/,'');
                 vv = vv.replace(/\n/g,"\n" + ipad);
                 
-                vva = vv.split(' ');
+                vva = k.split(':');
                 var rtype = vva.shift();
-                var body = vva.join(' ');
+                var body = vv;
+                var fname = vva.shift();
                 
                 
-                strbuilder(pad + "public " + rtype + " " + k.substring(1) +body + "\n");
+                strbuilder(pad + "public " + rtype + " " + fnamek.substring(1) + body + "\n");