Branch: Tag:

2004-10-30

2004-10-30 11:38:29 by Martin Stjernholm <mast@lysator.liu.se>

Implemented from-the-end indexing in ranges using the a[..<1] syntax. Added
`[..]. Still to do: Avoid fallback to `[] for ranges if it doesn't take two
args.

Rev: src/docode.c:1.181
Rev: src/interpret.c:1.358
Rev: src/interpret_functions.h:1.176
Rev: src/language.yacc:1.347
Rev: src/las.c:1.351
Rev: src/lexer.h:1.51
Rev: src/opcodes.h:1.41
Rev: src/operators.c:1.198
Rev: src/operators.h:1.16
Rev: src/pike_types.c:1.238
Rev: src/program.c:1.573
Rev: src/program.h:1.213
Rev: src/testsuite.in:1.741
Rev: src/treeopt.in:1.74

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: program.c,v 1.572 2004/10/22 23:24:49 nilsson Exp $ + || $Id: program.c,v 1.573 2004/10/30 11:38:27 mast Exp $   */      #include "global.h"
148:    "_equal",    "_m_delete",    "_get_iterator", +  "`[..]",    /* NOTE: After this point there are only fake lfuns. */    "_search",   };
204:    tFuncV(tMix,tVoid,tInt), /* "_equal", */    tFuncV(tZero,tVoid,tMix), /* "_m_delete", */    tFuncV(tNone,tVoid,tObj), /* "_get_iterator", */ +  tFuncV(tZero tRangeBound tZero tRangeBound, tVoid, tMix), /* "`[..]" */    /* NOTE: After this point there are only fake lfuns. */    tFuncV(tZero tOr(tZero, tVoid), tVoid, tMix), /* "_search", */   };
799:    *! It's assumed that this function is side-effect free.    */    + /*! @decl mixed lfun::`[..](zero low, int low_bound_type, zero high, int high_bound_type) +  *! +  *! Subrange callback. +  *! +  *! @note +  *! It's assumed that this function is side-effect free. +  *! +  *! @seealso +  *! @[predef::`[..]] +  */ +    /*! @decl mixed lfun::`[](zero arg1, zero|void arg2)    *! -  *! Index/subrange callback. +  *! Indexing callback.    *! -  +  *! For compatibility, this is also called to do subranges unless +  *! there is a @[`[..]] in the class. See @[predef::`[..]] for +  *! details. +  *!    *! @note    *! It's assumed that this function is side-effect free.    *!    *! @seealso -  *! @[predef::`[]()] +  *! @[predef::`[]()], @[predef::`[..]]    */      /*! @decl mixed lfun::`[]=(zero arg1, zero arg2)