diff options
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/string_parser.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Parser/string_parser.c b/Parser/string_parser.c index f1e0277..bacfd81 100644 --- a/Parser/string_parser.c +++ b/Parser/string_parser.c @@ -13,6 +13,11 @@ static int warn_invalid_escape_sequence(Parser *p, const char *first_invalid_escape, Token *t) { + if (p->call_invalid_rules) { + // Do not report warnings if we are in the second pass of the parser + // to avoid showing the warning twice. + return 0; + } 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, |