chiark / gitweb /
toplevel-find: allow ////-commented toplevel module directives
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 16 Feb 2016 21:20:11 +0000 (21:20 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 16 Feb 2016 21:20:23 +0000 (21:20 +0000)
This allows including .scad files to specify explicitly which
toplevels to generate.

toplevel-find

index 58c3554..3e3c28b 100755 (executable)
@@ -11,7 +11,7 @@ while (<F>) {
        open F, "$1" or die "$1 $!";
        next;
     }
-    next unless m#^\s*module\s+(\w+)\b.*////toplevel\b#;
+    next unless m#^\s*(?:////\s?)?module\s+(\w+)\b.*////toplevel\b#;
     print "$base,$1\n" or die $!;
 }
 close F or die $!;