1. Michele Bini
  2. PeML Perl Macro Language

Commits

Michele Bini  committed 9886e0f

Bugfix release

  • Participants
  • Parent commits dc50f2e
  • Branches master
  • Tags 0.1.1

Comments (0)

Files changed (2)

File README

View file
  • Ignore whitespace
 
 Example:
 
-Hello World $< 11*3 >$, today is $< `date` >$.
+Hello World $< 11*3 >$, today is a $< `date` >$
 
 becomes:
 

File peml

View file
  • Ignore whitespace
 
 # PeML: Perl Macro Language
 
-$VERSION = "0.1.0";
+$VERSION = "0.1.1";
 
 use strict;
 
   } elsif (/-close/) {
     shift @ARGV; $peml_close = shift @ARGV;
   } elsif (/-output/) {
-    shift @ARGV; open STDOUT ">", shift @ARGV;
+    shift @ARGV; open(STDOUT, ">", shift(@ARGV));
   }
 }
 
+OPENLOOP:
 while (defined($_ = <>)) {
+  SCAN:
+  while (1) {
   if (/$peml_open/) {
-    print "$`"; # '
+    print "$`";
 
     $_ = "$'";
 
+  CLOSELOOP:
     while(1) {
       if (/$peml_close/) {
 	print eval("$`");
       };
       last;
     };
-  };
-  print "$_";
+    next SCAN;
+  } else {
+      print "$_";
+      last;
+  }
+  }
 }