diff options
| author | Simon Tatham <anakin@pobox.com> | 2001-12-14 12:44:14 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2001-12-14 12:44:14 +0000 |
| commit | 22b1d999006ac7b67d675305087677c589f03cd6 (patch) | |
| tree | 1664e3b07694656820d4b9835933b1044cf7c619 /error.c | |
| parent | e06e29ae22c80de7f1b12fa5b81350a21a3ad3b3 (diff) | |
| download | halibut-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.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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); |