summaryrefslogtreecommitdiff
path: root/arg.c
diff options
context:
space:
mode:
authorLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1988-01-27 22:18:25 +0000
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1988-01-27 22:18:25 +0000
commita559c25918b1466cdb50c9f978a86f01be0bac10 (patch)
treeffbe6c7bc07144d291a61555d002e7969110f248 /arg.c
parenta1cc2bdc08f9aa1504f32e5b0b782c2b3cffd124 (diff)
downloadperl-a559c25918b1466cdb50c9f978a86f01be0bac10.tar.gz
perl 1.0 patch 8: perl needed an eval operator and a symbolic debugger
I didn't add an eval operator to the original perl because I hadn't thought of any good uses for it. Recently I thought of some. Along with creating the eval operator, this patch introduces a symbolic debugger for perl scripts, which makes use of eval to interpret some debugging commands. Having eval also lets me emulate awk's FOO=bar command line behavior with a line such as the one a2p now inserts at the beginning of translated scripts.
Diffstat (limited to 'arg.c')
-rw-r--r--arg.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/arg.c b/arg.c
index 728f44d819..df4887ad3a 100644
--- a/arg.c
+++ b/arg.c
@@ -1,8 +1,8 @@
-/* $Header: arg.c,v 1.0.1.3 88/01/26 12:30:33 root Exp $
+/* $Header: arg.c,v 1.0.1.4 88/01/28 10:22:06 root Exp $
*
* $Log: arg.c,v $
- * Revision 1.0.1.3 88/01/26 12:30:33 root
- * patch 6: sprintf didn't finish processing format string when out of args.
+ * Revision 1.0.1.4 88/01/28 10:22:06 root
+ * patch8: added eval operator.
*
* Revision 1.0.1.2 88/01/24 03:52:34 root
* patch 2: added STATBLKS dependencies.
@@ -1190,6 +1190,7 @@ init_eval()
opargs[O_UNSHIFT] = A(1,0,0);
opargs[O_LINK] = A(1,1,0);
opargs[O_REPEAT] = A(1,1,0);
+ opargs[O_EVAL] = A(1,0,0);
}
#ifdef VOIDSIG
@@ -2092,6 +2093,11 @@ STR ***retary; /* where to return an array to, null if nowhere */
}
value = (double)(ary->ary_fill + 1);
break;
+ case O_EVAL:
+ str_sset(str,
+ do_eval(arg[1].arg_type != A_NULL ? sarg[1] : defstab->stab_val) );
+ STABSET(str);
+ break;
}
#ifdef DEBUGGING
dlevel--;