@zzzen/pyright-internal 1.2.0-dev.20230625 → 1.2.0-dev.20230702
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyzer/binder.js +9 -1
- package/dist/analyzer/binder.js.map +1 -1
- package/dist/analyzer/constructors.js +13 -0
- package/dist/analyzer/constructors.js.map +1 -1
- package/dist/analyzer/program.d.ts +1 -0
- package/dist/analyzer/program.js +52 -33
- package/dist/analyzer/program.js.map +1 -1
- package/dist/analyzer/sourceFile.js +1 -0
- package/dist/analyzer/sourceFile.js.map +1 -1
- package/dist/analyzer/sourceFileInfoUtils.d.ts +4 -2
- package/dist/analyzer/sourceFileInfoUtils.js +67 -10
- package/dist/analyzer/sourceFileInfoUtils.js.map +1 -1
- package/dist/analyzer/typeEvaluator.js +1 -1
- package/dist/analyzer/typeEvaluator.js.map +1 -1
- package/dist/backgroundThreadBase.js +1 -1
- package/dist/backgroundThreadBase.js.map +1 -1
- package/dist/languageServerBase.js +2 -1
- package/dist/languageServerBase.js.map +1 -1
- package/dist/languageService/documentSymbolCollector.js +2 -2
- package/dist/languageService/documentSymbolCollector.js.map +1 -1
- package/dist/parser/parseNodes.d.ts +2 -1
- package/dist/parser/parseNodes.js +2 -1
- package/dist/parser/parseNodes.js.map +1 -1
- package/dist/parser/parser.js +10 -10
- package/dist/parser/parser.js.map +1 -1
- package/dist/pyright.js +1 -0
- package/dist/pyright.js.map +1 -1
- package/dist/tests/chainedSourceFiles.test.js +39 -1
- package/dist/tests/chainedSourceFiles.test.js.map +1 -1
- package/dist/tests/typeEvaluator3.test.js +5 -1
- package/dist/tests/typeEvaluator3.test.js.map +1 -1
- package/dist/tests/typeEvaluator4.test.js +5 -1
- package/dist/tests/typeEvaluator4.test.js.map +1 -1
- package/dist/workspaceFactory.d.ts +2 -1
- package/dist/workspaceFactory.js +3 -2
- package/dist/workspaceFactory.js.map +1 -1
- package/package.json +1 -1
package/dist/parser/parser.js
CHANGED
@@ -1182,7 +1182,7 @@ class Parser {
|
|
1182
1182
|
return forNode;
|
1183
1183
|
}
|
1184
1184
|
// comp_iter: comp_for | comp_if
|
1185
|
-
_tryParseListComprehension(target) {
|
1185
|
+
_tryParseListComprehension(target, isGenerator) {
|
1186
1186
|
const compFor = this._tryParseCompForStatement();
|
1187
1187
|
if (!compFor) {
|
1188
1188
|
return undefined;
|
@@ -1193,7 +1193,7 @@ class Parser {
|
|
1193
1193
|
else if (target.nodeType === 16 /* DictionaryExpandEntry */) {
|
1194
1194
|
this._addError(localize_1.Localizer.Diagnostic.dictExpandIllegalInComprehension(), target);
|
1195
1195
|
}
|
1196
|
-
const listCompNode = parseNodes_1.ListComprehensionNode.create(target);
|
1196
|
+
const listCompNode = parseNodes_1.ListComprehensionNode.create(target, isGenerator);
|
1197
1197
|
const forIfList = [compFor];
|
1198
1198
|
while (true) {
|
1199
1199
|
const compIter = this._tryParseCompForStatement() || this._tryParseCompIfStatement();
|
@@ -2965,7 +2965,7 @@ class Parser {
|
|
2965
2965
|
}
|
2966
2966
|
}
|
2967
2967
|
else {
|
2968
|
-
const listComp = this._tryParseListComprehension(valueExpr);
|
2968
|
+
const listComp = this._tryParseListComprehension(valueExpr, /* isGenerator */ true);
|
2969
2969
|
if (listComp) {
|
2970
2970
|
valueExpr = listComp;
|
2971
2971
|
}
|
@@ -3133,7 +3133,7 @@ class Parser {
|
|
3133
3133
|
}
|
3134
3134
|
return yieldExpr;
|
3135
3135
|
}
|
3136
|
-
const exprListResult = this._parseTestListWithComprehension();
|
3136
|
+
const exprListResult = this._parseTestListWithComprehension(/* isGenerator */ true);
|
3137
3137
|
const tupleOrExpression = this._makeExpressionOrTuple(exprListResult, /* enclosedInParens */ true);
|
3138
3138
|
(0, parseNodes_1.extendRange)(tupleOrExpression, startParen);
|
3139
3139
|
if (this._peekTokenType() !== 14 /* CloseParenthesis */) {
|
@@ -3150,7 +3150,7 @@ class Parser {
|
|
3150
3150
|
var _a;
|
3151
3151
|
const startBracket = this._getNextToken();
|
3152
3152
|
(0, debug_1.assert)(startBracket.type === 15 /* OpenBracket */);
|
3153
|
-
const exprListResult = this._parseTestListWithComprehension();
|
3153
|
+
const exprListResult = this._parseTestListWithComprehension(/* isGenerator */ false);
|
3154
3154
|
const closeBracket = this._peekToken();
|
3155
3155
|
if (!this._consumeTokenIfType(16 /* CloseBracket */)) {
|
3156
3156
|
return this._handleExpressionParseError(9 /* MissingListCloseBracket */, localize_1.Localizer.Diagnostic.expectedCloseBracket(), startBracket, (_a = exprListResult.parseError) !== null && _a !== void 0 ? _a : _createList());
|
@@ -3171,11 +3171,11 @@ class Parser {
|
|
3171
3171
|
return listAtom;
|
3172
3172
|
}
|
3173
3173
|
}
|
3174
|
-
_parseTestListWithComprehension() {
|
3174
|
+
_parseTestListWithComprehension(isGenerator) {
|
3175
3175
|
let sawComprehension = false;
|
3176
3176
|
return this._parseExpressionListGeneric(() => {
|
3177
3177
|
let expr = this._parseTestOrStarExpression(/* allowAssignmentExpression */ true);
|
3178
|
-
const listComp = this._tryParseListComprehension(expr);
|
3178
|
+
const listComp = this._tryParseListComprehension(expr, isGenerator);
|
3179
3179
|
if (listComp) {
|
3180
3180
|
expr = listComp;
|
3181
3181
|
sawComprehension = true;
|
@@ -3228,7 +3228,7 @@ class Parser {
|
|
3228
3228
|
else {
|
3229
3229
|
const keyEntryNode = parseNodes_1.DictionaryKeyEntryNode.create(keyExpression, valueExpression);
|
3230
3230
|
let dictEntry = keyEntryNode;
|
3231
|
-
const listComp = this._tryParseListComprehension(keyEntryNode);
|
3231
|
+
const listComp = this._tryParseListComprehension(keyEntryNode, /* isGenerator */ false);
|
3232
3232
|
if (listComp) {
|
3233
3233
|
dictEntry = listComp;
|
3234
3234
|
sawListComprehension = true;
|
@@ -3248,7 +3248,7 @@ class Parser {
|
|
3248
3248
|
const listEntryNode = parseNodes_1.DictionaryExpandEntryNode.create(doubleStarExpression);
|
3249
3249
|
(0, parseNodes_1.extendRange)(listEntryNode, doubleStar);
|
3250
3250
|
let expandEntryNode = listEntryNode;
|
3251
|
-
const listComp = this._tryParseListComprehension(listEntryNode);
|
3251
|
+
const listComp = this._tryParseListComprehension(listEntryNode, /* isGenerator */ false);
|
3252
3252
|
if (listComp) {
|
3253
3253
|
expandEntryNode = listComp;
|
3254
3254
|
sawListComprehension = true;
|
@@ -3270,7 +3270,7 @@ class Parser {
|
|
3270
3270
|
this._addError(localize_1.Localizer.Diagnostic.dictKeyValuePairs(), keyExpression);
|
3271
3271
|
}
|
3272
3272
|
else {
|
3273
|
-
const listComp = this._tryParseListComprehension(keyExpression);
|
3273
|
+
const listComp = this._tryParseListComprehension(keyExpression, /* isGenerator */ false);
|
3274
3274
|
if (listComp) {
|
3275
3275
|
keyExpression = listComp;
|
3276
3276
|
sawListComprehension = true;
|