pike.git/
src/
language.yacc
Branch:
Tag:
Non-build tags
All tags
No tags
2003-08-20
2003-08-20 12:02:43 by Henrik Grubbström (Grubba) <grubba@grubba.org>
25df64e6b79af0ec819110b538c751f7bd2a37dc (
19
lines) (+
11
/-
8
)
[
Show
|
Annotate
]
Branch:
7.9
Some minor error handling changes.
Rev: src/language.yacc:1.322
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: language.yacc,v 1.
321
2003/
06
/
03
19
:
41
:
11
grubba Exp $
+
|| $Id: language.yacc,v 1.
322
2003/
08
/
20
12
:
02
:
43
grubba Exp $
*/ %pure_parser
113:
/* This is the grammar definition of Pike. */ #include "global.h"
-
RCSID("$Id: language.yacc,v 1.
321
2003/
06
/
03
19
:
41
:
11
grubba Exp $");
+
RCSID("$Id: language.yacc,v 1.
322
2003/
08
/
20
12
:
02
:
43
grubba Exp $");
#ifdef HAVE_MEMORY_H #include <memory.h> #endif
2436:
i=isidentifier($4->u.sval.u.string); if(i<0) {
-
low_start_new_program(
Pike_compiler->new_program
, 2, 0,
+
// Seriously broken...
+
yyerror("Pass 2: program not defined!");
+
low_start_new_program(
0
, 2, 0,
$1, &$<number>$);
-
yyerror("Pass 2: program not defined!");
+
}else{ id=ID_FROM_INT(Pike_compiler->new_program, i); if(IDENTIFIER_IS_CONSTANT(id->identifier_flags)) { struct svalue *s;
-
s=&PROG_FROM_INT(Pike_compiler->new_program,i)->
constants[id->func.offset].sval;
-
if(s
->type==T_PROGRAM)
+
if ((id->func.offset >= 0) &&
+
((
s
=
&PROG_FROM_INT(Pike_compiler->new_program,i)->
+
constants[id
->
func.offset].sval)->
type
==
T_PROGRAM)
)
{ low_start_new_program(s->u.program, 2, $4->u.sval.u.string,
2458:
}else{ yyerror("Pass 2: constant redefined!");
-
low_start_new_program(
Pike_compiler->new_program
, 2, 0,
+
low_start_new_program(
0
, 2, 0,
$1, &$<number>$); } }else{ yyerror("Pass 2: class constant no longer constant!");
-
low_start_new_program(
Pike_compiler->new_program
, 2, 0,
+
low_start_new_program(
0
, 2, 0,
$1, &$<number>$); }