Branch: Tag:

1996-09-22

1996-09-22 19:40:33 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

Pike

Rev: .cvsignore:1.1.1.1
Rev: README:1.1.1.1
Rev: bin/export.pike:1.1.1.1
Rev: bin/fixdepends.sh:1.1.1.1
Rev: bin/hilfe:1.1.1.1
Rev: bin/htmlify_docs.pike:1.1.1.1
Rev: bin/httpd.pike:1.1.1.1
Rev: bin/metatest:1.1.1.1
Rev: bin/mkpeep.pike:1.1.1.1
Rev: bin/rsif:1.1.1.1
Rev: doc/README:1.1.1.1
Rev: doc/builtin/_verify_internals:1.1.1.1
Rev: doc/builtin/add_constant:1.1.1.1
Rev: doc/builtin/aggregage_multiset:1.1.1.1
Rev: doc/builtin/aggregate:1.1.1.1
Rev: doc/builtin/aggregate_mapping:1.1.1.1
Rev: doc/builtin/alarm:1.1.1.1
Rev: doc/builtin/all_constants:1.1.1.1
Rev: doc/builtin/allocate:1.1.1.1
Rev: doc/builtin/arrayp:1.1.1.1
Rev: doc/builtin/backtrace:1.1.1.1
Rev: doc/builtin/call_function:1.1.1.1
Rev: doc/builtin/clone:1.1.1.1
Rev: doc/builtin/column:1.1.1.1
Rev: doc/builtin/combine_path:1.1.1.1
Rev: doc/builtin/compile_file:1.1.1.1
Rev: doc/builtin/compile_string:1.1.1.1
Rev: doc/builtin/copy_value:1.1.1.1
Rev: doc/builtin/crypt:1.1.1.1
Rev: doc/builtin/ctime:1.1.1.1
Rev: doc/builtin/destruct:1.1.1.1
Rev: doc/builtin/equal:1.1.1.1
Rev: doc/builtin/exit:1.1.1.1
Rev: doc/builtin/floatp:1.1.1.1
Rev: doc/builtin/function_name:1.1.1.1
Rev: doc/builtin/function_object:1.1.1.1
Rev: doc/builtin/functionp:1.1.1.1
Rev: doc/builtin/gc:1.1.1.1
Rev: doc/builtin/getpid:1.1.1.1
Rev: doc/builtin/glob:1.1.1.1
Rev: doc/builtin/hash:1.1.1.1
Rev: doc/builtin/indices:1.1.1.1
Rev: doc/builtin/intp:1.1.1.1
Rev: doc/builtin/kill:1.1.1.1
Rev: doc/builtin/localtime:1.1.1.1
Rev: doc/builtin/lower_case:1.1.1.1
Rev: doc/builtin/m_delete:1.1.1.1
Rev: doc/builtin/mappingp:1.1.1.1
Rev: doc/builtin/mkmapping:1.1.1.1
Rev: doc/builtin/multisetp:1.1.1.1
Rev: doc/builtin/next_object:1.1.1.1
Rev: doc/builtin/object_program:1.1.1.1
Rev: doc/builtin/objectp:1.1.1.1
Rev: doc/builtin/programp:1.1.1.1
Rev: doc/builtin/query_host_name:1.1.1.1
Rev: doc/builtin/query_num_arg:1.1.1.1
Rev: doc/builtin/random:1.1.1.1
Rev: doc/builtin/random_seed:1.1.1.1
Rev: doc/builtin/replace:1.1.1.1
Rev: doc/builtin/reverse:1.1.1.1
Rev: doc/builtin/rows:1.1.1.1
Rev: doc/builtin/rusage:1.1.1.1
Rev: doc/builtin/search:1.1.1.1
Rev: doc/builtin/signal:1.1.1.1
Rev: doc/builtin/signame:1.1.1.1
Rev: doc/builtin/signum:1.1.1.1
Rev: doc/builtin/sizeof:1.1.1.1
Rev: doc/builtin/sleep:1.1.1.1
Rev: doc/builtin/sort:1.1.1.1
Rev: doc/builtin/stringp:1.1.1.1
Rev: doc/builtin/this_object:1.1.1.1
Rev: doc/builtin/throw:1.1.1.1
Rev: doc/builtin/time:1.1.1.1
Rev: doc/builtin/trace:1.1.1.1
Rev: doc/builtin/ualarm:1.1.1.1
Rev: doc/builtin/upper_case:1.1.1.1
Rev: doc/builtin/values:1.1.1.1
Rev: doc/builtin/zero_type:1.1.1.1
Rev: doc/index.bmml:1.1.1.1
Rev: doc/manual/example1:1.1.1.1
Rev: doc/manual/example2:1.1.1.1
Rev: doc/manual/example3:1.1.1.1
Rev: doc/manual/tutorial:1.1.1.1
Rev: doc/operators/and:1.1.1.1
Rev: doc/operators/complement:1.1.1.1
Rev: doc/operators/divide:1.1.1.1
Rev: doc/operators/index:1.1.1.1
Rev: doc/operators/is_equal:1.1.1.1
Rev: doc/operators/is_greater_or_equal:1.1.1.1
Rev: doc/operators/is_greater_than:1.1.1.1
Rev: doc/operators/is_lesser_or_equal:1.1.1.1
Rev: doc/operators/is_lesser_than:1.1.1.1
Rev: doc/operators/logical_and:1.1.1.1
Rev: doc/operators/logical_or:1.1.1.1
Rev: doc/operators/minus:1.1.1.1
Rev: doc/operators/modulo:1.1.1.1
Rev: doc/operators/mult:1.1.1.1
Rev: doc/operators/not:1.1.1.1
Rev: doc/operators/not_equal:1.1.1.1
Rev: doc/operators/operators:1.1.1.1
Rev: doc/operators/or:1.1.1.1
Rev: doc/operators/plus:1.1.1.1
Rev: doc/operators/range:1.1.1.1
Rev: doc/operators/shift_left:1.1.1.1
Rev: doc/operators/shift_right:1.1.1.1
Rev: doc/operators/xor:1.1.1.1
Rev: doc/pike/all.bmml:1.1.1.1
Rev: doc/pike/cast:1.1.1.1
Rev: doc/pike/catch:1.1.1.1
Rev: doc/pike/class:1.1.1.1
Rev: doc/pike/command_line_options:1.1.1.1
Rev: doc/pike/control_structures/break:1.1.1.1
Rev: doc/pike/control_structures/catch:1.1.1.1
Rev: doc/pike/control_structures/continue:1.1.1.1
Rev: doc/pike/control_structures/do-while:1.1.1.1
Rev: doc/pike/control_structures/for:1.1.1.1
Rev: doc/pike/control_structures/foreach:1.1.1.1
Rev: doc/pike/control_structures/if-else:1.1.1.1
Rev: doc/pike/control_structures/return:1.1.1.1
Rev: doc/pike/control_structures/switch:1.1.1.1
Rev: doc/pike/control_structures/while:1.1.1.1
Rev: doc/pike/efuns.bmml:1.1.1.1
Rev: doc/pike/functions:1.1.1.1
Rev: doc/pike/gauge:1.1.1.1
Rev: doc/pike/hilfe:1.1.1.1
Rev: doc/pike/how_to_make_modules:1.1.1.1
Rev: doc/pike/inherit:1.1.1.1
Rev: doc/pike/lambda:1.1.1.1
Rev: doc/pike/modifier:1.1.1.1
Rev: doc/pike/preprocessor:1.1.1.1
Rev: doc/pike/reserved.bmml:1.1.1.1
Rev: doc/pike/sscanf:1.1.1.1
Rev: doc/pike/typeof:1.1.1.1
Rev: doc/pike/variables:1.1.1.1
Rev: doc/simulated/PI:1.1.1.1
Rev: doc/simulated/add_efun:1.1.1.1
Rev: doc/simulated/aggregage_list:1.1.1.1
Rev: doc/simulated/all_efuns:1.1.1.1
Rev: doc/simulated/capitalize:1.1.1.1
Rev: doc/simulated/describe_backtrace:1.1.1.1
Rev: doc/simulated/exec:1.1.1.1
Rev: doc/simulated/explode:1.1.1.1
Rev: doc/simulated/file_size:1.1.1.1
Rev: doc/simulated/filter:1.1.1.1
Rev: doc/simulated/filter_array:1.1.1.1
Rev: doc/simulated/get_function:1.1.1.1
Rev: doc/simulated/getenv:1.1.1.1
Rev: doc/simulated/implode:1.1.1.1
Rev: doc/simulated/l_sizeof:1.1.1.1
Rev: doc/simulated/listp:1.1.1.1
Rev: doc/simulated/m_indices:1.1.1.1
Rev: doc/simulated/m_sizeof:1.1.1.1
Rev: doc/simulated/m_values:1.1.1.1
Rev: doc/simulated/map:1.1.1.1
Rev: doc/simulated/map_array:1.1.1.1
Rev: doc/simulated/master:1.1.1.1
Rev: doc/simulated/member_array:1.1.1.1
Rev: doc/simulated/mklist:1.1.1.1
Rev: doc/simulated/mkmultiset:1.1.1.1
Rev: doc/simulated/perror:1.1.1.1
Rev: doc/simulated/popen:1.1.1.1
Rev: doc/simulated/previous_object:1.1.1.1
Rev: doc/simulated/putenv:1.1.1.1
Rev: doc/simulated/read_bytes:1.1.1.1
Rev: doc/simulated/regexp:1.1.1.1
Rev: doc/simulated/search_array:1.1.1.1
Rev: doc/simulated/sort_array:1.1.1.1
Rev: doc/simulated/spawn:1.1.1.1
Rev: doc/simulated/strlen:1.1.1.1
Rev: doc/simulated/strstr:1.1.1.1
Rev: doc/simulated/sum:1.1.1.1
Rev: doc/simulated/sum_arrays:1.1.1.1
Rev: doc/simulated/system:1.1.1.1
Rev: doc/simulated/this_function:1.1.1.1
Rev: doc/simulated/version:1.1.1.1
Rev: doc/simulated/write:1.1.1.1
Rev: doc/simulated/write_file:1.1.1.1
Rev: doc/types/array:1.1.1.1
Rev: doc/types/float:1.1.1.1
Rev: doc/types/function:1.1.1.1
Rev: doc/types/int:1.1.1.1
Rev: doc/types/mapping:1.1.1.1
Rev: doc/types/mixed:1.1.1.1
Rev: doc/types/multiset:1.1.1.1
Rev: doc/types/object:1.1.1.1
Rev: doc/types/program:1.1.1.1
Rev: doc/types/string:1.1.1.1
Rev: lib/include/array.h:1.1.1.1
Rev: lib/include/array.pre.pike:1.1.1.1
Rev: lib/include/process.h:1.1.1.1
Rev: lib/include/process.pre.pike:1.1.1.1
Rev: lib/include/simulate.h:1.1.1.1
Rev: lib/include/simulate.pre.pike:1.1.1.1
Rev: lib/include/stdio.h:1.1.1.1
Rev: lib/include/stdio.pre.pike:1.1.1.1
Rev: lib/master.pike:1.1.1.1
Rev: src/.cvsignore:1.1.1.1
Rev: src/BUGS:1.1.1.1
Rev: src/COPYING:1.1.1.1
Rev: src/COPYRIGHT:1.1.1.1
Rev: src/ChangeLog:1.1.1.1
Rev: src/DISCLAIMER:1.1.1.1
Rev: src/Makefile.src:1.1.1.1
Rev: src/README:1.1.1.1
Rev: src/alloca.c:1.1.1.1
Rev: src/array.c:1.1.1.1
Rev: src/array.h:1.1.1.1
Rev: src/backend.c:1.1.1.1
Rev: src/backend.h:1.1.1.1
Rev: src/build_modlist_h:1.1.1.1
Rev: src/builtin_functions.c:1.1.1.1
Rev: src/builtin_functions.h:1.1.1.1
Rev: src/callback.c:1.1.1.1
Rev: src/callback.h:1.1.1.1
Rev: src/compilation.h:1.1.1.1
Rev: src/config.cache:1.1.1.1
Rev: src/config.h:1.1.1.1
Rev: src/config.log:1.1.1.1
Rev: src/configure.in:1.1.1.1
Rev: src/constants.c:1.1.1.1
Rev: src/constants.h:1.1.1.1
Rev: src/docode.c:1.1.1.1
Rev: src/docode.h:1.1.1.1
Rev: src/dynamic_buffer.c:1.1.1.1
Rev: src/dynamic_buffer.h:1.1.1.1
Rev: src/efun.h:1.1.1.1
Rev: src/error.c:1.1.1.1
Rev: src/error.h:1.1.1.1
Rev: src/fd_control.c:1.1.1.1
Rev: src/fd_control.h:1.1.1.1
Rev: src/fsort.c:1.1.1.1
Rev: src/fsort.h:1.1.1.1
Rev: src/gc.c:1.1.1.1
Rev: src/gc.h:1.1.1.1
Rev: src/global.h:1.1.1.1
Rev: src/hashtable.c:1.1.1.1
Rev: src/hashtable.h:1.1.1.1
Rev: src/install-sh:1.1.1.1
Rev: src/interpret.c:1.1.1.1
Rev: src/interpret.h:1.1.1.1
Rev: src/language.y:1.1.1.1
Rev: src/las.c:1.1.1.1
Rev: src/las.h:1.1.1.1
Rev: src/lex.c:1.1.1.1
Rev: src/lex.h:1.1.1.1
Rev: src/machine.h.in:1.1.1.1
Rev: src/macros.h:1.1.1.1
Rev: src/main.c:1.1.1.1
Rev: src/main.h:1.1.1.1
Rev: src/mapping.c:1.1.1.1
Rev: src/mapping.h:1.1.1.1
Rev: src/memory.c:1.1.1.1
Rev: src/memory.h:1.1.1.1
Rev: src/module.c:1.1.1.1
Rev: src/module.h:1.1.1.1
Rev: src/modules/.cvsignore:1.1.1.1
Rev: src/modules/Makefile.src:1.1.1.1
Rev: src/modules/call_out/.cvsignore:1.1.1.1
Rev: src/modules/call_out/Makefile.src:1.1.1.1
Rev: src/modules/call_out/call_out.c:1.1.1.1
Rev: src/modules/call_out/configure.in:1.1.1.1
Rev: src/modules/call_out/doc/call_out:1.1.1.1
Rev: src/modules/call_out/doc/call_out_info:1.1.1.1
Rev: src/modules/call_out/doc/find_call_out:1.1.1.1
Rev: src/modules/call_out/doc/remove_call_out:1.1.1.1
Rev: src/modules/configure.in:1.1.1.1
Rev: src/modules/files/.cvsignore:1.1.1.1
Rev: src/modules/files/Makefile.src:1.1.1.1
Rev: src/modules/files/configure.in:1.1.1.1
Rev: src/modules/files/datagram.c:1.1.1.1
Rev: src/modules/files/doc/cd:1.1.1.1
Rev: src/modules/files/doc/errno:1.1.1.1
Rev: src/modules/files/doc/exece:1.1.1.1
Rev: src/modules/files/doc/file:1.1.1.1
Rev: src/modules/files/doc/file_stat:1.1.1.1
Rev: src/modules/files/doc/fork:1.1.1.1
Rev: src/modules/files/doc/get_dir:1.1.1.1
Rev: src/modules/files/doc/getcwd:1.1.1.1
Rev: src/modules/files/doc/mkdir:1.1.1.1
Rev: src/modules/files/doc/mv:1.1.1.1
Rev: src/modules/files/doc/port:1.1.1.1
Rev: src/modules/files/doc/rm:1.1.1.1
Rev: src/modules/files/doc/strerror:1.1.1.1
Rev: src/modules/files/doc/werror:1.1.1.1
Rev: src/modules/files/efuns.c:1.1.1.1
Rev: src/modules/files/file.c:1.1.1.1
Rev: src/modules/files/file.h:1.1.1.1
Rev: src/modules/files/file_machine.h.in:1.1.1.1
Rev: src/modules/files/socket.c:1.1.1.1
Rev: src/modules/gdbmmod/.cvsignore:1.1.1.1
Rev: src/modules/gdbmmod/Makefile.src:1.1.1.1
Rev: src/modules/gdbmmod/configure.in:1.1.1.1
Rev: src/modules/gdbmmod/doc/gdbm:1.1.1.1
Rev: src/modules/gdbmmod/gdbm_machine.h.in:1.1.1.1
Rev: src/modules/gdbmmod/gdbmmod.c:1.1.1.1
Rev: src/modules/gmpmod/.cvsignore:1.1.1.1
Rev: src/modules/gmpmod/Makefile.src:1.1.1.1
Rev: src/modules/gmpmod/configure.in:1.1.1.1
Rev: src/modules/gmpmod/doc/mpz:1.1.1.1
Rev: src/modules/gmpmod/gmp_machine.h.in:1.1.1.1
Rev: src/modules/gmpmod/mpz_glue.c:1.1.1.1
Rev: src/modules/image/Makefile.in:1.1.1.1
Rev: src/modules/image/Makefile.src:1.1.1.1
Rev: src/modules/image/configure:1.1.1.1
Rev: src/modules/image/configure.in:1.1.1.1
Rev: src/modules/image/dependencies:1.1.1.1
Rev: src/modules/image/doc.txt:1.1.1.1
Rev: src/modules/image/doc/image.html:1.1.1.1
Rev: src/modules/image/font.c:1.1.1.1
Rev: src/modules/image/image.c:1.1.1.1
Rev: src/modules/image/image.h:1.1.1.1
Rev: src/modules/image/lzw.c:1.1.1.1
Rev: src/modules/image/lzw.h:1.1.1.1
Rev: src/modules/image/quant.c:1.1.1.1
Rev: src/modules/image/togif.c:1.1.1.1
Rev: src/modules/math/.cvsignore:1.1.1.1
Rev: src/modules/math/Makefile.src:1.1.1.1
Rev: src/modules/math/configure.in:1.1.1.1
Rev: src/modules/math/doc/acos:1.1.1.1
Rev: src/modules/math/doc/asin:1.1.1.1
Rev: src/modules/math/doc/atan:1.1.1.1
Rev: src/modules/math/doc/ceil:1.1.1.1
Rev: src/modules/math/doc/cos:1.1.1.1
Rev: src/modules/math/doc/exp:1.1.1.1
Rev: src/modules/math/doc/floor:1.1.1.1
Rev: src/modules/math/doc/log:1.1.1.1
Rev: src/modules/math/doc/pow:1.1.1.1
Rev: src/modules/math/doc/sin:1.1.1.1
Rev: src/modules/math/doc/sqrt:1.1.1.1
Rev: src/modules/math/doc/tan:1.1.1.1
Rev: src/modules/math/math.c:1.1.1.1
Rev: src/modules/module_dir_marker:1.1.1.1
Rev: src/modules/pipe/Makefile.in:1.1.1.1
Rev: src/modules/pipe/Makefile.src:1.1.1.1
Rev: src/modules/pipe/config.h:1.1.1.1
Rev: src/modules/pipe/configure:1.1.1.1
Rev: src/modules/pipe/configure.in:1.1.1.1
Rev: src/modules/pipe/dependencies:1.1.1.1
Rev: src/modules/pipe/pipe.c:1.1.1.1
Rev: src/modules/readlinemod/.cvsignore:1.1.1.1
Rev: src/modules/readlinemod/Makefile.src:1.1.1.1
Rev: src/modules/readlinemod/configure.in:1.1.1.1
Rev: src/modules/readlinemod/doc/readline:1.1.1.1
Rev: src/modules/readlinemod/readline_machine.h.in:1.1.1.1
Rev: src/modules/readlinemod/readlinemod.c:1.1.1.1
Rev: src/modules/regexp/.cvsignore:1.1.1.1
Rev: src/modules/regexp/Makefile.src:1.1.1.1
Rev: src/modules/regexp/configure.in:1.1.1.1
Rev: src/modules/regexp/doc/regexp:1.1.1.1
Rev: src/modules/regexp/glue.c:1.1.1.1
Rev: src/modules/regexp/regexp.c:1.1.1.1
Rev: src/modules/regexp/regexp.h:1.1.1.1
Rev: src/modules/spider/Makefile.in:1.1.1.1
Rev: src/modules/spider/Makefile.src:1.1.1.1
Rev: src/modules/spider/configure:1.1.1.1
Rev: src/modules/spider/configure.in:1.1.1.1
Rev: src/modules/spider/defs.h:1.1.1.1
Rev: src/modules/spider/dependencies:1.1.1.1
Rev: src/modules/spider/discdate.c:1.1.1.1
Rev: src/modules/spider/encode_decode.c:1.1.1.1
Rev: src/modules/spider/http_parse.c:1.1.1.1
Rev: src/modules/spider/lock.c:1.1.1.1
Rev: src/modules/spider/lock.h:1.1.1.1
Rev: src/modules/spider/sdebug.c:1.1.1.1
Rev: src/modules/spider/shared_mem_mapping.c:1.1.1.1
Rev: src/modules/spider/sharedmem.c:1.1.1.1
Rev: src/modules/spider/sharedmem.h:1.1.1.1
Rev: src/modules/spider/spider.c:1.1.1.1
Rev: src/modules/spider/spider.h.in:1.1.1.1
Rev: src/modules/spider/stardate.c:1.1.1.1
Rev: src/modules/spider/streamed_parser.c:1.1.1.1
Rev: src/modules/spider/streamed_parser.h:1.1.1.1
Rev: src/modules/spider/tree.c:1.1.1.1
Rev: src/modules/sprintf/.cvsignore:1.1.1.1
Rev: src/modules/sprintf/Makefile.src:1.1.1.1
Rev: src/modules/sprintf/configure.in:1.1.1.1
Rev: src/modules/sprintf/doc/sprintf:1.1.1.1
Rev: src/modules/sprintf/sprintf.c:1.1.1.1
Rev: src/multiset.c:1.1.1.1
Rev: src/multiset.h:1.1.1.1
Rev: src/object.c:1.1.1.1
Rev: src/object.h:1.1.1.1
Rev: src/opcodes.c:1.1.1.1
Rev: src/opcodes.h:1.1.1.1
Rev: src/operators.c:1.1.1.1
Rev: src/operators.h:1.1.1.1
Rev: src/otable.h:1.1.1.1
Rev: src/peep.c:1.1.1.1
Rev: src/peep.h:1.1.1.1
Rev: src/peep.in:1.1.1.1
Rev: src/pike_types.c:1.1.1.1
Rev: src/pike_types.h:1.1.1.1
Rev: src/port.c:1.1.1.1
Rev: src/port.h:1.1.1.1
Rev: src/program.c:1.1.1.1
Rev: src/program.h:1.1.1.1
Rev: src/run_autoconfig:1.1.1.1
Rev: src/rusage.c:1.1.1.1
Rev: src/rusage.h:1.1.1.1
Rev: src/signal_handler.c:1.1.1.1
Rev: src/signal_handler.h:1.1.1.1
Rev: src/stamp-h:1.1.1.1
Rev: src/stralloc.c:1.1.1.1
Rev: src/stralloc.h:1.1.1.1
Rev: src/stuff.c:1.1.1.1
Rev: src/stuff.h:1.1.1.1
Rev: src/svalue.c:1.1.1.1
Rev: src/svalue.h:1.1.1.1
Rev: src/test/.cvsignore:1.1.1.1
Rev: src/test/create_testsuite:1.1.1.1
Rev: src/test/test_pike.pike:1.1.1.1
Rev: src/time_stuff.h:1.1.1.1
Rev: src/todo:1.1.1.1
Rev: src/types.h:1.1.1.1
Rev: src/ualarm.c:1.1.1.1

1:   /*\ - ||| This file a part of uLPC, and is copyright by Fredrik Hubinette - ||| uLPC is distributed as GPL (General Public License) + ||| This file a part of Pike, and is copyright by Fredrik Hubinette + ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/ - #include <setjmp.h> +    #include "global.h"   #include "language.h"   #include "interpret.h"
13:   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h" - #include "lpc_types.h" - #include "add_efun.h" + #include "pike_types.h" + #include "constants.h"   #include "mapping.h" - #include "list.h" + #include "multiset.h"   #include "error.h"   #include "docode.h"   #include "main.h"   #include "memory.h" -  + #include "operators.h"      #define LASDEBUG   
67:      INT32 count_args(node *n)   { +  int a,b;    if(!n) return 0;    switch(n->token)    {    case F_VAL_LVAL:    case F_ARG_LIST: -  return count_args(CAR(n)) + count_args(CDR(n)); +  a=count_args(CAR(n)); +  if(a==-1) return -1; +  b=count_args(CDR(n)); +  if(b==-1) return -1; +  return a+b;       case F_CAST:    if(n->type == void_type_string)
96:    case '?':    {    int tmp1,tmp2; -  tmp1=count_args(CDAR(n)); -  tmp2=count_args(CDAR(n)); +  tmp1=count_args(CADR(n)); +  tmp2=count_args(CDDR(n)); +  if(tmp1==-1 || tmp2==-2) return -1;    if(tmp1 < tmp2) return tmp1;    return tmp2;    }    -  +  case F_PUSH_ARRAY: +  return -1; +     default:    if(n->type == void_type_string) return 0;    return 1;
155:    break;       case F_APPLY: +  if(a && a->token == F_CONSTANT && +  a->u.sval.type == T_FUNCTION && +  a->u.sval.subtype == -1) +  { +  res->node_info |= a->u.sval.u.efun->flags; +  }else{    res->node_info |= OPT_SIDE_EFFECT | OPT_EXTERNAL_DEPEND; /* for now */ -  +  }    break;       case F_RETURN:
200:    return res;   }    - node *mkstrnode(struct lpc_string *str) + node *mkstrnode(struct pike_string *str)   {    node *res = mkemptynode();    res->token = F_CONSTANT;
250:   node *mkefuncallnode(char *function, node *args)   {    struct efun *fun; -  struct lpc_string *name; +  struct pike_string *name;    name = findstring(function);    if(!name)    {
267:    return mkapplynode(mksvaluenode(&fun->function), args);   }    + node *mkopernode(char *oper_id, node *arg1, node *arg2) + { +  if(arg1 && arg2) +  arg1=mknode(F_ARG_LIST,arg1,arg2); +  +  return mkefuncallnode(oper_id, arg1); + } +    node *mklocalnode(int var)   {    node *res = mkemptynode();
297:    return res;   }    - node *mkcastnode(struct lpc_string *type,node *n) + node *mkcastnode(struct pike_string *type,node *n)   {    node *res;    if(!n) return 0;
327:    switch(a->token)    {    case F_LOCAL: +  case F_IDENTIFIER:    return a->u.number == b->u.number;       case F_CAST:
371:    case T_ARRAY:    return make_node_from_array(s->u.array);    -  case T_LIST: -  return make_node_from_list(s->u.list); +  case T_MULTISET: +  return make_node_from_multiset(s->u.multiset);       case T_MAPPING:    return make_node_from_mapping(s->u.mapping);
414:    switch(n->token)    {    case F_LOCAL: -  case F_EFUN: +  case F_IDENTIFIER:    b=mkintnode(0);    *b=*n;    copy_shared_string(b->type, n->type);
504:    }   }    - static node **last_cmd(node **a) + node **last_cmd(node **a)   {    node **n;    if(!a || !*a) return (node **)NULL;
548:    return 0;   }    - /* static node **my_get_arg(node **a,int n) { return low_get_arg(a,&n); } */ + node **my_get_arg(node **a,int n) { return low_get_arg(a,&n); }   /* static node **first_arg(node **a) { return my_get_arg(a,0); } */      static void low_print_tree(node *foo,int needlval)
914:      void fix_type_field(node *n)   { -  struct lpc_string *type_a,*type_b; +  struct pike_string *type_a,*type_b;       if(n->type) return; /* assume it is correct */   
936:    }    break;    +  case F_ASSIGN: +  if(CAR(n) && CDR(n) && +  !match_types(CDR(n)->type,CAR(n)->type)) +  my_yyerror("Bad type in assignment.\n"); +  copy_shared_string(n->type, CDR(n)->type); +  break; +     case F_INDEX:    type_a=CAR(n)->type;    type_b=CDR(n)->type;
946:       case F_APPLY:    { -  struct lpc_string *s; +  struct pike_string *s;    push_type(T_MIXED); /* match any return type, even void */    push_type(T_VOID); /* not varargs */    push_type(T_MANY);
1032:    n->type = get_type_of_svalue(& n->u.sval);    break;    -  /* Not yet checked, but we know what they should return */ -  case F_NOT: -  case F_LT: -  case F_LE: -  case F_EQ: -  case F_NE: -  case F_GT: -  case F_GE: -  case F_MOD: -  case F_XOR: -  case F_LSH: -  case F_RSH: -  case F_COMPL: -  copy_shared_string(n->type,int_type_string); -  break; -  +     case F_ARG_LIST:    if(!CAR(n) || CAR(n)->type==void_type_string)    {
1148:       switch(n->token)    { +  case F_APPLY: +  if(CAR(n)->token == F_CONSTANT && +  CAR(n)->u.sval.type == T_FUNCTION && +  CAR(n)->u.sval.subtype == -1 && /* driver fun? */ +  CAR(n)->u.sval.u.efun->optimize) +  { +  if(tmp1=CAR(n)->u.sval.u.efun->optimize(n)) +  goto use_tmp1; +  } +  break; +     case F_ARG_LIST:    case F_LVALUE_LIST:    if(!CAR(n)) goto use_cdr;
1269:    }       /* -  * if X and Y are free from 'continue' || X is null +  * if X and Y are free from 'continue' or X is null, +  * then the following optimizations can be done:    * for(;++e; X) Y; -> ++ne_loop(e, -1) { Y ; X }    * for(;e++; X) Y; -> ++ne_loop(e, 0) { Y; X }    * for(;--e; X) Y; -> --ne_loop(e, 1) { Y; X }
1283:    (!CDDR(n) || !(CDDR(n)->tree_info & OPT_CONTINUE)) &&    (!CADR(n) || !(CADR(n)->tree_info & OPT_CONTINUE)) )    { +  /* Check which of the above cases.. */    switch(CAR(n)->token)    {    case F_POST_DEC: token=F_DEC_NEQ_LOOP; inc=-1; break;
1292:    default: fatal("Impossible error\n"); return;    }    +  /* Build new tree */    tmp1=mknode(token,    mknode(F_VAL_LVAL,    mkintnode(inc),
1303:    goto use_tmp1;    }    +  /* Last is a pointer to the place where the incrementor is in the +  * tree. This is needed so we can nullify this pointer later and +  * free the rest of the tree +  */    last=&(CDDR(n)); -  tmp1=last?*last:(node *)NULL; +  tmp1=*last; +  +  /* We're not interested in casts to void */ +  while(tmp1 && +  tmp1->token == F_CAST && +  tmp1->type == void_type_string) +  { +  last=&CAR(tmp1); +  tmp1=*last; +  } +  +  /* If there is an incrementor, and it is one of x++, ++x, x-- or ++x */    if(tmp1 && (tmp1->token==F_INC ||    tmp1->token==F_POST_INC ||    tmp1->token==F_DEC ||    tmp1->token==F_POST_DEC))    { -  +  node *opnode, **arg1, **arg2; +  int oper; +     /* does it increment or decrement ? */    if(tmp1->token==F_INC || tmp1->token==F_POST_INC)    inc=1;    else    inc=0;    -  /* for(; x op y; z ++) p; */ +  /* for(; arg1 oper arg2; z ++) p; */    -  if(CAR(n)->token!=F_GT && -  CAR(n)->token!=F_GE && -  CAR(n)->token!=F_LE && -  CAR(n)->token!=F_LT && -  CAR(n)->token!=F_NE) +  opnode=CAR(n); +  +  if(opnode->token == F_APPLY && +  CAR(opnode) && +  CAR(opnode)->token == F_CONSTANT && +  CAR(opnode)->u.sval.type == T_FUNCTION && +  CAR(opnode)->u.sval.subtype == -1) +  { +  if(CAR(opnode)->u.sval.u.efun->function == f_gt) +  oper=F_GT; +  else if(CAR(opnode)->u.sval.u.efun->function == f_ge) +  oper=F_GE; +  else if(CAR(opnode)->u.sval.u.efun->function == f_lt) +  oper=F_LT; +  else if(CAR(opnode)->u.sval.u.efun->function == f_le) +  oper=F_LE; +  else if(CAR(opnode)->u.sval.u.efun->function == f_ne) +  oper=F_NE; +  else    break; -  +  }else{ +  break; +  }    -  if(!node_is_eq(CAAR(n),CAR(tmp1)) || /* x == z */ -  depend_p(CDAR(n),CDAR(n)) || /* does y depend on y? */ -  depend_p(CDAR(n),CAAR(n)) || /* does y depend on x? */ -  depend_p(CDAR(n),CADR(n))) /* does y depend on p? */ +  if(count_args(CDR(opnode)) != 2) break; +  arg1=my_get_arg(&CDR(opnode), 0); +  arg2=my_get_arg(&CDR(opnode), 1); +  +  /* it was not on the form for(; x op y; z++) p; */ +  if(!node_is_eq(*arg1,CAR(tmp1)) || /* x == z */ +  depend_p(*arg2,*arg2) || /* does y depend on y? */ +  depend_p(*arg2,*arg1) || /* does y depend on x? */ +  depend_p(*arg2,CADR(n))) /* does y depend on p? */    {    /* it was not on the form for(; x op y; x++) p; */ -  if(!node_is_eq(CADR(n),CAR(tmp1)) || /* y == z */ -  depend_p(CAAR(n),CDAR(n)) || /* does x depend on y? */ -  depend_p(CAAR(n),CAAR(n)) || /* does x depend on x? */ -  depend_p(CAAR(n),CADR(n)) /* does x depend on p? */ +  if(!node_is_eq(*arg2,CAR(tmp1)) || /* y == z */ +  depend_p(*arg1,*arg2) || /* does x depend on y? */ +  depend_p(*arg1,*arg1) || /* does x depend on x? */ +  depend_p(*arg1,CADR(n)) /* does x depend on p? */    )    {    /* it was not on the form for(; x op y; y++) p; */    break;    }else{ -  +  node **tmparg;    /* for(; x op y; y++) p; -> for(; y op^-1 x; y++) p; */    -  switch(CAR(n)->token) +  switch(oper)    { -  case F_LT: CAR(n)->token=F_GT; break; -  case F_LE: CAR(n)->token=F_GE; break; -  case F_GT: CAR(n)->token=F_LT; break; -  case F_GE: CAR(n)->token=F_LE; break; +  case F_LT: oper=F_GT; break; +  case F_LE: oper=F_GE; break; +  case F_GT: oper=F_LT; break; +  case F_GE: oper=F_LE; break;    } -  tmp2=CAAR(n); -  CAAR(n)=CDAR(n); -  CDAR(n)=tmp2; +  +  tmparg=arg1; +  arg1=arg2; +  arg2=tmparg;    }    }    if(inc)    { -  if(CAR(n)->token==F_LE) -  tmp3=mknode(F_ADD,CDAR(n),mkintnode(1)); -  else if(CAR(n)->token==F_LT) -  tmp3=CDAR(n); +  if(oper==F_LE) +  tmp3=mkopernode("`+",*arg2,mkintnode(1)); +  else if(oper==F_LT) +  tmp3=*arg2;    else    break;    }else{ -  if(CAR(n)->token==F_GE) -  tmp3=mknode(F_SUBTRACT,CDAR(n),mkintnode(1)); -  else if(CAR(n)->token==F_GT) -  tmp3=CDAR(n); +  if(oper==F_GE) +  tmp3=mkopernode("`-",*arg2,mkintnode(1)); +  else if(oper==F_GT) +  tmp3=*arg2;    else    break;    }       *last=0; -  if(CAR(n)->token==F_NE) +  if(oper==F_NE)    {    if(inc)    token=F_INC_NEQ_LOOP;
1384:    else    token=F_DEC_LOOP;    } -  tmp2=mknode(token,mknode(F_VAL_LVAL,tmp3,CAAR(n)),CADR(n)); -  CAAR(n) = CADR(n) = CDAR(n) = CDDR(n)=0; +  tmp2=mknode(token,mknode(F_VAL_LVAL,tmp3,*arg1),CADR(n)); +  *arg1 = *arg2 = CADR(n) =0;       if(inc)    {
1393:    }else{    tmp1->token=F_INC;    } +     tmp1=mknode(F_ARG_LIST,mkcastnode(void_type_string,tmp1),tmp2);    goto use_tmp1;    }
1483:    {    fake_program.num_strings--;    free_string(fake_program.strings[fake_program.num_strings]); -  areas[A_STRINGS].s.len-=sizeof(struct lpc_string *); +  areas[A_STRINGS].s.len-=sizeof(struct pike_string *);    }       while(fake_program.num_constants > num_constants)
1537:      INT32 last_function_opt_info;    - void dooptcode(struct lpc_string *name,node *n, int args) + void dooptcode(struct pike_string *name,node *n, int args)   {   #ifdef DEBUG    if(a_flag > 1) -  fprintf(stderr,"Doing function: %s\n",name->str); +  fprintf(stderr,"Doing function '%s' at %x\n",name->str,PC);   #endif    last_function_opt_info=OPT_SIDE_EFFECT;    n=mknode(F_ARG_LIST,n,0);