diff options
author | Guido van Rossum <guido@python.org> | 1990-12-20 15:06:42 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1990-12-20 15:06:42 (GMT) |
commit | 3f5da24ea304e674a9abbdcffc4d671e32aa70f1 (patch) | |
tree | e932e31cb9381f40b7c87c377638216c043b5cfc /Parser/tokenizer.c | |
parent | 226d79eb4a776dd54c9e4544b17deaf928bcef3a (diff) | |
download | cpython-3f5da24ea304e674a9abbdcffc4d671e32aa70f1.zip cpython-3f5da24ea304e674a9abbdcffc4d671e32aa70f1.tar.gz cpython-3f5da24ea304e674a9abbdcffc4d671e32aa70f1.tar.bz2 |
"Compiling" version
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r-- | Parser/tokenizer.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 97eda75..ad6f63a 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -2,13 +2,14 @@ /* XXX This is rather old, should be restructured perhaps */ /* XXX Need a better interface to report errors than writing to stderr */ +/* XXX Should use editor resource to fetch true tab size on Macintosh */ + +#include "pgenheaders.h" -#include <stdio.h> #include <ctype.h> #include "string.h" -#include "PROTO.h" -#include "malloc.h" +#include "fgetsintr.h" #include "tokenizer.h" #include "errcode.h" @@ -20,6 +21,11 @@ #define TABSIZE 8 #endif +/* Forward */ +static struct tok_state *tok_new PROTO((void)); +static int tok_nextc PROTO((struct tok_state *tok)); +static void tok_backup PROTO((struct tok_state *tok, int c)); + /* Token names */ char *tok_name[] = { @@ -352,7 +358,9 @@ tok_get(tok, p_start, p_end) This is also recognized by vi, when it occurs near the beginning or end of the file. (Will vi never die...?) */ int x; - if (sscanf(tok->cur, " vi:set tabsize=%d:", &x) == 1 && + /* XXX The case to (unsigned char *) is needed by THINK C */ + if (sscanf((unsigned char *)tok->cur, + " vi:set tabsize=%d:", &x) == 1 && x >= 1 && x <= 40) { fprintf(stderr, "# vi:set tabsize=%d:\n", x); tok->tabsize = x; |