Modified README.bs2000
[p5sagit/p5-mst-13.2.git] / opcode.pl
index ab98824..5b0933e 100755 (executable)
--- a/opcode.pl
+++ b/opcode.pl
@@ -1,5 +1,6 @@
 #!/usr/bin/perl
 
+chmod 0666, "opcode.h", "opnames.h";
 unlink "opcode.h", "opnames.h";
 open(OC, ">opcode.h") || die "Can't create opcode.h: $!\n";
 open(ON, ">opnames.h") || die "Can't create opnames.h: $!\n";
@@ -30,7 +31,7 @@ while (<DATA>) {
 
 $i = 0;
 print <<"END";
-/* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!! 
+/* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
    This file is built by opcode.pl from its data.  Any changes made here
    will be lost!
 */
@@ -43,7 +44,7 @@ print <<"END";
 END
 
 print ON <<"END";
-/* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!! 
+/* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
    This file is built by opcode.pl from its data.  Any changes made here
    will be lost!
 */
@@ -56,7 +57,9 @@ for (@ops) {
 }
 print ON "\t", &tab(3,"OP_max"), "\n";
 print ON "} opcode;\n";
-print ON "\n#define MAXO ", scalar @ops, "\n\n"; 
+print ON "\n#define MAXO ", scalar @ops, "\n";
+print ON "#define OP_phoney_INPUT_ONLY -1\n";
+print ON "#define OP_phoney_OUTPUT_ONLY -2\n\n";
 
 # Emit op names and descriptions.
 
@@ -90,7 +93,7 @@ END
 for (@ops) {
     my($safe_desc) = $desc{$_};
 
-    # Have to escape double quotes and escape characters.    
+    # Have to escape double quotes and escape characters.
     $safe_desc =~ s/(^|[^\\])([\\"])/$1\\$2/g;
 
     print qq(\t"$safe_desc",\n);
@@ -259,7 +262,7 @@ open PP, '>pp_proto.h' or die "Error creating pp_proto.h: $!";
 open PPSYM, '>pp.sym' or die "Error creating pp.sym: $!";
 
 print PP <<"END";
-/* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!! 
+/* !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
    This file is built by opcode.pl from its data.  Any changes made here
    will be lost!
 */
@@ -268,7 +271,7 @@ END
 
 print PPSYM <<"END";
 #
-# !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!! 
+# !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
 #   This file is built by opcode.pl from its data.  Any changes made here
 #   will be lost!
 #
@@ -321,7 +324,7 @@ sub tab {
 #      trans not OK (dTARG; TARG = sv_newmortal();)
 #      ucfirst etc not OK: TMP arg processed inplace
 #      quotemeta not OK (unsafe when TARG == arg)
-#      each repeat not OK too due to array context
+#      each repeat not OK too due to list context
 #      pack split - unknown whether they are safe
 #      sprintf: is calling do_sprintf(TARG,...) which can act on TARG
 #        before other args are processed.
@@ -515,7 +518,7 @@ abs         abs                     ck_fun          fsTu%   S?
 # String stuff.
 
 length         length                  ck_lengthconst  isTu%   S?
-substr         substr                  ck_fun          st@     S S S? S?
+substr         substr                  ck_substr       st@     S S S? S?
 vec            vec                     ck_fun          ist@    S S S
 
 index          index                   ck_index        isT@    S S S?
@@ -596,7 +599,7 @@ orassign    logical or assignment (||=)     ck_null         s|
 method         method lookup           ck_method       d1
 entersub       subroutine entry        ck_subr         dmt1    L
 leavesub       subroutine exit         ck_null         1       
-leavesublv     lvalue subroutine exit  ck_null         1       
+leavesublv     lvalue subroutine return        ck_null         1       
 caller         caller                  ck_fun          t%      S?
 warn           warn                    ck_fun          imst@   L
 die            die                     ck_fun          dimst@  L
@@ -613,7 +616,7 @@ enteriter   foreach loop entry      ck_null         d{
 iter           foreach loop iterator   ck_null         0       
 enterloop      loop entry              ck_null         d{      
 leaveloop      loop exit               ck_null         2       
-return         return                  ck_null         dm@     L
+return         return                  ck_return       dm@     L
 last           last                    ck_null         ds}     
 next           next                    ck_null         ds}     
 redo           redo                    ck_null         ds}     
@@ -627,7 +630,7 @@ exit                exit                    ck_exit         ds%     S?
 
 # I/O.
 
-open           open                    ck_open         ist@    F S? L
+open           open                    ck_open         ismt@   F S? L
 close          close                   ck_fun          is%     F?
 pipe_op                pipe                    ck_fun          is@     F F