pike.git
/
src
/
docode.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/docode.c:1:
/* || 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: docode.c,v 1.
189
2007/
03
/
03
15
:
26
:
54
grubba Exp $
+
|| $Id: docode.c,v 1.
190
2007/
10
/
06
13
:
45
:
22
grubba Exp $
*/ #include "global.h" #include "las.h" #include "program.h" #include "pike_types.h" #include "stralloc.h" #include "interpret.h" #include "constants.h" #include "array.h"
pike.git/src/docode.c:283:
int do_docode(node *n, int flags) { int i; int stack_depth_save = current_stack_depth; int save_current_line=lex.current_line; if(!n) return 0; lex.current_line=n->line_number; #ifdef PIKE_DEBUG if (current_stack_depth == -4711) Pike_fatal("do_docode() used outside docode().\n"); #endif
-
i=do_docode2(
check_node_hash(
n
)
, flags);
+
i=do_docode2(n, flags);
current_stack_depth = stack_depth_save + i; lex.current_line=save_current_line; return i; } static int is_efun(node *n, c_fun fun) { return n && n->token == F_CONSTANT && n->u.sval.subtype == FUNCTION_BUILTIN && n->u.sval.u.efun->function == fun; } static void code_expression(node *n, int flags, char *err) {
-
switch(do_docode(
check_node_hash(
n
)
, flags & ~DO_POP))
+
switch(do_docode(n, flags & ~DO_POP))
{ case 0: my_yyerror("Void expression for %s",err); case 1: return; case 2: Pike_fatal("Internal compiler error (%s), line %ld, file %s\n", err, (long)lex.current_line, lex.current_file?lex.current_file->str:"Unknown"); } }
pike.git/src/docode.c:612:
case F_RANGE_FROM_END: bound_types |= RANGE_HIGH_FROM_END; break; case F_RANGE_OPEN: bound_types |= RANGE_HIGH_OPEN; break; #ifdef PIKE_DEBUG default: Pike_fatal ("Unexpected node %d as range upper bound.\n", high->token); #endif } #ifdef PIKE_DEBUG {
-
int expected_args;
+
int expected_args
= 0
;
switch (bound_types & (RANGE_LOW_OPEN|RANGE_HIGH_OPEN)) { case 0: expected_args = 2; break; case RANGE_LOW_OPEN: case RANGE_HIGH_OPEN: expected_args = 1; break; case RANGE_LOW_OPEN|RANGE_HIGH_OPEN: expected_args = 0; break; } if (num_args != expected_args)
pike.git/src/docode.c:1025:
if(node_is_eq(CDR(n),CAAR(n))) { int num_args; tmp1=do_docode(CDR(n),DO_LVALUE); if(match_types(CDR(n)->type, array_type_string) || match_types(CDR(n)->type, string_type_string) || match_types(CDR(n)->type, object_type_string) || match_types(CDR(n)->type, multiset_type_string) || match_types(CDR(n)->type, mapping_type_string)) {
-
num_args = do_docode(
check_node_hash(
CDAR(n)
)
, 0);
+
num_args = do_docode(CDAR(n), 0);
switch (num_args) { case 0: emit0(F_LTOSVAL1); break; case 1: emit0(F_LTOSVAL2); break; case 2: emit0(F_LTOSVAL3); break; #ifdef PIKE_DEBUG default: Pike_fatal("Arglebargle glop-glyf?\n"); #endif } }else{ emit0(F_LTOSVAL);
-
num_args = do_docode(
check_node_hash(
CDAR(n)
)
, 0);
+
num_args = do_docode(CDAR(n), 0);
} if (CAR (n)->token == F_RANGE) emit_range (CAR (n) DO_IF_DEBUG (COMMA num_args)); else emit0(CAR(n)->token); emit0(n->token); return n->token==F_ASSIGN; }