Skip to content

Rule name conflict and token marking mistakes in the 3.12.0rc grammar #109596

@RobEin

Description

@RobEin

Bug report

Bug description:

This report was originally launched here.

grammars:
3.12.0rc3
3.13.0 alpha 0

Rule name conflict with the follwing two grammar rules:

fstring: star_expressions

and

fstring:
    | FSTRING_START fstring_middle* FSTRING_END

The colon sign is not a soft keyword (":"), it is a token (':') in these rules:

type_param:
    | NAME [type_param_bound] 
    | '*' NAME ":" expression 
    | '*' NAME 
    | '**' NAME ":" expression 
    | '**' NAME

type_param_bound: ":" expression

The equal sign is not a soft keyword ("="), it is a token ('=') in the following rule:

fstring_replacement_field:
    | '{' (yield_expr | star_expressions) "="? [fstring_conversion] [fstring_full_format_spec] '}'

These are more just notation problems in the previous two cases.
In general, this is a problem from that point of view that comparing two texts is slower than comparing two integers.

CPython versions tested on:

3.12

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

3.12only security fixes3.13bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions