[introspection-doc-generator] break apart gjs specific code (as per Sylvain original instructions)



commit 26f8e3bb9c8bcca3a03f0ccdb7cb5477af45c42a
Author: Sylvain Duclos <sylvain_duclos yahoo com>
Date:   Sat Apr 16 16:40:36 2011 +0800

    break apart gjs specific code (as per Sylvain original instructions)

 Introspect/NameSpace.js |   57 +---------------------------------------------
 1 files changed, 2 insertions(+), 55 deletions(-)
---
diff --git a/Introspect/NameSpace.js b/Introspect/NameSpace.js
index 4d2e62c..dc528c5 100644
--- a/Introspect/NameSpace.js
+++ b/Introspect/NameSpace.js
@@ -275,60 +275,7 @@ var NameSpace = {
             }
         }
         
-        function gjs_walk(gir) {
-            // clip XML declaration as per instruction at https://developer.mozilla.org/en/E4X
-            // to work around bug https://bugzilla.mozilla.org/show_bug.cgi?id=336551
-            //gir = gir.replace(/^<\?xml\s+version\s*=\s*(["'])[^\1]+\1[^?]*\?>/, "");    // ";
-            // the regex above take too long
-            gir = gir.replace(/^<\?xml version="1.0"\?>/, '');
-            //console.log('YYY : ');
-        
-            // clip gtk namespace declaration as it confuse the parser
-            gir = gir.replace(/xmlns=\"http:\/\/www.gtk.org\/introspection\/core\/1.0\"/, "");
-            //console.log('ZZZ : ');
-        
-        
-            var doc = new XML(gir);
-        
-            var ret = {};
-            var c = doc.namespace.*;
-            for (var i in c) {
-                if (c[i].function) {
-                    ret[c[i]  name] = c[i].doc.toString();
-        
-                    if (c[i]['return-value']) {
-                        var idxstr  = c[i]  name + '.return-value';
-                        ret[idxstr] = c[i]['return-value'].doc.toString();
-                        //console.log("=== XML: " +i+ '/' + ret[idxstr] + '/' + c[i] + '/' + idxstr);
-                    }
-        
-                    if (c[i].parameters) {
-                        for (var j in c[i].parameters.parameter) {
-                            var idxstr  = c[i]  name + '.' +  c[i] parameters parameter[j]  name;
-                            ret[idxstr] = c[i].parameters.parameter[j].doc.toString();
-                            //console.log('XXX : ' + c[i].parameters.parameter[j] + '///' + idxstr);
-                        }
-                    }
-                }
-        
-                // alias not in code but in gir
-                //if (c[i].alias) {
-                //    var idxstr  = c[i]  name;
-                //    ret[idxstr] = c[i].alias.doc.toString();
-                //    //console.log('YYY : ' + c[i].alias + '///' + idxstr);
-                //}
-        
-                // doc not in gir
-                //if (c[i].enumeration) {
-                //    // ,,,
-                //}
-                //if (c[i].constant) {
-                //    // ..,
-                //}
-            }
-        
-            return ret;
-        }
+   
         
         
         
@@ -348,7 +295,7 @@ var NameSpace = {
             return;
         }
         if (typeof(Seed) == 'undefined') {
-            const gjsxml      = imports.templates.gjs.parseXMLdoc;
+            const gjs_walk = imports.templates.gjs.walk.walk;
             var gir           = File.read(fn);
             this.comments[ns] = gjs_walk(gir);
          } else {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]