1010#define MAXFTSTRINGLEVEL 150
1111#define FTSTRING_STACK_INLINE_CAPACITY 1
1212
13- enum interactive_underflow_t {
14- /* Normal mode of operation: return a new token when asked in interactive mode */
15- IUNDERFLOW_NORMAL ,
16- /* Forcefully return ENDMARKER when asked for a new token in interactive mode. This
17- * can be used to prevent the tokenizer to prompt the user for new tokens */
18- IUNDERFLOW_STOP ,
19- };
2013
2114
2215typedef enum {
@@ -74,17 +67,13 @@ struct tok_state {
7467 _PyTok_Off start ;
7568 _PyTok_Off line_start ;
7669 _PyTok_SourceText source ;
77- int fp_interactive ; /* If the file descriptor is interactive */
78- char * interactive_src_start ; /* The start of the source parsed so far in interactive mode */
79- char * interactive_src_end ; /* The end of the source parsed so far in interactive mode */
8070 int done ; /* E_OK normally, E_EOF at EOF, otherwise error code */
8171 /* NB If done != E_OK, cur must be == inp!!! */
8272 FILE * fp ; /* Rest of input; NULL if tokenizing a string */
8373 int indent ; /* Current indentation index */
8474 int indstack [MAXINDENT ]; /* Stack of indents */
8575 int atbol ; /* Nonzero if at begin of new line */
8676 int pendin ; /* Pending indents (if > 0) or dedents (if < 0) */
87- const char * prompt ; /* For interactive prompting */
8877 int lineno ; /* Current line number */
8978 _PyTok_Loc start_loc ;
9079 int level ; /* () [] {} Parentheses nesting level */
@@ -98,15 +87,11 @@ struct tok_state {
9887 int altindstack [MAXINDENT ]; /* Stack of alternate indents */
9988 /* Stuff for PEP 0263 */
10089 char * encoding ; /* Source encoding. */
101- char * str ; /* Source string being tokenized (if tokenizing from a string)*/
10290
10391 struct _PyTok_Reader * reader ;
10492
10593 int type_comments ; /* Whether to look for type comments */
10694
107- /* How to proceed when asked for a new token in interactive mode */
108- enum interactive_underflow_t interactive_underflow ;
109- int report_warnings ;
11095 ftstring_state * ftstring_stack ;
11196 ftstring_state ftstring_stack_inline [FTSTRING_STACK_INLINE_CAPACITY ];
11297 int ftstring_depth ;
@@ -182,7 +167,6 @@ _PyLexer_ByteColumn(const struct tok_state *tok)
182167
183168int _PyLexer_token_setup (struct tok_state * tok , struct token * token , int type , _PyTok_Off start , _PyTok_Off end );
184169
185- struct tok_state * _PyTokenizer_tok_new (void );
186170void _PyTokenizer_Free (struct tok_state * );
187171ftstring_state * _PyLexer_PushFTString (struct tok_state * );
188172void _PyLexer_PopFTString (struct tok_state * );
0 commit comments