mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
"Compiling" version
This commit is contained in:
parent
226d79eb4a
commit
3f5da24ea3
72 changed files with 3363 additions and 2061 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue