pike.git/
src/
language.yacc
Branch:
Tag:
Non-build tags
All tags
No tags
1999-06-19
1999-06-19 22:10:07 by Henrik Grubbström (Grubba) <grubba@grubba.org>
52b45eacf8eee4572bac0d4e18ebdc115a43c20f (
26
lines) (+
20
/-
6
)
[
Show
|
Annotate
]
Branch:
7.9
yyerror() now survives lex.current_file being NULL.
Rev: src/language.yacc:1.118
181:
/* This is the grammar definition of Pike. */ #include "global.h"
-
RCSID("$Id: language.yacc,v 1.
117
1999/
05
/
26
07
:10:
01
hubbe
Exp $");
+
RCSID("$Id: language.yacc,v 1.
118
1999/
06
/
19
22
:10:
07
grubba
Exp $");
#ifdef HAVE_MEMORY_H #include <memory.h> #endif
2095:
if ( get_master() ) {
+
if (lex.current_file) {
ref_push_string(lex.current_file);
-
+
} else {
+
/* yyerror() can be called from define_function(), which
+
* can be called by the C module initialization code.
+
*/
+
push_constant_text("");
+
}
push_int(lex.current_line); push_text(str); SAFE_APPLY_MASTER("compile_error",3); pop_stack(); }else{
-
+
if (lex.current_file) {
(void)fprintf(stderr, "%s:%ld: %s\n", lex.current_file->str, (long)lex.current_line, str);
-
+
} else {
+
(void)fprintf(stderr, "NULL:%ld: %s\n",
+
(long)lex.current_line,
+
str);
+
}
fflush(stderr); } }