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

Re: BUG REPORT: Website META Language 1.7.2 (28-06-1999)



On Mon, 6 Sep 1999, Nobuyuki Tsuchimura wrote:

>   Hi,
> I'll write detail about my own bug report.

Hi, thanx for detailed informations, it helps solving problems ;-)

>   Then, I found a little trouble.
> Macro __FILE__ does not work as described in manual wml_p1_ipp(1).
> It is replaced by empty string.
> It works well ONLY at the first line of the file.

Not really. It works before any file inclusion, due to a problem with
variable scope. The patch below fixes this problem

[...]
>   I think <__FILE__> is better.

WML defines the WML_SRC_FILENAME variable. So you have to type
  <get-var WML_SRC_FILENAME>

Thanx for this bug report.

-- 
Denis Barbier
WML Maintainer

--- wml_backend/p1_ipp/ipp.src	1999/08/28 20:18:03	1.19
+++ wml_backend/p1_ipp/ipp.src	1999/09/06 09:05:35
@@ -251,7 +251,7 @@
 
 sub ProcessFile {
     my ($mode, $delimiter, $file, $level, $noid, %arg) = @_;
-    my ($in, $found, $line, $type, %argO, $out, $store);
+    my ($in, $found, $line, $incfile, $type, %argO, $out, $store);
 
     #
     #   first check whether this is a filename pattern in which case
@@ -381,30 +381,30 @@
         #   ``#include'', ``#use'' and ``#depends'' directives
         #
 
-        if (($cmd, $file, $args) = ($l =~ m/^#(use|include|depends)\s+(\S+)(.*)$/)) {
+        if (($cmd, $incfile, $args) = ($l =~ m/^#(use|include|depends)\s+(\S+)(.*)$/)) {
             #   set arguments
             %argO = %arg;
             &setargs(\%arg, $args);
 
             #   do possible argument mapping
-            $file = &mapfile($file);
+            $incfile = &mapfile($incfile);
 
             #   determine raw filename and type
-            if ($file =~ m|^(\S+?)::(\S+)$|) {
+            if ($incfile =~ m|^(\S+?)::(\S+)$|) {
                 $type = '<';
-                $file = "$2.$1";
-                $file =~ s|::|/|g;
+                $incfile = "$2.$1";
+                $incfile =~ s|::|/|g;
             }
-            elsif ($file =~ m|^(['"<])([^'">]+)['">]$|) {
+            elsif ($incfile =~ m|^(['"<])([^'">]+)['">]$|) {
                 $type = $1;
-                $file = $2;
+                $incfile = $2;
             }
             else {
-                &error("Unknown file-argument syntax: ``$file''");
+                &error("Unknown file-argument syntax: ``$incfile''");
             }
 
             #   now recurse down
-            $out .= &ProcessFile($cmd, $type, $file, $level+1, 0, %arg);
+            $out .= &ProcessFile($cmd, $type, $incfile, $level+1, 0, %arg);
 
             #   reset arguments
             %arg = %argO;

______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com