@zzzen/pyright-internal 1.1.254
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/aliasDeclarationUtils.d.ts +9 -0
- package/dist/analyzer/aliasDeclarationUtils.js +128 -0
- package/dist/analyzer/aliasDeclarationUtils.js.map +1 -0
- package/dist/analyzer/analysis.d.ts +18 -0
- package/dist/analyzer/analysis.js +81 -0
- package/dist/analyzer/analysis.js.map +1 -0
- package/dist/analyzer/analyzerFileInfo.d.ts +39 -0
- package/dist/analyzer/analyzerFileInfo.js +17 -0
- package/dist/analyzer/analyzerFileInfo.js.map +1 -0
- package/dist/analyzer/analyzerNodeInfo.d.ts +32 -0
- package/dist/analyzer/analyzerNodeInfo.js +138 -0
- package/dist/analyzer/analyzerNodeInfo.js.map +1 -0
- package/dist/analyzer/backgroundAnalysisProgram.d.ts +54 -0
- package/dist/analyzer/backgroundAnalysisProgram.js +222 -0
- package/dist/analyzer/backgroundAnalysisProgram.js.map +1 -0
- package/dist/analyzer/binder.d.ts +149 -0
- package/dist/analyzer/binder.js +3195 -0
- package/dist/analyzer/binder.js.map +1 -0
- package/dist/analyzer/checker.d.ts +116 -0
- package/dist/analyzer/checker.js +3828 -0
- package/dist/analyzer/checker.js.map +1 -0
- package/dist/analyzer/circularDependency.d.ts +7 -0
- package/dist/analyzer/circularDependency.js +51 -0
- package/dist/analyzer/circularDependency.js.map +1 -0
- package/dist/analyzer/codeFlowEngine.d.ts +21 -0
- package/dist/analyzer/codeFlowEngine.js +1132 -0
- package/dist/analyzer/codeFlowEngine.js.map +1 -0
- package/dist/analyzer/codeFlowTypes.d.ts +82 -0
- package/dist/analyzer/codeFlowTypes.js +134 -0
- package/dist/analyzer/codeFlowTypes.js.map +1 -0
- package/dist/analyzer/codeFlowUtils.d.ts +2 -0
- package/dist/analyzer/codeFlowUtils.js +348 -0
- package/dist/analyzer/codeFlowUtils.js.map +1 -0
- package/dist/analyzer/commentUtils.d.ts +4 -0
- package/dist/analyzer/commentUtils.js +131 -0
- package/dist/analyzer/commentUtils.js.map +1 -0
- package/dist/analyzer/constraintSolver.d.ts +7 -0
- package/dist/analyzer/constraintSolver.js +605 -0
- package/dist/analyzer/constraintSolver.js.map +1 -0
- package/dist/analyzer/constructorTransform.d.ts +4 -0
- package/dist/analyzer/constructorTransform.js +219 -0
- package/dist/analyzer/constructorTransform.js.map +1 -0
- package/dist/analyzer/dataClasses.d.ts +9 -0
- package/dist/analyzer/dataClasses.js +762 -0
- package/dist/analyzer/dataClasses.js.map +1 -0
- package/dist/analyzer/declaration.d.ts +90 -0
- package/dist/analyzer/declaration.js +42 -0
- package/dist/analyzer/declaration.js.map +1 -0
- package/dist/analyzer/declarationUtils.d.ts +12 -0
- package/dist/analyzer/declarationUtils.js +212 -0
- package/dist/analyzer/declarationUtils.js.map +1 -0
- package/dist/analyzer/docStringConversion.d.ts +2 -0
- package/dist/analyzer/docStringConversion.js +699 -0
- package/dist/analyzer/docStringConversion.js.map +1 -0
- package/dist/analyzer/docStringUtils.d.ts +3 -0
- package/dist/analyzer/docStringUtils.js +103 -0
- package/dist/analyzer/docStringUtils.js.map +1 -0
- package/dist/analyzer/functionTransform.d.ts +4 -0
- package/dist/analyzer/functionTransform.js +96 -0
- package/dist/analyzer/functionTransform.js.map +1 -0
- package/dist/analyzer/importResolver.d.ts +97 -0
- package/dist/analyzer/importResolver.js +1617 -0
- package/dist/analyzer/importResolver.js.map +1 -0
- package/dist/analyzer/importResult.d.ts +33 -0
- package/dist/analyzer/importResult.js +11 -0
- package/dist/analyzer/importResult.js.map +1 -0
- package/dist/analyzer/importStatementUtils.d.ts +46 -0
- package/dist/analyzer/importStatementUtils.js +618 -0
- package/dist/analyzer/importStatementUtils.js.map +1 -0
- package/dist/analyzer/namedTuples.d.ts +5 -0
- package/dist/analyzer/namedTuples.js +342 -0
- package/dist/analyzer/namedTuples.js.map +1 -0
- package/dist/analyzer/packageTypeReport.d.ts +52 -0
- package/dist/analyzer/packageTypeReport.js +45 -0
- package/dist/analyzer/packageTypeReport.js.map +1 -0
- package/dist/analyzer/packageTypeVerifier.d.ts +37 -0
- package/dist/analyzer/packageTypeVerifier.js +908 -0
- package/dist/analyzer/packageTypeVerifier.js.map +1 -0
- package/dist/analyzer/parentDirectoryCache.d.ts +23 -0
- package/dist/analyzer/parentDirectoryCache.js +71 -0
- package/dist/analyzer/parentDirectoryCache.js.map +1 -0
- package/dist/analyzer/parseTreeCleaner.d.ts +8 -0
- package/dist/analyzer/parseTreeCleaner.js +51 -0
- package/dist/analyzer/parseTreeCleaner.js.map +1 -0
- package/dist/analyzer/parseTreeUtils.d.ts +98 -0
- package/dist/analyzer/parseTreeUtils.js +1753 -0
- package/dist/analyzer/parseTreeUtils.js.map +1 -0
- package/dist/analyzer/parseTreeWalker.d.ts +81 -0
- package/dist/analyzer/parseTreeWalker.js +437 -0
- package/dist/analyzer/parseTreeWalker.js.map +1 -0
- package/dist/analyzer/patternMatching.d.ts +6 -0
- package/dist/analyzer/patternMatching.js +866 -0
- package/dist/analyzer/patternMatching.js.map +1 -0
- package/dist/analyzer/program.d.ts +158 -0
- package/dist/analyzer/program.js +1902 -0
- package/dist/analyzer/program.js.map +1 -0
- package/dist/analyzer/properties.d.ts +10 -0
- package/dist/analyzer/properties.js +368 -0
- package/dist/analyzer/properties.js.map +1 -0
- package/dist/analyzer/protocols.d.ts +8 -0
- package/dist/analyzer/protocols.js +409 -0
- package/dist/analyzer/protocols.js.map +1 -0
- package/dist/analyzer/pyTypedUtils.d.ts +6 -0
- package/dist/analyzer/pyTypedUtils.js +42 -0
- package/dist/analyzer/pyTypedUtils.js.map +1 -0
- package/dist/analyzer/pythonPathUtils.d.ts +14 -0
- package/dist/analyzer/pythonPathUtils.js +173 -0
- package/dist/analyzer/pythonPathUtils.js.map +1 -0
- package/dist/analyzer/scope.d.ts +39 -0
- package/dist/analyzer/scope.js +110 -0
- package/dist/analyzer/scope.js.map +1 -0
- package/dist/analyzer/scopeUtils.d.ts +6 -0
- package/dist/analyzer/scopeUtils.js +72 -0
- package/dist/analyzer/scopeUtils.js.map +1 -0
- package/dist/analyzer/service.d.ts +144 -0
- package/dist/analyzer/service.js +1197 -0
- package/dist/analyzer/service.js.map +1 -0
- package/dist/analyzer/sourceFile.d.ts +123 -0
- package/dist/analyzer/sourceFile.js +908 -0
- package/dist/analyzer/sourceFile.js.map +1 -0
- package/dist/analyzer/sourceMapper.d.ts +47 -0
- package/dist/analyzer/sourceMapper.js +543 -0
- package/dist/analyzer/sourceMapper.js.map +1 -0
- package/dist/analyzer/staticExpressions.d.ts +4 -0
- package/dist/analyzer/staticExpressions.js +242 -0
- package/dist/analyzer/staticExpressions.js.map +1 -0
- package/dist/analyzer/symbol.d.ts +50 -0
- package/dist/analyzer/symbol.js +160 -0
- package/dist/analyzer/symbol.js.map +1 -0
- package/dist/analyzer/symbolNameUtils.d.ts +8 -0
- package/dist/analyzer/symbolNameUtils.js +53 -0
- package/dist/analyzer/symbolNameUtils.js.map +1 -0
- package/dist/analyzer/symbolUtils.d.ts +7 -0
- package/dist/analyzer/symbolUtils.js +46 -0
- package/dist/analyzer/symbolUtils.js.map +1 -0
- package/dist/analyzer/testWalker.d.ts +14 -0
- package/dist/analyzer/testWalker.js +92 -0
- package/dist/analyzer/testWalker.js.map +1 -0
- package/dist/analyzer/tracePrinter.d.ts +11 -0
- package/dist/analyzer/tracePrinter.js +222 -0
- package/dist/analyzer/tracePrinter.js.map +1 -0
- package/dist/analyzer/typeCache.d.ts +40 -0
- package/dist/analyzer/typeCache.js +134 -0
- package/dist/analyzer/typeCache.js.map +1 -0
- package/dist/analyzer/typeDocStringUtils.d.ts +12 -0
- package/dist/analyzer/typeDocStringUtils.js +293 -0
- package/dist/analyzer/typeDocStringUtils.js.map +1 -0
- package/dist/analyzer/typeEvaluator.d.ts +18 -0
- package/dist/analyzer/typeEvaluator.js +16598 -0
- package/dist/analyzer/typeEvaluator.js.map +1 -0
- package/dist/analyzer/typeEvaluatorTypes.d.ts +220 -0
- package/dist/analyzer/typeEvaluatorTypes.js +16 -0
- package/dist/analyzer/typeEvaluatorTypes.js.map +1 -0
- package/dist/analyzer/typeEvaluatorWithTracker.d.ts +6 -0
- package/dist/analyzer/typeEvaluatorWithTracker.js +121 -0
- package/dist/analyzer/typeEvaluatorWithTracker.js.map +1 -0
- package/dist/analyzer/typeGuards.d.ts +6 -0
- package/dist/analyzer/typeGuards.js +1293 -0
- package/dist/analyzer/typeGuards.js.map +1 -0
- package/dist/analyzer/typePrinter.d.ts +17 -0
- package/dist/analyzer/typePrinter.js +603 -0
- package/dist/analyzer/typePrinter.js.map +1 -0
- package/dist/analyzer/typeStubWriter.d.ts +48 -0
- package/dist/analyzer/typeStubWriter.js +605 -0
- package/dist/analyzer/typeStubWriter.js.map +1 -0
- package/dist/analyzer/typeUtils.d.ts +134 -0
- package/dist/analyzer/typeUtils.js +2380 -0
- package/dist/analyzer/typeUtils.js.map +1 -0
- package/dist/analyzer/typeVarContext.d.ts +50 -0
- package/dist/analyzer/typeVarContext.js +250 -0
- package/dist/analyzer/typeVarContext.js.map +1 -0
- package/dist/analyzer/typedDicts.d.ts +12 -0
- package/dist/analyzer/typedDicts.js +695 -0
- package/dist/analyzer/typedDicts.js.map +1 -0
- package/dist/analyzer/types.d.ts +484 -0
- package/dist/analyzer/types.js +1844 -0
- package/dist/analyzer/types.js.map +1 -0
- package/dist/backgroundAnalysis.d.ts +14 -0
- package/dist/backgroundAnalysis.js +42 -0
- package/dist/backgroundAnalysis.js.map +1 -0
- package/dist/backgroundAnalysisBase.d.ts +83 -0
- package/dist/backgroundAnalysisBase.js +429 -0
- package/dist/backgroundAnalysisBase.js.map +1 -0
- package/dist/backgroundThreadBase.d.ts +34 -0
- package/dist/backgroundThreadBase.js +134 -0
- package/dist/backgroundThreadBase.js.map +1 -0
- package/dist/commands/commandController.d.ts +13 -0
- package/dist/commands/commandController.js +48 -0
- package/dist/commands/commandController.js.map +1 -0
- package/dist/commands/commandResult.d.ts +9 -0
- package/dist/commands/commandResult.js +19 -0
- package/dist/commands/commandResult.js.map +1 -0
- package/dist/commands/commands.d.ts +7 -0
- package/dist/commands/commands.js +11 -0
- package/dist/commands/commands.js.map +1 -0
- package/dist/commands/createTypeStub.d.ts +8 -0
- package/dist/commands/createTypeStub.js +50 -0
- package/dist/commands/createTypeStub.js.map +1 -0
- package/dist/commands/quickActionCommand.d.ts +8 -0
- package/dist/commands/quickActionCommand.js +31 -0
- package/dist/commands/quickActionCommand.js.map +1 -0
- package/dist/commands/restartServer.d.ts +8 -0
- package/dist/commands/restartServer.js +20 -0
- package/dist/commands/restartServer.js.map +1 -0
- package/dist/common/cancellationUtils.d.ts +16 -0
- package/dist/common/cancellationUtils.js +60 -0
- package/dist/common/cancellationUtils.js.map +1 -0
- package/dist/common/chokidarFileWatcherProvider.d.ts +9 -0
- package/dist/common/chokidarFileWatcherProvider.js +88 -0
- package/dist/common/chokidarFileWatcherProvider.js.map +1 -0
- package/dist/common/collectionUtils.d.ts +114 -0
- package/dist/common/collectionUtils.js +292 -0
- package/dist/common/collectionUtils.js.map +1 -0
- package/dist/common/commandLineOptions.d.ts +41 -0
- package/dist/common/commandLineOptions.js +46 -0
- package/dist/common/commandLineOptions.js.map +1 -0
- package/dist/common/configOptions.d.ts +144 -0
- package/dist/common/configOptions.js +908 -0
- package/dist/common/configOptions.js.map +1 -0
- package/dist/common/console.d.ts +61 -0
- package/dist/common/console.js +191 -0
- package/dist/common/console.js.map +1 -0
- package/dist/common/core.d.ts +67 -0
- package/dist/common/core.js +118 -0
- package/dist/common/core.js.map +1 -0
- package/dist/common/crypto.d.ts +1 -0
- package/dist/common/crypto.js +37 -0
- package/dist/common/crypto.js.map +1 -0
- package/dist/common/debug.d.ts +13 -0
- package/dist/common/debug.js +131 -0
- package/dist/common/debug.js.map +1 -0
- package/dist/common/deferred.d.ts +11 -0
- package/dist/common/deferred.js +62 -0
- package/dist/common/deferred.js.map +1 -0
- package/dist/common/diagnostic.d.ts +59 -0
- package/dist/common/diagnostic.js +134 -0
- package/dist/common/diagnostic.js.map +1 -0
- package/dist/common/diagnosticRules.d.ts +67 -0
- package/dist/common/diagnosticRules.js +83 -0
- package/dist/common/diagnosticRules.js.map +1 -0
- package/dist/common/diagnosticSink.d.ts +34 -0
- package/dist/common/diagnosticSink.js +110 -0
- package/dist/common/diagnosticSink.js.map +1 -0
- package/dist/common/editAction.d.ts +29 -0
- package/dist/common/editAction.js +11 -0
- package/dist/common/editAction.js.map +1 -0
- package/dist/common/extensibility.d.ts +11 -0
- package/dist/common/extensibility.js +10 -0
- package/dist/common/extensibility.js.map +1 -0
- package/dist/common/extensions.d.ts +3 -0
- package/dist/common/extensions.js +15 -0
- package/dist/common/extensions.js.map +1 -0
- package/dist/common/fileBasedCancellationUtils.d.ts +11 -0
- package/dist/common/fileBasedCancellationUtils.js +259 -0
- package/dist/common/fileBasedCancellationUtils.js.map +1 -0
- package/dist/common/fileSystem.d.ts +72 -0
- package/dist/common/fileSystem.js +69 -0
- package/dist/common/fileSystem.js.map +1 -0
- package/dist/common/fullAccessHost.d.ts +19 -0
- package/dist/common/fullAccessHost.js +193 -0
- package/dist/common/fullAccessHost.js.map +1 -0
- package/dist/common/host.d.ts +21 -0
- package/dist/common/host.js +30 -0
- package/dist/common/host.js.map +1 -0
- package/dist/common/logTracker.d.ts +15 -0
- package/dist/common/logTracker.js +129 -0
- package/dist/common/logTracker.js.map +1 -0
- package/dist/common/lspUtils.d.ts +3 -0
- package/dist/common/lspUtils.js +20 -0
- package/dist/common/lspUtils.js.map +1 -0
- package/dist/common/memUtils.d.ts +3 -0
- package/dist/common/memUtils.js +37 -0
- package/dist/common/memUtils.js.map +1 -0
- package/dist/common/pathConsts.d.ts +8 -0
- package/dist/common/pathConsts.js +19 -0
- package/dist/common/pathConsts.js.map +1 -0
- package/dist/common/pathUtils.d.ts +170 -0
- package/dist/common/pathUtils.js +762 -0
- package/dist/common/pathUtils.js.map +1 -0
- package/dist/common/positionUtils.d.ts +7 -0
- package/dist/common/positionUtils.js +71 -0
- package/dist/common/positionUtils.js.map +1 -0
- package/dist/common/progressReporter.d.ts +15 -0
- package/dist/common/progressReporter.js +44 -0
- package/dist/common/progressReporter.js.map +1 -0
- package/dist/common/pythonVersion.d.ts +20 -0
- package/dist/common/pythonVersion.js +71 -0
- package/dist/common/pythonVersion.js.map +1 -0
- package/dist/common/realFileSystem.d.ts +8 -0
- package/dist/common/realFileSystem.js +368 -0
- package/dist/common/realFileSystem.js.map +1 -0
- package/dist/common/stringUtils.d.ts +47 -0
- package/dist/common/stringUtils.js +160 -0
- package/dist/common/stringUtils.js.map +1 -0
- package/dist/common/textEditUtils.d.ts +3 -0
- package/dist/common/textEditUtils.js +29 -0
- package/dist/common/textEditUtils.js.map +1 -0
- package/dist/common/textRange.d.ts +47 -0
- package/dist/common/textRange.js +211 -0
- package/dist/common/textRange.js.map +1 -0
- package/dist/common/textRangeCollection.d.ts +13 -0
- package/dist/common/textRangeCollection.js +108 -0
- package/dist/common/textRangeCollection.js.map +1 -0
- package/dist/common/timing.d.ts +31 -0
- package/dist/common/timing.js +100 -0
- package/dist/common/timing.js.map +1 -0
- package/dist/common/uriParser.d.ts +12 -0
- package/dist/common/uriParser.js +25 -0
- package/dist/common/uriParser.js.map +1 -0
- package/dist/common/workspaceEditUtils.d.ts +7 -0
- package/dist/common/workspaceEditUtils.js +63 -0
- package/dist/common/workspaceEditUtils.js.map +1 -0
- package/dist/languageServerBase.d.ts +211 -0
- package/dist/languageServerBase.js +923 -0
- package/dist/languageServerBase.js.map +1 -0
- package/dist/languageService/analyzerServiceExecutor.d.ts +8 -0
- package/dist/languageService/analyzerServiceExecutor.js +97 -0
- package/dist/languageService/analyzerServiceExecutor.js.map +1 -0
- package/dist/languageService/autoImporter.d.ts +84 -0
- package/dist/languageService/autoImporter.js +635 -0
- package/dist/languageService/autoImporter.js.map +1 -0
- package/dist/languageService/callHierarchyProvider.d.ts +12 -0
- package/dist/languageService/callHierarchyProvider.js +368 -0
- package/dist/languageService/callHierarchyProvider.js.map +1 -0
- package/dist/languageService/codeActionProvider.d.ts +6 -0
- package/dist/languageService/codeActionProvider.js +53 -0
- package/dist/languageService/codeActionProvider.js.map +1 -0
- package/dist/languageService/completionProvider.d.ts +147 -0
- package/dist/languageService/completionProvider.js +2220 -0
- package/dist/languageService/completionProvider.js.map +1 -0
- package/dist/languageService/definitionProvider.d.ts +17 -0
- package/dist/languageService/definitionProvider.js +206 -0
- package/dist/languageService/definitionProvider.js.map +1 -0
- package/dist/languageService/documentHighlightProvider.d.ts +7 -0
- package/dist/languageService/documentHighlightProvider.js +63 -0
- package/dist/languageService/documentHighlightProvider.js.map +1 -0
- package/dist/languageService/documentSymbolCollector.d.ts +37 -0
- package/dist/languageService/documentSymbolCollector.js +344 -0
- package/dist/languageService/documentSymbolCollector.js.map +1 -0
- package/dist/languageService/documentSymbolProvider.d.ts +37 -0
- package/dist/languageService/documentSymbolProvider.js +308 -0
- package/dist/languageService/documentSymbolProvider.js.map +1 -0
- package/dist/languageService/hoverProvider.d.ts +25 -0
- package/dist/languageService/hoverProvider.js +366 -0
- package/dist/languageService/hoverProvider.js.map +1 -0
- package/dist/languageService/importAdder.d.ts +24 -0
- package/dist/languageService/importAdder.js +296 -0
- package/dist/languageService/importAdder.js.map +1 -0
- package/dist/languageService/importSorter.d.ts +15 -0
- package/dist/languageService/importSorter.js +152 -0
- package/dist/languageService/importSorter.js.map +1 -0
- package/dist/languageService/indentationUtils.d.ts +4 -0
- package/dist/languageService/indentationUtils.js +597 -0
- package/dist/languageService/indentationUtils.js.map +1 -0
- package/dist/languageService/quickActions.d.ts +4 -0
- package/dist/languageService/quickActions.js +97 -0
- package/dist/languageService/quickActions.js.map +1 -0
- package/dist/languageService/referencesProvider.d.ts +36 -0
- package/dist/languageService/referencesProvider.js +236 -0
- package/dist/languageService/referencesProvider.js.map +1 -0
- package/dist/languageService/renameModuleProvider.d.ts +58 -0
- package/dist/languageService/renameModuleProvider.js +884 -0
- package/dist/languageService/renameModuleProvider.js.map +1 -0
- package/dist/languageService/signatureHelpProvider.d.ts +26 -0
- package/dist/languageService/signatureHelpProvider.js +180 -0
- package/dist/languageService/signatureHelpProvider.js.map +1 -0
- package/dist/languageService/tooltipUtils.d.ts +9 -0
- package/dist/languageService/tooltipUtils.js +129 -0
- package/dist/languageService/tooltipUtils.js.map +1 -0
- package/dist/localization/localize.d.ts +1324 -0
- package/dist/localization/localize.js +788 -0
- package/dist/localization/localize.js.map +1 -0
- package/dist/localization/package.nls.de.json +1 -0
- package/dist/localization/package.nls.en-us.json +636 -0
- package/dist/localization/package.nls.es.json +1 -0
- package/dist/localization/package.nls.fr.json +1 -0
- package/dist/localization/package.nls.ja.json +1 -0
- package/dist/localization/package.nls.ru.json +1 -0
- package/dist/localization/package.nls.zh-cn.json +1 -0
- package/dist/localization/package.nls.zh-tw.json +1 -0
- package/dist/nodeMain.d.ts +1 -0
- package/dist/nodeMain.js +21 -0
- package/dist/nodeMain.js.map +1 -0
- package/dist/nodeServer.d.ts +3 -0
- package/dist/nodeServer.js +31 -0
- package/dist/nodeServer.js.map +1 -0
- package/dist/parser/characterStream.d.ts +27 -0
- package/dist/parser/characterStream.js +120 -0
- package/dist/parser/characterStream.js.map +1 -0
- package/dist/parser/characters.d.ts +17 -0
- package/dist/parser/characters.js +240 -0
- package/dist/parser/characters.js.map +1 -0
- package/dist/parser/parseNodes.d.ts +750 -0
- package/dist/parser/parseNodes.js +1406 -0
- package/dist/parser/parseNodes.js.map +1 -0
- package/dist/parser/parser.d.ts +191 -0
- package/dist/parser/parser.js +3806 -0
- package/dist/parser/parser.js.map +1 -0
- package/dist/parser/stringTokenUtils.d.ts +25 -0
- package/dist/parser/stringTokenUtils.js +455 -0
- package/dist/parser/stringTokenUtils.js.map +1 -0
- package/dist/parser/tokenizer.d.ts +71 -0
- package/dist/parser/tokenizer.js +1111 -0
- package/dist/parser/tokenizer.js.map +1 -0
- package/dist/parser/tokenizerTypes.d.ts +223 -0
- package/dist/parser/tokenizerTypes.js +164 -0
- package/dist/parser/tokenizerTypes.js.map +1 -0
- package/dist/parser/unicode.d.ts +23 -0
- package/dist/parser/unicode.js +2899 -0
- package/dist/parser/unicode.js.map +1 -0
- package/dist/pyright.d.ts +1 -0
- package/dist/pyright.js +645 -0
- package/dist/pyright.js.map +1 -0
- package/dist/pyrightFileSystem.d.ts +28 -0
- package/dist/pyrightFileSystem.js +196 -0
- package/dist/pyrightFileSystem.js.map +1 -0
- package/dist/readonlyAugmentedFileSystem.d.ts +40 -0
- package/dist/readonlyAugmentedFileSystem.js +155 -0
- package/dist/readonlyAugmentedFileSystem.js.map +1 -0
- package/dist/server.d.ts +21 -0
- package/dist/server.js +232 -0
- package/dist/server.js.map +1 -0
- package/dist/tests/chainedSourceFiles.test.d.ts +1 -0
- package/dist/tests/chainedSourceFiles.test.js +153 -0
- package/dist/tests/chainedSourceFiles.test.js.map +1 -0
- package/dist/tests/checker.test.d.ts +1 -0
- package/dist/tests/checker.test.js +346 -0
- package/dist/tests/checker.test.js.map +1 -0
- package/dist/tests/collectionUtils.test.d.ts +1 -0
- package/dist/tests/collectionUtils.test.js +153 -0
- package/dist/tests/collectionUtils.test.js.map +1 -0
- package/dist/tests/common.test.d.ts +1 -0
- package/dist/tests/common.test.js +125 -0
- package/dist/tests/common.test.js.map +1 -0
- package/dist/tests/config.test.d.ts +1 -0
- package/dist/tests/config.test.js +230 -0
- package/dist/tests/config.test.js.map +1 -0
- package/dist/tests/debug.test.d.ts +1 -0
- package/dist/tests/debug.test.js +102 -0
- package/dist/tests/debug.test.js.map +1 -0
- package/dist/tests/deferred.test.d.ts +1 -0
- package/dist/tests/deferred.test.js +65 -0
- package/dist/tests/deferred.test.js.map +1 -0
- package/dist/tests/diagnosticOverrides.test.d.ts +1 -0
- package/dist/tests/diagnosticOverrides.test.js +108 -0
- package/dist/tests/diagnosticOverrides.test.js.map +1 -0
- package/dist/tests/docStringConversion.test.d.ts +1 -0
- package/dist/tests/docStringConversion.test.js +695 -0
- package/dist/tests/docStringConversion.test.js.map +1 -0
- package/dist/tests/docStringUtils.test.d.ts +1 -0
- package/dist/tests/docStringUtils.test.js +70 -0
- package/dist/tests/docStringUtils.test.js.map +1 -0
- package/dist/tests/documentSymbolCollector.test.d.ts +1 -0
- package/dist/tests/documentSymbolCollector.test.js +635 -0
- package/dist/tests/documentSymbolCollector.test.js.map +1 -0
- package/dist/tests/filesystem.test.d.ts +1 -0
- package/dist/tests/filesystem.test.js +194 -0
- package/dist/tests/filesystem.test.js.map +1 -0
- package/dist/tests/fourSlashParser.test.d.ts +1 -0
- package/dist/tests/fourSlashParser.test.js +281 -0
- package/dist/tests/fourSlashParser.test.js.map +1 -0
- package/dist/tests/fourSlashRunner.test.d.ts +1 -0
- package/dist/tests/fourSlashRunner.test.js +52 -0
- package/dist/tests/fourSlashRunner.test.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.js +30 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.Type.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.js +42 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.Found.duplication.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.js +13 -0
- package/dist/tests/fourslash/completions.autoimport.Lib.NotFound.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.js +23 -0
- package/dist/tests/fourslash/completions.autoimport.disabled.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.js +35 -0
- package/dist/tests/fourslash/completions.autoimport.duplicates.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.autoimport.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.js +128 -0
- package/dist/tests/fourslash/completions.autoimport.fromImport.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.autoimport.plainText.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.js +43 -0
- package/dist/tests/fourslash/completions.autoimport.shadow.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.js +29 -0
- package/dist/tests/fourslash/completions.autoimport.submodule.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.js +50 -0
- package/dist/tests/fourslash/completions.autoimport.topLevel.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.js +116 -0
- package/dist/tests/fourslash/completions.builtinDocstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.builtinOverride.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.builtinOverride.fourslash.js +21 -0
- package/dist/tests/fourslash/completions.builtinOverride.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.js +54 -0
- package/dist/tests/fourslash/completions.call.stringLiteral.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.js +245 -0
- package/dist/tests/fourslash/completions.call.typedDict.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.js +162 -0
- package/dist/tests/fourslash/completions.call.typedDict.list.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.js +132 -0
- package/dist/tests/fourslash/completions.call.typedDict.states.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.classVariable.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.classVariable.fourslash.js +37 -0
- package/dist/tests/fourslash/completions.classVariable.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.comment.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.comment.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.comment.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.class.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.class.fourslash.js +30 -0
- package/dist/tests/fourslash/completions.declNames.class.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.exception.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.exception.fourslash.js +18 -0
- package/dist/tests/fourslash/completions.declNames.exception.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.for.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.for.fourslash.js +26 -0
- package/dist/tests/fourslash/completions.declNames.for.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.js +15 -0
- package/dist/tests/fourslash/completions.declNames.importAlias.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.js +36 -0
- package/dist/tests/fourslash/completions.declNames.lambda.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.method.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.method.fourslash.js +68 -0
- package/dist/tests/fourslash/completions.declNames.method.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.js +147 -0
- package/dist/tests/fourslash/completions.declNames.overload.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.js +131 -0
- package/dist/tests/fourslash/completions.declNames.topLevelOverload.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.js +73 -0
- package/dist/tests/fourslash/completions.dictionary.keys.complex.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.js +58 -0
- package/dist/tests/fourslash/completions.dictionary.keys.expression.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.js +154 -0
- package/dist/tests/fourslash/completions.dictionary.keys.literalTypes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.js +143 -0
- package/dist/tests/fourslash/completions.dictionary.keys.simple.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.js +109 -0
- package/dist/tests/fourslash/completions.dictionary.keys.stringLiterals.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.js +50 -0
- package/dist/tests/fourslash/completions.dictionary.keys.symbols.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.enums.members.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.enums.members.fourslash.js +44 -0
- package/dist/tests/fourslash/completions.enums.members.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.excluded.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.excluded.fourslash.js +12 -0
- package/dist/tests/fourslash/completions.excluded.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fourslash.js +51 -0
- package/dist/tests/fourslash/completions.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fstring.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fstring.fourslash.js +32 -0
- package/dist/tests/fourslash/completions.fstring.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.js +96 -0
- package/dist/tests/fourslash/completions.fstring.stringLiteral.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.js +30 -0
- package/dist/tests/fourslash/completions.fuzzyMatching.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.importDunderNames.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.importDunderNames.fourslash.js +29 -0
- package/dist/tests/fourslash/completions.importDunderNames.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.importSubmodule.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.importSubmodule.fourslash.js +22 -0
- package/dist/tests/fourslash/completions.importSubmodule.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.importsDuplicates.fourslash.d.ts +0 -0
- package/dist/tests/fourslash/completions.importsDuplicates.fourslash.js +22 -0
- package/dist/tests/fourslash/completions.importsDuplicates.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inList.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inList.fourslash.js +32 -0
- package/dist/tests/fourslash/completions.inList.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.included.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.included.fourslash.js +12 -0
- package/dist/tests/fourslash/completions.included.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.js +54 -0
- package/dist/tests/fourslash/completions.indexer.keys.getitem.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.js +26 -0
- package/dist/tests/fourslash/completions.inherited.function.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.js +49 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromScrWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.js +50 -0
- package/dist/tests/fourslash/completions.inherited.overload.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.js +101 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromSrc.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.js +105 -0
- package/dist/tests/fourslash/completions.inherited.property.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.js +67 -0
- package/dist/tests/fourslash/completions.keywords.pythonVersion.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.js +75 -0
- package/dist/tests/fourslash/completions.libCodeAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.js +66 -0
- package/dist/tests/fourslash/completions.libCodeNoStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.libStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.libStub.fourslash.js +66 -0
- package/dist/tests/fourslash/completions.libStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.literals.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.literals.fourslash.js +31 -0
- package/dist/tests/fourslash/completions.literals.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.localCode.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.localCode.fourslash.js +71 -0
- package/dist/tests/fourslash/completions.localCode.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.js +17 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownMemberOnInstance.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.js +57 -0
- package/dist/tests/fourslash/completions.moduleContext.UnknownStaticFunctionOnClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.js +27 -0
- package/dist/tests/fourslash/completions.moduleContext.libCodeNoStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.overloads.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.overloads.fourslash.js +37 -0
- package/dist/tests/fourslash/completions.overloads.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.default.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.importStub.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.importStub.js +49 -0
- package/dist/tests/fourslash/completions.override.default.importStub.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.imported.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.imported.fourslash.js +60 -0
- package/dist/tests/fourslash/completions.override.default.imported.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.default.stub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.default.stub.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.default.stub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.property.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.property.fourslash.js +31 -0
- package/dist/tests/fourslash/completions.override.property.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.property.stub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.property.stub.fourslash.js +31 -0
- package/dist/tests/fourslash/completions.override.property.stub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.js +63 -0
- package/dist/tests/fourslash/completions.override.staticAndClassmethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override.stub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override.stub.fourslash.js +47 -0
- package/dist/tests/fourslash/completions.override.stub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.override2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.override2.fourslash.js +66 -0
- package/dist/tests/fourslash/completions.override2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.parameters.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.parameters.fourslash.js +22 -0
- package/dist/tests/fourslash/completions.parameters.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.params.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.params.fourslash.js +23 -0
- package/dist/tests/fourslash/completions.params.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.parentFolder.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.parentFolder.fourslash.js +15 -0
- package/dist/tests/fourslash/completions.parentFolder.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.parentFolders.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.parentFolders.fourslash.js +68 -0
- package/dist/tests/fourslash/completions.parentFolders.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.plainText.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.plainText.fourslash.js +34 -0
- package/dist/tests/fourslash/completions.plainText.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.private.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.private.fourslash.js +61 -0
- package/dist/tests/fourslash/completions.private.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.property.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.property.fourslash.js +28 -0
- package/dist/tests/fourslash/completions.property.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.js +64 -0
- package/dist/tests/fourslash/completions.propertyDocStrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.self.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.self.fourslash.js +43 -0
- package/dist/tests/fourslash/completions.self.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.js +71 -0
- package/dist/tests/fourslash/completions.stringLiteral.escape.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.js +78 -0
- package/dist/tests/fourslash/completions.stringLiteral.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.typeAlias.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.typeAlias.fourslash.js +29 -0
- package/dist/tests/fourslash/completions.typeAlias.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.typeshed.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.typeshed.fourslash.js +9 -0
- package/dist/tests/fourslash/completions.typeshed.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.vardecls.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.vardecls.fourslash.js +33 -0
- package/dist/tests/fourslash/completions.vardecls.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.js +68 -0
- package/dist/tests/fourslash/completions.variableDocStrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.js +109 -0
- package/dist/tests/fourslash/completions.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/completions.with.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/completions.with.fourslash.js +25 -0
- package/dist/tests/fourslash/completions.with.fourslash.js.map +1 -0
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.js +64 -0
- package/dist/tests/fourslash/diagnostics.missingModuleSource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.js +24 -0
- package/dist/tests/fourslash/findDefinitions.builtinClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.js +93 -0
- package/dist/tests/fourslash/findDefinitions.classes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.js +23 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.js +19 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferSource.onlyStubs.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.js +23 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.js +20 -0
- package/dist/tests/fourslash/findDefinitions.definitionFilter.preferStub.onlySource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.js +123 -0
- package/dist/tests/fourslash/findDefinitions.fields.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.js +79 -0
- package/dist/tests/fourslash/findDefinitions.functions.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.js +154 -0
- package/dist/tests/fourslash/findDefinitions.methods.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.js +42 -0
- package/dist/tests/fourslash/findDefinitions.modules.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.js +34 -0
- package/dist/tests/fourslash/findDefinitions.namespaceImport.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.js +213 -0
- package/dist/tests/fourslash/findDefinitions.overloads.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.js +154 -0
- package/dist/tests/fourslash/findDefinitions.parameters.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.js +23 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.function.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.js +29 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.js +30 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.innerClassMethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.js +25 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.js +26 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassMethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.js +28 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadOnly.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.js +33 -0
- package/dist/tests/fourslash/findDefinitions.sourceAndStub.outerClassPropertyReadWrite.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.js +26 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.class.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.js +25 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.js +25 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.function2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.js +20 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.js +20 -0
- package/dist/tests/fourslash/findDefinitions.sourceOnly.relativeImport2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.js +59 -0
- package/dist/tests/fourslash/findDefinitions.stubOnly.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.js +59 -0
- package/dist/tests/fourslash/findDefinitions.stubPackages.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.js +94 -0
- package/dist/tests/fourslash/findDefinitions.typedDict.keys.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.js +79 -0
- package/dist/tests/fourslash/findDefinitions.variables.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.js +106 -0
- package/dist/tests/fourslash/findDefinitions.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.js +24 -0
- package/dist/tests/fourslash/findTypeDefinitions.builtinClass.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.js +66 -0
- package/dist/tests/fourslash/findTypeDefinitions.classes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.js +26 -0
- package/dist/tests/fourslash/findTypeDefinitions.unions.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.js +36 -0
- package/dist/tests/fourslash/findallreferences.classPropertyReadWrite.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.fourslash.js +30 -0
- package/dist/tests/fourslash/findallreferences.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.js +30 -0
- package/dist/tests/fourslash/findallreferences.importalias.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.js +46 -0
- package/dist/tests/fourslash/findallreferences.invokedFromLibrary.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.js +60 -0
- package/dist/tests/fourslash/findallreferences.module.nested.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.js +54 -0
- package/dist/tests/fourslash/findallreferences.modules.duplicated.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.modules.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.modules.fourslash.js +41 -0
- package/dist/tests/fourslash/findallreferences.modules.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.js +83 -0
- package/dist/tests/fourslash/findallreferences.modules.shadow.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.js +32 -0
- package/dist/tests/fourslash/findallreferences.openFiles.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.js +22 -0
- package/dist/tests/fourslash/findallreferences.parameter.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.js +29 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.class.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.js +33 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classMethod.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.js +36 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadOnly.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.js +44 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.classPropertyReadWrite.fourslash.skip.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.js +31 -0
- package/dist/tests/fourslash/findallreferences.sourceAndStub.function.fourslash.js.map +1 -0
- package/dist/tests/fourslash/findallreferences.variable.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/findallreferences.variable.fourslash.js +22 -0
- package/dist/tests/fourslash/findallreferences.variable.fourslash.js.map +1 -0
- package/dist/tests/fourslash/fourslash.d.ts +301 -0
- package/dist/tests/fourslash/fourslash.js +25 -0
- package/dist/tests/fourslash/fourslash.js.map +1 -0
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.js +30 -0
- package/dist/tests/fourslash/highlightreferences.attributes.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.js +63 -0
- package/dist/tests/fourslash/hover.builtinDocstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.classNoInit.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.classNoInit.fourslash.js +14 -0
- package/dist/tests/fourslash/hover.classNoInit.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromScr.stringFormat.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromScr.stringFormat.fourslash.js +47 -0
- package/dist/tests/fourslash/hover.docFromScr.stringFormat.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.js +77 -0
- package/dist/tests/fourslash/hover.docFromSrc.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.js +22 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.js +22 -0
- package/dist/tests/fourslash/hover.docFromSrc.pkg-vs-module2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.js +21 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport1.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.js +20 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport2.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.js +38 -0
- package/dist/tests/fourslash/hover.docFromSrc.relativeImport3.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.js +25 -0
- package/dist/tests/fourslash/hover.docFromSrc.stubs-package.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.js +18 -0
- package/dist/tests/fourslash/hover.docFromSrc.typeshed.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docstring.links.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docstring.links.fourslash.js +12 -0
- package/dist/tests/fourslash/hover.docstring.links.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docstring.overloads.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docstring.overloads.fourslash.js +38 -0
- package/dist/tests/fourslash/hover.docstring.overloads.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.docstring.split.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.docstring.split.fourslash.js +24 -0
- package/dist/tests/fourslash/hover.docstring.split.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.fourslash.js +20 -0
- package/dist/tests/fourslash/hover.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.import.django.view.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.import.django.view.fourslash.js +23 -0
- package/dist/tests/fourslash/hover.import.django.view.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.import.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.import.fourslash.js +10 -0
- package/dist/tests/fourslash/hover.import.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.js +61 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrc.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.js +51 -0
- package/dist/tests/fourslash/hover.inherited.docFromSrcWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.js +40 -0
- package/dist/tests/fourslash/hover.inherited.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.js +43 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromSrcWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.js +44 -0
- package/dist/tests/fourslash/hover.inherited.overload.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.js +84 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromSrcWithStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.js +88 -0
- package/dist/tests/fourslash/hover.inherited.property.docFromStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.init.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.init.fourslash.js +38 -0
- package/dist/tests/fourslash/hover.init.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.js +49 -0
- package/dist/tests/fourslash/hover.libCodeAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.js +39 -0
- package/dist/tests/fourslash/hover.libCodeNoStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.libStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.libStub.fourslash.js +39 -0
- package/dist/tests/fourslash/hover.libStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.js +14 -0
- package/dist/tests/fourslash/hover.optionalAliasParameter.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.plainText.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.plainText.fourslash.js +20 -0
- package/dist/tests/fourslash/hover.plainText.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.typedDict.key.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.typedDict.key.fourslash.js +50 -0
- package/dist/tests/fourslash/hover.typedDict.key.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.variable.docString.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.variable.docString.fourslash.js +35 -0
- package/dist/tests/fourslash/hover.variable.docString.fourslash.js.map +1 -0
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.js +73 -0
- package/dist/tests/fourslash/hover.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.publicSymbols.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.publicSymbols.fourslash.js +63 -0
- package/dist/tests/fourslash/import.publicSymbols.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.js +72 -0
- package/dist/tests/fourslash/import.pytyped.dunderAll.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.js +61 -0
- package/dist/tests/fourslash/import.pytyped.privateSymbols.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.js +35 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingBasic.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.js +35 -0
- package/dist/tests/fourslash/import.pytyped.typeCheckingOff.fourslash.js.map +1 -0
- package/dist/tests/fourslash/import.wildcard.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/import.wildcard.fourslash.js +24 -0
- package/dist/tests/fourslash/import.wildcard.fourslash.js.map +1 -0
- package/dist/tests/fourslash/importnotresolved.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/importnotresolved.fourslash.js +13 -0
- package/dist/tests/fourslash/importnotresolved.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.js +18 -0
- package/dist/tests/fourslash/missingModuleSource.disablingInStrictMode.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingModuleSource.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingModuleSource.fourslash.js +13 -0
- package/dist/tests/fourslash/missingModuleSource.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.js +31 -0
- package/dist/tests/fourslash/missingTypeStub.codeAction.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.d.ts +7 -0
- package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.js +44 -0
- package/dist/tests/fourslash/missingTypeStub.command.multipart.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.d.ts +7 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.js +35 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlefile.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.d.ts +7 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.js +35 -0
- package/dist/tests/fourslash/missingTypeStub.command.singlepart.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingTypeStub.fourslash.js +18 -0
- package/dist/tests/fourslash/missingTypeStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.js +34 -0
- package/dist/tests/fourslash/missingTypeStub.invokeCodeAction.fourslash.js.map +1 -0
- package/dist/tests/fourslash/noerrors.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/noerrors.fourslash.js +9 -0
- package/dist/tests/fourslash/noerrors.fourslash.js.map +1 -0
- package/dist/tests/fourslash/orderImports1.command.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/orderImports1.command.fourslash.js +17 -0
- package/dist/tests/fourslash/orderImports1.command.fourslash.js.map +1 -0
- package/dist/tests/fourslash/orderImports2.command.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/orderImports2.command.fourslash.js +21 -0
- package/dist/tests/fourslash/orderImports2.command.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.fourslash.js +23 -0
- package/dist/tests/fourslash/rename.externallyHidden.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.js +23 -0
- package/dist/tests/fourslash/rename.externallyHidden.params.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.fourslash.js +26 -0
- package/dist/tests/fourslash/rename.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.library.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.library.fourslash.js +26 -0
- package/dist/tests/fourslash/rename.library.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.js +29 -0
- package/dist/tests/fourslash/rename.library.sourceAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.d.ts +2 -0
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.js +19 -0
- package/dist/tests/fourslash/rename.multipleDecl.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.js +33 -0
- package/dist/tests/fourslash/rename.sourceAndStub.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.string.excluded.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.string.excluded.fourslash.js +39 -0
- package/dist/tests/fourslash/rename.string.excluded.fourslash.js.map +1 -0
- package/dist/tests/fourslash/rename.string.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/rename.string.fourslash.js +25 -0
- package/dist/tests/fourslash/rename.string.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js +62 -0
- package/dist/tests/fourslash/signature.builtinDocstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.complicated.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.complicated.fourslash.js +97 -0
- package/dist/tests/fourslash/signature.complicated.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.cornercases.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.cornercases.fourslash.js +22 -0
- package/dist/tests/fourslash/signature.cornercases.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.docstrings.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.docstrings.fourslash.js +42 -0
- package/dist/tests/fourslash/signature.docstrings.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.js +49 -0
- package/dist/tests/fourslash/signature.docstrings.overloaded.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.js +115 -0
- package/dist/tests/fourslash/signature.docstrings.wildcardimports.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.overload.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.overload.fourslash.js +63 -0
- package/dist/tests/fourslash/signature.overload.fourslash.js.map +1 -0
- package/dist/tests/fourslash/signature.simple.fourslash.d.ts +1 -0
- package/dist/tests/fourslash/signature.simple.fourslash.js +104 -0
- package/dist/tests/fourslash/signature.simple.fourslash.js.map +1 -0
- package/dist/tests/harness/fourslash/fourSlashParser.d.ts +10 -0
- package/dist/tests/harness/fourslash/fourSlashParser.js +347 -0
- package/dist/tests/harness/fourslash/fourSlashParser.js.map +1 -0
- package/dist/tests/harness/fourslash/fourSlashTypes.d.ts +81 -0
- package/dist/tests/harness/fourslash/fourSlashTypes.js +65 -0
- package/dist/tests/harness/fourslash/fourSlashTypes.js.map +1 -0
- package/dist/tests/harness/fourslash/runner.d.ts +20 -0
- package/dist/tests/harness/fourslash/runner.js +93 -0
- package/dist/tests/harness/fourslash/runner.js.map +1 -0
- package/dist/tests/harness/fourslash/testLanguageService.d.ts +40 -0
- package/dist/tests/harness/fourslash/testLanguageService.js +120 -0
- package/dist/tests/harness/fourslash/testLanguageService.js.map +1 -0
- package/dist/tests/harness/fourslash/testState.Consts.d.ts +11 -0
- package/dist/tests/harness/fourslash/testState.Consts.js +50 -0
- package/dist/tests/harness/fourslash/testState.Consts.js.map +1 -0
- package/dist/tests/harness/fourslash/testState.d.ts +232 -0
- package/dist/tests/harness/fourslash/testState.js +1381 -0
- package/dist/tests/harness/fourslash/testState.js.map +1 -0
- package/dist/tests/harness/testAccessHost.d.ts +8 -0
- package/dist/tests/harness/testAccessHost.js +26 -0
- package/dist/tests/harness/testAccessHost.js.map +1 -0
- package/dist/tests/harness/testHost.d.ts +16 -0
- package/dist/tests/harness/testHost.js +161 -0
- package/dist/tests/harness/testHost.js.map +1 -0
- package/dist/tests/harness/utils.d.ts +74 -0
- package/dist/tests/harness/utils.js +328 -0
- package/dist/tests/harness/utils.js.map +1 -0
- package/dist/tests/harness/vfs/factory.d.ts +32 -0
- package/dist/tests/harness/vfs/factory.js +173 -0
- package/dist/tests/harness/vfs/factory.js.map +1 -0
- package/dist/tests/harness/vfs/filesystem.d.ts +430 -0
- package/dist/tests/harness/vfs/filesystem.js +1455 -0
- package/dist/tests/harness/vfs/filesystem.js.map +1 -0
- package/dist/tests/harness/vfs/pathValidation.d.ts +24 -0
- package/dist/tests/harness/vfs/pathValidation.js +123 -0
- package/dist/tests/harness/vfs/pathValidation.js.map +1 -0
- package/dist/tests/importAdder.test.d.ts +1 -0
- package/dist/tests/importAdder.test.js +1192 -0
- package/dist/tests/importAdder.test.js.map +1 -0
- package/dist/tests/importResolver.test.d.ts +1 -0
- package/dist/tests/importResolver.test.js +450 -0
- package/dist/tests/importResolver.test.js.map +1 -0
- package/dist/tests/importStatementUtils.test.d.ts +1 -0
- package/dist/tests/importStatementUtils.test.js +371 -0
- package/dist/tests/importStatementUtils.test.js.map +1 -0
- package/dist/tests/indentationUtils.ptvs.test.d.ts +1 -0
- package/dist/tests/indentationUtils.ptvs.test.js +324 -0
- package/dist/tests/indentationUtils.ptvs.test.js.map +1 -0
- package/dist/tests/indentationUtils.reindent.test.d.ts +1 -0
- package/dist/tests/indentationUtils.reindent.test.js +332 -0
- package/dist/tests/indentationUtils.reindent.test.js.map +1 -0
- package/dist/tests/indentationUtils.test.d.ts +1 -0
- package/dist/tests/indentationUtils.test.js +375 -0
- package/dist/tests/indentationUtils.test.js.map +1 -0
- package/dist/tests/ipythonMode.test.d.ts +1 -0
- package/dist/tests/ipythonMode.test.js +303 -0
- package/dist/tests/ipythonMode.test.js.map +1 -0
- package/dist/tests/localizer.test.d.ts +1 -0
- package/dist/tests/localizer.test.js +64 -0
- package/dist/tests/localizer.test.js.map +1 -0
- package/dist/tests/parseTreeUtils.test.d.ts +1 -0
- package/dist/tests/parseTreeUtils.test.js +228 -0
- package/dist/tests/parseTreeUtils.test.js.map +1 -0
- package/dist/tests/parser.test.d.ts +1 -0
- package/dist/tests/parser.test.js +101 -0
- package/dist/tests/parser.test.js.map +1 -0
- package/dist/tests/pathUtils.test.d.ts +1 -0
- package/dist/tests/pathUtils.test.js +253 -0
- package/dist/tests/pathUtils.test.js.map +1 -0
- package/dist/tests/pyrightFileSystem.test.d.ts +1 -0
- package/dist/tests/pyrightFileSystem.test.js +152 -0
- package/dist/tests/pyrightFileSystem.test.js.map +1 -0
- package/dist/tests/renameModule.folder.test.d.ts +1 -0
- package/dist/tests/renameModule.folder.test.js +229 -0
- package/dist/tests/renameModule.folder.test.js.map +1 -0
- package/dist/tests/renameModule.fromImports.test.d.ts +1 -0
- package/dist/tests/renameModule.fromImports.test.js +790 -0
- package/dist/tests/renameModule.fromImports.test.js.map +1 -0
- package/dist/tests/renameModule.imports.test.d.ts +1 -0
- package/dist/tests/renameModule.imports.test.js +380 -0
- package/dist/tests/renameModule.imports.test.js.map +1 -0
- package/dist/tests/renameModule.misc.test.d.ts +1 -0
- package/dist/tests/renameModule.misc.test.js +615 -0
- package/dist/tests/renameModule.misc.test.js.map +1 -0
- package/dist/tests/renameModule.relativePath.test.d.ts +1 -0
- package/dist/tests/renameModule.relativePath.test.js +231 -0
- package/dist/tests/renameModule.relativePath.test.js.map +1 -0
- package/dist/tests/renameModuleTestUtils.d.ts +4 -0
- package/dist/tests/renameModuleTestUtils.js +148 -0
- package/dist/tests/renameModuleTestUtils.js.map +1 -0
- package/dist/tests/sourceFile.test.d.ts +1 -0
- package/dist/tests/sourceFile.test.js +25 -0
- package/dist/tests/sourceFile.test.js.map +1 -0
- package/dist/tests/stringUtils.test.d.ts +1 -0
- package/dist/tests/stringUtils.test.js +69 -0
- package/dist/tests/stringUtils.test.js.map +1 -0
- package/dist/tests/symbolNameUtils.test.d.ts +1 -0
- package/dist/tests/symbolNameUtils.test.js +83 -0
- package/dist/tests/symbolNameUtils.test.js.map +1 -0
- package/dist/tests/testState.test.d.ts +1 -0
- package/dist/tests/testState.test.js +521 -0
- package/dist/tests/testState.test.js.map +1 -0
- package/dist/tests/testUtils.d.ts +27 -0
- package/dist/tests/testUtils.js +213 -0
- package/dist/tests/testUtils.js.map +1 -0
- package/dist/tests/tokenizer.test.d.ts +1 -0
- package/dist/tests/tokenizer.test.js +1277 -0
- package/dist/tests/tokenizer.test.js.map +1 -0
- package/dist/tests/typeEvaluator1.test.d.ts +1 -0
- package/dist/tests/typeEvaluator1.test.js +1023 -0
- package/dist/tests/typeEvaluator1.test.js.map +1 -0
- package/dist/tests/typeEvaluator2.test.d.ts +1 -0
- package/dist/tests/typeEvaluator2.test.js +869 -0
- package/dist/tests/typeEvaluator2.test.js.map +1 -0
- package/dist/tests/typeEvaluator3.test.d.ts +1 -0
- package/dist/tests/typeEvaluator3.test.js +915 -0
- package/dist/tests/typeEvaluator3.test.js.map +1 -0
- package/dist/tests/typeEvaluator4.test.d.ts +1 -0
- package/dist/tests/typeEvaluator4.test.js +901 -0
- package/dist/tests/typeEvaluator4.test.js.map +1 -0
- package/dist/tests/updateSymbolReference.test.d.ts +1 -0
- package/dist/tests/updateSymbolReference.test.js +980 -0
- package/dist/tests/updateSymbolReference.test.js.map +1 -0
- package/dist/tests/zipfs.test.d.ts +1 -0
- package/dist/tests/zipfs.test.js +112 -0
- package/dist/tests/zipfs.test.js.map +1 -0
- package/dist/workspaceMap.d.ts +6 -0
- package/dist/workspaceMap.js +73 -0
- package/dist/workspaceMap.js.map +1 -0
- package/package.json +45 -0
@@ -0,0 +1,1111 @@
|
|
1
|
+
"use strict";
|
2
|
+
/*
|
3
|
+
* tokenizer.ts
|
4
|
+
* Copyright (c) Microsoft Corporation.
|
5
|
+
* Licensed under the MIT license.
|
6
|
+
* Author: Eric Traut
|
7
|
+
*
|
8
|
+
* Based on code from vscode-python repository:
|
9
|
+
* https://github.com/Microsoft/vscode-python
|
10
|
+
*
|
11
|
+
* Converts a Python program text stream into a stream of tokens.
|
12
|
+
*/
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
14
|
+
exports.Tokenizer = exports.defaultTabSize = void 0;
|
15
|
+
const textRangeCollection_1 = require("../common/textRangeCollection");
|
16
|
+
const characters_1 = require("./characters");
|
17
|
+
const characterStream_1 = require("./characterStream");
|
18
|
+
const tokenizerTypes_1 = require("./tokenizerTypes");
|
19
|
+
// This must be a Map, as operations like {}["constructor"] succeed.
|
20
|
+
const _keywords = new Map([
|
21
|
+
['and', 0 /* And */],
|
22
|
+
['as', 1 /* As */],
|
23
|
+
['assert', 2 /* Assert */],
|
24
|
+
['async', 3 /* Async */],
|
25
|
+
['await', 4 /* Await */],
|
26
|
+
['break', 5 /* Break */],
|
27
|
+
['case', 6 /* Case */],
|
28
|
+
['class', 7 /* Class */],
|
29
|
+
['continue', 8 /* Continue */],
|
30
|
+
['__debug__', 9 /* Debug */],
|
31
|
+
['def', 10 /* Def */],
|
32
|
+
['del', 11 /* Del */],
|
33
|
+
['elif', 12 /* Elif */],
|
34
|
+
['else', 13 /* Else */],
|
35
|
+
['except', 14 /* Except */],
|
36
|
+
['finally', 16 /* Finally */],
|
37
|
+
['for', 17 /* For */],
|
38
|
+
['from', 18 /* From */],
|
39
|
+
['global', 19 /* Global */],
|
40
|
+
['if', 20 /* If */],
|
41
|
+
['import', 21 /* Import */],
|
42
|
+
['in', 22 /* In */],
|
43
|
+
['is', 23 /* Is */],
|
44
|
+
['lambda', 24 /* Lambda */],
|
45
|
+
['match', 25 /* Match */],
|
46
|
+
['nonlocal', 27 /* Nonlocal */],
|
47
|
+
['not', 28 /* Not */],
|
48
|
+
['or', 29 /* Or */],
|
49
|
+
['pass', 30 /* Pass */],
|
50
|
+
['raise', 31 /* Raise */],
|
51
|
+
['return', 32 /* Return */],
|
52
|
+
['try', 34 /* Try */],
|
53
|
+
['while', 35 /* While */],
|
54
|
+
['with', 36 /* With */],
|
55
|
+
['yield', 37 /* Yield */],
|
56
|
+
['False', 15 /* False */],
|
57
|
+
['None', 26 /* None */],
|
58
|
+
['True', 33 /* True */],
|
59
|
+
]);
|
60
|
+
const _operatorInfo = {
|
61
|
+
[0 /* Add */]: 1 /* Unary */ | 2 /* Binary */,
|
62
|
+
[1 /* AddEqual */]: 4 /* Assignment */,
|
63
|
+
[2 /* Assign */]: 4 /* Assignment */,
|
64
|
+
[3 /* BitwiseAnd */]: 2 /* Binary */,
|
65
|
+
[4 /* BitwiseAndEqual */]: 4 /* Assignment */,
|
66
|
+
[5 /* BitwiseInvert */]: 1 /* Unary */,
|
67
|
+
[6 /* BitwiseOr */]: 2 /* Binary */,
|
68
|
+
[7 /* BitwiseOrEqual */]: 4 /* Assignment */,
|
69
|
+
[8 /* BitwiseXor */]: 2 /* Binary */,
|
70
|
+
[9 /* BitwiseXorEqual */]: 4 /* Assignment */,
|
71
|
+
[10 /* Divide */]: 2 /* Binary */,
|
72
|
+
[11 /* DivideEqual */]: 4 /* Assignment */,
|
73
|
+
[12 /* Equals */]: 2 /* Binary */ | 8 /* Comparison */,
|
74
|
+
[13 /* FloorDivide */]: 2 /* Binary */,
|
75
|
+
[14 /* FloorDivideEqual */]: 4 /* Assignment */,
|
76
|
+
[15 /* GreaterThan */]: 2 /* Binary */ | 8 /* Comparison */,
|
77
|
+
[16 /* GreaterThanOrEqual */]: 2 /* Binary */ | 8 /* Comparison */,
|
78
|
+
[17 /* LeftShift */]: 2 /* Binary */,
|
79
|
+
[18 /* LeftShiftEqual */]: 4 /* Assignment */,
|
80
|
+
[19 /* LessOrGreaterThan */]: 2 /* Binary */ | 8 /* Comparison */ | 16 /* Deprecated */,
|
81
|
+
[20 /* LessThan */]: 2 /* Binary */ | 8 /* Comparison */,
|
82
|
+
[21 /* LessThanOrEqual */]: 2 /* Binary */ | 8 /* Comparison */,
|
83
|
+
[22 /* MatrixMultiply */]: 2 /* Binary */,
|
84
|
+
[23 /* MatrixMultiplyEqual */]: 4 /* Assignment */,
|
85
|
+
[24 /* Mod */]: 2 /* Binary */,
|
86
|
+
[25 /* ModEqual */]: 4 /* Assignment */,
|
87
|
+
[26 /* Multiply */]: 2 /* Binary */,
|
88
|
+
[27 /* MultiplyEqual */]: 4 /* Assignment */,
|
89
|
+
[28 /* NotEquals */]: 2 /* Binary */ | 8 /* Comparison */,
|
90
|
+
[29 /* Power */]: 2 /* Binary */,
|
91
|
+
[30 /* PowerEqual */]: 4 /* Assignment */,
|
92
|
+
[31 /* RightShift */]: 2 /* Binary */,
|
93
|
+
[32 /* RightShiftEqual */]: 4 /* Assignment */,
|
94
|
+
[33 /* Subtract */]: 2 /* Binary */,
|
95
|
+
[34 /* SubtractEqual */]: 4 /* Assignment */,
|
96
|
+
[36 /* And */]: 2 /* Binary */,
|
97
|
+
[37 /* Or */]: 2 /* Binary */,
|
98
|
+
[38 /* Not */]: 1 /* Unary */,
|
99
|
+
[39 /* Is */]: 2 /* Binary */,
|
100
|
+
[40 /* IsNot */]: 2 /* Binary */,
|
101
|
+
[41 /* In */]: 2 /* Binary */,
|
102
|
+
[42 /* NotIn */]: 2 /* Binary */,
|
103
|
+
};
|
104
|
+
const _byteOrderMarker = 0xfeff;
|
105
|
+
const _maxStringTokenLength = 32 * 1024;
|
106
|
+
exports.defaultTabSize = 8;
|
107
|
+
class Tokenizer {
|
108
|
+
constructor() {
|
109
|
+
this._cs = new characterStream_1.CharacterStream('');
|
110
|
+
this._tokens = [];
|
111
|
+
this._prevLineStart = 0;
|
112
|
+
this._parenDepth = 0;
|
113
|
+
this._lineRanges = [];
|
114
|
+
this._indentAmounts = [];
|
115
|
+
this._typeIgnoreLines = new Map();
|
116
|
+
this._pyrightIgnoreLines = new Map();
|
117
|
+
// Total times CR, CR/LF, and LF are used to terminate
|
118
|
+
// lines. Used to determine the predominant line ending.
|
119
|
+
this._crCount = 0;
|
120
|
+
this._crLfCount = 0;
|
121
|
+
this._lfCount = 0;
|
122
|
+
// Number of times an indent token is emitted.
|
123
|
+
this._indentCount = 0;
|
124
|
+
// Number of times an indent token is emitted and a tab character
|
125
|
+
// is present (used to determine predominant tab sequence).
|
126
|
+
this._indentTabCount = 0;
|
127
|
+
// Number of spaces that are added for an indent token
|
128
|
+
// (used to determine predominant tab sequence).
|
129
|
+
this._indentSpacesTotal = 0;
|
130
|
+
// Number of single or double quote string literals found
|
131
|
+
// in the code.
|
132
|
+
this._singleQuoteCount = 0;
|
133
|
+
this._doubleQuoteCount = 0;
|
134
|
+
// ipython mode
|
135
|
+
this._ipythonMode = false;
|
136
|
+
}
|
137
|
+
tokenize(text, start, length, initialParenDepth = 0, ipythonMode = false) {
|
138
|
+
if (start === undefined) {
|
139
|
+
start = 0;
|
140
|
+
}
|
141
|
+
else if (start < 0 || start > text.length) {
|
142
|
+
throw new Error(`Invalid range start (start=${start}, text.length=${text.length})`);
|
143
|
+
}
|
144
|
+
if (length === undefined) {
|
145
|
+
length = text.length;
|
146
|
+
}
|
147
|
+
else if (length < 0 || start + length > text.length) {
|
148
|
+
throw new Error(`Invalid range length (start=${start}, length=${length}, text.length=${text.length})`);
|
149
|
+
}
|
150
|
+
else if (start + length < text.length) {
|
151
|
+
text = text.substring(0, start + length);
|
152
|
+
}
|
153
|
+
this._cs = new characterStream_1.CharacterStream(text);
|
154
|
+
this._cs.position = start;
|
155
|
+
this._tokens = [];
|
156
|
+
this._prevLineStart = 0;
|
157
|
+
this._parenDepth = initialParenDepth;
|
158
|
+
this._lineRanges = [];
|
159
|
+
this._indentAmounts = [];
|
160
|
+
this._ipythonMode = ipythonMode;
|
161
|
+
const end = start + length;
|
162
|
+
if (start === 0) {
|
163
|
+
this._readIndentationAfterNewLine();
|
164
|
+
}
|
165
|
+
while (!this._cs.isEndOfStream()) {
|
166
|
+
this._addNextToken();
|
167
|
+
if (this._cs.position >= end) {
|
168
|
+
break;
|
169
|
+
}
|
170
|
+
}
|
171
|
+
// Insert an implied new line to make parsing easier.
|
172
|
+
if (this._tokens.length === 0 || this._tokens[this._tokens.length - 1].type !== 2 /* NewLine */) {
|
173
|
+
this._tokens.push(tokenizerTypes_1.NewLineToken.create(this._cs.position, 0, 3 /* Implied */, this._getComments()));
|
174
|
+
}
|
175
|
+
// Insert any implied dedent tokens.
|
176
|
+
this._setIndent(0, 0, /* isSpacePresent */ false, /* isTabPresent */ false);
|
177
|
+
// Add a final end-of-stream token to make parsing easier.
|
178
|
+
this._tokens.push(tokenizerTypes_1.Token.create(1 /* EndOfStream */, this._cs.position, 0, this._getComments()));
|
179
|
+
// Add the final line range.
|
180
|
+
this._addLineRange();
|
181
|
+
let predominantEndOfLineSequence = '\n';
|
182
|
+
if (this._crCount > this._crLfCount && this._crCount > this._lfCount) {
|
183
|
+
predominantEndOfLineSequence = '\r';
|
184
|
+
}
|
185
|
+
else if (this._crLfCount > this._crCount && this._crLfCount > this._lfCount) {
|
186
|
+
predominantEndOfLineSequence = '\r\n';
|
187
|
+
}
|
188
|
+
let predominantTabSequence = ' ';
|
189
|
+
// If more than half of the indents use tab sequences,
|
190
|
+
// assume we're using tabs rather than spaces.
|
191
|
+
if (this._indentTabCount > this._indentCount / 2) {
|
192
|
+
predominantTabSequence = '\t';
|
193
|
+
}
|
194
|
+
else if (this._indentCount > 0) {
|
195
|
+
// Compute the average number of spaces per indent
|
196
|
+
// to estimate the predominant tab value.
|
197
|
+
let averageSpacePerIndent = Math.round(this._indentSpacesTotal / this._indentCount);
|
198
|
+
if (averageSpacePerIndent < 1) {
|
199
|
+
averageSpacePerIndent = 1;
|
200
|
+
}
|
201
|
+
else if (averageSpacePerIndent > exports.defaultTabSize) {
|
202
|
+
averageSpacePerIndent = exports.defaultTabSize;
|
203
|
+
}
|
204
|
+
predominantTabSequence = '';
|
205
|
+
for (let i = 0; i < averageSpacePerIndent; i++) {
|
206
|
+
predominantTabSequence += ' ';
|
207
|
+
}
|
208
|
+
}
|
209
|
+
return {
|
210
|
+
tokens: new textRangeCollection_1.TextRangeCollection(this._tokens),
|
211
|
+
lines: new textRangeCollection_1.TextRangeCollection(this._lineRanges),
|
212
|
+
typeIgnoreLines: this._typeIgnoreLines,
|
213
|
+
typeIgnoreAll: this._typeIgnoreAll,
|
214
|
+
pyrightIgnoreLines: this._pyrightIgnoreLines,
|
215
|
+
predominantEndOfLineSequence,
|
216
|
+
predominantTabSequence,
|
217
|
+
predominantSingleQuoteCharacter: this._singleQuoteCount >= this._doubleQuoteCount ? "'" : '"',
|
218
|
+
};
|
219
|
+
}
|
220
|
+
static getOperatorInfo(operatorType) {
|
221
|
+
return _operatorInfo[operatorType];
|
222
|
+
}
|
223
|
+
static isOperatorAssignment(operatorType) {
|
224
|
+
if (operatorType === undefined || _operatorInfo[operatorType] === undefined) {
|
225
|
+
return false;
|
226
|
+
}
|
227
|
+
return (_operatorInfo[operatorType] & 4 /* Assignment */) !== 0;
|
228
|
+
}
|
229
|
+
static isOperatorComparison(operatorType) {
|
230
|
+
if (operatorType === undefined || _operatorInfo[operatorType] === undefined) {
|
231
|
+
return false;
|
232
|
+
}
|
233
|
+
return (_operatorInfo[operatorType] & 8 /* Comparison */) !== 0;
|
234
|
+
}
|
235
|
+
_addNextToken() {
|
236
|
+
this._cs.skipWhitespace();
|
237
|
+
if (this._cs.isEndOfStream()) {
|
238
|
+
return;
|
239
|
+
}
|
240
|
+
if (!this._handleCharacter()) {
|
241
|
+
this._cs.moveNext();
|
242
|
+
}
|
243
|
+
}
|
244
|
+
_handleCharacter() {
|
245
|
+
// f-strings, b-strings, etc
|
246
|
+
const stringPrefixLength = this._getStringPrefixLength();
|
247
|
+
if (stringPrefixLength >= 0) {
|
248
|
+
let stringPrefix = '';
|
249
|
+
if (stringPrefixLength > 0) {
|
250
|
+
stringPrefix = this._cs.getText().substring(this._cs.position, this._cs.position + stringPrefixLength);
|
251
|
+
// Indeed a string
|
252
|
+
this._cs.advance(stringPrefixLength);
|
253
|
+
}
|
254
|
+
const quoteTypeFlags = this._getQuoteTypeFlags(stringPrefix);
|
255
|
+
if (quoteTypeFlags !== 0 /* None */) {
|
256
|
+
this._handleString(quoteTypeFlags, stringPrefixLength);
|
257
|
+
return true;
|
258
|
+
}
|
259
|
+
}
|
260
|
+
if (this._cs.currentChar === 35 /* Hash */) {
|
261
|
+
this._handleComment();
|
262
|
+
return true;
|
263
|
+
}
|
264
|
+
if (this._ipythonMode && this._isIPythonMagics()) {
|
265
|
+
this._handleIPythonMagics(this._cs.currentChar === 37 /* Percent */ ? 1 /* IPythonMagic */ : 2 /* IPythonShellEscape */);
|
266
|
+
return true;
|
267
|
+
}
|
268
|
+
switch (this._cs.currentChar) {
|
269
|
+
case _byteOrderMarker: {
|
270
|
+
// Skip the BOM if it's at the start of the file.
|
271
|
+
if (this._cs.position === 0) {
|
272
|
+
return false;
|
273
|
+
}
|
274
|
+
return this._handleInvalid();
|
275
|
+
}
|
276
|
+
case 13 /* CarriageReturn */: {
|
277
|
+
const length = this._cs.nextChar === 10 /* LineFeed */ ? 2 : 1;
|
278
|
+
const newLineType = length === 2 ? 2 /* CarriageReturnLineFeed */ : 0 /* CarriageReturn */;
|
279
|
+
this._handleNewLine(length, newLineType);
|
280
|
+
return true;
|
281
|
+
}
|
282
|
+
case 10 /* LineFeed */: {
|
283
|
+
this._handleNewLine(1, 1 /* LineFeed */);
|
284
|
+
return true;
|
285
|
+
}
|
286
|
+
case 92 /* Backslash */: {
|
287
|
+
if (this._cs.nextChar === 13 /* CarriageReturn */) {
|
288
|
+
if (this._cs.lookAhead(2) === 10 /* LineFeed */) {
|
289
|
+
this._cs.advance(3);
|
290
|
+
}
|
291
|
+
else {
|
292
|
+
this._cs.advance(2);
|
293
|
+
}
|
294
|
+
this._addLineRange();
|
295
|
+
return true;
|
296
|
+
}
|
297
|
+
else if (this._cs.nextChar === 10 /* LineFeed */) {
|
298
|
+
this._cs.advance(2);
|
299
|
+
this._addLineRange();
|
300
|
+
return true;
|
301
|
+
}
|
302
|
+
return this._handleInvalid();
|
303
|
+
}
|
304
|
+
case 40 /* OpenParenthesis */: {
|
305
|
+
this._parenDepth++;
|
306
|
+
this._tokens.push(tokenizerTypes_1.Token.create(13 /* OpenParenthesis */, this._cs.position, 1, this._getComments()));
|
307
|
+
break;
|
308
|
+
}
|
309
|
+
case 41 /* CloseParenthesis */: {
|
310
|
+
if (this._parenDepth > 0) {
|
311
|
+
this._parenDepth--;
|
312
|
+
}
|
313
|
+
this._tokens.push(tokenizerTypes_1.Token.create(14 /* CloseParenthesis */, this._cs.position, 1, this._getComments()));
|
314
|
+
break;
|
315
|
+
}
|
316
|
+
case 91 /* OpenBracket */: {
|
317
|
+
this._parenDepth++;
|
318
|
+
this._tokens.push(tokenizerTypes_1.Token.create(15 /* OpenBracket */, this._cs.position, 1, this._getComments()));
|
319
|
+
break;
|
320
|
+
}
|
321
|
+
case 93 /* CloseBracket */: {
|
322
|
+
if (this._parenDepth > 0) {
|
323
|
+
this._parenDepth--;
|
324
|
+
}
|
325
|
+
this._tokens.push(tokenizerTypes_1.Token.create(16 /* CloseBracket */, this._cs.position, 1, this._getComments()));
|
326
|
+
break;
|
327
|
+
}
|
328
|
+
case 123 /* OpenBrace */: {
|
329
|
+
this._parenDepth++;
|
330
|
+
this._tokens.push(tokenizerTypes_1.Token.create(17 /* OpenCurlyBrace */, this._cs.position, 1, this._getComments()));
|
331
|
+
break;
|
332
|
+
}
|
333
|
+
case 125 /* CloseBrace */: {
|
334
|
+
if (this._parenDepth > 0) {
|
335
|
+
this._parenDepth--;
|
336
|
+
}
|
337
|
+
this._tokens.push(tokenizerTypes_1.Token.create(18 /* CloseCurlyBrace */, this._cs.position, 1, this._getComments()));
|
338
|
+
break;
|
339
|
+
}
|
340
|
+
case 44 /* Comma */: {
|
341
|
+
this._tokens.push(tokenizerTypes_1.Token.create(12 /* Comma */, this._cs.position, 1, this._getComments()));
|
342
|
+
break;
|
343
|
+
}
|
344
|
+
case 96 /* Backtick */: {
|
345
|
+
this._tokens.push(tokenizerTypes_1.Token.create(22 /* Backtick */, this._cs.position, 1, this._getComments()));
|
346
|
+
break;
|
347
|
+
}
|
348
|
+
case 59 /* Semicolon */: {
|
349
|
+
this._tokens.push(tokenizerTypes_1.Token.create(11 /* Semicolon */, this._cs.position, 1, this._getComments()));
|
350
|
+
break;
|
351
|
+
}
|
352
|
+
case 58 /* Colon */: {
|
353
|
+
if (this._cs.nextChar === 61 /* Equal */) {
|
354
|
+
this._tokens.push(tokenizerTypes_1.OperatorToken.create(this._cs.position, 2, 35 /* Walrus */, this._getComments()));
|
355
|
+
this._cs.advance(1);
|
356
|
+
break;
|
357
|
+
}
|
358
|
+
this._tokens.push(tokenizerTypes_1.Token.create(10 /* Colon */, this._cs.position, 1, this._getComments()));
|
359
|
+
break;
|
360
|
+
}
|
361
|
+
default: {
|
362
|
+
if (this._isPossibleNumber()) {
|
363
|
+
if (this._tryNumber()) {
|
364
|
+
return true;
|
365
|
+
}
|
366
|
+
}
|
367
|
+
if (this._cs.currentChar === 46 /* Period */) {
|
368
|
+
if (this._cs.nextChar === 46 /* Period */ && this._cs.lookAhead(2) === 46 /* Period */) {
|
369
|
+
this._tokens.push(tokenizerTypes_1.Token.create(19 /* Ellipsis */, this._cs.position, 3, this._getComments()));
|
370
|
+
this._cs.advance(3);
|
371
|
+
return true;
|
372
|
+
}
|
373
|
+
this._tokens.push(tokenizerTypes_1.Token.create(20 /* Dot */, this._cs.position, 1, this._getComments()));
|
374
|
+
break;
|
375
|
+
}
|
376
|
+
if (!this._tryIdentifier()) {
|
377
|
+
if (!this._tryOperator()) {
|
378
|
+
return this._handleInvalid();
|
379
|
+
}
|
380
|
+
}
|
381
|
+
return true;
|
382
|
+
}
|
383
|
+
}
|
384
|
+
return false;
|
385
|
+
}
|
386
|
+
_addLineRange() {
|
387
|
+
const lineLength = this._cs.position - this._prevLineStart;
|
388
|
+
if (lineLength > 0) {
|
389
|
+
this._lineRanges.push({ start: this._prevLineStart, length: lineLength });
|
390
|
+
}
|
391
|
+
this._prevLineStart = this._cs.position;
|
392
|
+
}
|
393
|
+
_handleNewLine(length, newLineType) {
|
394
|
+
if (this._parenDepth === 0 && newLineType !== 3 /* Implied */) {
|
395
|
+
// New lines are ignored within parentheses.
|
396
|
+
// We'll also avoid adding multiple newlines in a row to simplify parsing.
|
397
|
+
if (this._tokens.length === 0 || this._tokens[this._tokens.length - 1].type !== 2 /* NewLine */) {
|
398
|
+
this._tokens.push(tokenizerTypes_1.NewLineToken.create(this._cs.position, length, newLineType, this._getComments()));
|
399
|
+
}
|
400
|
+
}
|
401
|
+
if (newLineType === 0 /* CarriageReturn */) {
|
402
|
+
this._crCount++;
|
403
|
+
}
|
404
|
+
else if (newLineType === 2 /* CarriageReturnLineFeed */) {
|
405
|
+
this._crLfCount++;
|
406
|
+
}
|
407
|
+
else {
|
408
|
+
this._lfCount++;
|
409
|
+
}
|
410
|
+
this._cs.advance(length);
|
411
|
+
this._addLineRange();
|
412
|
+
this._readIndentationAfterNewLine();
|
413
|
+
}
|
414
|
+
_readIndentationAfterNewLine() {
|
415
|
+
let tab1Spaces = 0;
|
416
|
+
let tab8Spaces = 0;
|
417
|
+
let isTabPresent = false;
|
418
|
+
let isSpacePresent = false;
|
419
|
+
while (!this._cs.isEndOfStream()) {
|
420
|
+
switch (this._cs.currentChar) {
|
421
|
+
case 32 /* Space */:
|
422
|
+
tab1Spaces++;
|
423
|
+
tab8Spaces++;
|
424
|
+
isSpacePresent = true;
|
425
|
+
this._cs.moveNext();
|
426
|
+
break;
|
427
|
+
case 9 /* Tab */:
|
428
|
+
// Translate tabs into spaces assuming both 1-space
|
429
|
+
// and 8-space tab stops.
|
430
|
+
tab1Spaces++;
|
431
|
+
tab8Spaces += exports.defaultTabSize - (tab8Spaces % exports.defaultTabSize);
|
432
|
+
isTabPresent = true;
|
433
|
+
this._cs.moveNext();
|
434
|
+
break;
|
435
|
+
case 12 /* FormFeed */:
|
436
|
+
tab1Spaces = 0;
|
437
|
+
tab8Spaces = 0;
|
438
|
+
isTabPresent = false;
|
439
|
+
isSpacePresent = false;
|
440
|
+
this._cs.moveNext();
|
441
|
+
break;
|
442
|
+
default:
|
443
|
+
// Non-blank line. Set the current indent level.
|
444
|
+
this._setIndent(tab1Spaces, tab8Spaces, isSpacePresent, isTabPresent);
|
445
|
+
return;
|
446
|
+
case 35 /* Hash */:
|
447
|
+
case 10 /* LineFeed */:
|
448
|
+
case 13 /* CarriageReturn */:
|
449
|
+
// Blank line -- no need to adjust indentation.
|
450
|
+
return;
|
451
|
+
}
|
452
|
+
}
|
453
|
+
}
|
454
|
+
// The caller must specify two space count values. The first assumes
|
455
|
+
// that tabs are translated into one-space tab stops. The second assumes
|
456
|
+
// that tabs are translated into eight-space tab stops.
|
457
|
+
_setIndent(tab1Spaces, tab8Spaces, isSpacePresent, isTabPresent) {
|
458
|
+
// Indentations are ignored within a parenthesized clause.
|
459
|
+
if (this._parenDepth > 0) {
|
460
|
+
return;
|
461
|
+
}
|
462
|
+
// Insert indent or dedent tokens as necessary.
|
463
|
+
if (this._indentAmounts.length === 0) {
|
464
|
+
if (tab8Spaces > 0) {
|
465
|
+
this._indentCount++;
|
466
|
+
if (isTabPresent) {
|
467
|
+
this._indentTabCount++;
|
468
|
+
}
|
469
|
+
this._indentSpacesTotal += tab8Spaces;
|
470
|
+
this._indentAmounts.push({
|
471
|
+
tab1Spaces,
|
472
|
+
tab8Spaces,
|
473
|
+
isSpacePresent,
|
474
|
+
isTabPresent,
|
475
|
+
});
|
476
|
+
this._tokens.push(tokenizerTypes_1.IndentToken.create(this._cs.position, 0, tab8Spaces, false, this._getComments()));
|
477
|
+
}
|
478
|
+
}
|
479
|
+
else {
|
480
|
+
const prevTabInfo = this._indentAmounts[this._indentAmounts.length - 1];
|
481
|
+
if (prevTabInfo.tab8Spaces < tab8Spaces) {
|
482
|
+
// The Python spec says that if there is ambiguity about how tabs should
|
483
|
+
// be translated into spaces because the user has intermixed tabs and
|
484
|
+
// spaces, it should be an error. We'll record this condition in the token
|
485
|
+
// so the parser can later report it.
|
486
|
+
const isIndentAmbiguous = ((prevTabInfo.isSpacePresent && isTabPresent) || (prevTabInfo.isTabPresent && isSpacePresent)) &&
|
487
|
+
prevTabInfo.tab1Spaces >= tab1Spaces;
|
488
|
+
this._indentCount++;
|
489
|
+
if (isTabPresent) {
|
490
|
+
this._indentTabCount++;
|
491
|
+
}
|
492
|
+
this._indentSpacesTotal += tab8Spaces - this._indentAmounts[this._indentAmounts.length - 1].tab8Spaces;
|
493
|
+
this._indentAmounts.push({
|
494
|
+
tab1Spaces,
|
495
|
+
tab8Spaces,
|
496
|
+
isSpacePresent,
|
497
|
+
isTabPresent,
|
498
|
+
});
|
499
|
+
this._tokens.push(tokenizerTypes_1.IndentToken.create(this._cs.position, 0, tab8Spaces, isIndentAmbiguous, this._getComments()));
|
500
|
+
}
|
501
|
+
else if (prevTabInfo.tab8Spaces === tab8Spaces) {
|
502
|
+
// The Python spec says that if there is ambiguity about how tabs should
|
503
|
+
// be translated into spaces because the user has intermixed tabs and
|
504
|
+
// spaces, it should be an error. We'll record this condition in the token
|
505
|
+
// so the parser can later report it.
|
506
|
+
if ((prevTabInfo.isSpacePresent && isTabPresent) || (prevTabInfo.isTabPresent && isSpacePresent)) {
|
507
|
+
this._tokens.push(tokenizerTypes_1.IndentToken.create(this._cs.position, 0, tab8Spaces, true, this._getComments()));
|
508
|
+
}
|
509
|
+
}
|
510
|
+
else {
|
511
|
+
// The Python spec says that if there is ambiguity about how tabs should
|
512
|
+
// be translated into spaces because the user has intermixed tabs and
|
513
|
+
// spaces, it should be an error. We'll record this condition in the token
|
514
|
+
// so the parser can later report it.
|
515
|
+
let isDedentAmbiguous = (prevTabInfo.isSpacePresent && isTabPresent) || (prevTabInfo.isTabPresent && isSpacePresent);
|
516
|
+
// The Python spec says that dedent amounts need to match the indent
|
517
|
+
// amount exactly. An error is generated at runtime if it doesn't.
|
518
|
+
// We'll record that error condition within the token, allowing the
|
519
|
+
// parser to report it later.
|
520
|
+
const dedentPoints = [];
|
521
|
+
while (this._indentAmounts.length > 0 &&
|
522
|
+
this._indentAmounts[this._indentAmounts.length - 1].tab8Spaces > tab8Spaces) {
|
523
|
+
dedentPoints.push(this._indentAmounts.length > 1
|
524
|
+
? this._indentAmounts[this._indentAmounts.length - 2].tab8Spaces
|
525
|
+
: 0);
|
526
|
+
this._indentAmounts.pop();
|
527
|
+
}
|
528
|
+
dedentPoints.forEach((dedentAmount, index) => {
|
529
|
+
const matchesIndent = index < dedentPoints.length - 1 || dedentAmount === tab8Spaces;
|
530
|
+
const actualDedentAmount = index < dedentPoints.length - 1 ? dedentAmount : tab8Spaces;
|
531
|
+
this._tokens.push(tokenizerTypes_1.DedentToken.create(this._cs.position, 0, actualDedentAmount, matchesIndent, isDedentAmbiguous, this._getComments()));
|
532
|
+
isDedentAmbiguous = false;
|
533
|
+
});
|
534
|
+
}
|
535
|
+
}
|
536
|
+
}
|
537
|
+
_tryIdentifier() {
|
538
|
+
const swallowRemainingChars = () => {
|
539
|
+
while (true) {
|
540
|
+
if ((0, characters_1.isIdentifierChar)(this._cs.currentChar)) {
|
541
|
+
this._cs.moveNext();
|
542
|
+
}
|
543
|
+
else if ((0, characters_1.isIdentifierChar)(this._cs.currentChar, this._cs.nextChar)) {
|
544
|
+
this._cs.moveNext();
|
545
|
+
this._cs.moveNext();
|
546
|
+
}
|
547
|
+
else {
|
548
|
+
break;
|
549
|
+
}
|
550
|
+
}
|
551
|
+
};
|
552
|
+
const start = this._cs.position;
|
553
|
+
if ((0, characters_1.isIdentifierStartChar)(this._cs.currentChar)) {
|
554
|
+
this._cs.moveNext();
|
555
|
+
swallowRemainingChars();
|
556
|
+
}
|
557
|
+
else if ((0, characters_1.isIdentifierStartChar)(this._cs.currentChar, this._cs.nextChar)) {
|
558
|
+
this._cs.moveNext();
|
559
|
+
this._cs.moveNext();
|
560
|
+
swallowRemainingChars();
|
561
|
+
}
|
562
|
+
if (this._cs.position > start) {
|
563
|
+
const value = this._cs.getText().substring(start, this._cs.position);
|
564
|
+
if (_keywords.has(value)) {
|
565
|
+
this._tokens.push(tokenizerTypes_1.KeywordToken.create(start, this._cs.position - start, _keywords.get(value), this._getComments()));
|
566
|
+
}
|
567
|
+
else {
|
568
|
+
this._tokens.push(tokenizerTypes_1.IdentifierToken.create(start, this._cs.position - start, value, this._getComments()));
|
569
|
+
}
|
570
|
+
return true;
|
571
|
+
}
|
572
|
+
return false;
|
573
|
+
}
|
574
|
+
_isPossibleNumber() {
|
575
|
+
if ((0, characters_1.isDecimal)(this._cs.currentChar)) {
|
576
|
+
return true;
|
577
|
+
}
|
578
|
+
if (this._cs.currentChar === 46 /* Period */ && (0, characters_1.isDecimal)(this._cs.nextChar)) {
|
579
|
+
return true;
|
580
|
+
}
|
581
|
+
return false;
|
582
|
+
}
|
583
|
+
_tryNumber() {
|
584
|
+
const start = this._cs.position;
|
585
|
+
if (this._cs.currentChar === 48 /* _0 */) {
|
586
|
+
let radix = 0;
|
587
|
+
let leadingChars = 0;
|
588
|
+
// Try hex => hexinteger: "0" ("x" | "X") (["_"] hexdigit)+
|
589
|
+
if ((this._cs.nextChar === 120 /* x */ || this._cs.nextChar === 88 /* X */) && (0, characters_1.isHex)(this._cs.lookAhead(2))) {
|
590
|
+
this._cs.advance(2);
|
591
|
+
leadingChars = 2;
|
592
|
+
while ((0, characters_1.isHex)(this._cs.currentChar)) {
|
593
|
+
this._cs.moveNext();
|
594
|
+
}
|
595
|
+
radix = 16;
|
596
|
+
}
|
597
|
+
// Try binary => bininteger: "0" ("b" | "B") (["_"] bindigit)+
|
598
|
+
else if ((this._cs.nextChar === 98 /* b */ || this._cs.nextChar === 66 /* B */) &&
|
599
|
+
(0, characters_1.isBinary)(this._cs.lookAhead(2))) {
|
600
|
+
this._cs.advance(2);
|
601
|
+
leadingChars = 2;
|
602
|
+
while ((0, characters_1.isBinary)(this._cs.currentChar)) {
|
603
|
+
this._cs.moveNext();
|
604
|
+
}
|
605
|
+
radix = 2;
|
606
|
+
}
|
607
|
+
// Try octal => octinteger: "0" ("o" | "O") (["_"] octdigit)+
|
608
|
+
else if ((this._cs.nextChar === 111 /* o */ || this._cs.nextChar === 79 /* O */) && (0, characters_1.isOctal)(this._cs.lookAhead(2))) {
|
609
|
+
this._cs.advance(2);
|
610
|
+
leadingChars = 2;
|
611
|
+
while ((0, characters_1.isOctal)(this._cs.currentChar)) {
|
612
|
+
this._cs.moveNext();
|
613
|
+
}
|
614
|
+
radix = 8;
|
615
|
+
}
|
616
|
+
if (radix > 0) {
|
617
|
+
const text = this._cs.getText().substring(start, this._cs.position);
|
618
|
+
const simpleIntText = text.replace(/_/g, '');
|
619
|
+
let intValue = parseInt(simpleIntText.substring(leadingChars), radix);
|
620
|
+
if (!isNaN(intValue)) {
|
621
|
+
const bigIntValue = BigInt(simpleIntText);
|
622
|
+
if (!isFinite(intValue) || BigInt(intValue) !== bigIntValue) {
|
623
|
+
intValue = bigIntValue;
|
624
|
+
}
|
625
|
+
this._tokens.push(tokenizerTypes_1.NumberToken.create(start, text.length, intValue, true, false, this._getComments()));
|
626
|
+
return true;
|
627
|
+
}
|
628
|
+
}
|
629
|
+
}
|
630
|
+
let isDecimalInteger = false;
|
631
|
+
let mightBeFloatingPoint = false;
|
632
|
+
// Try decimal int =>
|
633
|
+
// decinteger: nonzerodigit (["_"] digit)* | "0" (["_"] "0")*
|
634
|
+
// nonzerodigit: "1"..."9"
|
635
|
+
// digit: "0"..."9"
|
636
|
+
if (this._cs.currentChar >= 49 /* _1 */ && this._cs.currentChar <= 57 /* _9 */) {
|
637
|
+
while ((0, characters_1.isDecimal)(this._cs.currentChar)) {
|
638
|
+
mightBeFloatingPoint = true;
|
639
|
+
this._cs.moveNext();
|
640
|
+
}
|
641
|
+
isDecimalInteger =
|
642
|
+
this._cs.currentChar !== 46 /* Period */ &&
|
643
|
+
this._cs.currentChar !== 101 /* e */ &&
|
644
|
+
this._cs.currentChar !== 69 /* E */;
|
645
|
+
}
|
646
|
+
// "0" (["_"] "0")*
|
647
|
+
if (this._cs.currentChar === 48 /* _0 */) {
|
648
|
+
mightBeFloatingPoint = true;
|
649
|
+
while (this._cs.currentChar === 48 /* _0 */ || this._cs.currentChar === 95 /* Underscore */) {
|
650
|
+
this._cs.moveNext();
|
651
|
+
}
|
652
|
+
isDecimalInteger =
|
653
|
+
this._cs.currentChar !== 46 /* Period */ &&
|
654
|
+
this._cs.currentChar !== 101 /* e */ &&
|
655
|
+
this._cs.currentChar !== 69 /* E */;
|
656
|
+
}
|
657
|
+
if (isDecimalInteger) {
|
658
|
+
let text = this._cs.getText().substring(start, this._cs.position);
|
659
|
+
const simpleIntText = text.replace(/_/g, '');
|
660
|
+
let intValue = parseInt(simpleIntText, 10);
|
661
|
+
if (!isNaN(intValue)) {
|
662
|
+
let isImaginary = false;
|
663
|
+
const bigIntValue = BigInt(simpleIntText);
|
664
|
+
if (!isFinite(intValue) || BigInt(intValue) !== bigIntValue) {
|
665
|
+
intValue = bigIntValue;
|
666
|
+
}
|
667
|
+
if (this._cs.currentChar === 106 /* j */ || this._cs.currentChar === 74 /* J */) {
|
668
|
+
isImaginary = true;
|
669
|
+
text += String.fromCharCode(this._cs.currentChar);
|
670
|
+
this._cs.moveNext();
|
671
|
+
}
|
672
|
+
this._tokens.push(tokenizerTypes_1.NumberToken.create(start, text.length, intValue, true, isImaginary, this._getComments()));
|
673
|
+
return true;
|
674
|
+
}
|
675
|
+
}
|
676
|
+
// Floating point. Sign and leading digits were already skipped over.
|
677
|
+
this._cs.position = start;
|
678
|
+
if (mightBeFloatingPoint ||
|
679
|
+
(this._cs.currentChar === 46 /* Period */ && this._cs.nextChar >= 48 /* _0 */ && this._cs.nextChar <= 57 /* _9 */)) {
|
680
|
+
if (this._skipFloatingPointCandidate()) {
|
681
|
+
let text = this._cs.getText().substring(start, this._cs.position);
|
682
|
+
const value = parseFloat(text);
|
683
|
+
if (!isNaN(value)) {
|
684
|
+
let isImaginary = false;
|
685
|
+
if (this._cs.currentChar === 106 /* j */ || this._cs.currentChar === 74 /* J */) {
|
686
|
+
isImaginary = true;
|
687
|
+
text += String.fromCharCode(this._cs.currentChar);
|
688
|
+
this._cs.moveNext();
|
689
|
+
}
|
690
|
+
this._tokens.push(tokenizerTypes_1.NumberToken.create(start, this._cs.position - start, value, false, isImaginary, this._getComments()));
|
691
|
+
return true;
|
692
|
+
}
|
693
|
+
}
|
694
|
+
}
|
695
|
+
this._cs.position = start;
|
696
|
+
return false;
|
697
|
+
}
|
698
|
+
_tryOperator() {
|
699
|
+
let length = 0;
|
700
|
+
const nextChar = this._cs.nextChar;
|
701
|
+
let operatorType;
|
702
|
+
switch (this._cs.currentChar) {
|
703
|
+
case 43 /* Plus */:
|
704
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
705
|
+
operatorType = length === 2 ? 1 /* AddEqual */ : 0 /* Add */;
|
706
|
+
break;
|
707
|
+
case 38 /* Ampersand */:
|
708
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
709
|
+
operatorType = length === 2 ? 4 /* BitwiseAndEqual */ : 3 /* BitwiseAnd */;
|
710
|
+
break;
|
711
|
+
case 124 /* Bar */:
|
712
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
713
|
+
operatorType = length === 2 ? 7 /* BitwiseOrEqual */ : 6 /* BitwiseOr */;
|
714
|
+
break;
|
715
|
+
case 94 /* Caret */:
|
716
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
717
|
+
operatorType = length === 2 ? 9 /* BitwiseXorEqual */ : 8 /* BitwiseXor */;
|
718
|
+
break;
|
719
|
+
case 61 /* Equal */:
|
720
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
721
|
+
operatorType = length === 2 ? 12 /* Equals */ : 2 /* Assign */;
|
722
|
+
break;
|
723
|
+
case 33 /* ExclamationMark */:
|
724
|
+
if (nextChar !== 61 /* Equal */) {
|
725
|
+
return false;
|
726
|
+
}
|
727
|
+
length = 2;
|
728
|
+
operatorType = 28 /* NotEquals */;
|
729
|
+
break;
|
730
|
+
case 37 /* Percent */:
|
731
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
732
|
+
operatorType = length === 2 ? 25 /* ModEqual */ : 24 /* Mod */;
|
733
|
+
break;
|
734
|
+
case 126 /* Tilde */:
|
735
|
+
length = 1;
|
736
|
+
operatorType = 5 /* BitwiseInvert */;
|
737
|
+
break;
|
738
|
+
case 45 /* Hyphen */:
|
739
|
+
if (nextChar === 62 /* Greater */) {
|
740
|
+
this._tokens.push(tokenizerTypes_1.Token.create(21 /* Arrow */, this._cs.position, 2, this._getComments()));
|
741
|
+
this._cs.advance(2);
|
742
|
+
return true;
|
743
|
+
}
|
744
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
745
|
+
operatorType = length === 2 ? 34 /* SubtractEqual */ : 33 /* Subtract */;
|
746
|
+
break;
|
747
|
+
case 42 /* Asterisk */:
|
748
|
+
if (nextChar === 42 /* Asterisk */) {
|
749
|
+
length = this._cs.lookAhead(2) === 61 /* Equal */ ? 3 : 2;
|
750
|
+
operatorType = length === 3 ? 30 /* PowerEqual */ : 29 /* Power */;
|
751
|
+
}
|
752
|
+
else {
|
753
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
754
|
+
operatorType = length === 2 ? 27 /* MultiplyEqual */ : 26 /* Multiply */;
|
755
|
+
}
|
756
|
+
break;
|
757
|
+
case 47 /* Slash */:
|
758
|
+
if (nextChar === 47 /* Slash */) {
|
759
|
+
length = this._cs.lookAhead(2) === 61 /* Equal */ ? 3 : 2;
|
760
|
+
operatorType = length === 3 ? 14 /* FloorDivideEqual */ : 13 /* FloorDivide */;
|
761
|
+
}
|
762
|
+
else {
|
763
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
764
|
+
operatorType = length === 2 ? 11 /* DivideEqual */ : 10 /* Divide */;
|
765
|
+
}
|
766
|
+
break;
|
767
|
+
case 60 /* Less */:
|
768
|
+
if (nextChar === 60 /* Less */) {
|
769
|
+
length = this._cs.lookAhead(2) === 61 /* Equal */ ? 3 : 2;
|
770
|
+
operatorType = length === 3 ? 18 /* LeftShiftEqual */ : 17 /* LeftShift */;
|
771
|
+
}
|
772
|
+
else if (nextChar === 62 /* Greater */) {
|
773
|
+
length = 2;
|
774
|
+
operatorType = 19 /* LessOrGreaterThan */;
|
775
|
+
}
|
776
|
+
else {
|
777
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
778
|
+
operatorType = length === 2 ? 21 /* LessThanOrEqual */ : 20 /* LessThan */;
|
779
|
+
}
|
780
|
+
break;
|
781
|
+
case 62 /* Greater */:
|
782
|
+
if (nextChar === 62 /* Greater */) {
|
783
|
+
length = this._cs.lookAhead(2) === 61 /* Equal */ ? 3 : 2;
|
784
|
+
operatorType = length === 3 ? 32 /* RightShiftEqual */ : 31 /* RightShift */;
|
785
|
+
}
|
786
|
+
else {
|
787
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
788
|
+
operatorType = length === 2 ? 16 /* GreaterThanOrEqual */ : 15 /* GreaterThan */;
|
789
|
+
}
|
790
|
+
break;
|
791
|
+
case 64 /* At */:
|
792
|
+
length = nextChar === 61 /* Equal */ ? 2 : 1;
|
793
|
+
operatorType = length === 2 ? 23 /* MatrixMultiplyEqual */ : 22 /* MatrixMultiply */;
|
794
|
+
break;
|
795
|
+
default:
|
796
|
+
return false;
|
797
|
+
}
|
798
|
+
this._tokens.push(tokenizerTypes_1.OperatorToken.create(this._cs.position, length, operatorType, this._getComments()));
|
799
|
+
this._cs.advance(length);
|
800
|
+
return length > 0;
|
801
|
+
}
|
802
|
+
_handleInvalid() {
|
803
|
+
const start = this._cs.position;
|
804
|
+
while (true) {
|
805
|
+
if (this._cs.currentChar === 10 /* LineFeed */ ||
|
806
|
+
this._cs.currentChar === 13 /* CarriageReturn */ ||
|
807
|
+
this._cs.isAtWhiteSpace() ||
|
808
|
+
this._cs.isEndOfStream()) {
|
809
|
+
break;
|
810
|
+
}
|
811
|
+
if ((0, characters_1.isSurrogateChar)(this._cs.currentChar)) {
|
812
|
+
this._cs.moveNext();
|
813
|
+
this._cs.moveNext();
|
814
|
+
}
|
815
|
+
else {
|
816
|
+
this._cs.moveNext();
|
817
|
+
}
|
818
|
+
}
|
819
|
+
const length = this._cs.position - start;
|
820
|
+
if (length > 0) {
|
821
|
+
this._tokens.push(tokenizerTypes_1.Token.create(0 /* Invalid */, start, length, this._getComments()));
|
822
|
+
return true;
|
823
|
+
}
|
824
|
+
return false;
|
825
|
+
}
|
826
|
+
_getComments() {
|
827
|
+
const prevComments = this._comments;
|
828
|
+
this._comments = undefined;
|
829
|
+
return prevComments;
|
830
|
+
}
|
831
|
+
_isIPythonMagics() {
|
832
|
+
const prevToken = this._tokens.length > 0 ? this._tokens[this._tokens.length - 1] : undefined;
|
833
|
+
return ((prevToken === undefined || prevToken.type === 2 /* NewLine */ || prevToken.type === 3 /* Indent */) &&
|
834
|
+
(this._cs.currentChar === 37 /* Percent */ || this._cs.currentChar === 33 /* ExclamationMark */));
|
835
|
+
}
|
836
|
+
_handleIPythonMagics(type) {
|
837
|
+
const start = this._cs.position + 1;
|
838
|
+
let begin = start;
|
839
|
+
do {
|
840
|
+
this._cs.skipToEol();
|
841
|
+
const length = this._cs.position - begin;
|
842
|
+
const value = this._cs.getText().substring(begin, begin + length);
|
843
|
+
// is it multiline magics?
|
844
|
+
// %magic command \
|
845
|
+
// next arguments
|
846
|
+
if (!value.match(/\\\s*$/)) {
|
847
|
+
break;
|
848
|
+
}
|
849
|
+
begin = this._cs.position + 1;
|
850
|
+
} while (!this._cs.isEndOfStream());
|
851
|
+
const length = this._cs.position - start;
|
852
|
+
const value = this._cs.getText().substring(start, start + length);
|
853
|
+
const comment = tokenizerTypes_1.Comment.create(start, length, value, type);
|
854
|
+
this._addComments(comment);
|
855
|
+
}
|
856
|
+
_handleComment() {
|
857
|
+
const start = this._cs.position + 1;
|
858
|
+
this._cs.skipToEol();
|
859
|
+
const length = this._cs.position - start;
|
860
|
+
const value = this._cs.getText().substring(start, start + length);
|
861
|
+
const comment = tokenizerTypes_1.Comment.create(start, length, value);
|
862
|
+
const typeIgnoreRegexMatch = value.match(/^\s*type:\s*ignore(\s*\[([\s*\w-,]*)\]|\s|$)/);
|
863
|
+
if (typeIgnoreRegexMatch) {
|
864
|
+
const textRange = { start, length: typeIgnoreRegexMatch[0].length };
|
865
|
+
const ignoreComment = {
|
866
|
+
range: textRange,
|
867
|
+
rulesList: this._getIgnoreCommentRulesList(start, typeIgnoreRegexMatch),
|
868
|
+
};
|
869
|
+
if (this._tokens.findIndex((t) => t.type !== 2 /* NewLine */ && t && t.type !== 3 /* Indent */) < 0) {
|
870
|
+
this._typeIgnoreAll = ignoreComment;
|
871
|
+
}
|
872
|
+
else {
|
873
|
+
this._typeIgnoreLines.set(this._lineRanges.length, ignoreComment);
|
874
|
+
}
|
875
|
+
}
|
876
|
+
const pyrightIgnoreRegexMatch = value.match(/^\s*pyright:\s*ignore(\s*\[([\s*\w-,]*)\]|\s|$)/);
|
877
|
+
if (pyrightIgnoreRegexMatch) {
|
878
|
+
const textRange = { start, length: pyrightIgnoreRegexMatch[0].length };
|
879
|
+
const ignoreComment = {
|
880
|
+
range: textRange,
|
881
|
+
rulesList: this._getIgnoreCommentRulesList(start, pyrightIgnoreRegexMatch),
|
882
|
+
};
|
883
|
+
this._pyrightIgnoreLines.set(this._lineRanges.length, ignoreComment);
|
884
|
+
}
|
885
|
+
this._addComments(comment);
|
886
|
+
}
|
887
|
+
// Extracts the individual rules within a "type: ignore [x, y, z]" comment.
|
888
|
+
_getIgnoreCommentRulesList(start, match) {
|
889
|
+
if (match.length < 3 || match[2] === undefined) {
|
890
|
+
return undefined;
|
891
|
+
}
|
892
|
+
const splitElements = match[2].split(',');
|
893
|
+
const commentRules = [];
|
894
|
+
let currentOffset = start + match[0].indexOf('[') + 1;
|
895
|
+
for (const element of splitElements) {
|
896
|
+
const frontTrimmed = element.trimStart();
|
897
|
+
currentOffset += element.length - frontTrimmed.length;
|
898
|
+
const endTrimmed = frontTrimmed.trimEnd();
|
899
|
+
if (endTrimmed.length > 0) {
|
900
|
+
commentRules.push({
|
901
|
+
range: { start: currentOffset, length: endTrimmed.length },
|
902
|
+
text: endTrimmed,
|
903
|
+
});
|
904
|
+
}
|
905
|
+
currentOffset += frontTrimmed.length + 1;
|
906
|
+
}
|
907
|
+
return commentRules;
|
908
|
+
}
|
909
|
+
_addComments(comment) {
|
910
|
+
if (this._comments) {
|
911
|
+
this._comments.push(comment);
|
912
|
+
}
|
913
|
+
else {
|
914
|
+
this._comments = [comment];
|
915
|
+
}
|
916
|
+
}
|
917
|
+
_getStringPrefixLength() {
|
918
|
+
if (this._cs.currentChar === 39 /* SingleQuote */ || this._cs.currentChar === 34 /* DoubleQuote */) {
|
919
|
+
// Simple string, no prefix
|
920
|
+
return 0;
|
921
|
+
}
|
922
|
+
if (this._cs.nextChar === 39 /* SingleQuote */ || this._cs.nextChar === 34 /* DoubleQuote */) {
|
923
|
+
switch (this._cs.currentChar) {
|
924
|
+
case 102 /* f */:
|
925
|
+
case 70 /* F */:
|
926
|
+
case 114 /* r */:
|
927
|
+
case 82 /* R */:
|
928
|
+
case 98 /* b */:
|
929
|
+
case 66 /* B */:
|
930
|
+
case 117 /* u */:
|
931
|
+
case 85 /* U */:
|
932
|
+
// Single-char prefix like u"" or r""
|
933
|
+
return 1;
|
934
|
+
default:
|
935
|
+
break;
|
936
|
+
}
|
937
|
+
}
|
938
|
+
if (this._cs.lookAhead(2) === 39 /* SingleQuote */ || this._cs.lookAhead(2) === 34 /* DoubleQuote */) {
|
939
|
+
const prefix = this._cs
|
940
|
+
.getText()
|
941
|
+
.substring(this._cs.position, this._cs.position + 2)
|
942
|
+
.toLowerCase();
|
943
|
+
switch (prefix) {
|
944
|
+
case 'rf':
|
945
|
+
case 'fr':
|
946
|
+
case 'ur':
|
947
|
+
case 'ru':
|
948
|
+
case 'br':
|
949
|
+
case 'rb':
|
950
|
+
return 2;
|
951
|
+
default:
|
952
|
+
break;
|
953
|
+
}
|
954
|
+
}
|
955
|
+
return -1;
|
956
|
+
}
|
957
|
+
_getQuoteTypeFlags(prefix) {
|
958
|
+
let flags = 0 /* None */;
|
959
|
+
prefix = prefix.toLowerCase();
|
960
|
+
for (let i = 0; i < prefix.length; i++) {
|
961
|
+
switch (prefix[i]) {
|
962
|
+
case 'u':
|
963
|
+
flags |= 16 /* Unicode */;
|
964
|
+
break;
|
965
|
+
case 'b':
|
966
|
+
flags |= 32 /* Bytes */;
|
967
|
+
break;
|
968
|
+
case 'r':
|
969
|
+
flags |= 8 /* Raw */;
|
970
|
+
break;
|
971
|
+
case 'f':
|
972
|
+
flags |= 64 /* Format */;
|
973
|
+
break;
|
974
|
+
}
|
975
|
+
}
|
976
|
+
if (this._cs.currentChar === 39 /* SingleQuote */) {
|
977
|
+
flags |= 1 /* SingleQuote */;
|
978
|
+
if (this._cs.nextChar === 39 /* SingleQuote */ && this._cs.lookAhead(2) === 39 /* SingleQuote */) {
|
979
|
+
flags |= 4 /* Triplicate */;
|
980
|
+
}
|
981
|
+
}
|
982
|
+
else if (this._cs.currentChar === 34 /* DoubleQuote */) {
|
983
|
+
flags |= 2 /* DoubleQuote */;
|
984
|
+
if (this._cs.nextChar === 34 /* DoubleQuote */ && this._cs.lookAhead(2) === 34 /* DoubleQuote */) {
|
985
|
+
flags |= 4 /* Triplicate */;
|
986
|
+
}
|
987
|
+
}
|
988
|
+
return flags;
|
989
|
+
}
|
990
|
+
_handleString(flags, stringPrefixLength) {
|
991
|
+
const start = this._cs.position - stringPrefixLength;
|
992
|
+
if (flags & 4 /* Triplicate */) {
|
993
|
+
this._cs.advance(3);
|
994
|
+
}
|
995
|
+
else {
|
996
|
+
this._cs.moveNext();
|
997
|
+
if (flags & 1 /* SingleQuote */) {
|
998
|
+
this._singleQuoteCount++;
|
999
|
+
}
|
1000
|
+
else {
|
1001
|
+
this._doubleQuoteCount++;
|
1002
|
+
}
|
1003
|
+
}
|
1004
|
+
const stringLiteralInfo = this._skipToEndOfStringLiteral(flags);
|
1005
|
+
const end = this._cs.position;
|
1006
|
+
this._tokens.push(tokenizerTypes_1.StringToken.create(start, end - start, stringLiteralInfo.flags, stringLiteralInfo.escapedValue, stringPrefixLength, this._getComments()));
|
1007
|
+
}
|
1008
|
+
_skipToEndOfStringLiteral(flags) {
|
1009
|
+
const quoteChar = flags & 1 /* SingleQuote */ ? 39 /* SingleQuote */ : 34 /* DoubleQuote */;
|
1010
|
+
const isTriplicate = (flags & 4 /* Triplicate */) !== 0;
|
1011
|
+
let escapedValueParts = [];
|
1012
|
+
while (true) {
|
1013
|
+
if (this._cs.isEndOfStream()) {
|
1014
|
+
// Hit the end of file without a termination.
|
1015
|
+
flags |= 65536 /* Unterminated */;
|
1016
|
+
return { escapedValue: String.fromCharCode.apply(undefined, escapedValueParts), flags };
|
1017
|
+
}
|
1018
|
+
if (this._cs.currentChar === 92 /* Backslash */) {
|
1019
|
+
escapedValueParts.push(this._cs.currentChar);
|
1020
|
+
// Move past the escape (backslash) character.
|
1021
|
+
this._cs.moveNext();
|
1022
|
+
if (this._cs.getCurrentChar() === 13 /* CarriageReturn */ || this._cs.getCurrentChar() === 10 /* LineFeed */) {
|
1023
|
+
if (this._cs.getCurrentChar() === 13 /* CarriageReturn */ && this._cs.nextChar === 10 /* LineFeed */) {
|
1024
|
+
escapedValueParts.push(this._cs.currentChar);
|
1025
|
+
this._cs.moveNext();
|
1026
|
+
}
|
1027
|
+
escapedValueParts.push(this._cs.currentChar);
|
1028
|
+
this._cs.moveNext();
|
1029
|
+
this._addLineRange();
|
1030
|
+
}
|
1031
|
+
else {
|
1032
|
+
escapedValueParts.push(this._cs.currentChar);
|
1033
|
+
this._cs.moveNext();
|
1034
|
+
}
|
1035
|
+
}
|
1036
|
+
else if (this._cs.currentChar === 10 /* LineFeed */ || this._cs.currentChar === 13 /* CarriageReturn */) {
|
1037
|
+
if (!isTriplicate) {
|
1038
|
+
// Unterminated single-line string
|
1039
|
+
flags |= 65536 /* Unterminated */;
|
1040
|
+
return { escapedValue: String.fromCharCode.apply(undefined, escapedValueParts), flags };
|
1041
|
+
}
|
1042
|
+
// Skip over the new line (either one or two characters).
|
1043
|
+
if (this._cs.currentChar === 13 /* CarriageReturn */ && this._cs.nextChar === 10 /* LineFeed */) {
|
1044
|
+
escapedValueParts.push(this._cs.currentChar);
|
1045
|
+
this._cs.moveNext();
|
1046
|
+
}
|
1047
|
+
escapedValueParts.push(this._cs.currentChar);
|
1048
|
+
this._cs.moveNext();
|
1049
|
+
this._addLineRange();
|
1050
|
+
}
|
1051
|
+
else if (!isTriplicate && this._cs.currentChar === quoteChar) {
|
1052
|
+
this._cs.moveNext();
|
1053
|
+
break;
|
1054
|
+
}
|
1055
|
+
else if (isTriplicate &&
|
1056
|
+
this._cs.currentChar === quoteChar &&
|
1057
|
+
this._cs.nextChar === quoteChar &&
|
1058
|
+
this._cs.lookAhead(2) === quoteChar) {
|
1059
|
+
this._cs.advance(3);
|
1060
|
+
break;
|
1061
|
+
}
|
1062
|
+
else {
|
1063
|
+
escapedValueParts.push(this._cs.currentChar);
|
1064
|
+
this._cs.moveNext();
|
1065
|
+
}
|
1066
|
+
}
|
1067
|
+
// String.fromCharCode.apply crashes (stack overflow) if passed an array
|
1068
|
+
// that is too long. Cut off the extra characters in this case to avoid
|
1069
|
+
// the crash. It's unlikely that the full string value will be used as
|
1070
|
+
// a string literal, an f-string, or a docstring, so this should be fine.
|
1071
|
+
if (escapedValueParts.length > _maxStringTokenLength) {
|
1072
|
+
escapedValueParts = escapedValueParts.slice(0, _maxStringTokenLength);
|
1073
|
+
flags |= 131072 /* ExceedsMaxSize */;
|
1074
|
+
}
|
1075
|
+
return { escapedValue: String.fromCharCode.apply(undefined, escapedValueParts), flags };
|
1076
|
+
}
|
1077
|
+
_skipFloatingPointCandidate() {
|
1078
|
+
// Determine end of the potential floating point number
|
1079
|
+
const start = this._cs.position;
|
1080
|
+
this._skipFractionalNumber();
|
1081
|
+
if (this._cs.position > start) {
|
1082
|
+
// Optional exponent sign
|
1083
|
+
if (this._cs.currentChar === 101 /* e */ || this._cs.currentChar === 69 /* E */) {
|
1084
|
+
this._cs.moveNext();
|
1085
|
+
// Skip exponent value
|
1086
|
+
this._skipDecimalNumber(/* allowSign */ true);
|
1087
|
+
}
|
1088
|
+
}
|
1089
|
+
return this._cs.position > start;
|
1090
|
+
}
|
1091
|
+
_skipFractionalNumber() {
|
1092
|
+
this._skipDecimalNumber(false);
|
1093
|
+
if (this._cs.currentChar === 46 /* Period */) {
|
1094
|
+
// Optional period
|
1095
|
+
this._cs.moveNext();
|
1096
|
+
}
|
1097
|
+
this._skipDecimalNumber(false);
|
1098
|
+
}
|
1099
|
+
_skipDecimalNumber(allowSign) {
|
1100
|
+
if (allowSign && (this._cs.currentChar === 45 /* Hyphen */ || this._cs.currentChar === 43 /* Plus */)) {
|
1101
|
+
// Optional sign
|
1102
|
+
this._cs.moveNext();
|
1103
|
+
}
|
1104
|
+
while ((0, characters_1.isDecimal)(this._cs.currentChar)) {
|
1105
|
+
// Skip integer part
|
1106
|
+
this._cs.moveNext();
|
1107
|
+
}
|
1108
|
+
}
|
1109
|
+
}
|
1110
|
+
exports.Tokenizer = Tokenizer;
|
1111
|
+
//# sourceMappingURL=tokenizer.js.map
|