diff options
Diffstat (limited to 'embed.pl')
-rwxr-xr-x | embed.pl | 24 |
1 files changed, 11 insertions, 13 deletions
@@ -46,43 +46,41 @@ print EM <<'END'; #ifdef MULTIPLICITY -/* Undefine symbols that were defined by EMBED. Somewhat ugly */ - END - open(INT, "<interp.sym") || die "Can't open interp.sym: $!\n"; while (<INT>) { s/[ \t]*#.*//; # Delete comments. next unless /\S/; - s/^\s*(\S*).*$/#undef $1/; - print EM $_ if (exists $global{$1}); + s/^\s*(\S+).*$/#define $1\t\t(curinterp->I$1)/; + s/(................\t)\t/$1/; + print EM $_; } close(INT) || warn "Can't close interp.sym: $!\n"; -print EM "\n"; +print EM <<'END'; + +#else /* not multiple, so translate interpreter symbols the other way... */ + +END open(INT, "<interp.sym") || die "Can't open interp.sym: $!\n"; while (<INT>) { s/[ \t]*#.*//; # Delete comments. next unless /\S/; - s/^\s*(\S+).*$/#define $1\t\t(curinterp->I$1)/; + s/^\s*(\S+).*$/#define I$1\t\t$1/; s/(................\t)\t/$1/; print EM $_; } close(INT) || warn "Can't close interp.sym: $!\n"; -print EM <<'END'; - -#else /* not multiple, so translate interpreter symbols the other way... */ - -END +print EM "\n"; open(INT, "<interp.sym") || die "Can't open interp.sym: $!\n"; while (<INT>) { s/[ \t]*#.*//; # Delete comments. next unless /\S/; - s/^\s*(\S+).*$/#define I$1\t\t$1/; + s/^\s*(\S+).*$/#define $1\t\tPerl_$1/; s/(................\t)\t/$1/; print EM $_; } |