mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
PY-71002 PEP-696: Support new syntax for default types of Type Parameters in new-style declarations
- PEP-696 adds a new syntax for declaring the default types of Type Parameters in new-new style generic classes, functions and type alias statements. Support these grammar changes. - Store info about default types in stubs for Type Parameters - Increment the stub version counter in PyFileElementType GitOrigin-RevId: b6b22e3eaa86ce06132885781e5775a89bf4b840
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d73bf77d9a
commit
7751fceaed
@@ -1056,7 +1056,7 @@ public class StatementParsing extends Parsing implements ITokenTypeRemapper {
|
||||
nextToken();
|
||||
}
|
||||
|
||||
if (!parseIdentifierOrSkip(PyTokenTypes.RBRACKET, PyTokenTypes.COMMA, PyTokenTypes.COLON)) {
|
||||
if (!parseIdentifierOrSkip(PyTokenTypes.RBRACKET, PyTokenTypes.COMMA, PyTokenTypes.COLON, PyTokenTypes.EQ)) {
|
||||
typeParamMarker.drop();
|
||||
return false;
|
||||
}
|
||||
@@ -1066,6 +1066,12 @@ public class StatementParsing extends Parsing implements ITokenTypeRemapper {
|
||||
myBuilder.error(PyParsingBundle.message("PARSE.expected.expression"));
|
||||
}
|
||||
}
|
||||
|
||||
if (matchToken(PyTokenTypes.EQ)) {
|
||||
if (!myContext.getExpressionParser().parseSingleExpression(false)) {
|
||||
myBuilder.error(PyParsingBundle.message("PARSE.expected.expression"));
|
||||
}
|
||||
}
|
||||
typeParamMarker.done(PyElementTypes.TYPE_PARAMETER);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user