gh-104169: Fix test_peg_generator after tokenizer refactoring (#110727)

* Fix test_peg_generator after tokenizer refactoring
* Remove references to tokenizer.c in comments etc.
This commit is contained in:
Lysandros Nikolaou 2023-10-12 09:34:35 +02:00 committed by GitHub
parent 23645420dc
commit 17d65547df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 24 additions and 14 deletions

View file

@ -1,5 +1,5 @@
/* Readline interface for tokenizer.c and [raw_]input() in bltinmodule.c.
/* Readline interface for the tokenizer and [raw_]input() in bltinmodule.c.
By default, or when stdin is not a tty device, we have a super
simple my_readline function using fgets.
Optionally, we can use the GNU readline library.
@ -364,7 +364,7 @@ PyOS_StdioReadline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)
char *(*PyOS_ReadlineFunctionPointer)(FILE *, FILE *, const char *) = NULL;
/* Interface used by tokenizer.c and bltinmodule.c */
/* Interface used by file_tokenizer.c and bltinmodule.c */
char *
PyOS_Readline(FILE *sys_stdin, FILE *sys_stdout, const char *prompt)

View file

@ -14,8 +14,9 @@ static int
warn_invalid_escape_sequence(Parser *p, const char *first_invalid_escape, Token *t)
{
unsigned char c = *first_invalid_escape;
if ((t->type == FSTRING_MIDDLE || t->type == FSTRING_END) && (c == '{' || c == '}')) { // in this case the tokenizer has already emitted a warning,
// see tokenizer.c:warn_invalid_escape_sequence
if ((t->type == FSTRING_MIDDLE || t->type == FSTRING_END) && (c == '{' || c == '}')) {
// in this case the tokenizer has already emitted a warning,
// see Parser/tokenizer/helpers.c:warn_invalid_escape_sequence
return 0;
}