diff options
author | hobbs <hobbs> | 2001-11-14 23:17:02 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2001-11-14 23:17:02 (GMT) |
commit | 03bf512eba9ec5dde914e6b2cb171b35cf297b08 (patch) | |
tree | e2099b7a9dc4bb4dc572f484ee86baf5db2c28ae /generic/tclCompile.c | |
parent | 6b5ff76e865f488dd08efe0bd2a280b7ceda4543 (diff) | |
download | tcl-03bf512eba9ec5dde914e6b2cb171b35cf297b08.zip tcl-03bf512eba9ec5dde914e6b2cb171b35cf297b08.tar.gz tcl-03bf512eba9ec5dde914e6b2cb171b35cf297b08.tar.bz2 |
Reference implementation of TIP's #22, #33 and #45. Adds the
ability of the [lindex] command to have multiple index arguments,
and adds the [lset] command. Both commands are byte-code compiled.
[Patch #471874] (work by Kenny, commited by Hobbs)
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r-- | generic/tclCompile.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c index 539cb9b..3e71ee7 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -6,11 +6,12 @@ * sequence of instructions ("bytecodes"). * * Copyright (c) 1996-1998 Sun Microsystems, Inc. + * Copyright (c) 2001 by Kevin B. Kenny. All rights reserved. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompile.c,v 1.26 2001/10/15 20:26:57 andreas_kupries Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.27 2001/11/14 23:17:03 hobbs Exp $ */ #include "tclInt.h" @@ -254,6 +255,20 @@ InstructionDesc instructionTable[] = { /* Lappend array element; value is stktop, then elem, array names */ {"lappendStk", 1, 0, {OPERAND_NONE}}, /* Lappend general variable; value is stktop, then unparsed name */ + {"lindexMulti", 5, 1, {OPERAND_UINT4}}, + /* Lindex with generalized args, operand is number of indices. + * (operand) entries from stktop are the indices; then list to + * process. */ + {"over", 5, 1, {OPERAND_UINT4}}, + /* Duplicate the arg-th element from top of stack (TOS=0) */ + {"lsetList", 1, 0, {OPERAND_NONE}}, + /* Four-arg version of 'lset'. stktop is old value; next is + * new element value, next is the index list; pushes new value */ + {"lsetFlat", 5, 1, {OPERAND_UINT4}}, + /* Three- or >=5-arg version of 'lset'. stktop is old value, + * next is new element value; next come objc-2 indices; pushes + * the new value. + */ {0} }; |