Restored None, False, True as non-keywords (reserved words) in PY2 (PY-23305, PY-23364)

Typeshed doesn't contain the definitions for them in __builtins__.pyi
so we have to provide types and detect the builtin status for these
words as a special case.
This commit is contained in:
Andrey Vlasovskikh
2017-04-07 19:14:20 +03:00
committed by Andrey Vlasovskikh
parent 859ed8fb1c
commit 91a45bf7ed
15 changed files with 70 additions and 36 deletions

View File

@@ -13,8 +13,8 @@ PyFile:BlockWithoutColon.py
PyWhilePart
PsiElement(Py:WHILE_KEYWORD)('while')
PsiWhiteSpace(' ')
PyBoolLiteralExpression
PsiElement(Py:TRUE_KEYWORD)('True')
PyReferenceExpression: True
PsiElement(Py:IDENTIFIER)('True')
PsiErrorElement:Colon expected
<empty list>
PsiWhiteSpace('\n ')

View File

@@ -12,8 +12,8 @@ PyFile:ErrorInParameterList.py
PyNamedParameter('filds')
PsiElement(Py:IDENTIFIER)('filds')
PsiElement(Py:EQ)('=')
PyNoneLiteralExpression
PsiElement(Py:NONE_KEYWORD)('None')
PyReferenceExpression: None
PsiElement(Py:IDENTIFIER)('None')
PsiElement(Py:COMMA)(',')
PsiWhiteSpace(' ')
PsiErrorElement:formal parameter name expected

View File

@@ -19,8 +19,8 @@ PyFile:LambdaComprehension.py
<empty list>
PsiElement(Py:COLON)(':')
PsiWhiteSpace(' ')
PyBoolLiteralExpression
PsiElement(Py:TRUE_KEYWORD)('True')
PyReferenceExpression: True
PsiElement(Py:IDENTIFIER)('True')
PsiElement(Py:COMMA)(',')
PsiWhiteSpace(' ')
PyLambdaExpression
@@ -29,8 +29,8 @@ PyFile:LambdaComprehension.py
<empty list>
PsiElement(Py:COLON)(':')
PsiWhiteSpace(' ')
PyBoolLiteralExpression
PsiElement(Py:FALSE_KEYWORD)('False')
PyReferenceExpression: False
PsiElement(Py:IDENTIFIER)('False')
PsiWhiteSpace(' ')
PsiElement(Py:IF_KEYWORD)('if')
PsiWhiteSpace(' ')

View File

@@ -14,8 +14,8 @@ PyFile:NotClosedSlice.py
PyIfPartIf
PsiElement(Py:IF_KEYWORD)('if')
PsiWhiteSpace(' ')
PyBoolLiteralExpression
PsiElement(Py:TRUE_KEYWORD)('True')
PyReferenceExpression: True
PsiElement(Py:IDENTIFIER)('True')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList

View File

@@ -3,8 +3,8 @@ PyFile:ResetAfterSemicolon.py
PyIfPartIf
PsiElement(Py:IF_KEYWORD)('if')
PsiWhiteSpace(' ')
PyBoolLiteralExpression
PsiElement(Py:TRUE_KEYWORD)('True')
PyReferenceExpression: True
PsiElement(Py:IDENTIFIER)('True')
PsiElement(Py:COLON)(':')
PsiWhiteSpace('\n ')
PyStatementList