[Gd-chatter] r11730 - in trunk/libraries/network/koala/sources: examples/code-browser koala

turbo24prg at gwydiondylan.org turbo24prg at gwydiondylan.org
Sat Mar 8 16:25:05 CET 2008


Author: turbo24prg
Date: Sat Mar  8 16:25:03 2008
New Revision: 11730

Modified:
   trunk/libraries/network/koala/sources/examples/code-browser/main.dylan
   trunk/libraries/network/koala/sources/examples/code-browser/search.dylan
   trunk/libraries/network/koala/sources/koala/server.dylan
Log:
Job: minor
* make symbol-responder a regex-responder
* don't supply the regex match as an argument
* don't prefix the source slot of DSPs, use dsp-root in the config


Modified: trunk/libraries/network/koala/sources/examples/code-browser/main.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/code-browser/main.dylan	(original)
+++ trunk/libraries/network/koala/sources/examples/code-browser/main.dylan	Sat Mar  8 16:25:03 2008
@@ -15,12 +15,8 @@
 
 define generic environment-object-page (obj :: <environment-object>) => (res :: <code-browser-page>);
 
-define function symbol-responder (#key match :: <regex-match>)
-  let tail = match-group(match, 0);
-  let suffix = split(tail, '/');
-  //format-out("hit /: %= %d\n", suffix, suffix.size);
-  if (suffix.size > 0)
-    let library-name = suffix[0];
+define function symbol-responder (#key library-name, module-name, symbol-name)
+  if (library-name)
     let project = find-project(library-name);
     open-project-compiler-database(project, 
                                    warning-callback: callback-handler,
@@ -28,11 +24,9 @@
     parse-project-source(project);
     dynamic-bind(*project* = project)
       let library = project.project-library;
-      if (suffix.size > 1)
-        let module-name = suffix[1];
+      if (module-name)
         let module = find-module(project, module-name, library: library);
-        if (suffix.size = 3)
-          let symbol-name = suffix[2];
+        if (symbol-name)
           let symbol
             = find-environment-object(project, symbol-name,
                                       library: library,
@@ -56,7 +50,8 @@
 
 define url-map
   url "/symbol"
-    action GET ("^.*$") => symbol-responder;
+    action GET ("^(?P<library-name>[^/]+)(/(?P<module-name>[^/]+)(/(?P<symbol-name>[^/]+)/?)?)?$") => 
+      symbol-responder;
 end;
 
 
@@ -64,7 +59,7 @@
 end;
 
 define variable *raw-source-page*
-  = make(<raw-source-page>, source: "code-browser/raw-source.dsp");
+  = make(<raw-source-page>, source: "raw-source.dsp");
 
 define method environment-object-page (object :: <environment-object>)
  => (res :: <code-browser-page>)
@@ -81,7 +76,7 @@
         end;
         define variable "*" ## ?page ## "-page*"
           = make("<" ## ?page ## "-page>",
-                 source: "code-browser/" ## ?"page" ## ".dsp");
+                 source: ?"page" ## ".dsp");
         define method environment-object-page
          (object :: "<" ## ?page ## "-object>") => (res :: "<" ## ?page ## "-page>")
            "*" ## ?page ## "-page*";

Modified: trunk/libraries/network/koala/sources/examples/code-browser/search.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/examples/code-browser/search.dylan	(original)
+++ trunk/libraries/network/koala/sources/examples/code-browser/search.dylan	Sat Mar  8 16:25:03 2008
@@ -17,7 +17,7 @@
 end;
 
 define variable *result-page*
-  = make(<result-page>, source: "code-browser/results.dsp");
+  = make(<result-page>, source: "results.dsp");
   
 define body tag results in code-browser
     (page :: <code-browser-page>, do-body :: <function>)

Modified: trunk/libraries/network/koala/sources/koala/server.dylan
==============================================================================
--- trunk/libraries/network/koala/sources/koala/server.dylan	(original)
+++ trunk/libraries/network/koala/sources/koala/server.dylan	Sat Mar  8 16:25:03 2008
@@ -874,8 +874,6 @@
        let arguments = #[];
        if (match)
          arguments := make(<deque>);
-         push-last(arguments, #"match");
-         push-last(arguments, match);
          for (group keyed-by name in match.groups-by-name)
            if (group)
              push-last(arguments, as(<symbol>, name));
@@ -947,6 +945,7 @@
      action :: <function>,
      arguments :: <sequence>)
  => ()
+  log-debug("Invoking action %= with %=.", action, arguments);
   apply(action, arguments)
 end;
 



More information about the chatter mailing list