summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2001-12-14 12:44:14 +0000
committerSimon Tatham <anakin@pobox.com>2001-12-14 12:44:14 +0000
commit22b1d999006ac7b67d675305087677c589f03cd6 (patch)
tree1664e3b07694656820d4b9835933b1044cf7c619 /error.c
parente06e29ae22c80de7f1b12fa5b81350a21a3ad3b3 (diff)
downloadhalibut-22b1d999006ac7b67d675305087677c589f03cd6.zip
halibut-22b1d999006ac7b67d675305087677c589f03cd6.tar.gz
halibut-22b1d999006ac7b67d675305087677c589f03cd6.tar.bz2
halibut-22b1d999006ac7b67d675305087677c589f03cd6.tar.xz
Keywords are now collected using a B-tree rather than an array with
heapsort. This makes the code much simpler for a start, but the main reason is so that we can spot duplicate keywords as we go along rather than having to wait until the end of input processing. [originally from svn r1489]
Diffstat (limited to 'error.c')
-rw-r--r--error.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/error.c b/error.c
index d115073..4f7524c 100644
--- a/error.c
+++ b/error.c
@@ -18,7 +18,7 @@ static void do_error(int code, va_list ap) {
char auxbuf[256];
char *sp, *sp2;
wchar_t *wsp;
- filepos fpos;
+ filepos fpos, fpos2;
int flags;
switch(code) {
@@ -175,6 +175,15 @@ static void do_error(int code, va_list ap) {
"previously defined `%.200s'", sp, sp2);
flags = FILEPOS;
break;
+ case err_multikw:
+ fpos = *va_arg(ap, filepos *);
+ fpos2 = *va_arg(ap, filepos *);
+ wsp = va_arg(ap, wchar_t *);
+ sp = ustrtoa(wsp, auxbuf, sizeof(auxbuf));
+ sprintf(error, "paragraph keyword `%.200s' already defined at ", sp);
+ sprintf(error + strlen(error), "%s:%d", fpos2.filename, fpos2.line);
+ flags = FILEPOS;
+ break;
case err_whatever:
sp = va_arg(ap, char *);
vsprintf(error, sp, ap);