]> git.saurik.com Git - bison.git/blobdiff - examples/extexi
build: fix more example extraction issues.
[bison.git] / examples / extexi
index efce4e5738f1852cb3b3ddcd7a5b35302be66d4e..7ede7c4b40072c5946d1bd6d91748685bdd01e8f 100644 (file)
@@ -29,7 +29,7 @@ BEGIN {
     if (ARGV[argc] == "--")
       break;
   for (i = argc + 1; i < ARGC; ++i)
     if (ARGV[argc] == "--")
       break;
   for (i = argc + 1; i < ARGC; ++i)
-    file_wanted[ARGV[i]] = 1;
+    file_wanted[basename(ARGV[i])] = ARGV[i];
   ARGC = argc;
 }
 
   ARGC = argc;
 }
 
@@ -43,13 +43,10 @@ BEGIN {
 }
 
 /^@comment file: / {
 }
 
 /^@comment file: / {
-  if (!file_wanted[$3])
-    message("ignoring " $3);
+  if (file = file_wanted[$3])
+    message(" GEN " file);
   else
   else
-    {
-      message("extracting " $3);
-      file = $3;
-    }
+    message("SKIP " $3);
 }
 
 /^@(small)?example$/, /^@end (small)?example$/ {
 }
 
 /^@(small)?example$/, /^@end (small)?example$/ {
@@ -125,6 +122,11 @@ function normalize(contents,    i, lines, n, line, res) {
 }
 
 
 }
 
 
+function basename(name,     a, n) {
+  n = split (name, a, "/");
+  return a[n];
+}
+
 function message(msg) {
   if (! message_printed[msg])
     {
 function message(msg) {
   if (! message_printed[msg])
     {