From 68b243a9122c5f0196e5d8637214d6ca331a9474 Mon Sep 17 00:00:00 2001 From: Kutlu Date: Tue, 4 Jun 2024 16:01:34 +0200 Subject: [PATCH 01/13] e4e integration --- .github/workflows/build.yml | 2 +- BUILD.sh | 57 + CHANGELOG.md | 19 + README.md | 2 +- .../.vscode/settings.json | 2 +- .../cobol-lsp-vscode-extension/.vscodeignore | 2 + .../cobol-lsp-vscode-extension/CHANGELOG.md | 10 + .../package-lock.json | 15785 ++++++++++------ .../cobol-lsp-vscode-extension/package.json | 91 +- .../src/__mocks__/getE4EMock.utility.ts | 187 + .../__mocks__/getZoweExplorerMock.utility.ts | 83 + .../ClearCopybookCacheCommand.spec.ts | 23 +- .../commands/FetchCopybookCommandTest.spec.ts | 19 +- .../src/__tests__/extensionTest.spec.ts | 16 +- .../LanguageClientServiceTest.spec.ts | 20 +- .../__tests__/services/SettingsTest.spec.ts | 114 +- .../CopybookDownloadServiceTest.spec.ts | 696 +- .../CopybookMessageHandlerTest.spec.ts | 176 +- .../copybook/CopybookResolveURITest.spec.ts | 99 +- .../services/copybook/CopybookURITest.spec.ts | 20 +- .../copybook/DownloadQueueTest.spec.ts | 145 - .../copybook/E4ECopybookService.spec.ts | 43 + .../CopybookDownloaderForDsnTest.spec.ts | 145 + .../download/CopybookDownloaderForE4E.spec.ts | 171 + .../CopybookDownloaderForUssTest.spec.ts | 148 + .../DownloadStrategyResolverTest.spec.ts | 219 + .../serverRuntimeCodeActionProvider.spec.ts | 92 + .../services/util/ProfileUtilsTest.spec.ts | 20 + .../services/util/SubroutineUtilsTest.spec.ts | 13 +- .../src/commands/ClearCopybookCacheCommand.ts | 20 +- .../src/commands/FetchCopybookCommand.ts | 8 +- .../src/commands/UpdateCobolProgramRuler.ts | 67 + .../src/constants.ts | 13 +- .../src/extension.ts | 77 +- .../src/services/LanguageClientService.ts | 13 +- .../src/services/ProcessorGroups.ts | 4 +- .../src/services/Settings.ts | 82 +- .../copybook/CopybookDownloadService.ts | 645 +- .../copybook/CopybookMessageHandler.ts | 96 +- .../src/services/copybook/CopybookURI.ts | 93 +- .../copybook/CopybooksCodeActionProvider.ts | 6 +- .../src/services/copybook/DownloadQueue.ts | 101 - .../services/copybook/E4ECopybookService.ts | 154 + .../downloader/CopybookDownloaderForDsn.ts | 118 + .../downloader/CopybookDownloaderForE4E.ts | 134 + .../downloader/CopybookDownloaderForUss.ts | 118 + .../downloader/DownloadStrategyResolver.ts | 133 + .../copybook/downloader/DownloadUtil.ts | 188 + .../downloader/ZoweExplorerDownloader.ts | 99 + .../src/services/util/FSUtils.ts | 115 +- .../src/services/util/ProfileUtils.ts | 61 +- .../src/services/util/SettingsUtils.ts | 18 +- .../src/services/util/SubroutineUtils.ts | 15 +- .../src/services/util/Utils.ts | 57 +- .../src/test/suite/lsp.spec.test.ts | 17 +- .../src/test/suite/lsp.spec.user1.test.ts | 6 +- .../suite/replacingstatement.spec.test.ts | 2 +- .../src/type/codeLayout.d.ts | 24 + .../src/type/e4eApi.d.ts | 144 + .../src/type/zoweApi.d.ts | 6 + .../syntaxes/CICS.tmLanguage.json | 2 +- .../syntaxes/HP.COBOL.tmLanguage.json | 147 + .../syntaxes/SQL.tmLanguage.json | 21 +- .../syntaxes/lang-config-hp.json | 27 + .../cobol-lsp-vscode-extension/tsconfig.json | 2 +- server/common/pom.xml | 26 +- .../cobol/common/LanguageEngineFacade.java | 14 + .../common/benchmark/BenchmarkSession.java | 14 + .../benchmark/BenchmarkSessionProvider.java | 22 + .../common/copybook/CopybookService.java | 43 +- .../common/dialects/CobolLanguageId.java | 44 + .../common/dialects}/CobolProgramLayout.java | 55 +- .../dialects/DialectProcessingContext.java | 3 + .../common/dialects/TrueDialectService.java | 39 + .../common/file/WorkspaceFileService.java | 16 +- .../cobol/common/mapping/ExtendedText.java | 11 + .../common/mapping/ExtendedTextLine.java | 2 +- .../cobol/common/mapping/MappedCharacter.java | 2 +- .../lsp/cobol/common/model/NodeType.java | 3 +- .../lsp/cobol/common/model/tree/CopyNode.java | 10 +- .../common/model/tree/JsonGenerateNode.java | 1 - .../common/model/tree/XmlGenerateNode.java | 59 + .../lsp/cobol/common}/pipeline/Pipeline.java | 12 +- .../common}/pipeline/PipelineResult.java | 2 +- .../lsp/cobol/common}/pipeline/Stage.java | 8 +- .../cobol/common}/pipeline/StageResult.java | 2 +- .../lsp/cobol/common/utils/RangeUtils.java | 16 + .../dialects/daco/DaCoMaidProcessor.java | 15 +- .../usecases/TestAdjustCopyMaidNumbers.java | 4 +- ...ssingCopybookOnStatementWithoutNumber.java | 4 +- ...yMaidIsNotResolvedInProcedureDivision.java | 4 +- ...estCopyMaidWithKmkRequestsCorrectFile.java | 4 +- ...MaidWithQualifierHasCorrectDefinition.java | 12 +- ...estCopyMaidWithRedefinesGroupVariable.java | 4 +- .../daco/usecases/TestCopyMaidWithWRK.java | 4 +- .../TestCopyMaidWithWrkDifferentCase.java | 4 +- ...tCopyMaidWithWrkDoesNotTakeNameFrom88.java | 4 +- .../TestCopyMaidWithWrkRedefines.java | 4 +- .../TestCopyMaidWithWrkShortName.java | 4 +- ...tCopyMaidWithWrkShowsErrorAfterFiller.java | 4 +- ...WrkShowsErrorAfterVariableWithoutName.java | 4 +- ...dWithWrkShowsErrorOnShortVariableName.java | 4 +- .../TestCopyMaidWithWrkThreeCharsSuffix.java | 4 +- .../dialects/daco/usecases/TestDaCoRcu.java | 2 +- .../TestDaCoWhenKeywordTerminator.java | 2 +- .../usecases/TestOnRcuRangeException.java | 4 +- .../daco/usecases/TestReadTransaction.java | 2 +- .../usecases/TestUserDefinedSections.java | 2 +- .../daco/utils/UseCaseInitializerService.java | 10 +- server/dialect-idms/pom.xml | 24 - .../dialects/idms/IdmsCopybookService.java | 4 +- .../dialects/idms/IdmsCopybookVisitor.java | 12 +- .../lsp/cobol/dialects/idms/IdmsDialect.java | 13 +- .../idms/IdmsCopybookServiceTest.java | 6 +- .../idms/IdmsCopybookVisitorTest.java | 13 +- ...tCopyIdmsVariablesForNotAllowedLevels.java | 13 +- .../dialects/idms/usecases/TestDelete.java | 7 +- .../dialects/idms/usecases/TestIdmsCopy.java | 12 +- .../TestIdmsReadyAfterIfNotProducesError.java | 4 +- .../idms/utils/UseCaseInitializerService.java | 8 +- server/engine/pom.xml | 59 +- .../org/eclipse/lsp/cics/parser/CICSParser.g4 | 2 +- .../cobol/core/parser/CobolPreprocessor.g4 | 2 +- .../org/eclipse/lsp/db2/parser/Db2SqlLexer.g4 | 2 +- .../eclipse/lsp/db2/parser/Db2SqlParser.g4 | 6 +- .../java/org/eclipse/lsp/cobol/cli/Cli.java | 28 +- .../eclipse/lsp/cobol/cli/di/CliModule.java | 25 +- .../core/engine/CobolLanguageEngine.java | 78 +- .../core/engine/analysis/AnalysisContext.java | 30 +- .../core/engine/dialects/DialectService.java | 21 +- .../processors/JsonGenerateProcess.java | 38 +- .../engine/processors/JsonParseProcess.java | 2 +- .../processors/VariableWithLevelCheck.java | 16 +- .../engine/processors/XmlGenerateProcess.java | 641 + .../CobolLSPropertiesResourceBundle.java | 16 +- .../lsp/cobol/core/model/NodeUtils.java | 73 + .../core/preprocessor/TextPreprocessor.java | 35 - .../delegates/GrammarPreprocessor.java | 4 +- .../delegates/GrammarPreprocessorImpl.java | 8 +- .../CopybookPreprocessorService.java | 24 +- .../GrammarPreprocessorListenerFactory.java | 4 +- .../GrammarPreprocessorListenerImpl.java | 5 +- .../delegates/reader/CobolLineReader.java | 203 +- .../delegates/reader/CobolLineReaderImpl.java | 249 - ...rImpl.java => LineIndicatorProcessor.java} | 75 +- .../transformer/CobolLinesTransformation.java | 11 +- .../ContinuationLineTransformation.java | 19 +- .../delegates/util/CobolLineUtils.java | 2 +- .../delegates/writer/CobolLineWriter.java | 102 +- .../delegates/writer/CobolLineWriterImpl.java | 126 - .../core/strategy/BasicCobolErrorHandler.java | 138 + .../core/strategy/CobolErrorStrategy.java | 235 +- .../core/strategy/IdentifierReplacing.java | 17 +- .../lsp/cobol/core/visitor/CobolVisitor.java | 215 +- .../core/visitor/KeywordSuggestions.java | 2 +- .../visitor/MisspelledKeywordDistance.java | 4 +- .../cobol/core/visitor/ParserListener.java | 2 +- .../lsp/cobol/core/visitor/VisitorHelper.java | 6 +- .../lsp/cobol/dialects/TrueCobolDialect.java | 36 + .../dialects/TrueDialectServiceImpl.java | 97 + .../cobol/dialects/hp/CopybookDescriptor.java | 31 + .../lsp/cobol/dialects/hp/CopybookParser.java | 67 + .../cobol/dialects/hp/HPCobolLineReader.java | 79 + .../cobol/dialects/hp/HPCobolLineWriter.java | 40 + .../hp/HPContinuationLineTransformation.java | 43 + .../lsp/cobol/dialects/hp/HpCleanupStage.java | 53 + .../hp/HpCobolLineIndicatorProcessor.java | 40 + .../hp/HpCopybookProcessingStage.java | 133 + .../hp/HpTextPreprocessor.java} | 25 +- .../cobol/dialects/hp/HpTrueCobolDialect.java | 81 + .../ibm}/CompilerDirectivesStage.java | 8 +- .../ibm}/DialectCompilerDirectiveStage.java | 8 +- .../ibm}/DialectProcessingStage.java | 13 +- .../cobol/dialects/ibm/IbmCleanupStage.java | 53 + ...bmCobolContinuationLineTransformation.java | 42 + .../ibm/IbmCobolLineIndicatorProcessor.java | 45 + .../dialects/ibm/IbmCobolLineReader.java | 82 + .../dialects/ibm/IbmCobolLineWriter.java | 42 + .../dialects/ibm/IbmTextPreprocessor.java | 62 + .../dialects/ibm/IbmTrueCobolDialect.java | 78 + .../ibm}/ImplicitDialectProcessingStage.java | 8 +- .../stages => dialects/ibm}/ParserStage.java | 15 +- .../ibm}/ParserStageResult.java | 2 +- .../ibm}/PreprocessorStage.java | 17 +- .../ibm}/ProcessingResult.java | 2 +- .../ibm}/TransformTreeStage.java | 51 +- .../ibm/experimental/EnterpriseCobol64.java | 79 + .../experimental/ExperimentalParserStage.java | 86 + .../experimental/HwTransformTreeStage.java | 63 + .../visitors}/CobolDataDivisionVisitor.java | 3 +- .../CobolIdentificationDivisionVisitor.java | 2 +- .../CobolProcedureDivisionVisitor.java | 984 + .../HwCobolProcedureDivisionVisitor.java | 47 + .../experimental/visitors/HwCobolVisitor.java | 91 + .../cobol/domain/modules/EngineModule.java | 20 +- .../implicitDialects/sql/Db2SqlDialect.java | 2 +- .../implicitDialects/sql/Db2SqlVisitor.java | 40 +- .../sql/Db2SqlVisitorHelper.java | 48 +- .../lsp/cobol/lsp/CobolLanguageServer.java | 12 +- .../cobol/lsp/CobolWorkspaceServiceImpl.java | 73 +- .../lsp/cobol/lsp/SourceUnitGraph.java | 40 +- .../lsp/analysis/AsyncAnalysisService.java | 58 +- .../CancelProgressNotification.java | 36 + .../server/CancelProgressHandler.java | 37 + .../lsp/handlers/text/DidOpenHandler.java | 2 +- .../handlers/text/FoldingRangeHandler.java | 11 +- .../cobol/lsp/jrpc/CobolLanguageClient.java | 4 +- .../lsp/cobol/service/AnalysisService.java | 2 +- .../lsp/cobol/service/CobolDocumentModel.java | 31 +- .../cobol/service/DocumentModelService.java | 12 +- .../copybooks/CopybookServiceImpl.java | 54 +- .../communications/ServerCommunications.java | 2 + .../CobolLanguageEngineFacade.java | 19 +- .../settings/layout/CodeLayoutStore.java | 44 +- .../settings/layout/CodeLayoutUtil.java | 66 + .../src/main/resources/LanguageKeywords.txt | 3 + .../resourceBundles/messages_en.properties | 3 + .../lsp/cobol/ClientServerTestModule.java | 3 - .../org/eclipse/lsp/cobol/cli/CliTest.java | 41 + .../core/engine/CobolLanguageEngineTest.java | 68 +- .../stages/CompilerDirectivesStageTest.java | 1 + .../CobolLSPropertiesResourceBundleTest.java | 74 +- .../delegates/util/CobolLineUtilsTest.java | 10 +- .../visitor/CobolDataDivisionVisitorTest.java | 1 + .../AbstractCobolLinePreprocessorTest.java | 22 +- .../CobolLineIndicatorProcessorImplTest.java | 65 +- .../ibm}/CobolLineReaderImplTest.java | 3 +- .../ibm}/CobolLineWriterImplTest.java | 12 +- .../ContinuationLineTransformationTest.java | 16 +- .../ibm}/TestCommentLines.java | 28 +- .../ibm}/TestLinesConcatenation.java | 26 +- .../lsp/cobol/lsp/SourceUnitGraphTest.java | 2 +- .../analysis/AsyncAnalysisServiceTest.java | 23 +- .../CancelProgressNotificationTest.java | 32 + .../server/CancelProgressHandlerTest.java | 33 + .../server/InitializedHandlerTest.java | 7 +- .../DidChangeConfigurationHandlerTest.java | 14 +- .../lsp/cobol/positive/PositiveTest.java | 249 +- .../lsp/cobol/positive/PositiveTestOld.java | 82 + .../lsp/cobol/positive/TypingTest.java | 31 +- .../cobol/service/AnalysisServiceTest.java | 15 +- .../ClientServerIntegrationTestImpl.java | 9 +- .../service/CobolLanguageServerTest.java | 26 +- .../service/CobolTextDocumentServiceTest.java | 5 +- .../service/DocumentModelServiceTest.java | 19 +- .../cobol/service/WorkspaceServiceTest.java | 5 +- .../copybooks/CopybookServiceTest.java | 62 +- .../ServerCommunicationsTest.java | 5 +- .../completions/KeywordCompletionTest.java | 27 +- .../completions/VariableCompletionTest.java | 15 +- .../delegates/hover/VariableHoverTest.java | 10 +- .../service/mocks/MockTextPreprocessor.java | 4 +- .../settings/SettingsServiceImplTest.java | 87 + .../lsp/cobol/usecases/Test88ThruHover.java | 2 +- .../cobol/usecases/TestAllocateStatement.java | 1 + ...AsteriskBeforeCopyDoesntBreakAnalysis.java | 31 +- .../TestCOUNTVariableNameAllowed.java | 23 + .../usecases/TestCommaSeparatorAllowed.java | 2 +- .../cobol/usecases/TestContinuationLine.java | 11 +- .../usecases/TestDeclarativesSection.java | 8 +- .../usecases/TestEmptyOptionalParagraphs.java | 2 +- .../TestEndIfDoesNotProduceError.java | 13 +- ...rOnReadyTraceOutsideProcedureDivision.java | 25 +- .../usecases/TestErrorsInDifferentFiles.java | 54 +- .../TestExecVarDoesNotProduceNPE.java | 2 +- .../usecases/TestFDRecordContainsClause.java | 29 +- .../TestHalfTypedVariableDefinition.java | 12 +- ...nexpectedTextInIdentificationDivision.java | 55 + ...stIdentificationDivOptionalParagraphs.java | 2 +- ...tificationDivisionInCopybookWithError.java | 12 +- .../usecases/TestIndicatorAreaError.java | 27 +- .../usecases/TestKeywordInProgramId.java | 8 +- .../TestMappingMultilineVariable.java | 21 +- .../lsp/cobol/usecases/TestMarginAB.java | 136 +- .../lsp/cobol/usecases/TestMissedDialect.java | 2 +- ...pelledKeywordWarningInCorrectPosition.java | 23 +- .../usecases/TestMultilineCommentEntries.java | 2 +- .../usecases/TestNoExceptionOnEmptyUsage.java | 8 +- ...interExpForIncompleteReplaceStatement.java | 47 +- .../TestOccursToDoesNotProduceExceptions.java | 13 +- .../usecases/TestPICVariableStructure.java | 8 +- .../lsp/cobol/usecases/TestPerformClose.java | 8 +- .../cobol/usecases/TestProgramContexts.java | 4 +- ...ferentPlacesTreatedAsDifferentEntries.java | 11 +- ...lonNotAllowedInIdentificationDivision.java | 23 +- ...qlIncludeStatementNotDefinedCorrectly.java | 23 +- .../lsp/cobol/usecases/TestSyntaxError.java | 13 +- ...tSyntaxErrorTraversedThroughHierarchy.java | 26 +- .../usecases/TestTolerationForMissingDot.java | 94 + .../cobol/usecases/TestTopAsIdentifier.java | 30 +- ...TestTypingExecDoesNotProduceException.java | 4 +- ...rsDoesNotProduceNumberFormatException.java | 8 +- .../TestTyposOnCompilerDirectives.java | 22 +- .../TestUnexpectedCharErrorShown.java | 32 +- ...nexpectedTextInIdentificationDivision.java | 11 +- .../TestUnknownVariableDefinition.java | 8 +- .../TestVariableEndDoesNotProduceNPE.java | 15 +- .../usecases/TestVariableInFileControl.java | 2 +- .../TestVariableRedefineSameGroup.java | 2 +- .../usecases/TestXMLGenerateStatements.java | 184 + .../engine/UseCaseInitializerService.java | 8 +- .../usecases/example/TestParametrised.java | 25 +- .../usecases/example/TestPositiveCase.java | 2 +- .../cobol/usecases/example/TestReplacing.java | 2 +- .../usecases/example/TestWithCopybook.java | 2 +- .../usecases/example/TestWithErrorCheck.java | 20 +- .../cobol/usecases/hpcobol/TestHPCobol.java | 148 + .../cobol/usecases/sql/TestSqlComment.java | 47 + .../variables/TestSymbolVariableName.java | 117 +- .../cfast/case_execCicsHandleAbend.cbl | 1 - server/parser/pom.xml | 17 - .../core/parser/CobolDataDivisionParser.g4 | 4 +- .../CobolIdentificationDivisionParser.g4 | 2 +- .../lsp/cobol/core/parser/CobolLexer.g4 | 692 +- .../lsp/cobol/core/parser/CobolParser.g4 | 130 +- .../parser/CobolProcedureDivisionLexer.g4 | 1 + .../parser/CobolProcedureDivisionParser.g4 | 9 +- .../cobol}/codegen/CobolCodeGenerator.java | 8 +- .../lsp/cobol}/codegen/GeneratorContext.java | 2 +- .../lsp/cobol}/codegen/GeneratorSettings.java | 4 +- .../lsp/cobol}/codegen/IdentifierType.java | 2 +- .../snippets/DisplayStatementGenerator.java | 6 +- .../snippets/OpenStatementGenerator.java | 6 +- .../codegen/snippets/ParagraphGenerator.java | 6 +- .../codegen/snippets/SectionGenerator.java | 8 +- .../codegen/snippets/SnippetGenerator.java | 4 +- .../lsp/cobol/core/MessageServiceParser.java | 1 + .../eclipse/lsp/cobol/core/ParserUtils.java | 31 - .../eclipse/lsp/cobol/core/hw/CobolLexer.java | 172 - .../lsp/cobol/core/hw/CobolParser.java | 463 - .../lsp/cobol/core/hw/ParsingContext.java | 69 - .../org/eclipse/lsp/cobol/core/hw/Token.java | 53 - .../lsp/cobol/core/hw/antlradapter/Utils.java | 99 - .../cobol/{core => }/cst/DataDivision.java | 4 +- .../{core => }/cst/EnvironmentDivision.java | 4 +- .../cst/IdentificationDivision.java | 8 +- .../lsp/cobol/{core => }/cst/ProgramUnit.java | 4 +- .../lsp/cobol/{core => }/cst/Skipped.java | 4 +- .../lsp/cobol/{core => }/cst/SourceUnit.java | 4 +- .../cobol/{core => }/cst/base/CstNode.java | 29 +- .../{core => }/cst/base/CstNodeImpl.java | 8 +- .../procedure/Declaratives.java} | 10 +- .../{core => }/cst/procedure/Paragraph.java | 4 +- .../cst/procedure/ProcedureDivision.java | 10 +- .../{core => }/cst/procedure/Section.java | 8 +- .../{core => }/cst/procedure/Statement.java | 4 +- .../{core => parser}/AntlrCobolParser.java | 4 +- .../cobol/{core => parser}/AstBuilder.java | 5 +- .../cobol/{core => parser}/SplitParser.java | 20 +- .../WarningRecognitionException.java | 2 +- .../lsp/cobol/parser/hw/CobolParser.java | 49 + .../cobol/{core => parser}/hw/Diagnostic.java | 2 +- .../cobol/{core => parser}/hw/ParseError.java | 2 +- .../{core => parser}/hw/ParseResult.java | 4 +- .../{core => parser}/hw/ParserSettings.java | 2 +- .../lsp/cobol/parser/hw/ParsingContext.java | 278 + .../hw/antlradapter/AntlrAdapted.java | 4 +- .../hw/antlradapter/AntlrAdapter.java | 200 +- .../ProcedureDivisionAntlrAdapter.java | 285 + .../cobol/parser/hw/antlradapter/Utils.java | 236 + .../lsp/cobol/parser/hw/lexer/CobolLexer.java | 104 + .../lsp/cobol/parser/hw/lexer/Token.java | 94 + .../cobol/parser/hw/lexer/TokenScanner.java | 257 + .../hw => parser/hw/lexer}/TokenType.java | 6 +- .../lsp/cobol/rules/CobolLanguage.java | 581 + .../lsp/cobol/rules/CobolLanguageUtils.java | 106 + .../eclipse/lsp/cobol/rules/LanguageRule.java | 55 + .../eclipse/lsp/cobol/rules/ProgramRule.java | 63 + .../lsp/cobol/rules/SourceUnitRule.java | 72 + .../cobol/rules/data/DataDivisionRule.java | 49 + .../environment/EnvironmentDivisionRule.java | 50 + .../IdentificationDivisionRule.java | 69 + .../procedure/ConditionExpressionRule.java | 206 + .../rules/procedure/DeclarativesRule.java | 60 + .../cobol/rules/procedure/ParagraphRule.java | 79 + .../procedure/ProcedureDivisionRule.java | 69 + .../cobol/rules/procedure/SectionRule.java | 61 + .../cobol/rules/procedure/SentenceRule.java | 55 + .../statements/ImperativeStatementRule.java | 82 + .../rules/procedure/statements/MoveRule.java | 50 + .../procedure/statements/PerformRule.java | 228 + .../cobol/{core => }/EndNotTheEndTest.java | 10 +- .../{core => }/GenerativePerformanceTest.java | 15 +- .../cobol/{core => }/HwCobolParserTest.java | 40 +- .../lsp/cobol/{core => }/HwDivisionsTest.java | 57 +- .../cobol/{core => }/HwParserErrorTest.java | 12 +- .../lsp/cobol}/codegen/GenProgramTest.java | 2 +- .../lsp/cobol/core/HwCobolLexerTest.java | 68 - .../IdentificationDivisionTests.java | 14 +- .../divisions/procedure/AlterGoToTest.java | 48 + .../cobol/divisions/procedure/BrokenTest.java | 56 + .../divisions/procedure/DeclarativesTest.java | 55 + .../divisions/procedure/EndProgramTest.java | 61 + .../divisions/procedure/ParagraphTest.java | 24 +- .../procedure/PerformBasicStatementTest.java | 59 + .../procedure/PerformTimesStatementTest.java | 67 + .../procedure/PerformUntilStatementTest.java | 164 + .../PerformVaryingStatementTest.java | 109 + .../ProcedureDivisionWithVariablesTest.java | 41 + .../divisions/procedure/SectionTest.java | 37 +- .../procedure/bugs/PerformCommentEofTest.java | 58 + .../lsp/cobol/lexer/HwCobolLexerTest.java | 103 + .../lsp/cobol/lexer/LexerTestUtils.java | 43 + .../cobol/lexer/NonNumericLiteralTest.java | 89 + .../lsp/cobol/lexer/NumericLiteralsTest.java | 65 + .../{core => }/migration/CompositionTest.java | 44 +- .../cobol/migration/ElementsOrderTest.java | 131 + .../migration/SectionCompositionTest.java | 344 + .../eclipse/lsp/cobol/migration/Utils.java | 60 + server/pom.xml | 2 +- server/test/pom.xml | 24 - .../lsp/cobol/test/engine/UseCaseEngine.java | 173 +- .../lsp/cobol/test/engine/UseCaseUtils.java | 60 +- sonar-project.properties | 14 +- .../test_files/cicsGenApp/copybooks/ssmap.cpy | 612 + .../{negative => positive}/lgtestc1.cbl | 0 .../{negative => positive}/lgtestp1.cbl | 0 .../{negative => positive}/lgtestp2.cbl | 0 .../{negative => positive}/lgtestp3.cbl | 0 .../{negative => positive}/lgtestp4.cbl | 0 420 files changed, 26612 insertions(+), 11760 deletions(-) create mode 100755 BUILD.sh create mode 100644 clients/cobol-lsp-vscode-extension/src/__mocks__/getE4EMock.utility.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/__mocks__/getZoweExplorerMock.utility.ts delete mode 100644 clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/DownloadQueueTest.spec.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForDsnTest.spec.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForE4E.spec.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForUssTest.spec.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/__tests__/services/nativeLanguageClient/serverRuntimeCodeActionProvider.spec.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/commands/UpdateCobolProgramRuler.ts delete mode 100644 clients/cobol-lsp-vscode-extension/src/services/copybook/DownloadQueue.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/services/copybook/E4ECopybookService.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForDsn.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForE4E.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForUss.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadUtil.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/ZoweExplorerDownloader.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/type/codeLayout.d.ts create mode 100644 clients/cobol-lsp-vscode-extension/src/type/e4eApi.d.ts create mode 100644 clients/cobol-lsp-vscode-extension/syntaxes/HP.COBOL.tmLanguage.json create mode 100644 clients/cobol-lsp-vscode-extension/syntaxes/lang-config-hp.json create mode 100644 server/common/src/main/java/org/eclipse/lsp/cobol/common/benchmark/BenchmarkSessionProvider.java create mode 100644 server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/CobolLanguageId.java rename server/{engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout => common/src/main/java/org/eclipse/lsp/cobol/common/dialects}/CobolProgramLayout.java (55%) create mode 100644 server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/TrueDialectService.java create mode 100644 server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/XmlGenerateNode.java rename server/{engine/src/main/java/org/eclipse/lsp/cobol/core/engine => common/src/main/java/org/eclipse/lsp/cobol/common}/pipeline/Pipeline.java (77%) rename server/{engine/src/main/java/org/eclipse/lsp/cobol/core/engine => common/src/main/java/org/eclipse/lsp/cobol/common}/pipeline/PipelineResult.java (92%) rename server/{engine/src/main/java/org/eclipse/lsp/cobol/core/engine => common/src/main/java/org/eclipse/lsp/cobol/common}/pipeline/Stage.java (75%) rename server/{engine/src/main/java/org/eclipse/lsp/cobol/core/engine => common/src/main/java/org/eclipse/lsp/cobol/common}/pipeline/StageResult.java (95%) create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/XmlGenerateProcess.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/NodeUtils.java delete mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/TextPreprocessor.java delete mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/reader/CobolLineReaderImpl.java rename server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/rewriter/{CobolLineIndicatorProcessorImpl.java => LineIndicatorProcessor.java} (74%) delete mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/writer/CobolLineWriterImpl.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/BasicCobolErrorHandler.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/TrueCobolDialect.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/TrueDialectServiceImpl.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/CopybookDescriptor.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/CopybookParser.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPCobolLineReader.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPCobolLineWriter.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPContinuationLineTransformation.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCleanupStage.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCobolLineIndicatorProcessor.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCopybookProcessingStage.java rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/preprocessor/TextPreprocessorImpl.java => dialects/hp/HpTextPreprocessor.java} (76%) create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpTrueCobolDialect.java rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/engine/pipeline/stages => dialects/ibm}/CompilerDirectivesStage.java (93%) rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/engine/pipeline/stages => dialects/ibm}/DialectCompilerDirectiveStage.java (88%) rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/engine/pipeline/stages => dialects/ibm}/DialectProcessingStage.java (84%) create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCleanupStage.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolContinuationLineTransformation.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineIndicatorProcessor.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineReader.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineWriter.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmTextPreprocessor.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmTrueCobolDialect.java rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/engine/pipeline/stages => dialects/ibm}/ImplicitDialectProcessingStage.java (95%) rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/engine/pipeline/stages => dialects/ibm}/ParserStage.java (84%) rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/engine/pipeline/stages => dialects/ibm}/ParserStageResult.java (91%) rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/engine/pipeline/stages => dialects/ibm}/PreprocessorStage.java (80%) rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/engine/pipeline/stages => dialects/ibm}/ProcessingResult.java (92%) rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/engine/pipeline/stages => dialects/ibm}/TransformTreeStage.java (86%) create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/EnterpriseCobol64.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/ExperimentalParserStage.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/HwTransformTreeStage.java rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/visitor => dialects/ibm/experimental/visitors}/CobolDataDivisionVisitor.java (99%) rename server/engine/src/main/java/org/eclipse/lsp/cobol/{core/visitor => dialects/ibm/experimental/visitors}/CobolIdentificationDivisionVisitor.java (98%) create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/CobolProcedureDivisionVisitor.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/HwCobolProcedureDivisionVisitor.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/HwCobolVisitor.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/events/notifications/CancelProgressNotification.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/server/CancelProgressHandler.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout/CodeLayoutUtil.java create mode 100644 server/engine/src/test/java/org/eclipse/lsp/cobol/cli/CliTest.java rename server/engine/src/test/java/org/eclipse/lsp/cobol/{core => dialects/ibm}/AbstractCobolLinePreprocessorTest.java (73%) rename server/engine/src/test/java/org/eclipse/lsp/cobol/{core/preprocessor/delegates/rewriter/impl => dialects/ibm}/CobolLineIndicatorProcessorImplTest.java (86%) rename server/engine/src/test/java/org/eclipse/lsp/cobol/{core/preprocessor/delegates/reader/impl => dialects/ibm}/CobolLineReaderImplTest.java (98%) rename server/engine/src/test/java/org/eclipse/lsp/cobol/{core/preprocessor/delegates/writer/impl => dialects/ibm}/CobolLineWriterImplTest.java (82%) rename server/engine/src/test/java/org/eclipse/lsp/cobol/{core/preprocessor/delegates/transformer => dialects/ibm}/ContinuationLineTransformationTest.java (88%) rename server/engine/src/test/java/org/eclipse/lsp/cobol/{core/preprocessor => dialects/ibm}/TestCommentLines.java (60%) rename server/engine/src/test/java/org/eclipse/lsp/cobol/{core/preprocessor => dialects/ibm}/TestLinesConcatenation.java (66%) create mode 100644 server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/events/notifications/CancelProgressNotificationTest.java create mode 100644 server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/server/CancelProgressHandlerTest.java create mode 100644 server/engine/src/test/java/org/eclipse/lsp/cobol/positive/PositiveTestOld.java create mode 100644 server/engine/src/test/java/org/eclipse/lsp/cobol/service/settings/SettingsServiceImplTest.java create mode 100644 server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestHwUnexpectedTextInIdentificationDivision.java create mode 100644 server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTolerationForMissingDot.java create mode 100644 server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestXMLGenerateStatements.java create mode 100644 server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/hpcobol/TestHPCobol.java create mode 100644 server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlComment.java rename server/{test/src/main/java/org/eclipse/lsp/cobol/test => parser/src/main/java/org/eclipse/lsp/cobol}/codegen/CobolCodeGenerator.java (93%) rename server/{test/src/main/java/org/eclipse/lsp/cobol/test => parser/src/main/java/org/eclipse/lsp/cobol}/codegen/GeneratorContext.java (95%) rename server/{test/src/main/java/org/eclipse/lsp/cobol/test => parser/src/main/java/org/eclipse/lsp/cobol}/codegen/GeneratorSettings.java (96%) rename server/{test/src/main/java/org/eclipse/lsp/cobol/test => parser/src/main/java/org/eclipse/lsp/cobol}/codegen/IdentifierType.java (93%) rename server/{test/src/main/java/org/eclipse/lsp/cobol/test => parser/src/main/java/org/eclipse/lsp/cobol}/codegen/snippets/DisplayStatementGenerator.java (82%) rename server/{test/src/main/java/org/eclipse/lsp/cobol/test => parser/src/main/java/org/eclipse/lsp/cobol}/codegen/snippets/OpenStatementGenerator.java (83%) rename server/{test/src/main/java/org/eclipse/lsp/cobol/test => parser/src/main/java/org/eclipse/lsp/cobol}/codegen/snippets/ParagraphGenerator.java (82%) rename server/{test/src/main/java/org/eclipse/lsp/cobol/test => parser/src/main/java/org/eclipse/lsp/cobol}/codegen/snippets/SectionGenerator.java (79%) rename server/{test/src/main/java/org/eclipse/lsp/cobol/test => parser/src/main/java/org/eclipse/lsp/cobol}/codegen/snippets/SnippetGenerator.java (87%) delete mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/core/ParserUtils.java delete mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/CobolLexer.java delete mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/CobolParser.java delete mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParsingContext.java delete mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/Token.java delete mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/antlradapter/Utils.java rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/DataDivision.java (86%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/EnvironmentDivision.java (86%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/IdentificationDivision.java (77%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/ProgramUnit.java (87%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/Skipped.java (86%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/SourceUnit.java (86%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/base/CstNode.java (59%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/base/CstNodeImpl.java (84%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core/hw/GrammarRule.java => cst/procedure/Declaratives.java} (76%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/procedure/Paragraph.java (86%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/procedure/ProcedureDivision.java (64%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/procedure/Section.java (69%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => }/cst/procedure/Statement.java (85%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => parser}/AntlrCobolParser.java (92%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => parser}/AstBuilder.java (89%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => parser}/SplitParser.java (78%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => parser}/WarningRecognitionException.java (96%) create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/CobolParser.java rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => parser}/hw/Diagnostic.java (94%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => parser}/hw/ParseError.java (94%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => parser}/hw/ParseResult.java (89%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => parser}/hw/ParserSettings.java (94%) create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParsingContext.java rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => parser}/hw/antlradapter/AntlrAdapted.java (88%) rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core => parser}/hw/antlradapter/AntlrAdapter.java (51%) create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/ProcedureDivisionAntlrAdapter.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/Utils.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/CobolLexer.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/Token.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/TokenScanner.java rename server/parser/src/main/java/org/eclipse/lsp/cobol/{core/hw => parser/hw/lexer}/TokenType.java (84%) create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/CobolLanguage.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/CobolLanguageUtils.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/LanguageRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/ProgramRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/SourceUnitRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/data/DataDivisionRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/environment/EnvironmentDivisionRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/identification/IdentificationDivisionRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ConditionExpressionRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/DeclarativesRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ParagraphRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ProcedureDivisionRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/SectionRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/SentenceRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/ImperativeStatementRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/MoveRule.java create mode 100644 server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/PerformRule.java rename server/parser/src/test/java/org/eclipse/lsp/cobol/{core => }/EndNotTheEndTest.java (85%) rename server/parser/src/test/java/org/eclipse/lsp/cobol/{core => }/GenerativePerformanceTest.java (83%) rename server/parser/src/test/java/org/eclipse/lsp/cobol/{core => }/HwCobolParserTest.java (76%) rename server/parser/src/test/java/org/eclipse/lsp/cobol/{core => }/HwDivisionsTest.java (65%) rename server/parser/src/test/java/org/eclipse/lsp/cobol/{core => }/HwParserErrorTest.java (86%) rename server/{test/src/test/java/org/eclipse/lsp/cobol/test => parser/src/test/java/org/eclipse/lsp/cobol}/codegen/GenProgramTest.java (96%) delete mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwCobolLexerTest.java rename server/parser/src/test/java/org/eclipse/lsp/cobol/{core => }/divisions/IdentificationDivisionTests.java (76%) create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/AlterGoToTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/BrokenTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/DeclarativesTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/EndProgramTest.java rename server/parser/src/test/java/org/eclipse/lsp/cobol/{core => }/divisions/procedure/ParagraphTest.java (68%) create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformBasicStatementTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformTimesStatementTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformUntilStatementTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformVaryingStatementTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/ProcedureDivisionWithVariablesTest.java rename server/parser/src/test/java/org/eclipse/lsp/cobol/{core => }/divisions/procedure/SectionTest.java (57%) create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/bugs/PerformCommentEofTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/HwCobolLexerTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/LexerTestUtils.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/NonNumericLiteralTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/NumericLiteralsTest.java rename server/parser/src/test/java/org/eclipse/lsp/cobol/{core => }/migration/CompositionTest.java (56%) create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/migration/ElementsOrderTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/migration/SectionCompositionTest.java create mode 100644 server/parser/src/test/java/org/eclipse/lsp/cobol/migration/Utils.java create mode 100644 tests/test_files/cicsGenApp/copybooks/ssmap.cpy rename tests/test_files/cicsGenApp/{negative => positive}/lgtestc1.cbl (100%) rename tests/test_files/cicsGenApp/{negative => positive}/lgtestp1.cbl (100%) rename tests/test_files/cicsGenApp/{negative => positive}/lgtestp2.cbl (100%) rename tests/test_files/cicsGenApp/{negative => positive}/lgtestp3.cbl (100%) rename tests/test_files/cicsGenApp/{negative => positive}/lgtestp4.cbl (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53d7e69425..8b77bcc0f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,7 +95,7 @@ jobs: cache: 'maven' - name: Build Server and Dialects Jars working-directory: server - run: mvn clean package --no-transfer-progress + run: mvn clean verify --no-transfer-progress - name: Upload performance data uses: actions/upload-artifact@v3 with: diff --git a/BUILD.sh b/BUILD.sh new file mode 100755 index 0000000000..3c4909a414 --- /dev/null +++ b/BUILD.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +# +# Copyright (c) 2024 Broadcom. +# The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +# +# This program and the accompanying materials are made +# available under the terms of the Eclipse Public License 2.0 +# which is available at https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 +# +# Contributors: +# Broadcom, Inc. - initial API and implementation +# + +# Fail script if any command fails +set -e +# Echo commands as they are executed for better understanding +set -x + +# Compile language server and dialect jars +cd server +mvn clean package --no-transfer-progress -Dmaven.test.skip +cd - + +# Copy jars +cp server/dialect-daco/target/dialect-daco.jar clients/daco-dialect-support/server/jar +cp server/dialect-idms/target/dialect-idms.jar clients/idms-dialect-support/server/jar +cp server/engine/target/server.jar clients/cobol-lsp-vscode-extension/server/jar + +# Compile dialect api +cd clients/cobol-dialect-api +npm ci +npm run compile +cd - + +# Build COBOL LS extension +cd clients/cobol-lsp-vscode-extension +npm ci +npm run package +cd - + +# Build IMDS LS extension +cd clients/idms-dialect-support +npm ci +npm run package +cd - + +# Build DACO LS extension +cd clients/daco-dialect-support +npm ci +npm run package +cd - + +# Done +echo "Done building COBOL LS" diff --git a/CHANGELOG.md b/CHANGELOG.md index c6b84fd8a5..c9eacf63a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,25 @@ # Changelog All notable changes to the COBOL Language Support extension are documented in this file. +## [2.1.2](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/compare/2.1.1...2.2.0) (2024-04-03) + +### Bug Fixes +* Add benchmark service ([a313cc2](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/a313cc20340e819a6b4d079740b123f1ac65eb74)) +* Apply matching threshold while parsing different divisions of COBOL code ([4f20ce9](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/4f20ce9c11661321ad33058f01bbb0af658d7ac0)) +* Fix folding for evaluate block ([70a752d](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/70a752de324b560277af9ea4fa45aa04615bb8d0)) +* Fix folding when IfNode has a copynode child ([0c9717d](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/0c9717d161dd7c3c7f595c35c0a8b2be6e533aca)) +* Hardware parser tests ([cb98e83](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/cb98e83740c60fe48a41663b098d47896d9feca9)) +* Update CICS delay statement as per doc ([3aed670](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/3aed670a8ff661d3e958c6b30ad0f3288ae3643c)) +* Update new keywords introduced by CICS EXCI grammar ([f9a8e91](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/f9a8e91e16b3b4624acdbb1147c79d32016c30fd)) + +### Features +* Add CCF support for CICS RETURN statement ([#2229](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/issues/2229)) ([cbcd098](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/cbcd09873b34b3e841efc72b29ece7aaefcc3196)) +* Add CCF support for not supported statements ([#2242](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/issues/2242)) ([dcb5de5](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/dcb5de5483e3740e193de818bee870241d85e51c)) +* Add CCF support for the 'XML PARSE' statement ([#2237](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/issues/2237)) ([3c09a11](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/3c09a11fda5bd1f1ffabfc21e8d14e45a3748381)) +* Allow floating comments in DaCo COPY MAID statements ([deb5811](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/deb581168bd5c6c05ef9c791b1a8ca2ff73cd5c9)) +* Make COBOL code layout configurable ([26b3388](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/26b3388a9237b46f9fd8b62e831380c8317827fb)) +* Support EXCI command in CICS ([3dcd0f5](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/3dcd0f5a80f26d8de88cc07992d481916194c0ca)) + ## [2.1.1](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/compare/2.1.0...2.1.1) (2024-01-30) ### Bug Fixes * Add grammar for the CICS INQUIRE URIMAP statement ([f45d384](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/commit/f45d38410a5f08d785ee8a9ddc2dd6fde8862846)) diff --git a/README.md b/README.md index f23d07df8d..6edde543b7 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ COBOL Language Support recognizes files with the extensions `.cob`, `.cbl` and ` This extension is a part of the [Che4z](https://github.com/eclipse/che-che4z) open-source project. Feel free to contribute right here. -COBOL Language Support is also part of [Code4z](https://marketplace.visualstudio.com/items?itemName=broadcomMFD.code4z-extension-pack), an all-round package that offers a modern experience for mainframe application developers, including extensions for language support, data editing, testing, and source code management. For an interactive overview of Code4z, see the [Code4z Developer Cockpit](https://mainframe.broadcom.com/code4z-developer-cockpit). +COBOL Language Support is also part of [Code4z](https://techdocs.broadcom.com/code4z), an all-round VS Code extension package that offers a modern experience for mainframe application developers, including tools for language support, data editing, testing, and source code management. For an interactive overview of Code4z, see the [Code4z Developer Cockpit](https://mainframe.broadcom.com/code4z-developer-cockpit). ## Prerequisites diff --git a/clients/cobol-lsp-vscode-extension/.vscode/settings.json b/clients/cobol-lsp-vscode-extension/.vscode/settings.json index 3431d42e9b..96025acb6e 100644 --- a/clients/cobol-lsp-vscode-extension/.vscode/settings.json +++ b/clients/cobol-lsp-vscode-extension/.vscode/settings.json @@ -15,7 +15,7 @@ { "[typescript]": { "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "vscode.typescript-language-features" }, "[javascript]": { "editor.formatOnSave": true, diff --git a/clients/cobol-lsp-vscode-extension/.vscodeignore b/clients/cobol-lsp-vscode-extension/.vscodeignore index b1db545142..fd5077189b 100644 --- a/clients/cobol-lsp-vscode-extension/.vscodeignore +++ b/clients/cobol-lsp-vscode-extension/.vscodeignore @@ -25,9 +25,11 @@ !resources/TELEMETRY_KEY !package.json !syntaxes/lang-config.json +!syntaxes/lang-config-hp.json !syntaxes/COBOL.tmLanguage.json !syntaxes/CICS.tmLanguage.json !syntaxes/SQL.tmLanguage.json +!syntaxes/HP.COBOL.tmLanguage.json !schema/pgm_conf.schema.json !schema/preprocessor_entry.schema.json !schema/proc_grps.schema.json diff --git a/clients/cobol-lsp-vscode-extension/CHANGELOG.md b/clients/cobol-lsp-vscode-extension/CHANGELOG.md index 85617bde41..0ae716d1cf 100644 --- a/clients/cobol-lsp-vscode-extension/CHANGELOG.md +++ b/clients/cobol-lsp-vscode-extension/CHANGELOG.md @@ -1,6 +1,16 @@ # Changelog All notable changes to the COBOL Language Support extension are documented in this file. +## [2.1.2](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/compare/2.1.1...2.2.0) (2024-04-03) +#### Added +- Support EXCI command in CICS + +#### Fixed +- Miscellaneous bug fixes +- Fix folding for evaluate block +- Fix folding when IfNode has a copynode child +- Update CICS delay statement + ## [2.1.1](https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/compare/2.1.0...2.1.1) (2024-01-30) #### Added - Support for CICS INQUIRE URIMAP statement diff --git a/clients/cobol-lsp-vscode-extension/package-lock.json b/clients/cobol-lsp-vscode-extension/package-lock.json index f2b818ff87..76f539b529 100644 --- a/clients/cobol-lsp-vscode-extension/package-lock.json +++ b/clients/cobol-lsp-vscode-extension/package-lock.json @@ -1,20 +1,20 @@ { "name": "cobol-language-support", - "version": "2.1.1", + "version": "2.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "cobol-language-support", - "version": "2.1.1", + "version": "2.1.2", "hasInstallScript": true, "license": "EPL-2.0", "dependencies": { "@code4z/cobol-dialect-api": "file:../cobol-dialect-api", "@vscode/extension-telemetry": "^0.8.2", - "glob": "10.2.7", + "glob": "10.3.10", "iconv-lite": "^0.6.3", - "micromatch": "4.0.5", + "micromatch": "^4.0.7", "vscode-languageclient": "8.0.2" }, "devDependencies": { @@ -67,40 +67,40 @@ } }, "node_modules/@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.1.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@azure/abort-controller": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", - "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.1.tgz", + "integrity": "sha512-NhzeNm5zu2fPlwGXPUjzsRCRuPx5demaZyNcyNYJDqpa/Sbxzvo/RYt9IwUaAOnDW5+r7J9UOE6f22TQnb9nhQ==", "dependencies": { - "tslib": "^2.2.0" + "tslib": "^2.6.2" }, "engines": { - "node": ">=12.0.0" + "node": ">=18.0.0" } }, "node_modules/@azure/core-auth": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.5.0.tgz", - "integrity": "sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.7.1.tgz", + "integrity": "sha512-dyeQwvgthqs/SlPVQbZQetpslXceHd4i5a7M/7z/lGEAVwnSluabnQOjF2/dk/hhWgMISusv1Ytp4mQ8JNy62A==", "dependencies": { - "@azure/abort-controller": "^1.0.0", + "@azure/abort-controller": "^2.0.0", "@azure/core-util": "^1.1.0", - "tslib": "^2.2.0" + "tslib": "^2.6.2" }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" } }, "node_modules/@azure/core-rest-pipeline": { @@ -123,10 +123,10 @@ "node": ">=14.0.0" } }, - "node_modules/@azure/core-tracing": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz", - "integrity": "sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==", + "node_modules/@azure/core-rest-pipeline/node_modules/@azure/abort-controller": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", + "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", "dependencies": { "tslib": "^2.2.0" }, @@ -134,6 +134,38 @@ "node": ">=12.0.0" } }, + "node_modules/@azure/core-rest-pipeline/node_modules/@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/@azure/core-rest-pipeline/node_modules/http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "dependencies": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@azure/core-tracing": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.1.1.tgz", + "integrity": "sha512-qPbYhN1pE5XQ2jPKIHP33x8l3oBu1UqIWnYqZZ3OYnYjzY0xqIHjn49C+ptsPD9yC7uyWI9Zm7iZUZLs2R4DhQ==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" + } + }, "node_modules/@azure/core-util": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.2.0.tgz", @@ -146,15 +178,26 @@ "node": ">=14.0.0" } }, - "node_modules/@azure/logger": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz", - "integrity": "sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==", + "node_modules/@azure/core-util/node_modules/@azure/abort-controller": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", + "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", "dependencies": { "tslib": "^2.2.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=12.0.0" + } + }, + "node_modules/@azure/logger": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.1.1.tgz", + "integrity": "sha512-/+4TtokaGgC+MnThdf6HyIH9Wrjp+CnCn3Nx3ggevN7FFjjNyjqg0yLlc2i9S+Z2uAzI8GYOo35Nzb1MhQ89MA==", + "dependencies": { + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=18.0.0" } }, "node_modules/@azure/opentelemetry-instrumentation-azure-sdk": { @@ -173,133 +216,49 @@ "node": ">=14.0.0" } }, - "node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", - "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.2" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" - } - }, - "node_modules/@azure/opentelemetry-instrumentation-azure-sdk/node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==", - "engines": { - "node": ">=14" - } - }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", + "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" + "@babel/highlight": "^7.24.2", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/code-frame/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/code-frame/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/code-frame/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/code-frame/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/compat-data": { - "version": "7.20.14", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.14.tgz", - "integrity": "sha512-0YpKHD6ImkWMEINCyDAD0HLLUH/lPCefG8ld9it8DJB2wnApraKuhgYTvTY1z7UFIfBTGy5LwncZ+5HWWGbhFw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.1.tgz", + "integrity": "sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.20.12", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.12.tgz", - "integrity": "sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg==", - "dev": true, - "dependencies": { - "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.7", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helpers": "^7.20.7", - "@babel/parser": "^7.20.7", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.12", - "@babel/types": "^7.20.7", - "convert-source-map": "^1.7.0", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.3.tgz", + "integrity": "sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==", + "dev": true, + "dependencies": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.2", + "@babel/generator": "^7.24.1", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.24.1", + "@babel/parser": "^7.24.1", + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.1", + "@babel/types": "^7.24.0", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2", - "semver": "^6.3.0" + "json5": "^2.2.3", + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" @@ -309,12 +268,6 @@ "url": "https://opencollective.com/babel" } }, - "node_modules/@babel/core/node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - }, "node_modules/@babel/core/node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -325,51 +278,34 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", - "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.1.tgz", + "integrity": "sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A==", "dev": true, "dependencies": { - "@babel/types": "^7.23.0", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", + "@babel/types": "^7.24.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", - "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.21.3", + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", "lru-cache": "^5.1.1", - "semver": "^6.3.0" + "semver": "^6.3.1" }, "engines": { "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-compilation-targets/node_modules/lru-cache": { @@ -431,52 +367,52 @@ } }, "node_modules/@babel/helper-module-imports": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", - "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz", + "integrity": "sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==", "dev": true, "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.20.11", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz", - "integrity": "sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg==", - "dev": true, - "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.20.2", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.10", - "@babel/types": "^7.20.7" + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" }, "engines": { "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", - "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", + "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-simple-access": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", - "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "dependencies": { - "@babel/types": "^7.20.2" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -495,9 +431,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz", + "integrity": "sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==", "dev": true, "engines": { "node": ">=6.9.0" @@ -513,108 +449,47 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", - "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helpers": { - "version": "7.20.13", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.13.tgz", - "integrity": "sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.1.tgz", + "integrity": "sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg==", "dev": true, "dependencies": { - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.13", - "@babel/types": "^7.20.7" + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.1", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", + "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/@babel/highlight/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "dependencies": { - "color-name": "1.1.3" - } - }, - "node_modules/@babel/highlight/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@babel/highlight/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/@babel/highlight/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz", + "integrity": "sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -684,12 +559,12 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz", - "integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.1.tgz", + "integrity": "sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -786,12 +661,12 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", - "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.1.tgz", + "integrity": "sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.19.0" + "@babel/helper-plugin-utils": "^7.24.0" }, "engines": { "node": ">=6.9.0" @@ -801,47 +676,56 @@ } }, "node_modules/@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", + "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz", + "integrity": "sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", + "@babel/code-frame": "^7.24.1", + "@babel/generator": "^7.24.1", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", - "debug": "^4.1.0", + "@babel/parser": "^7.24.1", + "@babel/types": "^7.24.0", + "debug": "^4.3.1", "globals": "^11.1.0" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/traverse/node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", "dev": true, "dependencies": { - "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, @@ -859,2173 +743,2212 @@ "resolved": "../cobol-dialect-api", "link": true }, - "node_modules/@esbuild/darwin-x64": { + "node_modules/@esbuild/android-arm": { "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz", - "integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.17.tgz", + "integrity": "sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==", "cpu": [ - "x64" + "arm" ], "dev": true, "optional": true, "os": [ - "darwin" + "android" ], "engines": { "node": ">=12" } }, - "node_modules/@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "node_modules/@esbuild/android-arm64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz", + "integrity": "sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==", + "cpu": [ + "arm64" + ], "dev": true, - "peer": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.4.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "node_modules/@esbuild/android-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz", + "integrity": "sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==", + "cpu": [ + "x64" + ], "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" } }, - "node_modules/@eslint/eslintrc/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "node_modules/@esbuild/darwin-arm64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz", + "integrity": "sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==", + "cpu": [ + "arm64" + ], "dev": true, - "peer": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@eslint/eslintrc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/@esbuild/darwin-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz", + "integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==", + "cpu": [ + "x64" + ], "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": "*" + "node": ">=12" } }, - "node_modules/@eslint/eslintrc/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz", + "integrity": "sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==", + "cpu": [ + "arm64" + ], "dev": true, - "peer": true, + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" } }, - "node_modules/@eslint/eslintrc/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/@esbuild/freebsd-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz", + "integrity": "sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==", + "cpu": [ + "x64" + ], "dev": true, - "peer": true, + "optional": true, + "os": [ + "freebsd" + ], "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=12" } }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "node_modules/@esbuild/linux-arm": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz", + "integrity": "sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==", + "cpu": [ + "arm" + ], "dev": true, - "peer": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=10.10.0" + "node": ">=12" } }, - "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/@esbuild/linux-arm64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz", + "integrity": "sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==", + "cpu": [ + "arm64" + ], "dev": true, - "peer": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" } }, - "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/@esbuild/linux-ia32": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz", + "integrity": "sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==", + "cpu": [ + "ia32" + ], "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": "*" + "node": ">=12" } }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "node_modules/@esbuild/linux-loong64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz", + "integrity": "sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==", + "cpu": [ + "loong64" + ], "dev": true, - "peer": true, + "optional": true, + "os": [ + "linux" + ], "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" + "node": ">=12" } }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "node_modules/@esbuild/linux-mips64el": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz", + "integrity": "sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==", + "cpu": [ + "mips64el" + ], "dev": true, - "peer": true - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, + "optional": true, + "os": [ + "linux" + ], "engines": { "node": ">=12" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "node_modules/@esbuild/linux-ppc64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz", + "integrity": "sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "node_modules/@esbuild/linux-riscv64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz", + "integrity": "sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz", + "integrity": "sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dependencies": { - "ansi-regex": "^6.0.1" - }, + "node_modules/@esbuild/linux-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz", + "integrity": "sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz", + "integrity": "sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@istanbuljs/load-nyc-config": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "node_modules/@esbuild/openbsd-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz", + "integrity": "sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "camelcase": "^5.3.1", - "find-up": "^4.1.0", - "get-package-type": "^0.1.0", - "js-yaml": "^3.13.1", - "resolve-from": "^5.0.0" - }, + "optional": true, + "os": [ + "openbsd" + ], "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/@istanbuljs/schema": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", - "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", + "node_modules/@esbuild/sunos-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz", + "integrity": "sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==", + "cpu": [ + "x64" + ], "dev": true, + "optional": true, + "os": [ + "sunos" + ], "engines": { - "node": ">=8" + "node": ">=12" } }, - "node_modules/@jest/console": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.4.2.tgz", - "integrity": "sha512-0I/rEJwMpV9iwi9cDEnT71a5nNGK9lj8Z4+1pRAU2x/thVXCDnaTGrvxyK+cAqZTFVFCiR+hfVrP4l2m+dCmQg==", + "node_modules/@esbuild/win32-arm64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz", + "integrity": "sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==", + "cpu": [ + "arm64" + ], "dev": true, - "dependencies": { - "@jest/types": "^29.4.2", - "@types/node": "*", - "chalk": "^4.0.0", - "jest-message-util": "^29.4.2", - "jest-util": "^29.4.2", - "slash": "^3.0.0" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12" } }, - "node_modules/@jest/core": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.4.2.tgz", - "integrity": "sha512-KGuoQah0P3vGNlaS/l9/wQENZGNKGoWb+OPxh3gz+YzG7/XExvYu34MzikRndQCdM2S0tzExN4+FL37i6gZmCQ==", + "node_modules/@esbuild/win32-ia32": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz", + "integrity": "sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==", + "cpu": [ + "ia32" + ], "dev": true, - "dependencies": { - "@jest/console": "^29.4.2", - "@jest/reporters": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/transform": "^29.4.2", - "@jest/types": "^29.4.2", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.4.2", - "jest-config": "^29.4.2", - "jest-haste-map": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-regex-util": "^29.4.2", - "jest-resolve": "^29.4.2", - "jest-resolve-dependencies": "^29.4.2", - "jest-runner": "^29.4.2", - "jest-runtime": "^29.4.2", - "jest-snapshot": "^29.4.2", - "jest-util": "^29.4.2", - "jest-validate": "^29.4.2", - "jest-watcher": "^29.4.2", - "micromatch": "^4.0.4", - "pretty-format": "^29.4.2", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "node": ">=12" } }, - "node_modules/@jest/environment": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.4.2.tgz", - "integrity": "sha512-JKs3VUtse0vQfCaFGJRX1bir9yBdtasxziSyu+pIiEllAQOe4oQhdCYIf3+Lx+nGglFktSKToBnRJfD5QKp+NQ==", + "node_modules/@esbuild/win32-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz", + "integrity": "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==", + "cpu": [ + "x64" + ], "dev": true, - "dependencies": { - "@jest/fake-timers": "^29.4.2", - "@jest/types": "^29.4.2", - "@types/node": "*", - "jest-mock": "^29.4.2" - }, + "optional": true, + "os": [ + "win32" + ], "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=12" } }, - "node_modules/@jest/expect": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.4.2.tgz", - "integrity": "sha512-NUAeZVApzyaeLjfWIV/64zXjA2SS+NuUPHpAlO7IwVMGd5Vf9szTl9KEDlxY3B4liwLO31os88tYNHl6cpjtKQ==", + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", "dev": true, + "peer": true, "dependencies": { - "expect": "^29.4.2", - "jest-snapshot": "^29.4.2" + "eslint-visitor-keys": "^3.3.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, - "node_modules/@jest/expect-utils": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.4.2.tgz", - "integrity": "sha512-Dd3ilDJpBnqa0GiPN7QrudVs0cczMMHtehSo2CSTjm3zdHx0RcpmhFNVEltuEFeqfLIyWKFI224FsMSQ/nsJQA==", + "node_modules/@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", "dev": true, - "dependencies": { - "jest-get-type": "^29.4.2" - }, + "peer": true, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/@jest/fake-timers": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.4.2.tgz", - "integrity": "sha512-Ny1u0Wg6kCsHFWq7A/rW/tMhIedq2siiyHyLpHCmIhP7WmcAmd2cx95P+0xtTZlj5ZbJxIRQi4OPydZZUoiSQQ==", + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, + "peer": true, "dependencies": { - "@jest/types": "^29.4.2", - "@sinonjs/fake-timers": "^10.0.2", - "@types/node": "*", - "jest-message-util": "^29.4.2", - "jest-mock": "^29.4.2", - "jest-util": "^29.4.2" + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/@jest/globals": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.4.2.tgz", - "integrity": "sha512-zCk70YGPzKnz/I9BNFDPlK+EuJLk21ur/NozVh6JVM86/YYZtZHqxFFQ62O9MWq7uf3vIZnvNA0BzzrtxD9iyg==", + "node_modules/@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, - "dependencies": { - "@jest/environment": "^29.4.2", - "@jest/expect": "^29.4.2", - "@jest/types": "^29.4.2", - "jest-mock": "^29.4.2" - }, + "peer": true, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@jest/reporters": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.4.2.tgz", - "integrity": "sha512-10yw6YQe75zCgYcXgEND9kw3UZZH5tJeLzWv4vTk/2mrS1aY50A37F+XT2hPO5OqQFFnUWizXD8k1BMiATNfUw==", + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, + "peer": true, "dependencies": { - "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/transform": "^29.4.2", - "@jest/types": "^29.4.2", - "@jridgewell/trace-mapping": "^0.3.15", - "@types/node": "*", - "chalk": "^4.0.0", - "collect-v8-coverage": "^1.0.0", - "exit": "^0.1.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^5.1.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.0", - "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.4.2", - "jest-util": "^29.4.2", - "jest-worker": "^29.4.2", - "slash": "^3.0.0", - "string-length": "^4.0.1", - "strip-ansi": "^6.0.0", - "v8-to-istanbul": "^9.0.1" + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", + "minimatch": "^3.0.5" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "node": ">=10.10.0" } }, - "node_modules/@jest/reporters/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "peer": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/@jest/reporters/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true, + "peer": true + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" }, "engines": { - "node": "*" + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/@jest/reporters/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dependencies": { - "brace-expansion": "^1.1.7" + "ansi-regex": "^6.0.1" }, "engines": { - "node": "*" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/@jest/schemas": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.4.2.tgz", - "integrity": "sha512-ZrGzGfh31NtdVH8tn0mgJw4khQuNHiKqdzJAFbCaERbyCP9tHlxWuL/mnMu8P7e/+k4puWjI1NOzi/sFsjce/g==", + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "dependencies": { - "@sinclair/typebox": "^0.25.16" + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/@jest/source-map": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.4.2.tgz", - "integrity": "sha512-tIoqV5ZNgYI9XCKXMqbYe5JbumcvyTgNN+V5QW4My033lanijvCD0D4PI9tBw4pRTqWOc00/7X3KVvUh+qnF4Q==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.15", - "callsites": "^3.0.0", - "graceful-fs": "^4.2.9" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "sprintf-js": "~1.0.2" } }, - "node_modules/@jest/test-result": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.4.2.tgz", - "integrity": "sha512-HZsC3shhiHVvMtP+i55MGR5bPcc3obCFbA5bzIOb8pCjwBZf11cZliJncCgaVUbC5yoQNuGqCkC0Q3t6EItxZA==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { - "@jest/console": "^29.4.2", - "@jest/types": "^29.4.2", - "@types/istanbul-lib-coverage": "^2.0.0", - "collect-v8-coverage": "^1.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/@jest/test-sequencer": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.4.2.tgz", - "integrity": "sha512-9Z2cVsD6CcObIVrWigHp2McRJhvCxL27xHtrZFgNC1RwnoSpDx6fZo8QYjJmziFlW9/hr78/3sxF54S8B6v8rg==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "dependencies": { - "@jest/test-result": "^29.4.2", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.4.2", - "slash": "^3.0.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@jest/transform": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.4.2.tgz", - "integrity": "sha512-kf1v5iTJHn7p9RbOsBuc/lcwyPtJaZJt5885C98omWz79NIeD3PfoiiaPSu7JyCyFzNOIzKhmMhQLUhlTL9BvQ==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "dependencies": { - "@babel/core": "^7.11.6", - "@jest/types": "^29.4.2", - "@jridgewell/trace-mapping": "^0.3.15", - "babel-plugin-istanbul": "^6.1.1", - "chalk": "^4.0.0", - "convert-source-map": "^2.0.0", - "fast-json-stable-stringify": "^2.1.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.4.2", - "jest-regex-util": "^29.4.2", - "jest-util": "^29.4.2", - "micromatch": "^4.0.4", - "pirates": "^4.0.4", - "slash": "^3.0.0", - "write-file-atomic": "^4.0.2" + "p-locate": "^4.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/@jest/types": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.4.2.tgz", - "integrity": "sha512-CKlngyGP0fwlgC1BRUtPZSiWLBhyS9dKwKmyGxk8Z6M82LBEGB2aLQSg+U1MyLsU+M7UjnlLllBM2BLWKVm/Uw==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "dependencies": { - "@jest/schemas": "^29.4.2", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" + "p-try": "^2.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" + "p-limit": "^2.2.0" }, "engines": { - "node": ">=6.0.0" + "node": ">=8" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { - "node": ">=6.0.0" + "node": ">=8" } }, - "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", + "integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==", "dev": true, "engines": { - "node": ">=6.0.0" + "node": ">=8" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" - } - }, - "node_modules/@microsoft/1ds-core-js": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-3.2.12.tgz", - "integrity": "sha512-cHpxZZ+pbtOyqFMFB/c1COpaOE3VPFU6phYVHVvOA9DvoeMZfI/Xrxaj7B/vfq4MmkiE7nOAPhv5ZRn+i6OogA==", - "dependencies": { - "@microsoft/applicationinsights-core-js": "2.8.14", - "@microsoft/applicationinsights-shims": "^2.0.2", - "@microsoft/dynamicproto-js": "^1.1.7" + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@microsoft/1ds-post-js": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-3.2.12.tgz", - "integrity": "sha512-vhIVYg4FzBfwtM8tBqDUq3xU+cFu6SQ7biuJHtQpd5PVjDgvAovVOMRF1khsZE/k2rttRRBpmBgNEqG3Ptoysw==", + "node_modules/@jest/console/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { - "@microsoft/1ds-core-js": "3.2.12", - "@microsoft/applicationinsights-shims": "^2.0.2", - "@microsoft/dynamicproto-js": "^1.1.7" + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@microsoft/applicationinsights-channel-js": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.2.tgz", - "integrity": "sha512-jDBNKbCHsJgmpv0CKNhJ/uN9ZphvfGdb93Svk+R4LjO8L3apNNMbDDPxBvXXi0uigRmA1TBcmyBG4IRKjabGhw==", + "node_modules/@jest/console/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { - "@microsoft/applicationinsights-common": "3.0.2", - "@microsoft/applicationinsights-core-js": "3.0.2", - "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-async": ">= 0.2.4 < 2.x", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, - "peerDependencies": { - "tslib": "*" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@microsoft/applicationinsights-channel-js/node_modules/@microsoft/applicationinsights-core-js": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.2.tgz", - "integrity": "sha512-WQhVhzlRlLDrQzn3OShCW/pL3BW5WC57t0oywSknX3q7lMzI3jDg7Ihh0iuIcNTzGCTbDkuqr4d6IjEDWIMtJQ==", + "node_modules/@jest/console/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { - "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-async": ">= 0.2.4 < 2.x", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" + "color-name": "~1.1.4" }, - "peerDependencies": { - "tslib": "*" + "engines": { + "node": ">=7.0.0" } }, - "node_modules/@microsoft/applicationinsights-channel-js/node_modules/@microsoft/applicationinsights-shims": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", - "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", - "dependencies": { - "@nevware21/ts-utils": ">= 0.9.4 < 2.x" - } + "node_modules/@jest/console/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, - "node_modules/@microsoft/applicationinsights-channel-js/node_modules/@microsoft/dynamicproto-js": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", - "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", - "dependencies": { - "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + "node_modules/@jest/console/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" } }, - "node_modules/@microsoft/applicationinsights-common": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.2.tgz", - "integrity": "sha512-y+WXWop+OVim954Cu1uyYMnNx6PWO8okHpZIQi/1YSqtqaYdtJVPv4P0AVzwJdohxzVfgzKvqj9nec/VWqE2Zg==", + "node_modules/@jest/console/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { - "@microsoft/applicationinsights-core-js": "3.0.2", - "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" + "has-flag": "^4.0.0" }, - "peerDependencies": { - "tslib": "*" + "engines": { + "node": ">=8" } }, - "node_modules/@microsoft/applicationinsights-common/node_modules/@microsoft/applicationinsights-core-js": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.2.tgz", - "integrity": "sha512-WQhVhzlRlLDrQzn3OShCW/pL3BW5WC57t0oywSknX3q7lMzI3jDg7Ihh0iuIcNTzGCTbDkuqr4d6IjEDWIMtJQ==", + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, "dependencies": { - "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-async": ">= 0.2.4 < 2.x", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { - "tslib": "*" + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/@microsoft/applicationinsights-common/node_modules/@microsoft/applicationinsights-shims": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", - "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "node_modules/@jest/core/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { - "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@microsoft/applicationinsights-common/node_modules/@microsoft/dynamicproto-js": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", - "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "node_modules/@jest/core/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { - "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@microsoft/applicationinsights-core-js": { - "version": "2.8.14", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.14.tgz", - "integrity": "sha512-XacWUHdjSHMUwdngMZBp0oiCBifD56CQK2Egu2PiBiF4xu2AO2yNCtWSXsQX2g5OkEhVwaEjfa/aH3WbpYxB1g==", + "node_modules/@jest/core/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { - "@microsoft/applicationinsights-shims": "2.0.2", - "@microsoft/dynamicproto-js": "^1.1.9" + "color-name": "~1.1.4" }, - "peerDependencies": { - "tslib": "*" + "engines": { + "node": ">=7.0.0" } }, - "node_modules/@microsoft/applicationinsights-shims": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.2.tgz", - "integrity": "sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg==" + "node_modules/@jest/core/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, - "node_modules/@microsoft/applicationinsights-web-basic": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.2.tgz", - "integrity": "sha512-6Lq0DE/pZp9RvSV+weGbcxN1NDmfczj6gNPhvZKV2YSQ3RK0LZE3+wjTWLXfuStq8a+nCBdsRpWk8tOKgsoxcg==", - "dependencies": { - "@microsoft/applicationinsights-channel-js": "3.0.2", - "@microsoft/applicationinsights-common": "3.0.2", - "@microsoft/applicationinsights-core-js": "3.0.2", - "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-async": ">= 0.2.4 < 2.x", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" - }, - "peerDependencies": { - "tslib": "*" + "node_modules/@jest/core/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" } }, - "node_modules/@microsoft/applicationinsights-web-basic/node_modules/@microsoft/applicationinsights-core-js": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.2.tgz", - "integrity": "sha512-WQhVhzlRlLDrQzn3OShCW/pL3BW5WC57t0oywSknX3q7lMzI3jDg7Ihh0iuIcNTzGCTbDkuqr4d6IjEDWIMtJQ==", + "node_modules/@jest/core/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { - "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-async": ">= 0.2.4 < 2.x", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" + "has-flag": "^4.0.0" }, - "peerDependencies": { - "tslib": "*" - } - }, - "node_modules/@microsoft/applicationinsights-web-basic/node_modules/@microsoft/applicationinsights-shims": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", - "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", - "dependencies": { - "@nevware21/ts-utils": ">= 0.9.4 < 2.x" - } - }, - "node_modules/@microsoft/applicationinsights-web-basic/node_modules/@microsoft/dynamicproto-js": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", - "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", - "dependencies": { - "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + "engines": { + "node": ">=8" } }, - "node_modules/@microsoft/applicationinsights-web-snippet": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-snippet/-/applicationinsights-web-snippet-1.0.1.tgz", - "integrity": "sha512-2IHAOaLauc8qaAitvWS+U931T+ze+7MNWrDHY47IENP5y2UA0vqJDu67kWZDdpCN1fFC77sfgfB+HV7SrKshnQ==" - }, - "node_modules/@microsoft/dynamicproto-js": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.9.tgz", - "integrity": "sha512-n1VPsljTSkthsAFYdiWfC+DKzK2WwcRp83Y1YAqdX552BstvsDjft9YXppjUzp11BPsapDoO1LDgrDB0XVsfNQ==" - }, - "node_modules/@nevware21/ts-async": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.2.6.tgz", - "integrity": "sha512-NCUqEZSbsy7LVtKlUScd/eTst6djkWauLlzoIPVKCOxalEBdO8lrgNRIm4Xy68JNudNN5faqa2WA12X8m0BVhA==", + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, "dependencies": { - "@nevware21/ts-utils": ">= 0.9.7 < 2.x" + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" }, - "peerDependencies": { - "typescript": ">=1" - } - }, - "node_modules/@nevware21/ts-utils": { - "version": "0.9.8", - "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.9.8.tgz", - "integrity": "sha512-kZ8s8hcn9jPVX/M7kSsBYrOGlHjqLahmxrG7QeKTk5paeVwfgKdvVCjj5Acb4UGb/ukU1G34U1Z3eb7bbVanyA==", - "peerDependencies": { - "typescript": ">=1" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, - "peer": true, "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" }, "engines": { - "node": ">= 8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, - "peer": true, + "dependencies": { + "jest-get-type": "^29.6.3" + }, "engines": { - "node": ">= 8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, - "peer": true, "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { - "node": ">= 8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@opentelemetry/api": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.4.1.tgz", - "integrity": "sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==", + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, "engines": { - "node": ">=8.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@opentelemetry/core": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.1.tgz", - "integrity": "sha512-V6GoRTY6aANMDDOQ9CiHOiLWEK2b2b3OGZK+zk05Li5merb9jadFeV5ooTSGtjxfxVNMpQUaQERO1cdbdbeEGg==", + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, "dependencies": { - "@opentelemetry/semantic-conventions": "1.15.1" + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" }, "engines": { - "node": ">=14" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/@opentelemetry/instrumentation": { - "version": "0.41.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.41.2.tgz", - "integrity": "sha512-rxU72E0pKNH6ae2w5+xgVYZLzc5mlxAbGzF4shxMVK8YC2QQsfN38B2GPbj0jvrKWWNUElfclQ+YTykkNg/grw==", + "node_modules/@jest/reporters/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { - "@types/shimmer": "^1.0.2", - "import-in-the-middle": "1.4.2", - "require-in-the-middle": "^7.1.1", - "semver": "^7.5.1", - "shimmer": "^1.2.1" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=14" + "node": ">=8" }, - "peerDependencies": { - "@opentelemetry/api": "^1.3.0" + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@opentelemetry/instrumentation/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "node_modules/@jest/reporters/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@opentelemetry/resources": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.1.tgz", - "integrity": "sha512-15JcpyKZHhFYQ1uiC08vR02sRY/2seSnqSJ0tIUhcdYDzOhd0FrqPYpLj3WkLhVdQP6vgJ+pelAmSaOrCxCpKA==", + "node_modules/@jest/reporters/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { - "@opentelemetry/core": "1.15.1", - "@opentelemetry/semantic-conventions": "1.15.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">=14" - }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "node": ">=7.0.0" } }, - "node_modules/@opentelemetry/sdk-trace-base": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.1.tgz", - "integrity": "sha512-5hccBe2yXzzXyExJNkTsIzDe1AM7HK0al+y/D2yEpslJqS1HUzsUSuCMY7Z4+Sfz5Gf0kTa6KYEt1QUQppnoBA==", + "node_modules/@jest/reporters/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@jest/reporters/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "dependencies": { - "@opentelemetry/core": "1.15.1", - "@opentelemetry/resources": "1.15.1", - "@opentelemetry/semantic-conventions": "1.15.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=14" + "node": "*" }, - "peerDependencies": { - "@opentelemetry/api": ">=1.0.0 <1.5.0" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@opentelemetry/semantic-conventions": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.1.tgz", - "integrity": "sha512-n8Kur1/CZlYG32YCEj30CoUqA8R7UyDVZzoEU6SDP+13+kXDT2kFVu6MpcnEUTyGP3i058ID6Qjp5h6IJxdPPQ==", + "node_modules/@jest/reporters/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { - "node": ">=14" + "node": ">=8" } }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "optional": true, + "node_modules/@jest/reporters/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { - "node": ">=14" + "node": ">=8" } }, - "node_modules/@sinclair/typebox": { - "version": "0.25.21", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.21.tgz", - "integrity": "sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g==", - "dev": true - }, - "node_modules/@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "dependencies": { - "type-detect": "4.0.8" + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@sinonjs/fake-timers": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", - "integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, "dependencies": { - "@sinonjs/commons": "^2.0.0" - } - }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, "engines": { - "node": ">= 10" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@types/babel__core": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", - "integrity": "sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==", + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "dependencies": { - "@babel/parser": "^7.20.7", - "@babel/types": "^7.20.7", - "@types/babel__generator": "*", - "@types/babel__template": "*", - "@types/babel__traverse": "*" + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "dependencies": { - "@babel/types": "^7.0.0" + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "dependencies": { - "@babel/parser": "^7.1.0", - "@babel/types": "^7.0.0" + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@types/babel__traverse": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.3.tgz", - "integrity": "sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==", + "node_modules/@jest/transform/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@babel/types": "^7.3.0" + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@types/fs-extra": { - "version": "9.0.13", - "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", - "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", + "node_modules/@jest/transform/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "@types/node": "*" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@types/graceful-fs": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", - "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "node_modules/@jest/transform/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "@types/node": "*" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "node_modules/@jest/transform/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "node_modules/@jest/transform/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "@types/istanbul-lib-coverage": "*" + "engines": { + "node": ">=8" } }, - "node_modules/@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "node_modules/@jest/transform/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "@types/istanbul-lib-report": "*" + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@types/jest": { - "version": "29.4.0", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.4.0.tgz", - "integrity": "sha512-VaywcGQ9tPorCX/Jkkni7RWGFfI11whqzs8dvxF41P17Z+z872thvEvlIbznjPJ02kl1HMX3LmLOonsj2n7HeQ==", + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "dependencies": { - "expect": "^29.0.0", - "pretty-format": "^29.0.0" + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@types/minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", - "dev": true - }, - "node_modules/@types/mocha": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", - "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", - "dev": true - }, - "node_modules/@types/node": { - "version": "14.18.36", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz", - "integrity": "sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ==", - "dev": true - }, - "node_modules/@types/prettier": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", - "integrity": "sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==", - "dev": true - }, - "node_modules/@types/shimmer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.0.2.tgz", - "integrity": "sha512-dKkr1bTxbEsFlh2ARpKzcaAmsYixqt9UyCdoEZk8rHyE4iQYcDCyvSjDSf7JUWJHlJiTtbIoQjxKh6ViywqDAg==" - }, - "node_modules/@types/stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", - "dev": true - }, - "node_modules/@types/vscode": { - "version": "1.75.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.75.0.tgz", - "integrity": "sha512-SAr0PoOhJS6FUq5LjNr8C/StBKALZwDVm3+U4pjF/3iYkt3GioJOPV/oB1Sf1l7lROe4TgrMyL5N1yaEgTWycw==", - "dev": true - }, - "node_modules/@types/yargs": { - "version": "17.0.22", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.22.tgz", - "integrity": "sha512-pet5WJ9U8yPVRhkwuEIp5ktAeAqRZOq4UdAyWLWzxbtpyXnzbtLdKiXAjJzi/KLmPGS9wk86lUFWZFN6sISo4g==", + "node_modules/@jest/types/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@types/yargs-parser": "*" + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/@types/yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", - "dev": true - }, - "node_modules/@vscode/extension-telemetry": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.8.2.tgz", - "integrity": "sha512-bBvlyRpjJEmNXBaPkfJSpfD88kEWzbTpdavpo+NwW5uZguWHllbQebavjt6jH+Pm1k7hWnaJoS5PIULk7uuSgw==", + "node_modules/@jest/types/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { - "@microsoft/1ds-core-js": "^3.2.10", - "@microsoft/1ds-post-js": "^3.2.10", - "@microsoft/applicationinsights-web-basic": "^3.0.0", - "applicationinsights": "^2.7.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "vscode": "^1.75.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/@vscode/test-electron": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.8.tgz", - "integrity": "sha512-b4aZZsBKtMGdDljAsOPObnAi7+VWIaYl3ylCz1jTs+oV6BZ4TNHcVNC3xUn0azPeszBmwSBDQYfFESIaUQnrOg==", + "node_modules/@jest/types/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "jszip": "^3.10.1", - "semver": "^7.5.2" + "color-name": "~1.1.4" }, "engines": { - "node": ">=16" + "node": ">=7.0.0" } }, - "node_modules/@vscode/test-electron/node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "node_modules/@jest/types/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@jest/types/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">= 6" + "node": ">=8" } }, - "node_modules/@vscode/test-electron/node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "node_modules/@jest/types/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" + "has-flag": "^4.0.0" }, "engines": { - "node": ">= 6" + "node": ">=8" } }, - "node_modules/@vscode/test-electron/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { - "node": ">=10" + "node": ">=6.0.0" } }, - "node_modules/@vscode/vsce": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.19.0.tgz", - "integrity": "sha512-dAlILxC5ggOutcvJY24jxz913wimGiUrHaPkk16Gm9/PGFbz1YezWtrXsTKUtJws4fIlpX2UIlVlVESWq8lkfQ==", + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, - "dependencies": { - "azure-devops-node-api": "^11.0.1", - "chalk": "^2.4.2", - "cheerio": "^1.0.0-rc.9", - "commander": "^6.1.0", - "glob": "^7.0.6", - "hosted-git-info": "^4.0.2", - "jsonc-parser": "^3.2.0", - "leven": "^3.1.0", - "markdown-it": "^12.3.2", - "mime": "^1.3.4", - "minimatch": "^3.0.3", - "parse-semver": "^1.1.1", - "read": "^1.0.7", - "semver": "^5.1.0", - "tmp": "^0.2.1", - "typed-rest-client": "^1.8.4", - "url-join": "^4.0.1", - "xml2js": "^0.5.0", - "yauzl": "^2.3.1", - "yazl": "^2.2.2" - }, - "bin": { - "vsce": "vsce" - }, "engines": { - "node": ">= 14" - }, - "optionalDependencies": { - "keytar": "^7.7.0" + "node": ">=6.0.0" } }, - "node_modules/@vscode/vsce/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "node_modules/@jridgewell/set-array": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, "engines": { - "node": ">=4" + "node": ">=6.0.0" } }, - "node_modules/@vscode/vsce/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "dev": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@vscode/vsce/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, + "node_modules/@microsoft/1ds-core-js": { + "version": "3.2.17", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-3.2.17.tgz", + "integrity": "sha512-S9EgWfY9NP0oiB3sdsTL41hJ71rbQzz9ziijQjHoklFADv+vKNe/TbOAgupBKAW04FaL0wmfE7HGF7mao84hUw==", "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - }, - "engines": { - "node": ">=4" + "@microsoft/applicationinsights-core-js": "2.8.18", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.11" } }, - "node_modules/@vscode/vsce/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, + "node_modules/@microsoft/1ds-post-js": { + "version": "3.2.17", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-3.2.17.tgz", + "integrity": "sha512-YD/pGW/WqijRFEZ/1sSdlkFVM2ZWLGQIMDxRD6/o58c3cC5jzG5PlR1PLp314jFjpUrBc4cmico+WAOP548z4w==", "dependencies": { - "color-name": "1.1.3" + "@microsoft/1ds-core-js": "3.2.17", + "@microsoft/applicationinsights-shims": "^2.0.2", + "@microsoft/dynamicproto-js": "^1.1.11" } }, - "node_modules/@vscode/vsce/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "node_modules/@vscode/vsce/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.1.2.tgz", + "integrity": "sha512-QyPxpOOhtohFzcl4tzfWp4seN6JaToF66DZ1qjsYkUmEyHAackWSsv9m7qvuaAcCB9WrUzW9y0mRXgGKsEJcAg==", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "@microsoft/applicationinsights-common": "3.1.2", + "@microsoft/applicationinsights-core-js": "3.1.2", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" }, - "engines": { - "node": "*" + "peerDependencies": { + "tslib": "*" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js/node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.1.2.tgz", + "integrity": "sha512-xsJAm52tV355S/MogTunV/m1wg6P6tFg9Yhi4AC2OE9p2aa0k/FYHzWmrCrsEAVimCd8n/iTXmMRSrQk5QpxiA==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "peerDependencies": { + "tslib": "*" } }, - "node_modules/@vscode/vsce/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" + "node_modules/@microsoft/applicationinsights-channel-js/node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js/node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.3.tgz", + "integrity": "sha512-JTWTU80rMy3mdxOjjpaiDQsTLZ6YSGGqsjURsY6AUQtIj0udlF/jYmhdLZu8693ZIC0T1IwYnFa0+QeiMnziBA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.4 < 2.x" } }, - "node_modules/@vscode/vsce/node_modules/minimatch": { + "node_modules/@microsoft/applicationinsights-common": { "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.1.2.tgz", + "integrity": "sha512-ivu3s73xt6Owakepnx2mbrMCry1mVHrA/2TL4nKCRLad6O3IBK3MkruMoeb3hoWpECBhErFRVj+/b0Kh7dl/Lw==", "dependencies": { - "brace-expansion": "^1.1.7" + "@microsoft/applicationinsights-core-js": "3.1.2", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" }, - "engines": { - "node": "*" + "peerDependencies": { + "tslib": "*" } }, - "node_modules/@vscode/vsce/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, + "node_modules/@microsoft/applicationinsights-common/node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.1.2.tgz", + "integrity": "sha512-xsJAm52tV355S/MogTunV/m1wg6P6tFg9Yhi4AC2OE9p2aa0k/FYHzWmrCrsEAVimCd8n/iTXmMRSrQk5QpxiA==", "dependencies": { - "has-flag": "^3.0.0" + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" }, - "engines": { - "node": ">=4" + "peerDependencies": { + "tslib": "*" } }, - "node_modules/@yarnpkg/lockfile": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", - "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", - "dev": true + "node_modules/@microsoft/applicationinsights-common/node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } }, - "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" + "node_modules/@microsoft/applicationinsights-common/node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.3.tgz", + "integrity": "sha512-JTWTU80rMy3mdxOjjpaiDQsTLZ6YSGGqsjURsY6AUQtIj0udlF/jYmhdLZu8693ZIC0T1IwYnFa0+QeiMnziBA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.4 < 2.x" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "2.8.18", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.18.tgz", + "integrity": "sha512-yPHRZFLpnEO0uSgFPM1BLMRRwjoten9YBbn4pJRbCT4PigLnj748knmWsMwXIdcehtkRTYz78kPYa/LWP7nvmA==", + "dependencies": { + "@microsoft/applicationinsights-shims": "2.0.2", + "@microsoft/dynamicproto-js": "^1.1.11" + }, "peerDependencies": { - "acorn": "^8" + "tslib": "*" } }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peer": true, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-2.0.2.tgz", + "integrity": "sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg==" + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.1.2.tgz", + "integrity": "sha512-NUnAk/ML9ClnmiQQRo3Fq2obzJVZAfGTgkQOwobZMvNhBVK5IPuv/ROEEAVbl02Go9AjV5uCZ+QoRhTfWrIumQ==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.1.2", + "@microsoft/applicationinsights-common": "3.1.2", + "@microsoft/applicationinsights-core-js": "3.1.2", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" + }, "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + "tslib": "*" } }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "node_modules/@microsoft/applicationinsights-web-basic/node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.1.2.tgz", + "integrity": "sha512-xsJAm52tV355S/MogTunV/m1wg6P6tFg9Yhi4AC2OE9p2aa0k/FYHzWmrCrsEAVimCd8n/iTXmMRSrQk5QpxiA==", "dependencies": { - "debug": "4" + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" }, - "engines": { - "node": ">= 6.0.0" + "peerDependencies": { + "tslib": "*" } }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, + "node_modules/@microsoft/applicationinsights-web-basic/node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" } }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "node_modules/@microsoft/applicationinsights-web-basic/node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.3.tgz", + "integrity": "sha512-JTWTU80rMy3mdxOjjpaiDQsTLZ6YSGGqsjURsY6AUQtIj0udlF/jYmhdLZu8693ZIC0T1IwYnFa0+QeiMnziBA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-snippet": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-snippet/-/applicationinsights-web-snippet-1.0.1.tgz", + "integrity": "sha512-2IHAOaLauc8qaAitvWS+U931T+ze+7MNWrDHY47IENP5y2UA0vqJDu67kWZDdpCN1fFC77sfgfB+HV7SrKshnQ==" + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.11.tgz", + "integrity": "sha512-gNw9z9LbqLV+WadZ6/MMrWwO3e0LuoUH1wve/1iPsBNbgqeVCiB0EZFNNj2lysxS2gkqoF9hmyVaG3MoM1BkxA==" + }, + "node_modules/@nevware21/ts-async": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.4.0.tgz", + "integrity": "sha512-dbV826TTehQIBIJjh8GDSbwn1Z6+cnkyNbRlpcpdBPH8mROD2zabIUKqWcw9WRdTjjUIm21K+OR4DXWlAyOVTQ==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.11.0.tgz", + "integrity": "sha512-3yrohCSKYBLKrW41fYkZorN2rf9GYr/4Cb4Xu9fWCyXgVDyt1uLgMaCinhx0kEkEUfME3Smqs+2itJRhXgCo8Q==" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "peer": true, "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "engines": { + "node": ">= 8" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, + "peer": true, "engines": { - "node": ">=6" + "node": ">= 8" } }, - "node_modules/ansi-escapes": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", - "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, + "peer": true, "dependencies": { - "type-fest": "^0.21.3" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 8" } }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/@opentelemetry/api": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.8.0.tgz", + "integrity": "sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==", "engines": { - "node": ">=8" + "node": ">=8.0.0" } }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@opentelemetry/core": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.22.0.tgz", + "integrity": "sha512-0VoAlT6x+Xzik1v9goJ3pZ2ppi6+xd3aUfg4brfrLkDBHRIVjMP0eBHrKrhB+NKcDyMAg8fAbGL3Npg/F6AwWA==", "dependencies": { - "color-convert": "^2.0.1" + "@opentelemetry/semantic-conventions": "1.22.0" }, "engines": { - "node": ">=8" + "node": ">=14" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" } }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, + "node_modules/@opentelemetry/instrumentation": { + "version": "0.41.2", + "resolved": "https://registry.npmjs.org/@opentelemetry/instrumentation/-/instrumentation-0.41.2.tgz", + "integrity": "sha512-rxU72E0pKNH6ae2w5+xgVYZLzc5mlxAbGzF4shxMVK8YC2QQsfN38B2GPbj0jvrKWWNUElfclQ+YTykkNg/grw==", "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" + "@types/shimmer": "^1.0.2", + "import-in-the-middle": "1.4.2", + "require-in-the-middle": "^7.1.1", + "semver": "^7.5.1", + "shimmer": "^1.2.1" }, "engines": { - "node": ">= 8" + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.3.0" } }, - "node_modules/append-transform": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", - "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", - "dev": true, + "node_modules/@opentelemetry/resources": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.22.0.tgz", + "integrity": "sha512-+vNeIFPH2hfcNL0AJk/ykJXoUCtR1YaDUZM+p3wZNU4Hq98gzq+7b43xbkXjadD9VhWIUQqEwXyY64q6msPj6A==", "dependencies": { - "default-require-extensions": "^3.0.0" + "@opentelemetry/core": "1.22.0", + "@opentelemetry/semantic-conventions": "1.22.0" }, "engines": { - "node": ">=8" + "node": ">=14" + }, + "peerDependencies": { + "@opentelemetry/api": ">=1.0.0 <1.9.0" } }, - "node_modules/applicationinsights": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-2.7.0.tgz", - "integrity": "sha512-/vV5X6M4TlRA5NxNZAdCE0gukzfK24mb3z18D5Kl/CyIfSVIkafsIji3mK+Zi5q+7dn6H1CkFazlcnLf40anHw==", + "node_modules/@opentelemetry/sdk-trace-base": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.22.0.tgz", + "integrity": "sha512-pfTuSIpCKONC6vkTpv6VmACxD+P1woZf4q0K46nSUvXFvOFqjBYKFaAMkKD3M1mlKUUh0Oajwj35qNjMl80m1Q==", "dependencies": { - "@azure/core-auth": "^1.4.0", - "@azure/core-rest-pipeline": "1.10.1", - "@azure/core-util": "1.2.0", - "@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.3", - "@microsoft/applicationinsights-web-snippet": "^1.0.1", - "@opentelemetry/api": "^1.0.4", - "@opentelemetry/core": "^1.12.0", - "@opentelemetry/sdk-trace-base": "^1.12.0", - "@opentelemetry/semantic-conventions": "^1.12.0", - "cls-hooked": "^4.2.2", - "continuation-local-storage": "^3.2.1", - "diagnostic-channel": "1.1.0", - "diagnostic-channel-publishers": "1.0.6" + "@opentelemetry/core": "1.22.0", + "@opentelemetry/resources": "1.22.0", + "@opentelemetry/semantic-conventions": "1.22.0" }, "engines": { - "node": ">=8.0.0" + "node": ">=14" }, "peerDependencies": { - "applicationinsights-native-metrics": "*" - }, - "peerDependenciesMeta": { - "applicationinsights-native-metrics": { - "optional": true - } + "@opentelemetry/api": ">=1.0.0 <1.9.0" } }, - "node_modules/archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", - "dev": true + "node_modules/@opentelemetry/semantic-conventions": { + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.22.0.tgz", + "integrity": "sha512-CAOgFOKLybd02uj/GhCdEeeBjOS0yeoDeo/CA7ASBSmenpZHAKGB3iDm/rv3BQLcabb/OprDEsSQ1y0P8A7Siw==", + "engines": { + "node": ">=14" + } }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "optional": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sinclair/typebox": { + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, - "node_modules/async-hook-jl": { - "version": "1.7.6", - "resolved": "https://registry.npmjs.org/async-hook-jl/-/async-hook-jl-1.7.6.tgz", - "integrity": "sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==", + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, "dependencies": { - "stack-chain": "^1.3.7" - }, - "engines": { - "node": "^4.7 || >=6.9 || >=7.3" + "type-detect": "4.0.8" } }, - "node_modules/async-listener": { - "version": "0.6.10", - "resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz", - "integrity": "sha512-gpuo6xOyF4D5DE5WvyqZdPA3NGhiT6Qf07l7DCB0wwDEsLvDIbCr6j9S5aj5Ch96dLace5tXVzWBZkxU/c5ohw==", + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, "dependencies": { - "semver": "^5.3.0", - "shimmer": "^1.1.0" - }, - "engines": { - "node": "<=0.11.8 || >0.11.10" + "@sinonjs/commons": "^3.0.0" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" - }, - "node_modules/at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "dev": true, "engines": { - "node": ">= 4.0.0" + "node": ">= 6" } }, - "node_modules/azure-devops-node-api": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-11.2.0.tgz", - "integrity": "sha512-XdiGPhrpaT5J8wdERRKs5g8E0Zy1pvOYTli7z9E8nmOn3YGp4FhtjhrOyFmX/8veWCwdI69mCHKJw6l+4J/bHA==", + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { - "tunnel": "0.0.6", - "typed-rest-client": "^1.8.4" + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" } }, - "node_modules/babel-jest": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.4.2.tgz", - "integrity": "sha512-vcghSqhtowXPG84posYkkkzcZsdayFkubUgbE3/1tuGbX7AQtwCkkNA/wIbB0BMjuCPoqTkiDyKN7Ty7d3uwNQ==", + "node_modules/@types/babel__generator": { + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, "dependencies": { - "@jest/transform": "^29.4.2", - "@types/babel__core": "^7.1.14", - "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.4.2", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "slash": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.8.0" + "@babel/types": "^7.0.0" } }, - "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, - "engines": { - "node": ">=8" + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" } }, - "node_modules/babel-plugin-jest-hoist": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.4.2.tgz", - "integrity": "sha512-5HZRCfMeWypFEonRbEkwWXtNS1sQK159LhRVyRuLzyfVBxDy/34Tr/rg4YVi0SScSJ4fqeaR/OIeceJ/LaQ0pQ==", + "node_modules/@types/babel__traverse": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", + "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", "dev": true, "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "@babel/types": "^7.20.7" } }, - "node_modules/babel-preset-current-node-syntax": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", - "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "node_modules/@types/fs-extra": { + "version": "9.0.13", + "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.13.tgz", + "integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==", "dev": true, "dependencies": { - "@babel/plugin-syntax-async-generators": "^7.8.4", - "@babel/plugin-syntax-bigint": "^7.8.3", - "@babel/plugin-syntax-class-properties": "^7.8.3", - "@babel/plugin-syntax-import-meta": "^7.8.3", - "@babel/plugin-syntax-json-strings": "^7.8.3", - "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-syntax-numeric-separator": "^7.8.3", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3", - "@babel/plugin-syntax-top-level-await": "^7.8.3" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "@types/node": "*" } }, - "node_modules/babel-preset-jest": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.4.2.tgz", - "integrity": "sha512-ecWdaLY/8JyfUDr0oELBMpj3R5I1L6ZqG+kRJmwqfHtLWuPrJStR0LUkvUhfykJWTsXXMnohsayN/twltBbDrQ==", + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "dependencies": { - "babel-plugin-jest-hoist": "^29.4.2", - "babel-preset-current-node-syntax": "^1.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" + "@types/node": "*" } }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "optional": true + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "@types/istanbul-lib-coverage": "*" } }, - "node_modules/bl": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", - "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, - "optional": true, "dependencies": { - "buffer": "^5.5.0", - "inherits": "^2.0.4", - "readable-stream": "^3.4.0" + "@types/istanbul-lib-report": "*" } }, - "node_modules/bl/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "node_modules/@types/jest": { + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "dev": true, - "optional": true, "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" + "expect": "^29.0.0", + "pretty-format": "^29.0.0" } }, - "node_modules/boolbase": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", - "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "node_modules/@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", "dev": true }, - "node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } + "node_modules/@types/mocha": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", + "dev": true }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } + "node_modules/@types/node": { + "version": "14.18.63", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", + "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", + "dev": true }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "node_modules/@types/shimmer": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.0.5.tgz", + "integrity": "sha512-9Hp0ObzwwO57DpLFF0InUjUm/II8GmKAvzbefxQTihCb7KI6yc9yzf0nLc4mVdby5N4DRCgQM2wCup9KTieeww==" + }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, - "node_modules/browserslist": { - "version": "4.21.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", - "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "node_modules/@types/vscode": { + "version": "1.87.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.87.0.tgz", + "integrity": "sha512-y3yYJV2esWr8LNjp3VNbSMWG7Y43jC8pCldG8YwiHGAQbsymkkMMt0aDT1xZIOFM2eFcNiUc+dJMx1+Z0UT8fg==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", + "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - } - ], "dependencies": { - "caniuse-lite": "^1.0.30001449", - "electron-to-chromium": "^1.4.284", - "node-releases": "^2.0.8", - "update-browserslist-db": "^1.0.10" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + "@types/yargs-parser": "*" } }, - "node_modules/bs-logger": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", - "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true + }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true, + "peer": true + }, + "node_modules/@vscode/extension-telemetry": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.8.5.tgz", + "integrity": "sha512-YFKANBT2F3qdWQstjcr40XX8BLsdKlKM7a7YPi/jNuMjuiPhb1Jn7YsDR3WZaVEzAqeqGy4gzXsFCBbuZ+L1Tg==", "dependencies": { - "fast-json-stable-stringify": "2.x" + "@microsoft/1ds-core-js": "^3.2.13", + "@microsoft/1ds-post-js": "^3.2.13", + "@microsoft/applicationinsights-web-basic": "^3.0.2", + "applicationinsights": "^2.7.1" }, "engines": { - "node": ">= 6" + "vscode": "^1.75.0" } }, - "node_modules/bser": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", - "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "node_modules/@vscode/test-electron": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.3.8.tgz", + "integrity": "sha512-b4aZZsBKtMGdDljAsOPObnAi7+VWIaYl3ylCz1jTs+oV6BZ4TNHcVNC3xUn0azPeszBmwSBDQYfFESIaUQnrOg==", "dev": true, "dependencies": { - "node-int64": "^0.4.0" + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "jszip": "^3.10.1", + "semver": "^7.5.2" + }, + "engines": { + "node": ">=16" } }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "node_modules/@vscode/vsce": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-2.19.0.tgz", + "integrity": "sha512-dAlILxC5ggOutcvJY24jxz913wimGiUrHaPkk16Gm9/PGFbz1YezWtrXsTKUtJws4fIlpX2UIlVlVESWq8lkfQ==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "optional": true, "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" + "azure-devops-node-api": "^11.0.1", + "chalk": "^2.4.2", + "cheerio": "^1.0.0-rc.9", + "commander": "^6.1.0", + "glob": "^7.0.6", + "hosted-git-info": "^4.0.2", + "jsonc-parser": "^3.2.0", + "leven": "^3.1.0", + "markdown-it": "^12.3.2", + "mime": "^1.3.4", + "minimatch": "^3.0.3", + "parse-semver": "^1.1.1", + "read": "^1.0.7", + "semver": "^5.1.0", + "tmp": "^0.2.1", + "typed-rest-client": "^1.8.4", + "url-join": "^4.0.1", + "xml2js": "^0.5.0", + "yauzl": "^2.3.1", + "yazl": "^2.2.2" + }, + "bin": { + "vsce": "vsce" + }, + "engines": { + "node": ">= 14" + }, + "optionalDependencies": { + "keytar": "^7.7.0" } }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "node_modules/@vscode/vsce/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, "engines": { "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "node_modules/@vscode/vsce/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/@yarnpkg/lockfile": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", + "integrity": "sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==", "dev": true }, - "node_modules/builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", - "dev": true, + "node_modules/acorn": { + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", + "bin": { + "acorn": "bin/acorn" + }, "engines": { - "node": ">=0.10.0" + "node": ">=0.4.0" } }, - "node_modules/caching-transform": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", + "node_modules/acorn-import-assertions": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", + "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "peerDependencies": { + "acorn": "^8" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, + "peer": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", "dependencies": { - "hasha": "^5.0.0", - "make-dir": "^3.0.0", - "package-hash": "^4.0.0", - "write-file-atomic": "^3.0.0" + "debug": "4" }, "engines": { - "node": ">=8" + "node": ">= 6.0.0" } }, - "node_modules/caching-transform/node_modules/write-file-atomic": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, "dependencies": { - "imurmurhash": "^0.1.4", - "is-typedarray": "^1.0.0", - "signal-exit": "^3.0.2", - "typedarray-to-buffer": "^3.1.5" + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, + "peer": true, "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/callsite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ==", + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true, "engines": { - "node": "*" + "node": ">=6" } }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, "engines": { - "node": ">=6" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", "dev": true, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/caniuse-lite": { - "version": "1.0.30001451", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001451.tgz", - "integrity": "sha512-XY7UbUpGRatZzoRft//5xOa69/1iGJRBlrieH6QYrkKLIFn3m7OVEJ81dSrKoy2BnKsdbX5cLrOispZNYo9v2w==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - } - ] + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "color-convert": "^1.9.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=4" } }, - "node_modules/char-regex": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", - "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, "engines": { - "node": ">=10" + "node": ">= 8" } }, - "node_modules/cheerio": { - "version": "1.0.0-rc.12", - "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", - "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "node_modules/append-transform": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, "dependencies": { - "cheerio-select": "^2.1.0", - "dom-serializer": "^2.0.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1", - "htmlparser2": "^8.0.1", - "parse5": "^7.0.0", - "parse5-htmlparser2-tree-adapter": "^7.0.0" + "default-require-extensions": "^3.0.0" }, "engines": { - "node": ">= 6" - }, - "funding": { - "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + "node": ">=8" } }, - "node_modules/cheerio-select": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", - "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", - "dev": true, + "node_modules/applicationinsights": { + "version": "2.9.5", + "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-2.9.5.tgz", + "integrity": "sha512-APQ8IWyYDHFvKbitFKpsmZXxkzQh0yYTFacQqoVW7HwlPo3eeLprwnq5RFNmmG6iqLmvQ+xRJSDLEQCgqPh+bw==", "dependencies": { - "boolbase": "^1.0.0", - "css-select": "^5.1.0", - "css-what": "^6.1.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.3", - "domutils": "^3.0.1" + "@azure/core-auth": "^1.5.0", + "@azure/core-rest-pipeline": "1.10.1", + "@azure/core-util": "1.2.0", + "@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.5", + "@microsoft/applicationinsights-web-snippet": "1.0.1", + "@opentelemetry/api": "^1.7.0", + "@opentelemetry/core": "^1.19.0", + "@opentelemetry/sdk-trace-base": "^1.19.0", + "@opentelemetry/semantic-conventions": "^1.19.0", + "cls-hooked": "^4.2.2", + "continuation-local-storage": "^3.2.1", + "diagnostic-channel": "1.1.1", + "diagnostic-channel-publishers": "1.0.8" }, - "funding": { - "url": "https://github.com/sponsors/fb55" + "engines": { + "node": ">=8.0.0" + }, + "peerDependencies": { + "applicationinsights-native-metrics": "*" + }, + "peerDependenciesMeta": { + "applicationinsights-native-metrics": { + "optional": true + } } }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], + "node_modules/archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==", + "dev": true + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/async-hook-jl": { + "version": "1.7.6", + "resolved": "https://registry.npmjs.org/async-hook-jl/-/async-hook-jl-1.7.6.tgz", + "integrity": "sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==", "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "stack-chain": "^1.3.7" }, "engines": { - "node": ">= 8.10.0" + "node": "^4.7 || >=6.9 || >=7.3" + } + }, + "node_modules/async-listener": { + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz", + "integrity": "sha512-gpuo6xOyF4D5DE5WvyqZdPA3NGhiT6Qf07l7DCB0wwDEsLvDIbCr6j9S5aj5Ch96dLace5tXVzWBZkxU/c5ohw==", + "dependencies": { + "semver": "^5.3.0", + "shimmer": "^1.1.0" }, - "optionalDependencies": { - "fsevents": "~2.3.2" + "engines": { + "node": "<=0.11.8 || >0.11.10" } }, - "node_modules/chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true, - "optional": true + "node_modules/async-listener/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" + } }, - "node_modules/ci-info": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.1.tgz", - "integrity": "sha512-4jYS4MOAaCIStSRwiuxc4B8MYhIe676yO1sYGzARnjXkWpmzZMMYxY6zu8WYWDhSuth5zhrQ1rhNSibyyvv4/w==", + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], "engines": { - "node": ">=8" + "node": ">= 4.0.0" } }, - "node_modules/cjs-module-lexer": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", - "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==" - }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "node_modules/azure-devops-node-api": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/azure-devops-node-api/-/azure-devops-node-api-11.2.0.tgz", + "integrity": "sha512-XdiGPhrpaT5J8wdERRKs5g8E0Zy1pvOYTli7z9E8nmOn3YGp4FhtjhrOyFmX/8veWCwdI69mCHKJw6l+4J/bHA==", "dev": true, - "engines": { - "node": ">=6" + "dependencies": { + "tunnel": "0.0.6", + "typed-rest-client": "^1.8.4" } }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" }, "engines": { - "node": ">=12" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" } }, - "node_modules/cls-hooked": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/cls-hooked/-/cls-hooked-4.2.2.tgz", - "integrity": "sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw==", + "node_modules/babel-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { - "async-hook-jl": "^1.7.6", - "emitter-listener": "^1.0.1", - "semver": "^5.4.1" + "color-convert": "^2.0.1" }, "engines": { - "node": "^4.7 || >=6.9 || >=7.3 || >=8.2.1" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/co": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "node_modules/babel-jest/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "iojs": ">= 1.0.0", - "node": ">= 0.12.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", - "dev": true - }, - "node_modules/color-convert": { + "node_modules/babel-jest/node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -3033,733 +2956,2495 @@ "node": ">=7.0.0" } }, - "node_modules/color-name": { + "node_modules/babel-jest/node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, + "node_modules/babel-jest/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { - "node": ">= 0.8" + "node": ">=8" } }, - "node_modules/commander": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", - "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "node_modules/babel-jest/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { - "node": ">= 6" + "node": ">=8" } }, - "node_modules/commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", - "dev": true - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/continuation-local-storage": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.2.1.tgz", - "integrity": "sha512-jx44cconVqkCEEyLSKWwkvUXwO561jXMa3LPjTPsm5QR22PA0/mhe33FT4Xb5y74JDvt/Cq+5lm8S8rskLv9ZA==", + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, "dependencies": { - "async-listener": "^0.6.0", - "emitter-listener": "^1.1.1" + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", - "dev": true - }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" }, "engines": { - "node": ">= 8" + "node": ">=8" } }, - "node_modules/css-select": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", - "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "dependencies": { - "boolbase": "^1.0.0", - "css-what": "^6.1.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "nth-check": "^2.0.1" + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" }, - "funding": { - "url": "https://github.com/sponsors/fb55" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/css-what": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", - "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", "dev": true, - "engines": { - "node": ">= 6" + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" }, - "funding": { - "url": "https://github.com/sponsors/fb55" + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, "dependencies": { - "ms": "2.1.2" + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" }, "engines": { - "node": ">=6.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "peerDependencies": { + "@babel/core": "^7.0.0" } }, - "node_modules/decache": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/decache/-/decache-4.6.1.tgz", - "integrity": "sha512-ohApBM8u9ygepJCjgBrEZSSxPjc0T/PJkD+uNyxXPkqudyUpdXpwJYp0VISm2WrPVzASU6DZyIi6BWdyw7uJ2Q==", + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "dev": true, - "dependencies": { - "callsite": "^1.0.0" - } + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "dev": true, "engines": { - "node": ">=10" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", "dev": true, "optional": true, "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" } }, - "node_modules/dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", - "dev": true - }, - "node_modules/deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, "engines": { - "node": ">=4.0.0" + "node": ">= 6" } }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true, - "peer": true + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true }, - "node_modules/deepmerge": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.0.tgz", - "integrity": "sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og==", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/default-require-extensions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", - "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", - "dev": true, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", "dependencies": { - "strip-bom": "^4.0.0" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "engines": { - "node": ">=0.4.0" - } + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true }, - "node_modules/detect-libc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "node_modules/browserslist": { + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "dev": true, - "optional": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" + }, + "bin": { + "browserslist": "cli.js" + }, "engines": { - "node": ">=8" + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, - "node_modules/detect-newline": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", - "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", "dev": true, + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, "engines": { - "node": ">=8" + "node": ">= 6" } }, - "node_modules/diagnostic-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/diagnostic-channel/-/diagnostic-channel-1.1.0.tgz", - "integrity": "sha512-fwujyMe1gj6rk6dYi9hMZm0c8Mz8NDMVl2LB4iaYh3+LIAThZC8RKFGXWG0IML2OxAit/ZFRgZhMkhQ3d/bobQ==", + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, "dependencies": { - "semver": "^5.3.0" - } - }, - "node_modules/diagnostic-channel-publishers": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-1.0.6.tgz", - "integrity": "sha512-RE5AP4JmEm/CV06gOyFdgWWm3gMNOoXulod2mq4ysiz9s77ZhHb1P1DGrfePHjNOmgvWglhegmj5q8DNtjRrEg==", - "peerDependencies": { - "diagnostic-channel": "*" + "node-int64": "^0.4.0" } }, - "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", "dev": true, - "engines": { - "node": ">=0.3.1" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true, + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" } }, - "node_modules/diff-sequences": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.2.tgz", - "integrity": "sha512-R6P0Y6PrsH3n4hUXxL3nns0rbRk6Q33js3ygJBeEpbzLzgcNuJ61+u0RXasFpTKISw99TxUzFnumSnRLsjhLaw==", + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", "dev": true, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "*" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", "dev": true, - "peer": true, - "dependencies": { - "esutils": "^2.0.2" - }, "engines": { - "node": ">=6.0.0" + "node": ">=0.10.0" } }, - "node_modules/dom-serializer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", - "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "node_modules/caching-transform": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "entities": "^4.2.0" + "hasha": "^5.0.0", + "make-dir": "^3.0.0", + "package-hash": "^4.0.0", + "write-file-atomic": "^3.0.0" }, - "funding": { - "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + "engines": { + "node": ">=8" } }, - "node_modules/domelementtype": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", - "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ] - }, - "node_modules/domhandler": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", - "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "node_modules/caching-transform/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "dependencies": { - "domelementtype": "^2.3.0" + "semver": "^6.0.0" }, "engines": { - "node": ">= 4" + "node": ">=8" }, "funding": { - "url": "https://github.com/fb55/domhandler?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/domutils": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", - "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "node_modules/caching-transform/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true, - "dependencies": { - "dom-serializer": "^2.0.0", - "domelementtype": "^2.3.0", - "domhandler": "^5.0.1" - }, - "funding": { - "url": "https://github.com/fb55/domutils?sponsor=1" + "bin": { + "semver": "bin/semver.js" } }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" - }, - "node_modules/electron-to-chromium": { - "version": "1.4.289", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.289.tgz", - "integrity": "sha512-relLdMfPBxqGCxy7Gyfm1HcbRPcFUJdlgnCPVgQ23sr1TvUrRJz0/QPoGP0+x41wOVSTN/Wi3w6YDgHiHJGOzg==", + "node_modules/caching-transform/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, - "node_modules/emitter-listener": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz", - "integrity": "sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==", + "node_modules/caching-transform/node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, "dependencies": { - "shimmer": "^1.2.0" + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" } }, - "node_modules/emittery": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", - "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, "engines": { - "node": ">=12" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sindresorhus/emittery?sponsor=1" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "node_modules/callsite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", + "integrity": "sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ==", "dev": true, - "optional": true, - "dependencies": { - "once": "^1.4.0" + "engines": { + "node": "*" } }, - "node_modules/entities": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", - "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true, "engines": { - "node": ">=0.12" - }, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" + "node": ">=6" } }, - "node_modules/error-ex": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true, - "dependencies": { - "is-arrayish": "^0.2.1" + "engines": { + "node": ">=6" } }, - "node_modules/es6-error": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", - "dev": true - }, - "node_modules/esbuild": { - "version": "0.16.17", + "node_modules/caniuse-lite": { + "version": "1.0.30001600", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001600.tgz", + "integrity": "sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/cheerio": { + "version": "1.0.0-rc.12", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz", + "integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==", + "dev": true, + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "htmlparser2": "^8.0.1", + "parse5": "^7.0.0", + "parse5-htmlparser2-tree-adapter": "^7.0.0" + }, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chokidar/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true, + "optional": true + }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==" + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/cliui/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/cliui/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/cliui/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cliui/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/cls-hooked": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/cls-hooked/-/cls-hooked-4.2.2.tgz", + "integrity": "sha512-J4Xj5f5wq/4jAvcdgoGsL3G103BtWpZrMo8NEinRltN+xpTZdI+M38pyQqhuFU/P792xkMFvnKSf+Lm81U1bxw==", + "dependencies": { + "async-hook-jl": "^1.7.6", + "emitter-listener": "^1.0.1", + "semver": "^5.4.1" + }, + "engines": { + "node": "^4.7 || >=6.9 || >=7.3 || >=8.2.1" + } + }, + "node_modules/cls-hooked/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", + "dev": true + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/continuation-local-storage": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/continuation-local-storage/-/continuation-local-storage-3.2.1.tgz", + "integrity": "sha512-jx44cconVqkCEEyLSKWwkvUXwO561jXMa3LPjTPsm5QR22PA0/mhe33FT4Xb5y74JDvt/Cq+5lm8S8rskLv9ZA==", + "dependencies": { + "async-listener": "^0.6.0", + "emitter-listener": "^1.1.1" + } + }, + "node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true + }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/create-jest/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/create-jest/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/create-jest/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/create-jest/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/create-jest/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/create-jest/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decache": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/decache/-/decache-4.6.2.tgz", + "integrity": "sha512-2LPqkLeu8XWHU8qNCS3kcF6sCcb5zIzvWaAHYSvPfwhdd7mHuah29NssMzrTYyHN4F5oFy2ko9OBYxegtU0FEw==", + "dev": true, + "dependencies": { + "callsite": "^1.0.0" + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "optional": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/dedent": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "optional": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "peer": true + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/default-require-extensions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.1.tgz", + "integrity": "sha512-eXTJmRbm2TIt9MgWTsOH1wEuhew6XGZcMeGKCtLedIg/NCsg1iBePXkceTdK4Fii7pzmN9tGsZhKzZ4h7O/fxw==", + "dev": true, + "dependencies": { + "strip-bom": "^4.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "dev": true, + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diagnostic-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/diagnostic-channel/-/diagnostic-channel-1.1.1.tgz", + "integrity": "sha512-r2HV5qFkUICyoaKlBEpLKHjxMXATUf/l+h8UZPGBHGLy4DDiY2sOLcIctax4eRnTw5wH2jTMExLntGPJ8eOJxw==", + "dependencies": { + "semver": "^7.5.3" + } + }, + "node_modules/diagnostic-channel-publishers": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-1.0.8.tgz", + "integrity": "sha512-HmSm9hXxSPxA9BaLGY98QU1zsdjeCk113KjAYGPCen1ZP6mhVaTPzHd6UYv5r21DnWANi+f+NyPOHruGT9jpqQ==", + "peerDependencies": { + "diagnostic-channel": "*" + } + }, + "node_modules/diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "peer": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "dev": true, + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "dev": true, + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" + }, + "node_modules/electron-to-chromium": { + "version": "1.4.719", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.719.tgz", + "integrity": "sha512-FbWy2Q2YgdFzkFUW/W5jBjE9dj+804+98E4Pup78JBPnbdb3pv6IneY2JCPKdeKLh3AOKHQeYf+KwLr7mxGh6Q==", + "dev": true + }, + "node_modules/emitter-listener": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/emitter-listener/-/emitter-listener-1.1.2.tgz", + "integrity": "sha512-Bt1sBAGFHY9DKY+4/2cV6izcKJUf5T7/gkdmkxzX/qv9CcGH8xSwVRW5mtX03SWJtRTWSOpzCuWN9rBFYZepZQ==", + "dependencies": { + "shimmer": "^1.2.0" + } + }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "optional": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, + "node_modules/esbuild": { + "version": "0.16.17", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.17.tgz", "integrity": "sha512-G8LEkV0XzDMNwXKgM0Jwu3nY3lSTwSGY6XbxM9cr9+s0T/qSV1q1JVPBGzm3dcjhCic9+emZDmMffkwgPeOeLg==", "dev": true, - "hasInstallScript": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.16.17", + "@esbuild/android-arm64": "0.16.17", + "@esbuild/android-x64": "0.16.17", + "@esbuild/darwin-arm64": "0.16.17", + "@esbuild/darwin-x64": "0.16.17", + "@esbuild/freebsd-arm64": "0.16.17", + "@esbuild/freebsd-x64": "0.16.17", + "@esbuild/linux-arm": "0.16.17", + "@esbuild/linux-arm64": "0.16.17", + "@esbuild/linux-ia32": "0.16.17", + "@esbuild/linux-loong64": "0.16.17", + "@esbuild/linux-mips64el": "0.16.17", + "@esbuild/linux-ppc64": "0.16.17", + "@esbuild/linux-riscv64": "0.16.17", + "@esbuild/linux-s390x": "0.16.17", + "@esbuild/linux-x64": "0.16.17", + "@esbuild/netbsd-x64": "0.16.17", + "@esbuild/openbsd-x64": "0.16.17", + "@esbuild/sunos-x64": "0.16.17", + "@esbuild/win32-arm64": "0.16.17", + "@esbuild/win32-ia32": "0.16.17", + "@esbuild/win32-x64": "0.16.17" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eslint": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", + "dev": true, + "peer": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-sonarjs": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.15.0.tgz", + "integrity": "sha512-LuxHdAe6VqSbi1phsUvNjbmXLuvlobmryQJJNyQYbdubCfz6K8tmgoqNiJPnz0pP2AbYDbtuPm0ajOMgMrC+dQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "peer": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/eslint/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/eslint/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/eslint/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "peer": true + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "peer": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, + "peer": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "peer": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/execa/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true, + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "peer": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "peer": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "peer": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "peer": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-cache-dir": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "dev": true, + "dependencies": { + "commondir": "^1.0.1", + "make-dir": "^3.0.2", + "pkg-dir": "^4.1.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + } + }, + "node_modules/find-cache-dir/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-cache-dir/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-yarn-workspace-root": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", + "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", + "dev": true, + "dependencies": { + "micromatch": "^4.0.2" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "peer": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", + "dev": true, + "peer": true + }, + "node_modules/foreground-child": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fromentries": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", + "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true, + "optional": true + }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "dev": true, + "optional": true + }, + "node_modules/glob": { + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^2.3.5", + "minimatch": "^9.0.1", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "peer": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "peer": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true, + "peer": true + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasha": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", + "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "dev": true, + "dependencies": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/hasha/node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, "bin": { - "esbuild": "bin/esbuild" + "he": "bin/he" + } + }, + "node_modules/hosted-git-info": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", + "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" }, "engines": { - "node": ">=12" + "node": ">=10" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/htmlparser2": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1", + "entities": "^4.4.0" + } + }, + "node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" }, - "optionalDependencies": { - "@esbuild/android-arm": "0.16.17", - "@esbuild/android-arm64": "0.16.17", - "@esbuild/android-x64": "0.16.17", - "@esbuild/darwin-arm64": "0.16.17", - "@esbuild/darwin-x64": "0.16.17", - "@esbuild/freebsd-arm64": "0.16.17", - "@esbuild/freebsd-x64": "0.16.17", - "@esbuild/linux-arm": "0.16.17", - "@esbuild/linux-arm64": "0.16.17", - "@esbuild/linux-ia32": "0.16.17", - "@esbuild/linux-loong64": "0.16.17", - "@esbuild/linux-mips64el": "0.16.17", - "@esbuild/linux-ppc64": "0.16.17", - "@esbuild/linux-riscv64": "0.16.17", - "@esbuild/linux-s390x": "0.16.17", - "@esbuild/linux-x64": "0.16.17", - "@esbuild/netbsd-x64": "0.16.17", - "@esbuild/openbsd-x64": "0.16.17", - "@esbuild/sunos-x64": "0.16.17", - "@esbuild/win32-arm64": "0.16.17", - "@esbuild/win32-ia32": "0.16.17", - "@esbuild/win32-x64": "0.16.17" + "engines": { + "node": ">= 6" } }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true + }, + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", + "dev": true + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, + "peer": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, - "engines": { - "node": ">=0.8.0" + "node_modules/import-in-the-middle": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.4.2.tgz", + "integrity": "sha512-9WOz1Yh/cvO/p69sxRmhyQwrIGGSp7EIdcb+fFNVi7CzQGQB8U1/1XrKVSbEd/GNOAeM0peJtmi7+qphe7NvAw==", + "dependencies": { + "acorn": "^8.8.2", + "acorn-import-assertions": "^1.9.0", + "cjs-module-lexer": "^1.2.2", + "module-details-from-path": "^1.0.3" } }, - "node_modules/eslint": { - "version": "8.33.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.33.0.tgz", - "integrity": "sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA==", + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", "dev": true, - "peer": true, "dependencies": { - "@eslint/eslintrc": "^1.4.1", - "@humanwhocodes/config-array": "^0.11.8", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0" + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" }, "bin": { - "eslint": "bin/eslint.js" + "import-local-fixture": "fixtures/cli.js" }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=8" }, "funding": { - "url": "https://opencollective.com/eslint" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint-plugin-sonarjs": { - "version": "0.15.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.15.0.tgz", - "integrity": "sha512-LuxHdAe6VqSbi1phsUvNjbmXLuvlobmryQJJNyQYbdubCfz6K8tmgoqNiJPnz0pP2AbYDbtuPm0ajOMgMrC+dQ==", + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true, "engines": { - "node": ">=12" - }, - "peerDependencies": { - "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + "node": ">=0.8.19" } }, - "node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true, - "peer": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=8" } }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "dev": true, - "peer": true, "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" + "once": "^1.3.0", + "wrappy": "1" } }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true, - "peer": true, - "engines": { - "node": ">=10" - } + "optional": true }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, - "peer": true, + "dependencies": { + "binary-extensions": "^2.0.0" + }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": ">=8" } }, - "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", "dev": true, - "peer": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "ci-info": "^2.0.0" + }, + "bin": { + "is-ci": "bin.js" } }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true, - "engines": { - "node": ">=10" + "node_modules/is-ci/node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "node_modules/is-core-module": { + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "dependencies": { + "hasown": "^2.0.0" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/eslint/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", "dev": true, - "peer": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" + "bin": { + "is-docker": "cli.js" }, "engines": { - "node": ">=10" + "node": ">=8" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true, - "peer": true, - "dependencies": { - "is-glob": "^4.0.3" - }, "engines": { - "node": ">=10.13.0" + "node": ">=0.10.0" } }, - "node_modules/eslint/node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "dependencies": { - "type-fest": "^0.20.2" - }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true, - "peer": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": ">=6" } }, - "node_modules/eslint/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, - "peer": true, "dependencies": { - "p-locate": "^5.0.0" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.10.0" } }, - "node_modules/eslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", "engines": { - "node": "*" + "node": ">=0.12.0" } }, - "node_modules/eslint/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "peer": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/eslint/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true, - "peer": true, - "dependencies": { - "p-limit": "^3.0.2" - }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/eslint/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", "dev": true, - "peer": true, "engines": { "node": ">=8" }, @@ -3767,12 +5452,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", "dev": true, - "peer": true, "engines": { "node": ">=10" }, @@ -3780,1263 +5470,1401 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/espree": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", - "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true, - "peer": true, - "dependencies": { - "acorn": "^8.8.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - }, "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" + "node": ">=0.10.0" } }, - "node_modules/esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" + "dependencies": { + "is-docker": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/isexe": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==", + "engines": { + "node": ">=16" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, - "peer": true, - "dependencies": { - "estraverse": "^5.1.0" - }, "engines": { - "node": ">=0.10" + "node": ">=8" } }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "node_modules/istanbul-lib-hook": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, - "peer": true, "dependencies": { - "estraverse": "^5.2.0" + "append-transform": "^2.0.0" }, "engines": { - "node": ">=4.0" + "node": ">=8" } }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "node_modules/istanbul-lib-instrument": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.2.tgz", + "integrity": "sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==", "dev": true, - "peer": true, + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, "engines": { - "node": ">=4.0" + "node": ">=10" } }, - "node_modules/esutils": { + "node_modules/istanbul-lib-processinfo": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", + "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", "dev": true, - "peer": true, + "dependencies": { + "archy": "^1.0.0", + "cross-spawn": "^7.0.3", + "istanbul-lib-coverage": "^3.2.0", + "p-map": "^3.0.0", + "rimraf": "^3.0.0", + "uuid": "^8.3.2" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/execa": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", - "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^6.0.0", - "human-signals": "^2.1.0", - "is-stream": "^2.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^4.0.1", - "onetime": "^5.1.2", - "signal-exit": "^3.0.3", - "strip-final-newline": "^2.0.0" + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" }, "engines": { "node": ">=10" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" } }, - "node_modules/exit": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", - "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "node_modules/istanbul-lib-report/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">= 0.8.0" + "node": ">=8" } }, - "node_modules/expand-template": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", - "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "optional": true, + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/expect": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.4.2.tgz", - "integrity": "sha512-+JHYg9O3hd3RlICG90OPVjRkPBoiUH7PxvDVMnRiaq1g6JUgZStX514erMl0v2Dc5SkfVbm7ztqbd6qHHPn+mQ==", + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", "dev": true, "dependencies": { - "@jest/expect-utils": "^29.4.2", - "jest-get-type": "^29.4.2", - "jest-matcher-utils": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-util": "^29.4.2" + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=10" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true, - "peer": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "node_modules/istanbul-reports": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, - "peer": true + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "peer": true, + "node_modules/jackspeak": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", "dependencies": { - "reusify": "^1.0.4" + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" } }, - "node_modules/fb-watchman": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", - "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "dependencies": { - "bser": "2.1.1" + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "dependencies": { - "pend": "~1.2.0" + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, - "peer": true, "dependencies": { - "flat-cache": "^3.0.4" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "node_modules/jest-circus/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { - "to-regex-range": "^5.0.1" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/find-cache-dir": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", - "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", + "node_modules/jest-circus/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "commondir": "^1.0.1", - "make-dir": "^3.0.2", - "pkg-dir": "^4.1.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { - "url": "https://github.com/avajs/find-cache-dir?sponsor=1" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/jest-circus/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=8" + "node": ">=7.0.0" } }, - "node_modules/find-yarn-workspace-root": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz", - "integrity": "sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==", - "dev": true, - "dependencies": { - "micromatch": "^4.0.2" - } + "node_modules/jest-circus/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "node_modules/jest-circus/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "bin": { - "flat": "cli.js" + "engines": { + "node": ">=8" } }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "node_modules/jest-circus/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "peer": true, "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" + "has-flag": "^4.0.0" }, "engines": { - "node": "^10.12.0 || >=12.0.0" + "node": ">=8" } }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true, - "peer": true - }, - "node_modules/foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" }, "engines": { - "node": ">=8.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "node_modules/jest-cli/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" + "color-convert": "^2.0.1" }, "engines": { - "node": ">= 6" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/fromentries": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.3.2.tgz", - "integrity": "sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/fs-constants": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "node_modules/jest-cli/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "optional": true + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } }, - "node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "node_modules/jest-cli/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=12" + "node": ">=7.0.0" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "node_modules/jest-cli/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "node_modules/jest-cli/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=8" } }, - "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" - }, - "node_modules/gensync": { - "version": "1.0.0-beta.2", - "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "node_modules/jest-cli/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { - "node": ">=6.9.0" + "node": ">=8" } }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, "engines": { - "node": "6.* || 8.* || >= 10.*" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } } }, - "node_modules/get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "node_modules/jest-config/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "color-convert": "^2.0.1" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "dev": true, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/get-stream": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", - "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", - "dev": true, "engines": { - "node": ">=10" + "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/github-from-package": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", - "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "node_modules/jest-config/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, - "optional": true - }, - "node_modules/glob": { - "version": "10.2.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.7.tgz", - "integrity": "sha512-jTKehsravOJo8IJxUGfZILnkvVJM/MOfHRs8QcXolVef2zNI9Tqyy5+SeuOAZd3upViEZQLyFpQhYiHLrMUNmA==", "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", - "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2", - "path-scurry": "^1.7.0" - }, - "bin": { - "glob": "dist/cjs/src/bin.js" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=16 || 14 >=14.17" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/jest-config/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "is-glob": "^4.0.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">= 6" + "node": ">=7.0.0" } }, - "node_modules/glob/node_modules/foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "node_modules/jest-config/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-config/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=14" + "node": "*" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob/node_modules/signal-exit": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", - "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==", + "node_modules/jest-config/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=8" } }, - "node_modules/globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "node_modules/jest-config/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "dev": true - }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, - "peer": true - }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dependencies": { - "function-bind": "^1.1.1" + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">= 0.4.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "node_modules/jest-diff/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "node_modules/jest-diff/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "node": ">= 0.4" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/hasha": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.2.tgz", - "integrity": "sha512-Hrp5vIK/xr5SkeN2onO32H0MgNZ0f17HRNH39WfL0SYUNOTZ5Lz1TJ8Pajo/87dYGEFlLMm7mIc/k/s6Bvz9HQ==", + "node_modules/jest-diff/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "is-stream": "^2.0.0", - "type-fest": "^0.8.0" + "color-name": "~1.1.4" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=7.0.0" } }, - "node_modules/hasha/node_modules/type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "node_modules/jest-diff/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-diff/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "node_modules/jest-diff/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "bin": { - "he": "bin/he" + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/hosted-git-info": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", - "integrity": "sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==", + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" + "detect-newline": "^3.0.0" }, "engines": { - "node": ">=10" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/html-escaper": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", - "dev": true + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } }, - "node_modules/htmlparser2": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz", - "integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==", + "node_modules/jest-each/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, - "funding": [ - "https://github.com/fb55/htmlparser2?sponsor=1", - { - "type": "github", - "url": "https://github.com/sponsors/fb55" - } - ], "dependencies": { - "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", - "domutils": "^3.0.1", - "entities": "^4.3.0" + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "node_modules/jest-each/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">= 6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "node_modules/jest-each/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { - "agent-base": "6", - "debug": "4" + "color-name": "~1.1.4" }, "engines": { - "node": ">= 6" + "node": ">=7.0.0" } }, - "node_modules/human-signals": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", - "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "node_modules/jest-each/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-each/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">=10.17.0" + "node": ">=8" } }, - "node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "node_modules/jest-each/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "optional": true + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true, - "peer": true, "engines": { - "node": ">= 4" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==", - "dev": true - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, - "peer": true, "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" }, "engines": { - "node": ">=6" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optionalDependencies": { + "fsevents": "^2.3.2" } }, - "node_modules/import-fresh/node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "node_modules/jest-jasmine2": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-29.7.0.tgz", + "integrity": "sha512-N3nRpBVTM5erHtMi6ODBUEqG/LpVgSJC8qk14duw88d9Eigx2vL+n4LF1d8eV8pegnnzKyNHdTGxa/NsIKj0Zw==", "dev": true, - "peer": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0" + }, "engines": { - "node": ">=4" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/import-in-the-middle": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/import-in-the-middle/-/import-in-the-middle-1.4.2.tgz", - "integrity": "sha512-9WOz1Yh/cvO/p69sxRmhyQwrIGGSp7EIdcb+fFNVi7CzQGQB8U1/1XrKVSbEd/GNOAeM0peJtmi7+qphe7NvAw==", + "node_modules/jest-jasmine2/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { - "acorn": "^8.8.2", - "acorn-import-assertions": "^1.9.0", - "cjs-module-lexer": "^1.2.2", - "module-details-from-path": "^1.0.3" + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", + "node_modules/jest-jasmine2/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "node_modules/jest-jasmine2/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, "engines": { - "node": ">=0.8.19" + "node": ">=7.0.0" } }, - "node_modules/indent-string": { + "node_modules/jest-jasmine2/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-jasmine2/node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "node_modules/jest-jasmine2/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, - "optional": true + "dependencies": { + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } }, - "node_modules/is-arrayish": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", - "dev": true + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "node_modules/jest-matcher-utils/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "binary-extensions": "^2.0.0" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/is-ci": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "node_modules/jest-matcher-utils/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "ci-info": "^2.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, - "bin": { - "is-ci": "bin.js" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/is-ci/node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true - }, - "node_modules/is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "node_modules/jest-matcher-utils/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { - "has": "^1.0.3" + "color-name": "~1.1.4" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/jest-matcher-utils/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-matcher-utils/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" } }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "node_modules/jest-matcher-utils/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, - "bin": { - "is-docker": "cli.js" + "dependencies": { + "has-flag": "^4.0.0" }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/jest-message-util/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/is-generator-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", - "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "node_modules/jest-message-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, "engines": { - "node": ">=6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/jest-message-util/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "is-extglob": "^2.1.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">=0.10.0" + "node": ">=7.0.0" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } + "node_modules/jest-message-util/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "node_modules/jest-message-util/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "peer": true, "engines": { "node": ">=8" } }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "node_modules/jest-message-util/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, "engines": { "node": ">=8" } }, - "node_modules/is-stream": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", - "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", - "dev": true - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, "engines": { - "node": ">=10" + "node": ">=6" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } } }, - "node_modules/is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "dependencies": { - "is-docker": "^2.0.0" + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", - "dev": true - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/istanbul-lib-hook": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", - "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", + "node_modules/jest-resolve/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "append-transform": "^2.0.0" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "node_modules/jest-resolve/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "node_modules/jest-resolve/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "bin": { - "semver": "bin/semver.js" + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "node_modules/istanbul-lib-processinfo": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.3.tgz", - "integrity": "sha512-NkwHbo3E00oybX6NGJi6ar0B29vxyvNwoC7eJ4G4Yq28UfY758Hgn/heV8VRFhevPED4LXfFz0DQ8z/0kw9zMg==", + "node_modules/jest-resolve/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-resolve/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "archy": "^1.0.0", - "cross-spawn": "^7.0.3", - "istanbul-lib-coverage": "^3.2.0", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "uuid": "^8.3.2" - }, "engines": { "node": ">=8" } }, - "node_modules/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "node_modules/jest-resolve/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", - "supports-color": "^7.1.0" + "has-flag": "^4.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "dependencies": { - "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" }, "engines": { - "node": ">=10" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/istanbul-reports": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", - "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", + "node_modules/jest-runner/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "html-escaper": "^2.0.0", - "istanbul-lib-report": "^3.0.0" + "color-convert": "^2.0.1" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jackspeak": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.1.tgz", - "integrity": "sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==", + "node_modules/jest-runner/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "dependencies": { - "@isaacs/cliui": "^8.0.2" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=14" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.4.2.tgz", - "integrity": "sha512-+5hLd260vNIHu+7ZgMIooSpKl7Jp5pHKb51e73AJU3owd5dEo/RfVwHbA/na3C/eozrt3hJOLGf96c7EWwIAzg==", + "node_modules/jest-runner/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "@jest/core": "^29.4.2", - "@jest/types": "^29.4.2", - "import-local": "^3.0.2", - "jest-cli": "^29.4.2" - }, - "bin": { - "jest": "bin/jest.js" + "color-name": "~1.1.4" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } + "node": ">=7.0.0" } }, - "node_modules/jest-changed-files": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.4.2.tgz", - "integrity": "sha512-Qdd+AXdqD16PQa+VsWJpxR3kN0JyOCX1iugQfx5nUgAsI4gwsKviXkpclxOK9ZnwaY2IQVHz+771eAvqeOlfuw==", + "node_modules/jest-runner/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-runner/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "execa": "^5.0.0", - "p-limit": "^3.1.0" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/jest-changed-files/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/jest-runner/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "yocto-queue": "^0.1.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/jest-circus": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.4.2.tgz", - "integrity": "sha512-wW3ztp6a2P5c1yOc1Cfrt5ozJ7neWmqeXm/4SYiqcSriyisgq63bwFj1NuRdSR5iqS0CMEYwSZd89ZA47W9zUg==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.4.2", - "@jest/expect": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/types": "^29.4.2", + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "co": "^4.6.0", - "dedent": "^0.7.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.4.2", - "jest-matcher-utils": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-runtime": "^29.4.2", - "jest-snapshot": "^29.4.2", - "jest-util": "^29.4.2", - "p-limit": "^3.1.0", - "pretty-format": "^29.4.2", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "strip-bom": "^4.0.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-circus/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/jest-runtime/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "yocto-queue": "^0.1.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=8" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-config": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.4.2.tgz", - "integrity": "sha512-919CtnXic52YM0zW4C1QxjG6aNueX1kBGthuMtvFtRTAxhKfJmiXC9qwHmi6o2josjbDz8QlWyY55F1SIVmCWA==", + "node_modules/jest-runtime/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.4.2", - "@jest/types": "^29.4.2", - "babel-jest": "^29.4.2", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "deepmerge": "^4.2.2", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-circus": "^29.4.2", - "jest-environment-node": "^29.4.2", - "jest-get-type": "^29.4.2", - "jest-regex-util": "^29.4.2", - "jest-resolve": "^29.4.2", - "jest-runner": "^29.4.2", - "jest-util": "^29.4.2", - "jest-validate": "^29.4.2", - "micromatch": "^4.0.4", - "parse-json": "^5.2.0", - "pretty-format": "^29.4.2", - "slash": "^3.0.0", - "strip-json-comments": "^3.1.1" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "@types/node": "*", - "ts-node": ">=9.0.0" + "node": ">=10" }, - "peerDependenciesMeta": { - "@types/node": { - "optional": true - }, - "ts-node": { - "optional": true - } + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-config/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/jest-runtime/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, - "node_modules/jest-config/node_modules/glob": { + "node_modules/jest-runtime/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-runtime/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", @@ -5056,328 +6884,264 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/jest-config/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/jest-config/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "node_modules/jest-runtime/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-diff": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.4.2.tgz", - "integrity": "sha512-EK8DSajVtnjx9sa1BkjZq3mqChm2Cd8rIzdXkQMA8e0wuXq53ypz6s5o5V8HRZkoEt2ywJ3eeNWFKWeYr8HK4g==", + "node_modules/jest-runtime/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "chalk": "^4.0.0", - "diff-sequences": "^29.4.2", - "jest-get-type": "^29.4.2", - "pretty-format": "^29.4.2" + "has-flag": "^4.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/jest-docblock": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.2.tgz", - "integrity": "sha512-dV2JdahgClL34Y5vLrAHde3nF3yo2jKRH+GIYJuCpfqwEJZcikzeafVTGAjbOfKPG17ez9iWXwUYp7yefeCRag==", + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "dependencies": { - "detect-newline": "^3.0.0" + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-each": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.4.2.tgz", - "integrity": "sha512-trvKZb0JYiCndc55V1Yh0Luqi7AsAdDWpV+mKT/5vkpnnFQfuQACV72IoRV161aAr6kAVIBpmYzwhBzm34vQkA==", + "node_modules/jest-snapshot/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@jest/types": "^29.4.2", - "chalk": "^4.0.0", - "jest-get-type": "^29.4.2", - "jest-util": "^29.4.2", - "pretty-format": "^29.4.2" + "color-convert": "^2.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-environment-node": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.4.2.tgz", - "integrity": "sha512-MLPrqUcOnNBc8zTOfqBbxtoa8/Ee8tZ7UFW7hRDQSUT+NGsvS96wlbHGTf+EFAT9KC3VNb7fWEM6oyvmxtE/9w==", + "node_modules/jest-snapshot/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "@jest/environment": "^29.4.2", - "@jest/fake-timers": "^29.4.2", - "@jest/types": "^29.4.2", - "@types/node": "*", - "jest-mock": "^29.4.2", - "jest-util": "^29.4.2" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-get-type": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.2.tgz", - "integrity": "sha512-vERN30V5i2N6lqlFu4ljdTqQAgrkTFMC9xaIIfOPYBw04pufjXRty5RuXBiB1d72tGbURa/UgoiHB90ruOSivg==", - "dev": true, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-haste-map": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.4.2.tgz", - "integrity": "sha512-WkUgo26LN5UHPknkezrBzr7lUtV1OpGsp+NfXbBwHztsFruS3gz+AMTTBcEklvi8uPzpISzYjdKXYZQJXBnfvw==", + "node_modules/jest-snapshot/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "@jest/types": "^29.4.2", - "@types/graceful-fs": "^4.1.3", - "@types/node": "*", - "anymatch": "^3.0.3", - "fb-watchman": "^2.0.0", - "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.4.2", - "jest-util": "^29.4.2", - "jest-worker": "^29.4.2", - "micromatch": "^4.0.4", - "walker": "^1.0.8" + "color-name": "~1.1.4" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "optionalDependencies": { - "fsevents": "^2.3.2" + "node": ">=7.0.0" } }, - "node_modules/jest-jasmine2": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-29.4.2.tgz", - "integrity": "sha512-9BqsCw467c+xpFQ8DaPDchg9Z412yGqeHg7UEO5L7RI2NpevVudyvQp2aLhhPy0RbILFVuGBzv3ZSmYe4/hrsw==", + "node_modules/jest-snapshot/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-snapshot/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "@jest/environment": "^29.4.2", - "@jest/expect": "^29.4.2", - "@jest/source-map": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/types": "^29.4.2", - "@types/node": "*", - "chalk": "^4.0.0", - "co": "^4.6.0", - "is-generator-fn": "^2.0.0", - "jest-each": "^29.4.2", - "jest-matcher-utils": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-runtime": "^29.4.2", - "jest-snapshot": "^29.4.2", - "jest-util": "^29.4.2", - "p-limit": "^3.1.0", - "pretty-format": "^29.4.2" - }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/jest-jasmine2/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/jest-snapshot/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "yocto-queue": "^0.1.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/jest-leak-detector": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.4.2.tgz", - "integrity": "sha512-Wa62HuRJmWXtX9F00nUpWlrbaH5axeYCdyRsOs/+Rb1Vb6+qWTlB5rKwCCRKtorM7owNwKsyJ8NRDUcZ8ghYUA==", + "node_modules/jest-sonar-reporter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jest-sonar-reporter/-/jest-sonar-reporter-2.0.0.tgz", + "integrity": "sha512-ZervDCgEX5gdUbdtWsjdipLN3bKJwpxbvhkYNXTAYvAckCihobSLr9OT/IuyNIRT1EZMDDwR6DroWtrq+IL64w==", "dev": true, "dependencies": { - "jest-get-type": "^29.4.2", - "pretty-format": "^29.4.2" + "xml": "^1.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8.0.0" } }, - "node_modules/jest-matcher-utils": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.4.2.tgz", - "integrity": "sha512-EZaAQy2je6Uqkrm6frnxBIdaWtSYFoR8SVb2sNLAtldswlR/29JAgx+hy67llT3+hXBaLB0zAm5UfeqerioZyg==", + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", "chalk": "^4.0.0", - "jest-diff": "^29.4.2", - "jest-get-type": "^29.4.2", - "pretty-format": "^29.4.2" + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-message-util": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.4.2.tgz", - "integrity": "sha512-SElcuN4s6PNKpOEtTInjOAA8QvItu0iugkXqhYyguRvQoXapg5gN+9RQxLAkakChZA7Y26j6yUCsFWN+hlKD6g==", + "node_modules/jest-util/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.4.2", - "@types/stack-utils": "^2.0.0", - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "micromatch": "^4.0.4", - "pretty-format": "^29.4.2", - "slash": "^3.0.0", - "stack-utils": "^2.0.3" + "color-convert": "^2.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-mock": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.4.2.tgz", - "integrity": "sha512-x1FSd4Gvx2yIahdaIKoBjwji6XpboDunSJ95RpntGrYulI1ByuYQCKN/P7hvk09JB74IonU3IPLdkutEWYt++g==", + "node_modules/jest-util/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "@jest/types": "^29.4.2", - "@types/node": "*", - "jest-util": "^29.4.2" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-pnp-resolver": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", - "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", + "node_modules/jest-util/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "engines": { - "node": ">=6" - }, - "peerDependencies": { - "jest-resolve": "*" + "dependencies": { + "color-name": "~1.1.4" }, - "peerDependenciesMeta": { - "jest-resolve": { - "optional": true - } + "engines": { + "node": ">=7.0.0" } }, - "node_modules/jest-regex-util": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.4.2.tgz", - "integrity": "sha512-XYZXOqUl1y31H6VLMrrUL1ZhXuiymLKPz0BO1kEeR5xER9Tv86RZrjTm74g5l9bPJQXA/hyLdaVPN/sdqfteig==", + "node_modules/jest-util/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-util/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/jest-resolve": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.4.2.tgz", - "integrity": "sha512-RtKWW0mbR3I4UdkOrW7552IFGLYQ5AF9YrzD0FnIOkDu0rAMlA5/Y1+r7lhCAP4nXSBTaE7ueeqj6IOwZpgoqw==", + "node_modules/jest-util/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "chalk": "^4.0.0", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.4.2", - "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.4.2", - "jest-validate": "^29.4.2", - "resolve": "^1.20.0", - "resolve.exports": "^2.0.0", - "slash": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/jest-resolve-dependencies": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.4.2.tgz", - "integrity": "sha512-6pL4ptFw62rjdrPk7rRpzJYgcRqRZNsZTF1VxVTZMishbO6ObyWvX57yHOaNGgKoADtAHRFYdHQUEvYMJATbDg==", + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "dependencies": { - "jest-regex-util": "^29.4.2", - "jest-snapshot": "^29.4.2" + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-runner": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.4.2.tgz", - "integrity": "sha512-wqwt0drm7JGjwdH+x1XgAl+TFPH7poowMguPQINYxaukCqlczAcNLJiK+OLxUxQAEWMdy+e6nHZlFHO5s7EuRg==", + "node_modules/jest-validate/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "@jest/console": "^29.4.2", - "@jest/environment": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/transform": "^29.4.2", - "@jest/types": "^29.4.2", - "@types/node": "*", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "graceful-fs": "^4.2.9", - "jest-docblock": "^29.4.2", - "jest-environment-node": "^29.4.2", - "jest-haste-map": "^29.4.2", - "jest-leak-detector": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-resolve": "^29.4.2", - "jest-runtime": "^29.4.2", - "jest-util": "^29.4.2", - "jest-watcher": "^29.4.2", - "jest-worker": "^29.4.2", - "p-limit": "^3.1.0", - "source-map-support": "0.5.13" + "color-convert": "^2.0.1" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-runner/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, "engines": { "node": ">=10" }, @@ -5385,232 +7149,158 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-runtime": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.4.2.tgz", - "integrity": "sha512-3fque9vtpLzGuxT9eZqhxi+9EylKK/ESfhClv4P7Y9sqJPs58LjVhTt8jaMp/pRO38agll1CkSu9z9ieTQeRrw==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.4.2", - "@jest/fake-timers": "^29.4.2", - "@jest/globals": "^29.4.2", - "@jest/source-map": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/transform": "^29.4.2", - "@jest/types": "^29.4.2", - "@types/node": "*", - "chalk": "^4.0.0", - "cjs-module-lexer": "^1.0.0", - "collect-v8-coverage": "^1.0.0", - "glob": "^7.1.3", - "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-mock": "^29.4.2", - "jest-regex-util": "^29.4.2", - "jest-resolve": "^29.4.2", - "jest-snapshot": "^29.4.2", - "jest-util": "^29.4.2", - "semver": "^7.3.5", - "slash": "^3.0.0", - "strip-bom": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-runtime/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/jest-runtime/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "node_modules/jest-validate/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": "*" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-runtime/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/jest-validate/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "color-name": "~1.1.4" }, "engines": { - "node": "*" + "node": ">=7.0.0" } }, - "node_modules/jest-runtime/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "node_modules/jest-validate/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-validate/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, "engines": { - "node": ">=10" + "node": ">=8" } }, - "node_modules/jest-snapshot": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.4.2.tgz", - "integrity": "sha512-PdfubrSNN5KwroyMH158R23tWcAXJyx4pvSvWls1dHoLCaUhGul9rsL3uVjtqzRpkxlkMavQjGuWG1newPgmkw==", + "node_modules/jest-validate/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "@babel/core": "^7.11.6", - "@babel/generator": "^7.7.2", - "@babel/plugin-syntax-jsx": "^7.7.2", - "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/traverse": "^7.7.2", - "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.4.2", - "@jest/transform": "^29.4.2", - "@jest/types": "^29.4.2", - "@types/babel__traverse": "^7.0.6", - "@types/prettier": "^2.1.5", - "babel-preset-current-node-syntax": "^1.0.0", - "chalk": "^4.0.0", - "expect": "^29.4.2", - "graceful-fs": "^4.2.9", - "jest-diff": "^29.4.2", - "jest-get-type": "^29.4.2", - "jest-haste-map": "^29.4.2", - "jest-matcher-utils": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-util": "^29.4.2", - "natural-compare": "^1.4.0", - "pretty-format": "^29.4.2", - "semver": "^7.3.5" + "has-flag": "^4.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, - "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" }, "engines": { - "node": ">=10" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-sonar-reporter": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/jest-sonar-reporter/-/jest-sonar-reporter-2.0.0.tgz", - "integrity": "sha512-ZervDCgEX5gdUbdtWsjdipLN3bKJwpxbvhkYNXTAYvAckCihobSLr9OT/IuyNIRT1EZMDDwR6DroWtrq+IL64w==", + "node_modules/jest-watcher/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "xml": "^1.0.1" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=8.0.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jest-util": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.4.2.tgz", - "integrity": "sha512-wKnm6XpJgzMUSRFB7YF48CuwdzuDIHenVuoIb1PLuJ6F+uErZsuDkU+EiExkChf6473XcawBrSfDSnXl+/YG4g==", + "node_modules/jest-watcher/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "@jest/types": "^29.4.2", - "@types/node": "*", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "graceful-fs": "^4.2.9", - "picomatch": "^2.2.3" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/jest-validate": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.4.2.tgz", - "integrity": "sha512-tto7YKGPJyFbhcKhIDFq8B5od+eVWD/ySZ9Tvcp/NGCvYA4RQbuzhbwYWtIjMT5W5zA2W0eBJwu4HVw34d5G6Q==", + "node_modules/jest-watcher/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "@jest/types": "^29.4.2", - "camelcase": "^6.2.0", - "chalk": "^4.0.0", - "jest-get-type": "^29.4.2", - "leven": "^3.1.0", - "pretty-format": "^29.4.2" + "color-name": "~1.1.4" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=7.0.0" } }, - "node_modules/jest-validate/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "node_modules/jest-watcher/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/jest-watcher/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/jest-watcher": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.4.2.tgz", - "integrity": "sha512-onddLujSoGiMJt+tKutehIidABa175i/Ays+QvKxCqBwp7fvxP3ZhKsrIdOodt71dKxqk4sc0LN41mWLGIK44w==", + "node_modules/jest-watcher/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "@jest/test-result": "^29.4.2", - "@jest/types": "^29.4.2", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "emittery": "^0.13.1", - "jest-util": "^29.4.2", - "string-length": "^4.0.1" + "has-flag": "^4.0.0" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": ">=8" } }, "node_modules/jest-worker": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.4.2.tgz", - "integrity": "sha512-VIuZA2hZmFyRbchsUCHEehoSf2HEl0YVF8SDJqtPnKorAaBuh42V8QsLnde0XP5F6TyCynGPEGgBOn3Fc+wZGw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "dependencies": { "@types/node": "*", - "jest-util": "^29.4.2", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, @@ -5618,6 +7308,15 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/jest-worker/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/jest-worker/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -5633,51 +7332,6 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/jest/node_modules/jest-cli": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.4.2.tgz", - "integrity": "sha512-b+eGUtXq/K2v7SH3QcJvFvaUaCDS1/YAZBYz0m28Q/Ppyr+1qNaHmVYikOrbHVbZqYQs2IeI3p76uy6BWbXq8Q==", - "dev": true, - "dependencies": { - "@jest/core": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/types": "^29.4.2", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "import-local": "^3.0.2", - "jest-config": "^29.4.2", - "jest-util": "^29.4.2", - "jest-validate": "^29.4.2", - "prompts": "^2.0.1", - "yargs": "^17.3.1" - }, - "bin": { - "jest": "bin/jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/js-sdsl": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", - "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", - "dev": true, - "peer": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -5685,27 +7339,17 @@ "dev": true }, "node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" + "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, - "node_modules/js-yaml/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -5718,6 +7362,13 @@ "node": ">=4" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "peer": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -5751,9 +7402,9 @@ } }, "node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", "dev": true }, "node_modules/jsonfile": { @@ -5792,6 +7443,16 @@ "prebuild-install": "^7.0.1" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "peer": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/klaw-sync": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", @@ -5858,15 +7519,18 @@ } }, "node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "dependencies": { - "p-locate": "^4.1.0" + "p-locate": "^5.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/lodash.flattendeep": { @@ -5904,6 +7568,76 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -5916,29 +7650,20 @@ } }, "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "dependencies": { - "semver": "^6.0.0" + "semver": "^7.5.3" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - } - }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -5992,11 +7717,12 @@ "dev": true }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "license": "MIT", "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -6057,32 +7783,29 @@ } }, "node_modules/minimatch": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.1.tgz", - "integrity": "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "dependencies": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": "*" } }, "node_modules/minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/minipass": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-6.0.2.tgz", - "integrity": "sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==", "engines": { "node": ">=16 || 14 >=14.17" } @@ -6107,9 +7830,9 @@ "optional": true }, "node_modules/mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz", + "integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==", "dev": true, "dependencies": { "ansi-colors": "4.1.1", @@ -6119,13 +7842,12 @@ "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.2.0", + "glob": "8.1.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", - "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", @@ -6140,20 +7862,30 @@ }, "engines": { "node": ">= 14.0.0" + } + }, + "node_modules/mocha/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/mocha/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "node_modules/mocha/node_modules/cliui": { @@ -6167,27 +7899,35 @@ "wrap-ansi": "^7.0.0" } }, - "node_modules/mocha/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "node_modules/mocha/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, - "engines": { - "node": ">=10" + "dependencies": { + "color-name": "~1.1.4" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">=7.0.0" } }, - "node_modules/mocha/node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "node_modules/mocha/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/mocha/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, "engines": { "node": ">=10" }, @@ -6196,62 +7936,31 @@ } }, "node_modules/mocha/node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "minimatch": "^5.0.1", + "once": "^1.3.0" }, "engines": { - "node": "*" + "node": ">=12" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/mocha/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/mocha/node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, "node_modules/mocha/node_modules/minimatch": { @@ -6266,76 +7975,56 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/mocha/node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "node_modules/mocha/node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/mocha/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "dependencies": { - "yocto-queue": "^0.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/mocha/node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { - "p-limit": "^3.0.2" + "has-flag": "^4.0.0" }, "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/mocha/node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "node_modules/mocha/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" }, "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, "node_modules/mocha/node_modules/yargs": { @@ -6356,15 +8045,6 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/module-details-from-path": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/module-details-from-path/-/module-details-from-path-1.0.3.tgz", @@ -6381,18 +8061,6 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, - "node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "node_modules/napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", @@ -6413,9 +8081,9 @@ "dev": true }, "node_modules/node-abi": { - "version": "3.32.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.32.0.tgz", - "integrity": "sha512-HkwdiLzE/LeuOMIQq/dJq70oNyRc88+wt5CH/RXYseE00LkA/c4PkS6Ti1vE4OHYUiKjkwuxjWq9pItgrz8UJw==", + "version": "3.56.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.56.0.tgz", + "integrity": "sha512-fZjdhDOeRcaS+rcpve7XuwHBmktS1nS1gzgghwKUQQ8nTy2FdSDr6ZT8k6YhvlJeHmmQMYiT/IH9hfco5zeW2Q==", "dev": true, "optional": true, "dependencies": { @@ -6425,22 +8093,6 @@ "node": ">=10" } }, - "node_modules/node-abi/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "optional": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/node-addon-api": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", @@ -6467,9 +8119,9 @@ } }, "node_modules/node-releases": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", - "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, "node_modules/normalize-path": { @@ -6546,14 +8198,19 @@ "node": ">=8.9" } }, - "node_modules/nyc/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/nyc/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, "node_modules/nyc/node_modules/cliui": { @@ -6567,66 +8224,158 @@ "wrap-ansi": "^6.2.0" } }, + "node_modules/nyc/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/nyc/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/nyc/node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, - "node_modules/nyc/node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "node_modules/nyc/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/nyc/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/nyc/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/nyc/node_modules/istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/nyc/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/nyc/node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "node_modules/nyc/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "p-try": "^2.0.0" }, "engines": { - "node": "*" + "node": ">=6" }, "funding": { - "url": "https://github.com/sponsors/isaacs" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/nyc/node_modules/istanbul-lib-instrument": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "node_modules/nyc/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "dependencies": { - "@babel/core": "^7.7.5", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.0.0", - "semver": "^6.3.0" + "p-limit": "^2.2.0" }, "engines": { "node": ">=8" } }, - "node_modules/nyc/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/nyc/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, "engines": { - "node": "*" + "node": ">=8" } }, "node_modules/nyc/node_modules/semver": { @@ -6638,6 +8387,26 @@ "semver": "bin/semver.js" } }, + "node_modules/nyc/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "node_modules/nyc/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/nyc/node_modules/wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -6694,9 +8463,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6770,30 +8539,33 @@ } }, "node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">=6" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "dependencies": { - "p-limit": "^2.2.0" + "p-limit": "^3.0.2" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/p-map": { @@ -6878,6 +8650,15 @@ "semver": "^5.1.0" } }, + "node_modules/parse-semver/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/parse5": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", @@ -6932,16 +8713,55 @@ "npm": ">5" } }, - "node_modules/patch-package/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "node_modules/patch-package/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/patch-package/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/patch-package/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, + "node_modules/patch-package/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "node_modules/patch-package/node_modules/cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -6993,16 +8813,13 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/patch-package/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/patch-package/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, "engines": { - "node": "*" + "node": ">=8" } }, "node_modules/patch-package/node_modules/path-key": { @@ -7026,6 +8843,15 @@ "rimraf": "bin.js" } }, + "node_modules/patch-package/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, "node_modules/patch-package/node_modules/shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -7056,6 +8882,18 @@ "node": ">=6" } }, + "node_modules/patch-package/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/patch-package/node_modules/tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -7112,12 +8950,12 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-scurry": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.9.2.tgz", - "integrity": "sha512-qSDLy2aGFPm8i4rsbHd4MNyTcrzHFsLQykrtbuGRknZZCBBVXSv2tSCDN2Cg6Rt/GFRw8GoW9y9Ecw5rIPG1sg==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", + "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", "dependencies": { - "lru-cache": "^9.1.1", - "minipass": "^5.0.0 || ^6.0.2" + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { "node": ">=16 || 14 >=14.17" @@ -7127,9 +8965,9 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.2.tgz", - "integrity": "sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", "engines": { "node": "14 || >=16.14" } @@ -7158,9 +8996,9 @@ } }, "node_modules/pirates": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", - "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true, "engines": { "node": ">= 6" @@ -7178,10 +9016,62 @@ "node": ">=8" } }, + "node_modules/pkg-dir/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/pkg-dir/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pkg-dir/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/prebuild-install": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", - "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", + "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", "dev": true, "optional": true, "dependencies": { @@ -7231,12 +9121,12 @@ } }, "node_modules/pretty-format": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.4.2.tgz", - "integrity": "sha512-qKlHR8yFVCbcEWba0H0TOC8dnLlO4vPlyEjRPw31FZ2Rupy9nLa8ZLbYny8gWEl8CkEhJqAE6IzdNELTBVcBEg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { - "@jest/schemas": "^29.4.2", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -7299,22 +9189,38 @@ } }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "peer": true, "engines": { "node": ">=6" } }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.0.tgz", + "integrity": "sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==", "dev": true, "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -7369,6 +9275,16 @@ "rc": "cli.js" } }, + "node_modules/rc/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", @@ -7414,19 +9330,6 @@ "node": ">=8.10.0" } }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "peer": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, "node_modules/release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -7449,9 +9352,9 @@ } }, "node_modules/require-in-the-middle": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz", - "integrity": "sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.3.0.tgz", + "integrity": "sha512-nQFEv9gRw6SJAwWD2LrL0NmQvAcO7FBwJbwmr2ttPAacfy0xuiOjE5zt+zM4xDyuyvUaxBi/9gb2SoCyNEVJcw==", "dependencies": { "debug": "^4.1.1", "module-details-from-path": "^1.0.3", @@ -7468,11 +9371,11 @@ "dev": true }, "node_modules/resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dependencies": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -7495,19 +9398,29 @@ "node": ">=8" } }, - "node_modules/resolve-from": { + "node_modules/resolve-cwd/node_modules/resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true, "engines": { - "node": ">=8" + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=4" } }, "node_modules/resolve.exports": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.0.tgz", - "integrity": "sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true, "engines": { "node": ">=10" @@ -7539,16 +9452,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/rimraf/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -7569,18 +9472,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/rimraf/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -7617,17 +9508,23 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==", "dev": true }, "node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { - "semver": "bin/semver" + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, "node_modules/serialize-javascript": { @@ -7645,6 +9542,23 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -7676,24 +9590,33 @@ "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" }, "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" } }, "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } }, "node_modules/simple-concat": { "version": "1.0.1", @@ -7793,6 +9716,49 @@ "node": ">=8" } }, + "node_modules/spawn-wrap/node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/spawn-wrap/node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/spawn-wrap/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/spawn-wrap/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -7848,16 +9814,19 @@ } }, "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/string-width-cjs": { @@ -7874,6 +9843,36 @@ "node": ">=8" } }, + "node_modules/string-width-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -7916,25 +9915,27 @@ } }, "node_modules/strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true, - "optional": true, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { - "has-flag": "^4.0.0" + "has-flag": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=4" } }, "node_modules/supports-preserve-symlinks-flag": { @@ -7979,9 +9980,9 @@ } }, "node_modules/tar-stream/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "optional": true, "dependencies": { @@ -8007,16 +10008,6 @@ "node": ">=8" } }, - "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "node_modules/test-exclude/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -8037,18 +10028,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/test-exclude/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -8057,15 +10036,12 @@ "peer": true }, "node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", "dev": true, - "dependencies": { - "rimraf": "^3.0.0" - }, "engines": { - "node": ">=8.17.0" + "node": ">=14.14" } }, "node_modules/tmpl": { @@ -8087,6 +10063,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", "dependencies": { "is-number": "^7.0.0" }, @@ -8095,9 +10072,9 @@ } }, "node_modules/ts-jest": { - "version": "29.0.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.5.tgz", - "integrity": "sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==", + "version": "29.1.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", + "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", "dev": true, "dependencies": { "bs-logger": "0.x", @@ -8106,21 +10083,21 @@ "json5": "^2.2.3", "lodash.memoize": "4.x", "make-error": "1.x", - "semver": "7.x", + "semver": "^7.5.3", "yargs-parser": "^21.0.1" }, "bin": { "ts-jest": "cli.js" }, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^16.10.0 || ^18.0.0 || >=20.0.0" }, "peerDependencies": { "@babel/core": ">=7.0.0-beta.0 <8", "@jest/types": "^29.0.0", "babel-jest": "^29.0.0", "jest": "^29.0.0", - "typescript": ">=4.3" + "typescript": ">=4.3 <6" }, "peerDependenciesMeta": { "@babel/core": { @@ -8137,25 +10114,19 @@ } } }, - "node_modules/ts-jest/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "node_modules/ts-jest/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/tslib": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", - "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/tslint": { "version": "5.20.1", @@ -8166,78 +10137,36 @@ "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", - "commander": "^2.12.1", - "diff": "^4.0.1", - "glob": "^7.1.1", - "js-yaml": "^3.13.1", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.1", - "resolve": "^1.3.2", - "semver": "^5.3.0", - "tslib": "^1.8.0", - "tsutils": "^2.29.0" - }, - "bin": { - "tslint": "bin/tslint" - }, - "engines": { - "node": ">=4.8.0" - }, - "peerDependencies": { - "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev" - } - }, - "node_modules/tslint/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/tslint/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "commander": "^2.12.1", + "diff": "^4.0.1", + "glob": "^7.1.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.29.0" + }, + "bin": { + "tslint": "bin/tslint" }, "engines": { - "node": ">=4" + "node": ">=4.8.0" + }, + "peerDependencies": { + "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev" } }, - "node_modules/tslint/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "node_modules/tslint/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "dependencies": { - "color-name": "1.1.3" + "sprintf-js": "~1.0.2" } }, - "node_modules/tslint/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, "node_modules/tslint/node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -8273,37 +10202,26 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/tslint/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/tslint/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/tslint/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "argparse": "^1.0.7", + "esprima": "^4.0.0" }, - "engines": { - "node": "*" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/tslint/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/tslint/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, - "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" + "bin": { + "semver": "bin/semver" } }, "node_modules/tslint/node_modules/tslib": { @@ -8375,10 +10293,11 @@ } }, "node_modules/type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, + "peer": true, "engines": { "node": ">=10" }, @@ -8387,9 +10306,9 @@ } }, "node_modules/typed-rest-client": { - "version": "1.8.9", - "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.9.tgz", - "integrity": "sha512-uSmjE38B80wjL85UFX3sTYEUlvZ1JgCRhsWj/fJ4rZ0FqDUFoIuodtiVeE+cUqiVTOKPdKrp/sdftD15MDek6g==", + "version": "1.8.11", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.11.tgz", + "integrity": "sha512-5UvfMpd1oelmUPRbbaVnq+rHP7ng2cE4qoQkQeAqxRL6PklkxsM0g32/HL0yfvruK6ojQ5x8EE+HF4YV6DtuCA==", "dev": true, "dependencies": { "qs": "^6.9.1", @@ -8410,6 +10329,7 @@ "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -8431,18 +10351,18 @@ "dev": true }, "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "engines": { "node": ">= 10.0.0" } }, "node_modules/update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "dev": true, "funding": [ { @@ -8452,6 +10372,10 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { @@ -8459,7 +10383,7 @@ "picocolors": "^1.0.0" }, "bin": { - "browserslist-lint": "cli.js" + "update-browserslist-db": "cli.js" }, "peerDependencies": { "browserslist": ">= 4.21.0" @@ -8496,25 +10420,19 @@ } }, "node_modules/v8-to-istanbul": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz", - "integrity": "sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", "dev": true, "dependencies": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0" + "convert-source-map": "^2.0.0" }, "engines": { "node": ">=10.12.0" } }, - "node_modules/v8-to-istanbul/node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - }, "node_modules/vscode-jsonrpc": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-8.0.2.tgz", @@ -8536,40 +10454,6 @@ "vscode": "^1.67.0" } }, - "node_modules/vscode-languageclient/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/vscode-languageclient/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/vscode-languageclient/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/vscode-languageserver-protocol": { "version": "3.17.2", "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.2.tgz", @@ -8608,9 +10492,9 @@ } }, "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", "dev": true }, "node_modules/workerpool": { @@ -8620,17 +10504,16 @@ "dev": true }, "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" }, "engines": { - "node": ">=10" + "node": ">=12" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -8653,6 +10536,90 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi-cjs/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/wrap-ansi-cjs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -8672,6 +10639,12 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/write-file-atomic/node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/xml": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", @@ -8724,9 +10697,9 @@ } }, "node_modules/yargs": { - "version": "17.6.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", - "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "dependencies": { "cliui": "^8.0.1", @@ -8742,12 +10715,12 @@ } }, "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true, "engines": { - "node": ">=12" + "node": ">=10" } }, "node_modules/yargs-unparser": { @@ -8771,10 +10744,51 @@ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs-unparser/node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" } }, "node_modules/yauzl": { @@ -8818,31 +10832,31 @@ "peer": true }, "@ampproject/remapping": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.0.tgz", - "integrity": "sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "requires": { - "@jridgewell/gen-mapping": "^0.1.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" } }, "@azure/abort-controller": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", - "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-2.1.1.tgz", + "integrity": "sha512-NhzeNm5zu2fPlwGXPUjzsRCRuPx5demaZyNcyNYJDqpa/Sbxzvo/RYt9IwUaAOnDW5+r7J9UOE6f22TQnb9nhQ==", "requires": { - "tslib": "^2.2.0" + "tslib": "^2.6.2" } }, "@azure/core-auth": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.5.0.tgz", - "integrity": "sha512-udzoBuYG1VBoHVohDTrvKjyzel34zt77Bhp7dQntVGGD0ehVq48owENbBG8fIgkHRNUBQH5k1r0hpoMu5L8+kw==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.7.1.tgz", + "integrity": "sha512-dyeQwvgthqs/SlPVQbZQetpslXceHd4i5a7M/7z/lGEAVwnSluabnQOjF2/dk/hhWgMISusv1Ytp4mQ8JNy62A==", "requires": { - "@azure/abort-controller": "^1.0.0", + "@azure/abort-controller": "^2.0.0", "@azure/core-util": "^1.1.0", - "tslib": "^2.2.0" + "tslib": "^2.6.2" } }, "@azure/core-rest-pipeline": { @@ -8860,14 +10874,39 @@ "https-proxy-agent": "^5.0.0", "tslib": "^2.2.0", "uuid": "^8.3.0" + }, + "dependencies": { + "@azure/abort-controller": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", + "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", + "requires": { + "tslib": "^2.2.0" + } + }, + "@tootallnate/once": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==" + }, + "http-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "requires": { + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + } + } } }, "@azure/core-tracing": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.1.tgz", - "integrity": "sha512-I5CGMoLtX+pI17ZdiFJZgxMJApsK6jjfm85hpgp3oazCdq5Wxgh4wMr7ge/TTWW1B5WBuvIOI1fMU/FrOAMKrw==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.1.1.tgz", + "integrity": "sha512-qPbYhN1pE5XQ2jPKIHP33x8l3oBu1UqIWnYqZZ3OYnYjzY0xqIHjn49C+ptsPD9yC7uyWI9Zm7iZUZLs2R4DhQ==", "requires": { - "tslib": "^2.2.0" + "tslib": "^2.6.2" } }, "@azure/core-util": { @@ -8877,14 +10916,24 @@ "requires": { "@azure/abort-controller": "^1.0.0", "tslib": "^2.2.0" + }, + "dependencies": { + "@azure/abort-controller": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", + "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", + "requires": { + "tslib": "^2.2.0" + } + } } }, "@azure/logger": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.4.tgz", - "integrity": "sha512-ustrPY8MryhloQj7OWGe+HrYx+aoiOxzbXTtgblbV3xwCqpzUK36phH3XNHQKj3EPonyFUuDTfR3qFhTEAuZEg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.1.1.tgz", + "integrity": "sha512-/+4TtokaGgC+MnThdf6HyIH9Wrjp+CnCn3Nx3ggevN7FFjjNyjqg0yLlc2i9S+Z2uAzI8GYOo35Nzb1MhQ89MA==", "requires": { - "tslib": "^2.2.0" + "tslib": "^2.6.2" } }, "@azure/opentelemetry-instrumentation-azure-sdk": { @@ -8898,120 +10947,47 @@ "@opentelemetry/core": "^1.15.2", "@opentelemetry/instrumentation": "^0.41.2", "tslib": "^2.2.0" - }, - "dependencies": { - "@opentelemetry/core": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.2.tgz", - "integrity": "sha512-+gBv15ta96WqkHZaPpcDHiaz0utiiHZVfm2YOYSqFGrUaJpPkMoSuLBB58YFQGi6Rsb9EHos84X6X5+9JspmLw==", - "requires": { - "@opentelemetry/semantic-conventions": "1.15.2" - } - }, - "@opentelemetry/semantic-conventions": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.2.tgz", - "integrity": "sha512-CjbOKwk2s+3xPIMcd5UNYQzsf+v94RczbdNix9/kQh38WiQkM90sUOi3if8eyHFgiBjBjhwXrA7W3ydiSQP9mw==" - } } }, "@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.2.tgz", + "integrity": "sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==", "dev": true, "requires": { - "@babel/highlight": "^7.22.13", - "chalk": "^2.4.2" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "@babel/highlight": "^7.24.2", + "picocolors": "^1.0.0" } }, "@babel/compat-data": { - "version": "7.20.14", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.20.14.tgz", - "integrity": "sha512-0YpKHD6ImkWMEINCyDAD0HLLUH/lPCefG8ld9it8DJB2wnApraKuhgYTvTY1z7UFIfBTGy5LwncZ+5HWWGbhFw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.24.1.tgz", + "integrity": "sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA==", "dev": true }, "@babel/core": { - "version": "7.20.12", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.20.12.tgz", - "integrity": "sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg==", - "dev": true, - "requires": { - "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.7", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-module-transforms": "^7.20.11", - "@babel/helpers": "^7.20.7", - "@babel/parser": "^7.20.7", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.12", - "@babel/types": "^7.20.7", - "convert-source-map": "^1.7.0", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.24.3.tgz", + "integrity": "sha512-5FcvN1JHw2sHJChotgx8Ek0lyuh4kCKelgMTTqhYJJtloNvUfpAFMeNQUtdlIaktwrSV9LtCdqwk48wL2wBacQ==", + "dev": true, + "requires": { + "@ampproject/remapping": "^2.2.0", + "@babel/code-frame": "^7.24.2", + "@babel/generator": "^7.24.1", + "@babel/helper-compilation-targets": "^7.23.6", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.24.1", + "@babel/parser": "^7.24.1", + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.1", + "@babel/types": "^7.24.0", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.2", - "semver": "^6.3.0" + "json5": "^2.2.3", + "semver": "^6.3.1" }, "dependencies": { - "convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - }, "semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -9021,41 +10997,28 @@ } }, "@babel/generator": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", - "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.24.1.tgz", + "integrity": "sha512-DfCRfZsBcrPEHUfuBMgbJ1Ut01Y/itOs+hY2nFLgqsqXd52/iSiVq5TITtUasIUgm+IIKdY2/1I7auiQOEeC9A==", "dev": true, "requires": { - "@babel/types": "^7.23.0", - "@jridgewell/gen-mapping": "^0.3.2", - "@jridgewell/trace-mapping": "^0.3.17", + "@babel/types": "^7.24.0", + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^2.5.1" - }, - "dependencies": { - "@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", - "dev": true, - "requires": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - } - } } }, "@babel/helper-compilation-targets": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", - "integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", + "version": "7.23.6", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz", + "integrity": "sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==", "dev": true, "requires": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.21.3", + "@babel/compat-data": "^7.23.5", + "@babel/helper-validator-option": "^7.23.5", + "browserslist": "^4.22.2", "lru-cache": "^5.1.1", - "semver": "^6.3.0" + "semver": "^6.3.1" }, "dependencies": { "lru-cache": { @@ -9107,43 +11070,40 @@ } }, "@babel/helper-module-imports": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz", - "integrity": "sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==", + "version": "7.24.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.24.3.tgz", + "integrity": "sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==", "dev": true, "requires": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.24.0" } }, "@babel/helper-module-transforms": { - "version": "7.20.11", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz", - "integrity": "sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg==", - "dev": true, - "requires": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.20.2", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.10", - "@babel/types": "^7.20.7" + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", + "dev": true, + "requires": { + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-module-imports": "^7.22.15", + "@babel/helper-simple-access": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/helper-validator-identifier": "^7.22.20" } }, "@babel/helper-plugin-utils": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz", - "integrity": "sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==", + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.24.0.tgz", + "integrity": "sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==", "dev": true }, "@babel/helper-simple-access": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz", - "integrity": "sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", + "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", "dev": true, "requires": { - "@babel/types": "^7.20.2" + "@babel/types": "^7.22.5" } }, "@babel/helper-split-export-declaration": { @@ -9156,9 +11116,9 @@ } }, "@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.1.tgz", + "integrity": "sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==", "dev": true }, "@babel/helper-validator-identifier": { @@ -9168,89 +11128,38 @@ "dev": true }, "@babel/helper-validator-option": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz", - "integrity": "sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==", + "version": "7.23.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz", + "integrity": "sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==", "dev": true }, "@babel/helpers": { - "version": "7.20.13", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.20.13.tgz", - "integrity": "sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.24.1.tgz", + "integrity": "sha512-BpU09QqEe6ZCHuIHFphEFgvNSrubve1FtyMton26ekZ85gRGi6LrTF7zArARp2YvyFxloeiRmtSCq5sjh1WqIg==", "dev": true, "requires": { - "@babel/template": "^7.20.7", - "@babel/traverse": "^7.20.13", - "@babel/types": "^7.20.7" + "@babel/template": "^7.24.0", + "@babel/traverse": "^7.24.1", + "@babel/types": "^7.24.0" } }, "@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.24.2", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.2.tgz", + "integrity": "sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" } }, "@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.1.tgz", + "integrity": "sha512-Zo9c7N3xdOIQrNip7Lc9wvRPzlRtovHVE4lkz8WEDr7uYh/GMQhSiIgFxGIArRHYdJE5kxtZjAf8rT0xhdLCzg==", "dev": true }, "@babel/plugin-syntax-async-generators": { @@ -9299,12 +11208,12 @@ } }, "@babel/plugin-syntax-jsx": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz", - "integrity": "sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==", + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.24.1.tgz", + "integrity": "sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.24.0" } }, "@babel/plugin-syntax-logical-assignment-operators": { @@ -9370,185 +11279,284 @@ "@babel/helper-plugin-utils": "^7.14.5" } }, - "@babel/plugin-syntax-typescript": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz", - "integrity": "sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==", + "@babel/plugin-syntax-typescript": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.24.1.tgz", + "integrity": "sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.24.0" + } + }, + "@babel/template": { + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.24.0.tgz", + "integrity": "sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.23.5", + "@babel/parser": "^7.24.0", + "@babel/types": "^7.24.0" + } + }, + "@babel/traverse": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.24.1.tgz", + "integrity": "sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.24.1", + "@babel/generator": "^7.24.1", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.24.1", + "@babel/types": "^7.24.0", + "debug": "^4.3.1", + "globals": "^11.1.0" + }, + "dependencies": { + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.24.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.0.tgz", + "integrity": "sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==", + "dev": true, + "requires": { + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", + "to-fast-properties": "^2.0.0" + } + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "@code4z/cobol-dialect-api": { + "version": "file:../cobol-dialect-api", + "requires": { + "@tsconfig/node16": "^1.0.4", + "@types/vscode": "1.74.0", + "prettier": "2.8.7", + "typescript": "5.0.4" + } + }, + "@esbuild/android-arm": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.17.tgz", + "integrity": "sha512-N9x1CMXVhtWEAMS7pNNONyA14f71VPQN9Cnavj1XQh6T7bskqiLLrSca4O0Vr8Wdcga943eThxnVp3JLnBMYtw==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.17.tgz", + "integrity": "sha512-MIGl6p5sc3RDTLLkYL1MyL8BMRN4tLMRCn+yRJJmEDvYZ2M7tmAf80hx1kbNEUX2KJ50RRtxZ4JHLvCfuB6kBg==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.17.tgz", + "integrity": "sha512-a3kTv3m0Ghh4z1DaFEuEDfz3OLONKuFvI4Xqczqx4BqLyuFaFkuaG4j2MtA6fuWEFeC5x9IvqnX7drmRq/fyAQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.17.tgz", + "integrity": "sha512-/2agbUEfmxWHi9ARTX6OQ/KgXnOWfsNlTeLcoV7HSuSTv63E4DqtAc+2XqGw1KHxKMHGZgbVCZge7HXWX9Vn+w==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz", + "integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.17.tgz", + "integrity": "sha512-mt+cxZe1tVx489VTb4mBAOo2aKSnJ33L9fr25JXpqQqzbUIw/yzIzi+NHwAXK2qYV1lEFp4OoVeThGjUbmWmdw==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.17.tgz", + "integrity": "sha512-8ScTdNJl5idAKjH8zGAsN7RuWcyHG3BAvMNpKOBaqqR7EbUhhVHOqXRdL7oZvz8WNHL2pr5+eIT5c65kA6NHug==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.17.tgz", + "integrity": "sha512-iihzrWbD4gIT7j3caMzKb/RsFFHCwqqbrbH9SqUSRrdXkXaygSZCZg1FybsZz57Ju7N/SHEgPyaR0LZ8Zbe9gQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.17.tgz", + "integrity": "sha512-7S8gJnSlqKGVJunnMCrXHU9Q8Q/tQIxk/xL8BqAP64wchPCTzuM6W3Ra8cIa1HIflAvDnNOt2jaL17vaW+1V0g==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.17.tgz", + "integrity": "sha512-kiX69+wcPAdgl3Lonh1VI7MBr16nktEvOfViszBSxygRQqSpzv7BffMKRPMFwzeJGPxcio0pdD3kYQGpqQ2SSg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.17.tgz", + "integrity": "sha512-dTzNnQwembNDhd654cA4QhbS9uDdXC3TKqMJjgOWsC0yNCbpzfWoXdZvp0mY7HU6nzk5E0zpRGGx3qoQg8T2DQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.17.tgz", + "integrity": "sha512-ezbDkp2nDl0PfIUn0CsQ30kxfcLTlcx4Foz2kYv8qdC6ia2oX5Q3E/8m6lq84Dj/6b0FrkgD582fJMIfHhJfSw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.17.tgz", + "integrity": "sha512-dzS678gYD1lJsW73zrFhDApLVdM3cUF2MvAa1D8K8KtcSKdLBPP4zZSLy6LFZ0jYqQdQ29bjAHJDgz0rVbLB3g==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.17.tgz", + "integrity": "sha512-ylNlVsxuFjZK8DQtNUwiMskh6nT0vI7kYl/4fZgV1llP5d6+HIeL/vmmm3jpuoo8+NuXjQVZxmKuhDApK0/cKw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.17.tgz", + "integrity": "sha512-gzy7nUTO4UA4oZ2wAMXPNBGTzZFP7mss3aKR2hH+/4UUkCOyqmjXiKpzGrY2TlEUhbbejzXVKKGazYcQTZWA/w==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.17.tgz", + "integrity": "sha512-mdPjPxfnmoqhgpiEArqi4egmBAMYvaObgn4poorpUaqmvzzbvqbowRllQ+ZgzGVMGKaPkqUmPDOOFQRUFDmeUw==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.17.tgz", + "integrity": "sha512-/PzmzD/zyAeTUsduZa32bn0ORug+Jd1EGGAUJvqfeixoEISYpGnAezN6lnJoskauoai0Jrs+XSyvDhppCPoKOA==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.17.tgz", + "integrity": "sha512-2yaWJhvxGEz2RiftSk0UObqJa/b+rIAjnODJgv2GbGGpRwAfpgzyrg1WLK8rqA24mfZa9GvpjLcBBg8JHkoodg==", "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.19.0" - } + "optional": true }, - "@babel/template": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", - "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", + "@esbuild/sunos-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.17.tgz", + "integrity": "sha512-xtVUiev38tN0R3g8VhRfN7Zl42YCJvyBhRKw1RJjwE1d2emWTVToPLNEQj/5Qxc6lVFATDiy6LjVHYhIPrLxzw==", "dev": true, - "requires": { - "@babel/code-frame": "^7.22.13", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15" - } + "optional": true }, - "@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "@esbuild/win32-arm64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.17.tgz", + "integrity": "sha512-ga8+JqBDHY4b6fQAmOgtJJue36scANy4l/rL97W+0wYmijhxKetzZdKOJI7olaBaMhWt8Pac2McJdZLxXWUEQw==", "dev": true, - "requires": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", - "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.23.0", - "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", - "debug": "^4.1.0", - "globals": "^11.1.0" - } + "optional": true }, - "@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "@esbuild/win32-ia32": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.17.tgz", + "integrity": "sha512-WnsKaf46uSSF/sZhwnqE4L/F89AYNMiD4YtEcYekBt9Q7nj0DiId2XH2Ng2PHM54qi5oPrQ8luuzGszqi/veig==", "dev": true, - "requires": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.20", - "to-fast-properties": "^2.0.0" - } + "optional": true }, - "@bcoe/v8-coverage": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", - "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", - "dev": true + "@esbuild/win32-x64": { + "version": "0.16.17", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.17.tgz", + "integrity": "sha512-y+EHuSchhL7FjHgvQL/0fnnFmO4T1bhvWANX6gcnqTjtnKWbTvUMCpGnv2+t+31d7RzyEAYAd4u2fnIhHL6N/Q==", + "dev": true, + "optional": true }, - "@code4z/cobol-dialect-api": { - "version": "file:../cobol-dialect-api", + "@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, + "peer": true, "requires": { - "@tsconfig/node16": "^1.0.4", - "@types/vscode": "1.74.0", - "prettier": "2.8.7", - "typescript": "5.0.4" + "eslint-visitor-keys": "^3.3.0" } }, - "@esbuild/darwin-x64": { - "version": "0.16.17", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.17.tgz", - "integrity": "sha512-2By45OBHulkd9Svy5IOCZt376Aa2oOkiE9QWUK9fe6Tb+WDr8hXL3dpqi+DeLiMed8tVXspzsTAvd0jUl96wmg==", + "@eslint-community/regexpp": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.0.tgz", + "integrity": "sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==", "dev": true, - "optional": true + "peer": true }, "@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "peer": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.4.0", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "peer": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "peer": true, - "requires": { - "argparse": "^2.0.1" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true - } } }, + "@eslint/js": { + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", + "dev": true, + "peer": true + }, "@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "peer": true, "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } } }, "@humanwhocodes/module-importer": { @@ -9559,9 +11567,9 @@ "peer": true }, "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true, "peer": true }, @@ -9583,26 +11591,6 @@ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" }, - "ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==" - }, - "emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" - }, - "string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "requires": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - } - }, "strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -9610,16 +11598,6 @@ "requires": { "ansi-regex": "^6.0.1" } - }, - "wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "requires": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - } } } }, @@ -9634,6 +11612,70 @@ "get-package-type": "^0.1.0", "js-yaml": "^3.13.1", "resolve-from": "^5.0.0" + }, + "dependencies": { + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } } }, "@istanbuljs/schema": { @@ -9643,124 +11685,226 @@ "dev": true }, "@jest/console": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.4.2.tgz", - "integrity": "sha512-0I/rEJwMpV9iwi9cDEnT71a5nNGK9lj8Z4+1pRAU2x/thVXCDnaTGrvxyK+cAqZTFVFCiR+hfVrP4l2m+dCmQg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, "requires": { - "@jest/types": "^29.4.2", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^29.4.2", - "jest-util": "^29.4.2", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "@jest/core": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.4.2.tgz", - "integrity": "sha512-KGuoQah0P3vGNlaS/l9/wQENZGNKGoWb+OPxh3gz+YzG7/XExvYu34MzikRndQCdM2S0tzExN4+FL37i6gZmCQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "requires": { - "@jest/console": "^29.4.2", - "@jest/reporters": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/transform": "^29.4.2", - "@jest/types": "^29.4.2", + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "ci-info": "^3.2.0", "exit": "^0.1.2", "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.4.2", - "jest-config": "^29.4.2", - "jest-haste-map": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-regex-util": "^29.4.2", - "jest-resolve": "^29.4.2", - "jest-resolve-dependencies": "^29.4.2", - "jest-runner": "^29.4.2", - "jest-runtime": "^29.4.2", - "jest-snapshot": "^29.4.2", - "jest-util": "^29.4.2", - "jest-validate": "^29.4.2", - "jest-watcher": "^29.4.2", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", "micromatch": "^4.0.4", - "pretty-format": "^29.4.2", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "@jest/environment": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.4.2.tgz", - "integrity": "sha512-JKs3VUtse0vQfCaFGJRX1bir9yBdtasxziSyu+pIiEllAQOe4oQhdCYIf3+Lx+nGglFktSKToBnRJfD5QKp+NQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "requires": { - "@jest/fake-timers": "^29.4.2", - "@jest/types": "^29.4.2", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.4.2" + "jest-mock": "^29.7.0" } }, "@jest/expect": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.4.2.tgz", - "integrity": "sha512-NUAeZVApzyaeLjfWIV/64zXjA2SS+NuUPHpAlO7IwVMGd5Vf9szTl9KEDlxY3B4liwLO31os88tYNHl6cpjtKQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", "dev": true, "requires": { - "expect": "^29.4.2", - "jest-snapshot": "^29.4.2" + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" } }, "@jest/expect-utils": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.4.2.tgz", - "integrity": "sha512-Dd3ilDJpBnqa0GiPN7QrudVs0cczMMHtehSo2CSTjm3zdHx0RcpmhFNVEltuEFeqfLIyWKFI224FsMSQ/nsJQA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", "dev": true, "requires": { - "jest-get-type": "^29.4.2" + "jest-get-type": "^29.6.3" } }, "@jest/fake-timers": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.4.2.tgz", - "integrity": "sha512-Ny1u0Wg6kCsHFWq7A/rW/tMhIedq2siiyHyLpHCmIhP7WmcAmd2cx95P+0xtTZlj5ZbJxIRQi4OPydZZUoiSQQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", "dev": true, "requires": { - "@jest/types": "^29.4.2", + "@jest/types": "^29.6.3", "@sinonjs/fake-timers": "^10.0.2", "@types/node": "*", - "jest-message-util": "^29.4.2", - "jest-mock": "^29.4.2", - "jest-util": "^29.4.2" + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" } }, "@jest/globals": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.4.2.tgz", - "integrity": "sha512-zCk70YGPzKnz/I9BNFDPlK+EuJLk21ur/NozVh6JVM86/YYZtZHqxFFQ62O9MWq7uf3vIZnvNA0BzzrtxD9iyg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", "dev": true, "requires": { - "@jest/environment": "^29.4.2", - "@jest/expect": "^29.4.2", - "@jest/types": "^29.4.2", - "jest-mock": "^29.4.2" + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" } }, "@jest/reporters": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.4.2.tgz", - "integrity": "sha512-10yw6YQe75zCgYcXgEND9kw3UZZH5tJeLzWv4vTk/2mrS1aY50A37F+XT2hPO5OqQFFnUWizXD8k1BMiATNfUw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", "dev": true, "requires": { "@bcoe/v8-coverage": "^0.2.3", - "@jest/console": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/transform": "^29.4.2", - "@jest/types": "^29.4.2", - "@jridgewell/trace-mapping": "^0.3.15", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", "@types/node": "*", "chalk": "^4.0.0", "collect-v8-coverage": "^1.0.0", @@ -9768,29 +11912,53 @@ "glob": "^7.1.3", "graceful-fs": "^4.2.9", "istanbul-lib-coverage": "^3.0.0", - "istanbul-lib-instrument": "^5.1.0", + "istanbul-lib-instrument": "^6.0.0", "istanbul-lib-report": "^3.0.0", "istanbul-lib-source-maps": "^4.0.0", "istanbul-reports": "^3.1.3", - "jest-message-util": "^29.4.2", - "jest-util": "^29.4.2", - "jest-worker": "^29.4.2", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "slash": "^3.0.0", "string-length": "^4.0.1", "strip-ansi": "^6.0.0", "v8-to-istanbul": "^9.0.1" }, "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "color-name": "~1.1.4" } }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9805,178 +11973,287 @@ "path-is-absolute": "^1.0.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "has-flag": "^4.0.0" } } } }, "@jest/schemas": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.4.2.tgz", - "integrity": "sha512-ZrGzGfh31NtdVH8tn0mgJw4khQuNHiKqdzJAFbCaERbyCP9tHlxWuL/mnMu8P7e/+k4puWjI1NOzi/sFsjce/g==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", "dev": true, "requires": { - "@sinclair/typebox": "^0.25.16" + "@sinclair/typebox": "^0.27.8" } }, "@jest/source-map": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.4.2.tgz", - "integrity": "sha512-tIoqV5ZNgYI9XCKXMqbYe5JbumcvyTgNN+V5QW4My033lanijvCD0D4PI9tBw4pRTqWOc00/7X3KVvUh+qnF4Q==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", "dev": true, "requires": { - "@jridgewell/trace-mapping": "^0.3.15", + "@jridgewell/trace-mapping": "^0.3.18", "callsites": "^3.0.0", "graceful-fs": "^4.2.9" } }, "@jest/test-result": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.4.2.tgz", - "integrity": "sha512-HZsC3shhiHVvMtP+i55MGR5bPcc3obCFbA5bzIOb8pCjwBZf11cZliJncCgaVUbC5yoQNuGqCkC0Q3t6EItxZA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", "dev": true, "requires": { - "@jest/console": "^29.4.2", - "@jest/types": "^29.4.2", + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "@jest/test-sequencer": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.4.2.tgz", - "integrity": "sha512-9Z2cVsD6CcObIVrWigHp2McRJhvCxL27xHtrZFgNC1RwnoSpDx6fZo8QYjJmziFlW9/hr78/3sxF54S8B6v8rg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", "dev": true, "requires": { - "@jest/test-result": "^29.4.2", + "@jest/test-result": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.4.2", + "jest-haste-map": "^29.7.0", "slash": "^3.0.0" } }, "@jest/transform": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.4.2.tgz", - "integrity": "sha512-kf1v5iTJHn7p9RbOsBuc/lcwyPtJaZJt5885C98omWz79NIeD3PfoiiaPSu7JyCyFzNOIzKhmMhQLUhlTL9BvQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", "dev": true, "requires": { "@babel/core": "^7.11.6", - "@jest/types": "^29.4.2", - "@jridgewell/trace-mapping": "^0.3.15", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", "babel-plugin-istanbul": "^6.1.1", "chalk": "^4.0.0", "convert-source-map": "^2.0.0", "fast-json-stable-stringify": "^2.1.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.4.2", - "jest-regex-util": "^29.4.2", - "jest-util": "^29.4.2", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", "micromatch": "^4.0.4", "pirates": "^4.0.4", "slash": "^3.0.0", "write-file-atomic": "^4.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "@jest/types": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.4.2.tgz", - "integrity": "sha512-CKlngyGP0fwlgC1BRUtPZSiWLBhyS9dKwKmyGxk8Z6M82LBEGB2aLQSg+U1MyLsU+M7UjnlLllBM2BLWKVm/Uw==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "requires": { - "@jest/schemas": "^29.4.2", + "@jest/schemas": "^29.6.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", "@types/yargs": "^17.0.8", "chalk": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "@jridgewell/gen-mapping": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz", - "integrity": "sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "requires": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/set-array": "^1.2.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.24" } }, "@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true }, "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true }, "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz", - "integrity": "sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@microsoft/1ds-core-js": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-3.2.12.tgz", - "integrity": "sha512-cHpxZZ+pbtOyqFMFB/c1COpaOE3VPFU6phYVHVvOA9DvoeMZfI/Xrxaj7B/vfq4MmkiE7nOAPhv5ZRn+i6OogA==", + "version": "3.2.17", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-3.2.17.tgz", + "integrity": "sha512-S9EgWfY9NP0oiB3sdsTL41hJ71rbQzz9ziijQjHoklFADv+vKNe/TbOAgupBKAW04FaL0wmfE7HGF7mao84hUw==", "requires": { - "@microsoft/applicationinsights-core-js": "2.8.14", + "@microsoft/applicationinsights-core-js": "2.8.18", "@microsoft/applicationinsights-shims": "^2.0.2", - "@microsoft/dynamicproto-js": "^1.1.7" + "@microsoft/dynamicproto-js": "^1.1.11" } }, "@microsoft/1ds-post-js": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-3.2.12.tgz", - "integrity": "sha512-vhIVYg4FzBfwtM8tBqDUq3xU+cFu6SQ7biuJHtQpd5PVjDgvAovVOMRF1khsZE/k2rttRRBpmBgNEqG3Ptoysw==", + "version": "3.2.17", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-3.2.17.tgz", + "integrity": "sha512-YD/pGW/WqijRFEZ/1sSdlkFVM2ZWLGQIMDxRD6/o58c3cC5jzG5PlR1PLp314jFjpUrBc4cmico+WAOP548z4w==", "requires": { - "@microsoft/1ds-core-js": "3.2.12", + "@microsoft/1ds-core-js": "3.2.17", "@microsoft/applicationinsights-shims": "^2.0.2", - "@microsoft/dynamicproto-js": "^1.1.7" + "@microsoft/dynamicproto-js": "^1.1.11" } }, "@microsoft/applicationinsights-channel-js": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.0.2.tgz", - "integrity": "sha512-jDBNKbCHsJgmpv0CKNhJ/uN9ZphvfGdb93Svk+R4LjO8L3apNNMbDDPxBvXXi0uigRmA1TBcmyBG4IRKjabGhw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.1.2.tgz", + "integrity": "sha512-QyPxpOOhtohFzcl4tzfWp4seN6JaToF66DZ1qjsYkUmEyHAackWSsv9m7qvuaAcCB9WrUzW9y0mRXgGKsEJcAg==", "requires": { - "@microsoft/applicationinsights-common": "3.0.2", - "@microsoft/applicationinsights-core-js": "3.0.2", + "@microsoft/applicationinsights-common": "3.1.2", + "@microsoft/applicationinsights-core-js": "3.1.2", "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-async": ">= 0.2.4 < 2.x", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" }, "dependencies": { "@microsoft/applicationinsights-core-js": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.2.tgz", - "integrity": "sha512-WQhVhzlRlLDrQzn3OShCW/pL3BW5WC57t0oywSknX3q7lMzI3jDg7Ihh0iuIcNTzGCTbDkuqr4d6IjEDWIMtJQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.1.2.tgz", + "integrity": "sha512-xsJAm52tV355S/MogTunV/m1wg6P6tFg9Yhi4AC2OE9p2aa0k/FYHzWmrCrsEAVimCd8n/iTXmMRSrQk5QpxiA==", "requires": { "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-async": ">= 0.2.4 < 2.x", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" } }, "@microsoft/applicationinsights-shims": { @@ -9988,35 +12265,35 @@ } }, "@microsoft/dynamicproto-js": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", - "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.3.tgz", + "integrity": "sha512-JTWTU80rMy3mdxOjjpaiDQsTLZ6YSGGqsjURsY6AUQtIj0udlF/jYmhdLZu8693ZIC0T1IwYnFa0+QeiMnziBA==", "requires": { - "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + "@nevware21/ts-utils": ">= 0.10.4 < 2.x" } } } }, "@microsoft/applicationinsights-common": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.0.2.tgz", - "integrity": "sha512-y+WXWop+OVim954Cu1uyYMnNx6PWO8okHpZIQi/1YSqtqaYdtJVPv4P0AVzwJdohxzVfgzKvqj9nec/VWqE2Zg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.1.2.tgz", + "integrity": "sha512-ivu3s73xt6Owakepnx2mbrMCry1mVHrA/2TL4nKCRLad6O3IBK3MkruMoeb3hoWpECBhErFRVj+/b0Kh7dl/Lw==", "requires": { - "@microsoft/applicationinsights-core-js": "3.0.2", + "@microsoft/applicationinsights-core-js": "3.1.2", "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" }, "dependencies": { "@microsoft/applicationinsights-core-js": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.2.tgz", - "integrity": "sha512-WQhVhzlRlLDrQzn3OShCW/pL3BW5WC57t0oywSknX3q7lMzI3jDg7Ihh0iuIcNTzGCTbDkuqr4d6IjEDWIMtJQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.1.2.tgz", + "integrity": "sha512-xsJAm52tV355S/MogTunV/m1wg6P6tFg9Yhi4AC2OE9p2aa0k/FYHzWmrCrsEAVimCd8n/iTXmMRSrQk5QpxiA==", "requires": { "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-async": ">= 0.2.4 < 2.x", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" } }, "@microsoft/applicationinsights-shims": { @@ -10028,22 +12305,22 @@ } }, "@microsoft/dynamicproto-js": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", - "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.3.tgz", + "integrity": "sha512-JTWTU80rMy3mdxOjjpaiDQsTLZ6YSGGqsjURsY6AUQtIj0udlF/jYmhdLZu8693ZIC0T1IwYnFa0+QeiMnziBA==", "requires": { - "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + "@nevware21/ts-utils": ">= 0.10.4 < 2.x" } } } }, "@microsoft/applicationinsights-core-js": { - "version": "2.8.14", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.14.tgz", - "integrity": "sha512-XacWUHdjSHMUwdngMZBp0oiCBifD56CQK2Egu2PiBiF4xu2AO2yNCtWSXsQX2g5OkEhVwaEjfa/aH3WbpYxB1g==", + "version": "2.8.18", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-2.8.18.tgz", + "integrity": "sha512-yPHRZFLpnEO0uSgFPM1BLMRRwjoten9YBbn4pJRbCT4PigLnj748knmWsMwXIdcehtkRTYz78kPYa/LWP7nvmA==", "requires": { "@microsoft/applicationinsights-shims": "2.0.2", - "@microsoft/dynamicproto-js": "^1.1.9" + "@microsoft/dynamicproto-js": "^1.1.11" } }, "@microsoft/applicationinsights-shims": { @@ -10052,28 +12329,28 @@ "integrity": "sha512-PoHEgsnmcqruLNHZ/amACqdJ6YYQpED0KSRe6J7gIJTtpZC1FfFU9b1fmDKDKtFoUSrPzEh1qzO3kmRZP0betg==" }, "@microsoft/applicationinsights-web-basic": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.0.2.tgz", - "integrity": "sha512-6Lq0DE/pZp9RvSV+weGbcxN1NDmfczj6gNPhvZKV2YSQ3RK0LZE3+wjTWLXfuStq8a+nCBdsRpWk8tOKgsoxcg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.1.2.tgz", + "integrity": "sha512-NUnAk/ML9ClnmiQQRo3Fq2obzJVZAfGTgkQOwobZMvNhBVK5IPuv/ROEEAVbl02Go9AjV5uCZ+QoRhTfWrIumQ==", "requires": { - "@microsoft/applicationinsights-channel-js": "3.0.2", - "@microsoft/applicationinsights-common": "3.0.2", - "@microsoft/applicationinsights-core-js": "3.0.2", + "@microsoft/applicationinsights-channel-js": "3.1.2", + "@microsoft/applicationinsights-common": "3.1.2", + "@microsoft/applicationinsights-core-js": "3.1.2", "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-async": ">= 0.2.4 < 2.x", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" }, "dependencies": { "@microsoft/applicationinsights-core-js": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.0.2.tgz", - "integrity": "sha512-WQhVhzlRlLDrQzn3OShCW/pL3BW5WC57t0oywSknX3q7lMzI3jDg7Ihh0iuIcNTzGCTbDkuqr4d6IjEDWIMtJQ==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.1.2.tgz", + "integrity": "sha512-xsJAm52tV355S/MogTunV/m1wg6P6tFg9Yhi4AC2OE9p2aa0k/FYHzWmrCrsEAVimCd8n/iTXmMRSrQk5QpxiA==", "requires": { "@microsoft/applicationinsights-shims": "3.0.1", - "@microsoft/dynamicproto-js": "^2.0.2", - "@nevware21/ts-async": ">= 0.2.4 < 2.x", - "@nevware21/ts-utils": ">= 0.9.5 < 2.x" + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.3.0 < 2.x", + "@nevware21/ts-utils": ">= 0.11.0 < 2.x" } }, "@microsoft/applicationinsights-shims": { @@ -10085,11 +12362,11 @@ } }, "@microsoft/dynamicproto-js": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.2.tgz", - "integrity": "sha512-MB8trWaFREpmb037k/d0bB7T2BP7Ai24w1e1tbz3ASLB0/lwphsq3Nq8S9I5AsI5vs4zAQT+SB5nC5/dLYTiOg==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.3.tgz", + "integrity": "sha512-JTWTU80rMy3mdxOjjpaiDQsTLZ6YSGGqsjURsY6AUQtIj0udlF/jYmhdLZu8693ZIC0T1IwYnFa0+QeiMnziBA==", "requires": { - "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + "@nevware21/ts-utils": ">= 0.10.4 < 2.x" } } } @@ -10100,23 +12377,22 @@ "integrity": "sha512-2IHAOaLauc8qaAitvWS+U931T+ze+7MNWrDHY47IENP5y2UA0vqJDu67kWZDdpCN1fFC77sfgfB+HV7SrKshnQ==" }, "@microsoft/dynamicproto-js": { - "version": "1.1.9", - "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.9.tgz", - "integrity": "sha512-n1VPsljTSkthsAFYdiWfC+DKzK2WwcRp83Y1YAqdX552BstvsDjft9YXppjUzp11BPsapDoO1LDgrDB0XVsfNQ==" + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-1.1.11.tgz", + "integrity": "sha512-gNw9z9LbqLV+WadZ6/MMrWwO3e0LuoUH1wve/1iPsBNbgqeVCiB0EZFNNj2lysxS2gkqoF9hmyVaG3MoM1BkxA==" }, "@nevware21/ts-async": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.2.6.tgz", - "integrity": "sha512-NCUqEZSbsy7LVtKlUScd/eTst6djkWauLlzoIPVKCOxalEBdO8lrgNRIm4Xy68JNudNN5faqa2WA12X8m0BVhA==", + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.4.0.tgz", + "integrity": "sha512-dbV826TTehQIBIJjh8GDSbwn1Z6+cnkyNbRlpcpdBPH8mROD2zabIUKqWcw9WRdTjjUIm21K+OR4DXWlAyOVTQ==", "requires": { - "@nevware21/ts-utils": ">= 0.9.7 < 2.x" + "@nevware21/ts-utils": ">= 0.10.0 < 2.x" } }, "@nevware21/ts-utils": { - "version": "0.9.8", - "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.9.8.tgz", - "integrity": "sha512-kZ8s8hcn9jPVX/M7kSsBYrOGlHjqLahmxrG7QeKTk5paeVwfgKdvVCjj5Acb4UGb/ukU1G34U1Z3eb7bbVanyA==", - "requires": {} + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.11.0.tgz", + "integrity": "sha512-3yrohCSKYBLKrW41fYkZorN2rf9GYr/4Cb4Xu9fWCyXgVDyt1uLgMaCinhx0kEkEUfME3Smqs+2itJRhXgCo8Q==" }, "@nodelib/fs.scandir": { "version": "2.1.5", @@ -10148,16 +12424,16 @@ } }, "@opentelemetry/api": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.4.1.tgz", - "integrity": "sha512-O2yRJce1GOc6PAy3QxFM4NzFiWzvScDC1/5ihYBL6BUEVdq0XMWN01sppE+H6bBXbaFYipjwFLEWLg5PaSOThA==" + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.8.0.tgz", + "integrity": "sha512-I/s6F7yKUDdtMsoBWXJe8Qz40Tui5vsuKCWJEWVL+5q9sSWRzzx6v2KeNsOBEwd94j0eWkpWCH4yB6rZg9Mf0w==" }, "@opentelemetry/core": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.15.1.tgz", - "integrity": "sha512-V6GoRTY6aANMDDOQ9CiHOiLWEK2b2b3OGZK+zk05Li5merb9jadFeV5ooTSGtjxfxVNMpQUaQERO1cdbdbeEGg==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/core/-/core-1.22.0.tgz", + "integrity": "sha512-0VoAlT6x+Xzik1v9goJ3pZ2ppi6+xd3aUfg4brfrLkDBHRIVjMP0eBHrKrhB+NKcDyMAg8fAbGL3Npg/F6AwWA==", "requires": { - "@opentelemetry/semantic-conventions": "1.15.1" + "@opentelemetry/semantic-conventions": "1.22.0" } }, "@opentelemetry/instrumentation": { @@ -10170,41 +12446,31 @@ "require-in-the-middle": "^7.1.1", "semver": "^7.5.1", "shimmer": "^1.2.1" - }, - "dependencies": { - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "@opentelemetry/resources": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.15.1.tgz", - "integrity": "sha512-15JcpyKZHhFYQ1uiC08vR02sRY/2seSnqSJ0tIUhcdYDzOhd0FrqPYpLj3WkLhVdQP6vgJ+pelAmSaOrCxCpKA==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/resources/-/resources-1.22.0.tgz", + "integrity": "sha512-+vNeIFPH2hfcNL0AJk/ykJXoUCtR1YaDUZM+p3wZNU4Hq98gzq+7b43xbkXjadD9VhWIUQqEwXyY64q6msPj6A==", "requires": { - "@opentelemetry/core": "1.15.1", - "@opentelemetry/semantic-conventions": "1.15.1" + "@opentelemetry/core": "1.22.0", + "@opentelemetry/semantic-conventions": "1.22.0" } }, "@opentelemetry/sdk-trace-base": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.15.1.tgz", - "integrity": "sha512-5hccBe2yXzzXyExJNkTsIzDe1AM7HK0al+y/D2yEpslJqS1HUzsUSuCMY7Z4+Sfz5Gf0kTa6KYEt1QUQppnoBA==", + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.22.0.tgz", + "integrity": "sha512-pfTuSIpCKONC6vkTpv6VmACxD+P1woZf4q0K46nSUvXFvOFqjBYKFaAMkKD3M1mlKUUh0Oajwj35qNjMl80m1Q==", "requires": { - "@opentelemetry/core": "1.15.1", - "@opentelemetry/resources": "1.15.1", - "@opentelemetry/semantic-conventions": "1.15.1" + "@opentelemetry/core": "1.22.0", + "@opentelemetry/resources": "1.22.0", + "@opentelemetry/semantic-conventions": "1.22.0" } }, "@opentelemetry/semantic-conventions": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.15.1.tgz", - "integrity": "sha512-n8Kur1/CZlYG32YCEj30CoUqA8R7UyDVZzoEU6SDP+13+kXDT2kFVu6MpcnEUTyGP3i058ID6Qjp5h6IJxdPPQ==" + "version": "1.22.0", + "resolved": "https://registry.npmjs.org/@opentelemetry/semantic-conventions/-/semantic-conventions-1.22.0.tgz", + "integrity": "sha512-CAOgFOKLybd02uj/GhCdEeeBjOS0yeoDeo/CA7ASBSmenpZHAKGB3iDm/rv3BQLcabb/OprDEsSQ1y0P8A7Siw==" }, "@pkgjs/parseargs": { "version": "0.11.0", @@ -10213,38 +12479,39 @@ "optional": true }, "@sinclair/typebox": { - "version": "0.25.21", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.21.tgz", - "integrity": "sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g==", + "version": "0.27.8", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, "@sinonjs/commons": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", - "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", "dev": true, "requires": { "type-detect": "4.0.8" } }, "@sinonjs/fake-timers": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", - "integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", "dev": true, "requires": { - "@sinonjs/commons": "^2.0.0" + "@sinonjs/commons": "^3.0.0" } }, "@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "dev": true }, "@types/babel__core": { - "version": "7.20.0", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.0.tgz", - "integrity": "sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "requires": { "@babel/parser": "^7.20.7", @@ -10255,18 +12522,18 @@ } }, "@types/babel__generator": { - "version": "7.6.4", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", - "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", + "version": "7.6.8", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.8.tgz", + "integrity": "sha512-ASsj+tpEDsEiFr1arWrlN6V3mdfjRMZt6LtK/Vp/kreFLnr5QH5+DhvD5nINYZXzwJvXeGq+05iUXcAzVrqWtw==", "dev": true, "requires": { "@babel/types": "^7.0.0" } }, "@types/babel__template": { - "version": "7.4.1", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", - "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -10274,12 +12541,12 @@ } }, "@types/babel__traverse": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.18.3.tgz", - "integrity": "sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.5.tgz", + "integrity": "sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==", "dev": true, "requires": { - "@babel/types": "^7.3.0" + "@babel/types": "^7.20.7" } }, "@types/fs-extra": { @@ -10292,42 +12559,42 @@ } }, "@types/graceful-fs": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.6.tgz", - "integrity": "sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==", + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", "dev": true, "requires": { "@types/node": "*" } }, "@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", "dev": true }, "@types/istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", "dev": true, "requires": { "@types/istanbul-lib-coverage": "*" } }, "@types/istanbul-reports": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", - "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", "dev": true, "requires": { "@types/istanbul-lib-report": "*" } }, "@types/jest": { - "version": "29.4.0", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.4.0.tgz", - "integrity": "sha512-VaywcGQ9tPorCX/Jkkni7RWGFfI11whqzs8dvxF41P17Z+z872thvEvlIbznjPJ02kl1HMX3LmLOonsj2n7HeQ==", + "version": "29.5.12", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.12.tgz", + "integrity": "sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw==", "dev": true, "requires": { "expect": "^29.0.0", @@ -10347,58 +12614,59 @@ "dev": true }, "@types/node": { - "version": "14.18.36", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.36.tgz", - "integrity": "sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ==", - "dev": true - }, - "@types/prettier": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.2.tgz", - "integrity": "sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==", + "version": "14.18.63", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.63.tgz", + "integrity": "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ==", "dev": true }, "@types/shimmer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.0.2.tgz", - "integrity": "sha512-dKkr1bTxbEsFlh2ARpKzcaAmsYixqt9UyCdoEZk8rHyE4iQYcDCyvSjDSf7JUWJHlJiTtbIoQjxKh6ViywqDAg==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/shimmer/-/shimmer-1.0.5.tgz", + "integrity": "sha512-9Hp0ObzwwO57DpLFF0InUjUm/II8GmKAvzbefxQTihCb7KI6yc9yzf0nLc4mVdby5N4DRCgQM2wCup9KTieeww==" }, "@types/stack-utils": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.1.tgz", - "integrity": "sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, "@types/vscode": { - "version": "1.75.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.75.0.tgz", - "integrity": "sha512-SAr0PoOhJS6FUq5LjNr8C/StBKALZwDVm3+U4pjF/3iYkt3GioJOPV/oB1Sf1l7lROe4TgrMyL5N1yaEgTWycw==", + "version": "1.87.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.87.0.tgz", + "integrity": "sha512-y3yYJV2esWr8LNjp3VNbSMWG7Y43jC8pCldG8YwiHGAQbsymkkMMt0aDT1xZIOFM2eFcNiUc+dJMx1+Z0UT8fg==", "dev": true }, "@types/yargs": { - "version": "17.0.22", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.22.tgz", - "integrity": "sha512-pet5WJ9U8yPVRhkwuEIp5ktAeAqRZOq4UdAyWLWzxbtpyXnzbtLdKiXAjJzi/KLmPGS9wk86lUFWZFN6sISo4g==", + "version": "17.0.32", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", + "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", "dev": true, "requires": { "@types/yargs-parser": "*" } }, "@types/yargs-parser": { - "version": "21.0.0", - "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz", - "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, + "@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", + "dev": true, + "peer": true + }, "@vscode/extension-telemetry": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.8.2.tgz", - "integrity": "sha512-bBvlyRpjJEmNXBaPkfJSpfD88kEWzbTpdavpo+NwW5uZguWHllbQebavjt6jH+Pm1k7hWnaJoS5PIULk7uuSgw==", + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.8.5.tgz", + "integrity": "sha512-YFKANBT2F3qdWQstjcr40XX8BLsdKlKM7a7YPi/jNuMjuiPhb1Jn7YsDR3WZaVEzAqeqGy4gzXsFCBbuZ+L1Tg==", "requires": { - "@microsoft/1ds-core-js": "^3.2.10", - "@microsoft/1ds-post-js": "^3.2.10", - "@microsoft/applicationinsights-web-basic": "^3.0.0", - "applicationinsights": "^2.7.0" + "@microsoft/1ds-core-js": "^3.2.13", + "@microsoft/1ds-post-js": "^3.2.13", + "@microsoft/applicationinsights-web-basic": "^3.0.2", + "applicationinsights": "^2.7.1" } }, "@vscode/test-electron": { @@ -10411,34 +12679,6 @@ "https-proxy-agent": "^5.0.0", "jszip": "^3.10.1", "semver": "^7.5.2" - }, - "dependencies": { - "@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "dev": true - }, - "http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "dev": true, - "requires": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - } - }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "@vscode/vsce": { @@ -10470,51 +12710,6 @@ "yazl": "^2.2.2" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -10529,29 +12724,11 @@ "path-is-absolute": "^1.0.0" } }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } } } }, @@ -10562,9 +12739,9 @@ "dev": true }, "acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==" + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==" }, "acorn-import-assertions": { "version": "1.9.0", @@ -10624,6 +12801,14 @@ "dev": true, "requires": { "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true + } } }, "ansi-regex": { @@ -10632,11 +12817,12 @@ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, "requires": { - "color-convert": "^2.0.1" + "color-convert": "^1.9.0" } }, "anymatch": { @@ -10659,23 +12845,23 @@ } }, "applicationinsights": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-2.7.0.tgz", - "integrity": "sha512-/vV5X6M4TlRA5NxNZAdCE0gukzfK24mb3z18D5Kl/CyIfSVIkafsIji3mK+Zi5q+7dn6H1CkFazlcnLf40anHw==", + "version": "2.9.5", + "resolved": "https://registry.npmjs.org/applicationinsights/-/applicationinsights-2.9.5.tgz", + "integrity": "sha512-APQ8IWyYDHFvKbitFKpsmZXxkzQh0yYTFacQqoVW7HwlPo3eeLprwnq5RFNmmG6iqLmvQ+xRJSDLEQCgqPh+bw==", "requires": { - "@azure/core-auth": "^1.4.0", + "@azure/core-auth": "^1.5.0", "@azure/core-rest-pipeline": "1.10.1", "@azure/core-util": "1.2.0", - "@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.3", - "@microsoft/applicationinsights-web-snippet": "^1.0.1", - "@opentelemetry/api": "^1.0.4", - "@opentelemetry/core": "^1.12.0", - "@opentelemetry/sdk-trace-base": "^1.12.0", - "@opentelemetry/semantic-conventions": "^1.12.0", + "@azure/opentelemetry-instrumentation-azure-sdk": "^1.0.0-beta.5", + "@microsoft/applicationinsights-web-snippet": "1.0.1", + "@opentelemetry/api": "^1.7.0", + "@opentelemetry/core": "^1.19.0", + "@opentelemetry/sdk-trace-base": "^1.19.0", + "@opentelemetry/semantic-conventions": "^1.19.0", "cls-hooked": "^4.2.2", "continuation-local-storage": "^3.2.1", - "diagnostic-channel": "1.1.0", - "diagnostic-channel-publishers": "1.0.6" + "diagnostic-channel": "1.1.1", + "diagnostic-channel-publishers": "1.0.8" } }, "archy": { @@ -10705,6 +12891,13 @@ "requires": { "semver": "^5.3.0", "shimmer": "^1.1.0" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" + } } }, "asynckit": { @@ -10729,18 +12922,69 @@ } }, "babel-jest": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.4.2.tgz", - "integrity": "sha512-vcghSqhtowXPG84posYkkkzcZsdayFkubUgbE3/1tuGbX7AQtwCkkNA/wIbB0BMjuCPoqTkiDyKN7Ty7d3uwNQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", "dev": true, "requires": { - "@jest/transform": "^29.4.2", + "@jest/transform": "^29.7.0", "@types/babel__core": "^7.1.14", "babel-plugin-istanbul": "^6.1.1", - "babel-preset-jest": "^29.4.2", + "babel-preset-jest": "^29.6.3", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "slash": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "babel-plugin-istanbul": { @@ -10754,12 +12998,33 @@ "@istanbuljs/schema": "^0.1.2", "istanbul-lib-instrument": "^5.0.4", "test-exclude": "^6.0.0" + }, + "dependencies": { + "istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } } }, "babel-plugin-jest-hoist": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.4.2.tgz", - "integrity": "sha512-5HZRCfMeWypFEonRbEkwWXtNS1sQK159LhRVyRuLzyfVBxDy/34Tr/rg4YVi0SScSJ4fqeaR/OIeceJ/LaQ0pQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "requires": { "@babel/template": "^7.3.3", @@ -10789,12 +13054,12 @@ } }, "babel-preset-jest": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.4.2.tgz", - "integrity": "sha512-ecWdaLY/8JyfUDr0oELBMpj3R5I1L6ZqG+kRJmwqfHtLWuPrJStR0LUkvUhfykJWTsXXMnohsayN/twltBbDrQ==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^29.4.2", + "babel-plugin-jest-hoist": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0" } }, @@ -10811,9 +13076,9 @@ "optional": true }, "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", "dev": true }, "bl": { @@ -10829,9 +13094,9 @@ }, "dependencies": { "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "optional": true, "requires": { @@ -10849,19 +13114,20 @@ "dev": true }, "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "requires": { - "balanced-match": "^1.0.0" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "requires": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" } }, "browser-stdout": { @@ -10871,15 +13137,15 @@ "dev": true }, "browserslist": { - "version": "4.21.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz", - "integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001449", - "electron-to-chromium": "^1.4.284", - "node-releases": "^2.0.8", - "update-browserslist-db": "^1.0.10" + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", + "node-releases": "^2.0.14", + "update-browserslist-db": "^1.0.13" } }, "bs-logger": { @@ -10941,6 +13207,27 @@ "write-file-atomic": "^3.0.0" }, "dependencies": { + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", @@ -10956,13 +13243,16 @@ } }, "call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" } }, "callsite": { @@ -10984,19 +13274,20 @@ "dev": true }, "caniuse-lite": { - "version": "1.0.30001451", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001451.tgz", - "integrity": "sha512-XY7UbUpGRatZzoRft//5xOa69/1iGJRBlrieH6QYrkKLIFn3m7OVEJ81dSrKoy2BnKsdbX5cLrOispZNYo9v2w==", + "version": "1.0.30001600", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001600.tgz", + "integrity": "sha512-+2S9/2JFhYmYaDpZvo0lKkfvuKIglrx68MwOBqMGHhQsNkLjB5xtc/TGoEPs+MxjSyN/72qer2g97nzR641mOQ==", "dev": true }, "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "char-regex": { @@ -11048,6 +13339,17 @@ "is-glob": "~4.0.1", "normalize-path": "~3.0.0", "readdirp": "~3.6.0" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } } }, "chownr": { @@ -11058,15 +13360,15 @@ "optional": true }, "ci-info": { - "version": "3.7.1", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.7.1.tgz", - "integrity": "sha512-4jYS4MOAaCIStSRwiuxc4B8MYhIe676yO1sYGzARnjXkWpmzZMMYxY6zu8WYWDhSuth5zhrQ1rhNSibyyvv4/w==", + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", "dev": true }, "cjs-module-lexer": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz", - "integrity": "sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==" + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", + "integrity": "sha512-0TNiGstbQmCFwt4akjjBg5pLRTSyj/PkWQ1ZoO2zntmg9yLqSRxwEa4iCfQLGjqhiqBfOJa7W/E8wfGrTDmlZQ==" }, "clean-stack": { "version": "2.2.0", @@ -11083,6 +13385,60 @@ "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + } } }, "cls-hooked": { @@ -11093,6 +13449,13 @@ "async-hook-jl": "^1.7.6", "emitter-listener": "^1.0.1", "semver": "^5.4.1" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" + } } }, "co": { @@ -11102,23 +13465,25 @@ "dev": true }, "collect-v8-coverage": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", - "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", + "integrity": "sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==", "dev": true }, "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, "requires": { - "color-name": "~1.1.4" + "color-name": "1.1.3" } }, "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true }, "combined-stream": { "version": "1.0.8", @@ -11166,6 +13531,72 @@ "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", "dev": true }, + "create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "requires": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -11204,18 +13635,18 @@ } }, "decache": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/decache/-/decache-4.6.1.tgz", - "integrity": "sha512-ohApBM8u9ygepJCjgBrEZSSxPjc0T/PJkD+uNyxXPkqudyUpdXpwJYp0VISm2WrPVzASU6DZyIi6BWdyw7uJ2Q==", + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/decache/-/decache-4.6.2.tgz", + "integrity": "sha512-2LPqkLeu8XWHU8qNCS3kcF6sCcb5zIzvWaAHYSvPfwhdd7mHuah29NssMzrTYyHN4F5oFy2ko9OBYxegtU0FEw==", "dev": true, "requires": { "callsite": "^1.0.0" } }, "decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", "dev": true }, "decompress-response": { @@ -11229,10 +13660,11 @@ } }, "dedent": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", - "integrity": "sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==", - "dev": true + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz", + "integrity": "sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg==", + "dev": true, + "requires": {} }, "deep-extend": { "version": "0.6.0", @@ -11249,9 +13681,9 @@ "peer": true }, "deepmerge": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.0.tgz", - "integrity": "sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og==", + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", "dev": true }, "default-require-extensions": { @@ -11263,15 +13695,26 @@ "strip-bom": "^4.0.0" } }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" }, "detect-libc": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", - "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", "dev": true, "optional": true }, @@ -11282,17 +13725,17 @@ "dev": true }, "diagnostic-channel": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/diagnostic-channel/-/diagnostic-channel-1.1.0.tgz", - "integrity": "sha512-fwujyMe1gj6rk6dYi9hMZm0c8Mz8NDMVl2LB4iaYh3+LIAThZC8RKFGXWG0IML2OxAit/ZFRgZhMkhQ3d/bobQ==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/diagnostic-channel/-/diagnostic-channel-1.1.1.tgz", + "integrity": "sha512-r2HV5qFkUICyoaKlBEpLKHjxMXATUf/l+h8UZPGBHGLy4DDiY2sOLcIctax4eRnTw5wH2jTMExLntGPJ8eOJxw==", "requires": { - "semver": "^5.3.0" + "semver": "^7.5.3" } }, "diagnostic-channel-publishers": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-1.0.6.tgz", - "integrity": "sha512-RE5AP4JmEm/CV06gOyFdgWWm3gMNOoXulod2mq4ysiz9s77ZhHb1P1DGrfePHjNOmgvWglhegmj5q8DNtjRrEg==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/diagnostic-channel-publishers/-/diagnostic-channel-publishers-1.0.8.tgz", + "integrity": "sha512-HmSm9hXxSPxA9BaLGY98QU1zsdjeCk113KjAYGPCen1ZP6mhVaTPzHd6UYv5r21DnWANi+f+NyPOHruGT9jpqQ==", "requires": {} }, "diff": { @@ -11302,9 +13745,9 @@ "dev": true }, "diff-sequences": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.2.tgz", - "integrity": "sha512-R6P0Y6PrsH3n4hUXxL3nns0rbRk6Q33js3ygJBeEpbzLzgcNuJ61+u0RXasFpTKISw99TxUzFnumSnRLsjhLaw==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true }, "doctrine": { @@ -11344,14 +13787,14 @@ } }, "domutils": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.0.1.tgz", - "integrity": "sha512-z08c1l761iKhDFtfXO04C7kTdPBLi41zwOZl00WS8b5eiaebNpY00HKbztwBq+e3vyqWNwWF3mP9YLUeqIrF+Q==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", "dev": true, "requires": { "dom-serializer": "^2.0.0", "domelementtype": "^2.3.0", - "domhandler": "^5.0.1" + "domhandler": "^5.0.3" } }, "eastasianwidth": { @@ -11360,9 +13803,9 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" }, "electron-to-chromium": { - "version": "1.4.289", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.289.tgz", - "integrity": "sha512-relLdMfPBxqGCxy7Gyfm1HcbRPcFUJdlgnCPVgQ23sr1TvUrRJz0/QPoGP0+x41wOVSTN/Wi3w6YDgHiHJGOzg==", + "version": "1.4.719", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.719.tgz", + "integrity": "sha512-FbWy2Q2YgdFzkFUW/W5jBjE9dj+804+98E4Pup78JBPnbdb3pv6IneY2JCPKdeKLh3AOKHQeYf+KwLr7mxGh6Q==", "dev": true }, "emitter-listener": { @@ -11380,9 +13823,9 @@ "dev": true }, "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, "end-of-stream": { "version": "1.4.4", @@ -11395,9 +13838,9 @@ } }, "entities": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz", - "integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==", + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", "dev": true }, "error-ex": { @@ -11409,6 +13852,21 @@ "is-arrayish": "^0.2.1" } }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true + }, "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -11446,9 +13904,9 @@ } }, "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true }, "escape-string-regexp": { @@ -11458,165 +13916,113 @@ "dev": true }, "eslint": { - "version": "8.33.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.33.0.tgz", - "integrity": "sha512-WjOpFQgKK8VrCnAtl8We0SUOy/oVZ5NHykyMiagV1M9r8IFpIJX7DduK6n1mpfhlG7T1NLWm2SuD8QB7KFySaA==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "peer": true, "requires": { - "@eslint/eslintrc": "^1.4.1", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.3.2", "doctrine": "^3.0.0", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", + "graphemer": "^1.4.0", "ignore": "^5.2.0", - "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" }, "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "peer": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "peer": true - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "peer": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "peer": true, "requires": { - "is-glob": "^4.0.3" + "color-convert": "^2.0.1" } }, - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "peer": true, "requires": { - "type-fest": "^0.20.2" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" } }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "peer": true, "requires": { - "argparse": "^2.0.1" + "color-name": "~1.1.4" } }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, - "peer": true, - "requires": { - "p-locate": "^5.0.0" - } + "peer": true }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "peer": true, - "requires": { - "brace-expansion": "^1.1.7" - } + "peer": true }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, - "peer": true, - "requires": { - "yocto-queue": "^0.1.0" - } + "peer": true }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "peer": true, "requires": { - "p-limit": "^3.0.2" + "has-flag": "^4.0.0" } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "peer": true - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "peer": true } } }, @@ -11628,52 +14034,33 @@ "requires": {} }, "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, - "peer": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "peer": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "peer": true - } + "peer": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" } }, "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", "dev": true, "peer": true }, "espree": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", - "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "peer": true, "requires": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" + "eslint-visitor-keys": "^3.4.1" } }, "esprima": { @@ -11683,9 +14070,9 @@ "dev": true }, "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", "dev": true, "peer": true, "requires": { @@ -11731,6 +14118,14 @@ "onetime": "^5.1.2", "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" + }, + "dependencies": { + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + } } }, "exit": { @@ -11747,16 +14142,16 @@ "optional": true }, "expect": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/expect/-/expect-29.4.2.tgz", - "integrity": "sha512-+JHYg9O3hd3RlICG90OPVjRkPBoiUH7PxvDVMnRiaq1g6JUgZStX514erMl0v2Dc5SkfVbm7ztqbd6qHHPn+mQ==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", "dev": true, "requires": { - "@jest/expect-utils": "^29.4.2", - "jest-get-type": "^29.4.2", - "jest-matcher-utils": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-util": "^29.4.2" + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" } }, "fast-deep-equal": { @@ -11780,9 +14175,9 @@ "peer": true }, "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, "peer": true, "requires": { @@ -11818,9 +14213,9 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "requires": { "to-regex-range": "^5.0.1" } @@ -11834,15 +14229,32 @@ "commondir": "^1.0.1", "make-dir": "^3.0.2", "pkg-dir": "^4.1.0" + }, + "dependencies": { + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + } } }, "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dev": true, "requires": { - "locate-path": "^5.0.0", + "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, @@ -11862,31 +14274,31 @@ "dev": true }, "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "peer": true, "requires": { - "flatted": "^3.1.0", + "flatted": "^3.2.9", + "keyv": "^4.5.3", "rimraf": "^3.0.2" } }, "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", + "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true, "peer": true }, "foreground-child": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", - "dev": true, + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", + "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", "requires": { "cross-spawn": "^7.0.0", - "signal-exit": "^3.0.2" + "signal-exit": "^4.0.1" } }, "form-data": { @@ -11930,16 +14342,16 @@ "dev": true }, "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", "dev": true, "optional": true }, "function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" }, "gensync": { "version": "1.0.0-beta.2", @@ -11954,14 +14366,16 @@ "dev": true }, "get-intrinsic": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", - "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", "dev": true, "requires": { - "function-bind": "^1.1.1", - "has": "^1.0.3", - "has-symbols": "^1.0.3" + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" } }, "get-package-type": { @@ -11984,73 +14398,96 @@ "optional": true }, "glob": { - "version": "10.2.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.2.7.tgz", - "integrity": "sha512-jTKehsravOJo8IJxUGfZILnkvVJM/MOfHRs8QcXolVef2zNI9Tqyy5+SeuOAZd3upViEZQLyFpQhYiHLrMUNmA==", + "version": "10.3.10", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", + "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", "requires": { "foreground-child": "^3.1.0", - "jackspeak": "^2.0.3", + "jackspeak": "^2.3.5", "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2", - "path-scurry": "^1.7.0" + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", + "path-scurry": "^1.10.1" }, "dependencies": { - "foreground-child": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz", - "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==", + "brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "requires": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" + "balanced-match": "^1.0.0" } }, - "signal-exit": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.0.2.tgz", - "integrity": "sha512-MY2/qGx4enyjprQnFaZsHib3Yadh3IXyV2C321GY0pjGfVBu4un0uDJkwgdxqO+Rdx8JMT8IfJIRwbYVz3Ob3Q==" + "minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "requires": { + "brace-expansion": "^2.0.1" + } } } }, "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dev": true, + "peer": true, "requires": { - "is-glob": "^4.0.1" + "is-glob": "^4.0.3" } }, "globals": { - "version": "11.12.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "peer": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.3" + } }, "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true, "peer": true }, - "has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, "requires": { - "function-bind": "^1.1.1" + "es-define-property": "^1.0.0" } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", "dev": true }, "has-symbols": { @@ -12077,6 +14514,14 @@ } } }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "requires": { + "function-bind": "^1.1.2" + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -12099,23 +14544,24 @@ "dev": true }, "htmlparser2": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.1.tgz", - "integrity": "sha512-4lVbmc1diZC7GUJQtRQ5yBAeUCL1exyMwmForWkRLnwyzWBFxN633SALPMGYaWZvKe9j1pRZJpauvmxENSp/EA==", + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-8.0.2.tgz", + "integrity": "sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==", "dev": true, "requires": { "domelementtype": "^2.3.0", - "domhandler": "^5.0.2", + "domhandler": "^5.0.3", "domutils": "^3.0.1", - "entities": "^4.3.0" + "entities": "^4.4.0" } }, "http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "dev": true, "requires": { - "@tootallnate/once": "2", + "@tootallnate/once": "1", "agent-base": "6", "debug": "4" } @@ -12151,9 +14597,9 @@ "optional": true }, "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "peer": true }, @@ -12172,15 +14618,6 @@ "requires": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" - }, - "dependencies": { - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "peer": true - } } }, "import-in-the-middle": { @@ -12272,11 +14709,11 @@ } }, "is-core-module": { - "version": "2.11.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.11.0.tgz", - "integrity": "sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "requires": { - "has": "^1.0.3" + "hasown": "^2.0.0" } }, "is-docker": { @@ -12369,14 +14806,14 @@ "dev": true }, "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-3.1.1.tgz", + "integrity": "sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==" }, "istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true }, "istanbul-lib-hook": { @@ -12389,24 +14826,16 @@ } }, "istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.2.tgz", + "integrity": "sha512-1WUsZ9R1lA0HtBSohTkm39WTPlNKSJ5iFk7UwqXkBLoHQT+hfqPsfsTDVuZdKGaBwn7din9bS7SsnoAr943hvw==", "dev": true, "requires": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } + "semver": "^7.5.4" } }, "istanbul-lib-processinfo": { @@ -12424,14 +14853,31 @@ } }, "istanbul-lib-report": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, "requires": { "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", + "make-dir": "^4.0.0", "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "istanbul-lib-source-maps": { @@ -12446,9 +14892,9 @@ } }, "istanbul-reports": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.5.tgz", - "integrity": "sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, "requires": { "html-escaper": "^2.0.0", @@ -12456,147 +14902,250 @@ } }, "jackspeak": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.2.1.tgz", - "integrity": "sha512-MXbxovZ/Pm42f6cDIDkl3xpwv1AGwObKwfmjs2nQePiy85tP3fatofl3FC1aBsOtP/6fq5SbtgHwWcMsLP+bDw==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz", + "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==", "requires": { "@isaacs/cliui": "^8.0.2", "@pkgjs/parseargs": "^0.11.0" } }, "jest": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest/-/jest-29.4.2.tgz", - "integrity": "sha512-+5hLd260vNIHu+7ZgMIooSpKl7Jp5pHKb51e73AJU3owd5dEo/RfVwHbA/na3C/eozrt3hJOLGf96c7EWwIAzg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", "dev": true, "requires": { - "@jest/core": "^29.4.2", - "@jest/types": "^29.4.2", + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", "import-local": "^3.0.2", - "jest-cli": "^29.4.2" - }, - "dependencies": { - "jest-cli": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.4.2.tgz", - "integrity": "sha512-b+eGUtXq/K2v7SH3QcJvFvaUaCDS1/YAZBYz0m28Q/Ppyr+1qNaHmVYikOrbHVbZqYQs2IeI3p76uy6BWbXq8Q==", - "dev": true, - "requires": { - "@jest/core": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/types": "^29.4.2", - "chalk": "^4.0.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "import-local": "^3.0.2", - "jest-config": "^29.4.2", - "jest-util": "^29.4.2", - "jest-validate": "^29.4.2", - "prompts": "^2.0.1", - "yargs": "^17.3.1" - } - } + "jest-cli": "^29.7.0" } }, "jest-changed-files": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.4.2.tgz", - "integrity": "sha512-Qdd+AXdqD16PQa+VsWJpxR3kN0JyOCX1iugQfx5nUgAsI4gwsKviXkpclxOK9ZnwaY2IQVHz+771eAvqeOlfuw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", "dev": true, "requires": { "execa": "^5.0.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0" - }, - "dependencies": { - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - } } }, "jest-circus": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.4.2.tgz", - "integrity": "sha512-wW3ztp6a2P5c1yOc1Cfrt5ozJ7neWmqeXm/4SYiqcSriyisgq63bwFj1NuRdSR5iqS0CMEYwSZd89ZA47W9zUg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", "dev": true, "requires": { - "@jest/environment": "^29.4.2", - "@jest/expect": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/types": "^29.4.2", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", - "dedent": "^0.7.0", + "dedent": "^1.0.0", "is-generator-fn": "^2.0.0", - "jest-each": "^29.4.2", - "jest-matcher-utils": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-runtime": "^29.4.2", - "jest-snapshot": "^29.4.2", - "jest-util": "^29.4.2", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0", - "pretty-format": "^29.4.2", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, "dependencies": { - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "requires": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "yocto-queue": "^0.1.0" + "has-flag": "^4.0.0" } } } }, "jest-config": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.4.2.tgz", - "integrity": "sha512-919CtnXic52YM0zW4C1QxjG6aNueX1kBGthuMtvFtRTAxhKfJmiXC9qwHmi6o2josjbDz8QlWyY55F1SIVmCWA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", "dev": true, "requires": { "@babel/core": "^7.11.6", - "@jest/test-sequencer": "^29.4.2", - "@jest/types": "^29.4.2", - "babel-jest": "^29.4.2", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", "chalk": "^4.0.0", "ci-info": "^3.2.0", "deepmerge": "^4.2.2", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-circus": "^29.4.2", - "jest-environment-node": "^29.4.2", - "jest-get-type": "^29.4.2", - "jest-regex-util": "^29.4.2", - "jest-resolve": "^29.4.2", - "jest-runner": "^29.4.2", - "jest-util": "^29.4.2", - "jest-validate": "^29.4.2", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "micromatch": "^4.0.4", "parse-json": "^5.2.0", - "pretty-format": "^29.4.2", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "strip-json-comments": "^3.1.1" }, "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "color-name": "~1.1.4" } }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -12611,181 +15160,425 @@ "path-is-absolute": "^1.0.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "has-flag": "^4.0.0" } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true } } }, "jest-diff": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.4.2.tgz", - "integrity": "sha512-EK8DSajVtnjx9sa1BkjZq3mqChm2Cd8rIzdXkQMA8e0wuXq53ypz6s5o5V8HRZkoEt2ywJ3eeNWFKWeYr8HK4g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", "dev": true, "requires": { "chalk": "^4.0.0", - "diff-sequences": "^29.4.2", - "jest-get-type": "^29.4.2", - "pretty-format": "^29.4.2" + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "jest-docblock": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.4.2.tgz", - "integrity": "sha512-dV2JdahgClL34Y5vLrAHde3nF3yo2jKRH+GIYJuCpfqwEJZcikzeafVTGAjbOfKPG17ez9iWXwUYp7yefeCRag==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "requires": { "detect-newline": "^3.0.0" } }, "jest-each": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.4.2.tgz", - "integrity": "sha512-trvKZb0JYiCndc55V1Yh0Luqi7AsAdDWpV+mKT/5vkpnnFQfuQACV72IoRV161aAr6kAVIBpmYzwhBzm34vQkA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "requires": { - "@jest/types": "^29.4.2", + "@jest/types": "^29.6.3", "chalk": "^4.0.0", - "jest-get-type": "^29.4.2", - "jest-util": "^29.4.2", - "pretty-format": "^29.4.2" + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "jest-environment-node": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.4.2.tgz", - "integrity": "sha512-MLPrqUcOnNBc8zTOfqBbxtoa8/Ee8tZ7UFW7hRDQSUT+NGsvS96wlbHGTf+EFAT9KC3VNb7fWEM6oyvmxtE/9w==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, "requires": { - "@jest/environment": "^29.4.2", - "@jest/fake-timers": "^29.4.2", - "@jest/types": "^29.4.2", + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-mock": "^29.4.2", - "jest-util": "^29.4.2" + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" } }, "jest-get-type": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.4.2.tgz", - "integrity": "sha512-vERN30V5i2N6lqlFu4ljdTqQAgrkTFMC9xaIIfOPYBw04pufjXRty5RuXBiB1d72tGbURa/UgoiHB90ruOSivg==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", "dev": true }, "jest-haste-map": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.4.2.tgz", - "integrity": "sha512-WkUgo26LN5UHPknkezrBzr7lUtV1OpGsp+NfXbBwHztsFruS3gz+AMTTBcEklvi8uPzpISzYjdKXYZQJXBnfvw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", "dev": true, "requires": { - "@jest/types": "^29.4.2", + "@jest/types": "^29.6.3", "@types/graceful-fs": "^4.1.3", "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", "fsevents": "^2.3.2", "graceful-fs": "^4.2.9", - "jest-regex-util": "^29.4.2", - "jest-util": "^29.4.2", - "jest-worker": "^29.4.2", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", "micromatch": "^4.0.4", "walker": "^1.0.8" } }, "jest-jasmine2": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-29.4.2.tgz", - "integrity": "sha512-9BqsCw467c+xpFQ8DaPDchg9Z412yGqeHg7UEO5L7RI2NpevVudyvQp2aLhhPy0RbILFVuGBzv3ZSmYe4/hrsw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-29.7.0.tgz", + "integrity": "sha512-N3nRpBVTM5erHtMi6ODBUEqG/LpVgSJC8qk14duw88d9Eigx2vL+n4LF1d8eV8pegnnzKyNHdTGxa/NsIKj0Zw==", "dev": true, "requires": { - "@jest/environment": "^29.4.2", - "@jest/expect": "^29.4.2", - "@jest/source-map": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/types": "^29.4.2", + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "co": "^4.6.0", "is-generator-fn": "^2.0.0", - "jest-each": "^29.4.2", - "jest-matcher-utils": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-runtime": "^29.4.2", - "jest-snapshot": "^29.4.2", - "jest-util": "^29.4.2", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "p-limit": "^3.1.0", - "pretty-format": "^29.4.2" + "pretty-format": "^29.7.0" }, "dependencies": { - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "yocto-queue": "^0.1.0" + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" } } } }, "jest-leak-detector": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.4.2.tgz", - "integrity": "sha512-Wa62HuRJmWXtX9F00nUpWlrbaH5axeYCdyRsOs/+Rb1Vb6+qWTlB5rKwCCRKtorM7owNwKsyJ8NRDUcZ8ghYUA==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "requires": { - "jest-get-type": "^29.4.2", - "pretty-format": "^29.4.2" + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" } }, "jest-matcher-utils": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.4.2.tgz", - "integrity": "sha512-EZaAQy2je6Uqkrm6frnxBIdaWtSYFoR8SVb2sNLAtldswlR/29JAgx+hy67llT3+hXBaLB0zAm5UfeqerioZyg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "requires": { "chalk": "^4.0.0", - "jest-diff": "^29.4.2", - "jest-get-type": "^29.4.2", - "pretty-format": "^29.4.2" + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "jest-message-util": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.4.2.tgz", - "integrity": "sha512-SElcuN4s6PNKpOEtTInjOAA8QvItu0iugkXqhYyguRvQoXapg5gN+9RQxLAkakChZA7Y26j6yUCsFWN+hlKD6g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "requires": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^29.4.2", + "@jest/types": "^29.6.3", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^29.4.2", + "pretty-format": "^29.7.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "jest-mock": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.4.2.tgz", - "integrity": "sha512-x1FSd4Gvx2yIahdaIKoBjwji6XpboDunSJ95RpntGrYulI1ByuYQCKN/P7hvk09JB74IonU3IPLdkutEWYt++g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "requires": { - "@jest/types": "^29.4.2", + "@jest/types": "^29.6.3", "@types/node": "*", - "jest-util": "^29.4.2" + "jest-util": "^29.7.0" } }, "jest-pnp-resolver": { @@ -12796,119 +15589,233 @@ "requires": {} }, "jest-regex-util": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.4.2.tgz", - "integrity": "sha512-XYZXOqUl1y31H6VLMrrUL1ZhXuiymLKPz0BO1kEeR5xER9Tv86RZrjTm74g5l9bPJQXA/hyLdaVPN/sdqfteig==", + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true }, "jest-resolve": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.4.2.tgz", - "integrity": "sha512-RtKWW0mbR3I4UdkOrW7552IFGLYQ5AF9YrzD0FnIOkDu0rAMlA5/Y1+r7lhCAP4nXSBTaE7ueeqj6IOwZpgoqw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", "dev": true, "requires": { "chalk": "^4.0.0", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.4.2", + "jest-haste-map": "^29.7.0", "jest-pnp-resolver": "^1.2.2", - "jest-util": "^29.4.2", - "jest-validate": "^29.4.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", "resolve": "^1.20.0", "resolve.exports": "^2.0.0", "slash": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "jest-resolve-dependencies": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.4.2.tgz", - "integrity": "sha512-6pL4ptFw62rjdrPk7rRpzJYgcRqRZNsZTF1VxVTZMishbO6ObyWvX57yHOaNGgKoADtAHRFYdHQUEvYMJATbDg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, "requires": { - "jest-regex-util": "^29.4.2", - "jest-snapshot": "^29.4.2" + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" } }, "jest-runner": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.4.2.tgz", - "integrity": "sha512-wqwt0drm7JGjwdH+x1XgAl+TFPH7poowMguPQINYxaukCqlczAcNLJiK+OLxUxQAEWMdy+e6nHZlFHO5s7EuRg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", "dev": true, "requires": { - "@jest/console": "^29.4.2", - "@jest/environment": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/transform": "^29.4.2", - "@jest/types": "^29.4.2", + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "emittery": "^0.13.1", "graceful-fs": "^4.2.9", - "jest-docblock": "^29.4.2", - "jest-environment-node": "^29.4.2", - "jest-haste-map": "^29.4.2", - "jest-leak-detector": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-resolve": "^29.4.2", - "jest-runtime": "^29.4.2", - "jest-util": "^29.4.2", - "jest-watcher": "^29.4.2", - "jest-worker": "^29.4.2", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", "p-limit": "^3.1.0", "source-map-support": "0.5.13" }, "dependencies": { - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "yocto-queue": "^0.1.0" + "has-flag": "^4.0.0" } } } }, "jest-runtime": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.4.2.tgz", - "integrity": "sha512-3fque9vtpLzGuxT9eZqhxi+9EylKK/ESfhClv4P7Y9sqJPs58LjVhTt8jaMp/pRO38agll1CkSu9z9ieTQeRrw==", - "dev": true, - "requires": { - "@jest/environment": "^29.4.2", - "@jest/fake-timers": "^29.4.2", - "@jest/globals": "^29.4.2", - "@jest/source-map": "^29.4.2", - "@jest/test-result": "^29.4.2", - "@jest/transform": "^29.4.2", - "@jest/types": "^29.4.2", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "requires": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "cjs-module-lexer": "^1.0.0", "collect-v8-coverage": "^1.0.0", "glob": "^7.1.3", "graceful-fs": "^4.2.9", - "jest-haste-map": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-mock": "^29.4.2", - "jest-regex-util": "^29.4.2", - "jest-resolve": "^29.4.2", - "jest-snapshot": "^29.4.2", - "jest-util": "^29.4.2", - "semver": "^7.3.5", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", "slash": "^3.0.0", "strip-bom": "^4.0.0" }, "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "color-name": "~1.1.4" } }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -12923,65 +15830,98 @@ "path-is-absolute": "^1.0.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "lru-cache": "^6.0.0" + "has-flag": "^4.0.0" } } } }, "jest-snapshot": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.4.2.tgz", - "integrity": "sha512-PdfubrSNN5KwroyMH158R23tWcAXJyx4pvSvWls1dHoLCaUhGul9rsL3uVjtqzRpkxlkMavQjGuWG1newPgmkw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "requires": { "@babel/core": "^7.11.6", "@babel/generator": "^7.7.2", "@babel/plugin-syntax-jsx": "^7.7.2", "@babel/plugin-syntax-typescript": "^7.7.2", - "@babel/traverse": "^7.7.2", "@babel/types": "^7.3.3", - "@jest/expect-utils": "^29.4.2", - "@jest/transform": "^29.4.2", - "@jest/types": "^29.4.2", - "@types/babel__traverse": "^7.0.6", - "@types/prettier": "^2.1.5", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", "babel-preset-current-node-syntax": "^1.0.0", "chalk": "^4.0.0", - "expect": "^29.4.2", + "expect": "^29.7.0", "graceful-fs": "^4.2.9", - "jest-diff": "^29.4.2", - "jest-get-type": "^29.4.2", - "jest-haste-map": "^29.4.2", - "jest-matcher-utils": "^29.4.2", - "jest-message-util": "^29.4.2", - "jest-util": "^29.4.2", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", "natural-compare": "^1.4.0", - "pretty-format": "^29.4.2", - "semver": "^7.3.5" + "pretty-format": "^29.7.0", + "semver": "^7.5.3" }, "dependencies": { - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { - "lru-cache": "^6.0.0" + "has-flag": "^4.0.0" } } } @@ -12996,69 +15936,226 @@ } }, "jest-util": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.4.2.tgz", - "integrity": "sha512-wKnm6XpJgzMUSRFB7YF48CuwdzuDIHenVuoIb1PLuJ6F+uErZsuDkU+EiExkChf6473XcawBrSfDSnXl+/YG4g==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, "requires": { - "@jest/types": "^29.4.2", + "@jest/types": "^29.6.3", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", "graceful-fs": "^4.2.9", "picomatch": "^2.2.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "jest-validate": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.4.2.tgz", - "integrity": "sha512-tto7YKGPJyFbhcKhIDFq8B5od+eVWD/ySZ9Tvcp/NGCvYA4RQbuzhbwYWtIjMT5W5zA2W0eBJwu4HVw34d5G6Q==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, "requires": { - "@jest/types": "^29.4.2", + "@jest/types": "^29.6.3", "camelcase": "^6.2.0", "chalk": "^4.0.0", - "jest-get-type": "^29.4.2", + "jest-get-type": "^29.6.3", "leven": "^3.1.0", - "pretty-format": "^29.4.2" + "pretty-format": "^29.7.0" }, "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, "camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } } } }, "jest-watcher": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.4.2.tgz", - "integrity": "sha512-onddLujSoGiMJt+tKutehIidABa175i/Ays+QvKxCqBwp7fvxP3ZhKsrIdOodt71dKxqk4sc0LN41mWLGIK44w==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, "requires": { - "@jest/test-result": "^29.4.2", - "@jest/types": "^29.4.2", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "emittery": "^0.13.1", - "jest-util": "^29.4.2", + "jest-util": "^29.7.0", "string-length": "^4.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "jest-worker": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.4.2.tgz", - "integrity": "sha512-VIuZA2hZmFyRbchsUCHEehoSf2HEl0YVF8SDJqtPnKorAaBuh42V8QsLnde0XP5F6TyCynGPEGgBOn3Fc+wZGw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, "requires": { "@types/node": "*", - "jest-util": "^29.4.2", + "jest-util": "^29.7.0", "merge-stream": "^2.0.0", "supports-color": "^8.0.0" }, "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -13070,13 +16167,6 @@ } } }, - "js-sdsl": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", - "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", - "dev": true, - "peer": true - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -13084,24 +16174,12 @@ "dev": true }, "js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "dependencies": { - "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dev": true, - "requires": { - "sprintf-js": "~1.0.2" - } - } + "argparse": "^2.0.1" } }, "jsesc": { @@ -13110,6 +16188,13 @@ "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, + "json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true, + "peer": true + }, "json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -13137,9 +16222,9 @@ "dev": true }, "jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.1.tgz", + "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", "dev": true }, "jsonfile": { @@ -13175,6 +16260,16 @@ "prebuild-install": "^7.0.1" } }, + "keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "peer": true, + "requires": { + "json-buffer": "3.0.1" + } + }, "klaw-sync": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz", @@ -13232,12 +16327,12 @@ } }, "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dev": true, "requires": { - "p-locate": "^4.1.0" + "p-locate": "^5.0.0" } }, "lodash.flattendeep": { @@ -13267,6 +16362,57 @@ "requires": { "chalk": "^4.1.0", "is-unicode-supported": "^0.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } } }, "lru-cache": { @@ -13278,20 +16424,12 @@ } }, "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, "requires": { - "semver": "^6.0.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } + "semver": "^7.5.3" } }, "make-error": { @@ -13343,11 +16481,11 @@ "dev": true }, "micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "requires": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" } }, @@ -13384,23 +16522,23 @@ "optional": true }, "minimatch": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.1.tgz", - "integrity": "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", "requires": { - "brace-expansion": "^2.0.1" + "brace-expansion": "^1.1.7" } }, "minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true }, "minipass": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-6.0.2.tgz", - "integrity": "sha512-MzWSV5nYVT7mVyWCwn2o7JH13w2TBRmmSqSRCKzTw+lmft9X4z+3wjvs06Tzijo5z4W/kahUCDpRXTF+ZrmF/w==" + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz", + "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==" }, "mkdirp": { "version": "0.5.6", @@ -13419,9 +16557,9 @@ "optional": true }, "mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz", + "integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==", "dev": true, "requires": { "ansi-colors": "4.1.1", @@ -13431,13 +16569,12 @@ "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.2.0", + "glob": "8.1.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", - "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", @@ -13447,14 +16584,22 @@ "yargs-unparser": "2.0.0" }, "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0" } }, "cliui": { @@ -13468,64 +16613,51 @@ "wrap-ansi": "^7.0.0" } }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" + "color-name": "~1.1.4" } }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "dependencies": { - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" + "minimatch": "^5.0.1", + "once": "^1.3.0" } }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, "minimatch": { "version": "5.0.1", @@ -13534,17 +16666,6 @@ "dev": true, "requires": { "brace-expansion": "^2.0.1" - }, - "dependencies": { - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0" - } - } } }, "ms": { @@ -13553,30 +16674,17 @@ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { - "p-limit": "^3.0.2" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" } }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, "supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -13586,6 +16694,17 @@ "has-flag": "^4.0.0" } }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, "yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", @@ -13600,12 +16719,6 @@ "y18n": "^5.0.5", "yargs-parser": "^20.2.2" } - }, - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true } } }, @@ -13625,12 +16738,6 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, - "nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "dev": true - }, "napi-build-utils": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", @@ -13651,25 +16758,13 @@ "dev": true }, "node-abi": { - "version": "3.32.0", - "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.32.0.tgz", - "integrity": "sha512-HkwdiLzE/LeuOMIQq/dJq70oNyRc88+wt5CH/RXYseE00LkA/c4PkS6Ti1vE4OHYUiKjkwuxjWq9pItgrz8UJw==", + "version": "3.56.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.56.0.tgz", + "integrity": "sha512-fZjdhDOeRcaS+rcpve7XuwHBmktS1nS1gzgghwKUQQ8nTy2FdSDr6ZT8k6YhvlJeHmmQMYiT/IH9hfco5zeW2Q==", "dev": true, "optional": true, "requires": { "semver": "^7.3.5" - }, - "dependencies": { - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "optional": true, - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "node-addon-api": { @@ -13695,9 +16790,9 @@ } }, "node-releases": { - "version": "2.0.10", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz", - "integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==", + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.14.tgz", + "integrity": "sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==", "dev": true }, "normalize-path": { @@ -13759,14 +16854,13 @@ "yargs": "^15.0.2" }, "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "color-convert": "^2.0.1" } }, "cliui": { @@ -13780,18 +16874,53 @@ "wrap-ansi": "^6.2.0" } }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, - "decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -13818,21 +16947,71 @@ "semver": "^6.3.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "p-limit": "^2.2.0" } }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + }, "semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "dev": true }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", @@ -13882,9 +17061,9 @@ } }, "object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "dev": true }, "once": { @@ -13937,21 +17116,21 @@ "dev": true }, "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "requires": { - "p-try": "^2.0.0" + "yocto-queue": "^0.1.0" } }, "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, "requires": { - "p-limit": "^2.2.0" + "p-limit": "^3.0.2" } }, "p-map": { @@ -14016,6 +17195,14 @@ "dev": true, "requires": { "semver": "^5.1.0" + }, + "dependencies": { + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + } } }, "parse5": { @@ -14059,16 +17246,40 @@ "yaml": "^1.10.2" }, "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "color-name": "~1.1.4" } }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -14108,14 +17319,11 @@ "path-is-absolute": "^1.0.0" } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true }, "path-key": { "version": "2.0.1", @@ -14132,6 +17340,12 @@ "glob": "^7.1.3" } }, + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -14153,6 +17367,15 @@ "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", "dev": true }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", @@ -14168,7 +17391,7 @@ "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" } } } @@ -14196,18 +17419,18 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "path-scurry": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.9.2.tgz", - "integrity": "sha512-qSDLy2aGFPm8i4rsbHd4MNyTcrzHFsLQykrtbuGRknZZCBBVXSv2tSCDN2Cg6Rt/GFRw8GoW9y9Ecw5rIPG1sg==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", + "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", "requires": { - "lru-cache": "^9.1.1", - "minipass": "^5.0.0 || ^6.0.2" + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "dependencies": { "lru-cache": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-9.1.2.tgz", - "integrity": "sha512-ERJq3FOzJTxBbFjZ7iDs+NiK4VI9Wz+RdrrAB8dio1oV+YvdPzUEE4QNiT2VD51DkIbCYRUUzCRkssXCHqSnKQ==" + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==" } } }, @@ -14229,9 +17452,9 @@ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" }, "pirates": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", - "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz", + "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true }, "pkg-dir": { @@ -14241,12 +17464,51 @@ "dev": true, "requires": { "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + } } }, "prebuild-install": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", - "integrity": "sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", + "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", "dev": true, "optional": true, "requires": { @@ -14278,12 +17540,12 @@ "dev": true }, "pretty-format": { - "version": "29.4.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.4.2.tgz", - "integrity": "sha512-qKlHR8yFVCbcEWba0H0TOC8dnLlO4vPlyEjRPw31FZ2Rupy9nLa8ZLbYny8gWEl8CkEhJqAE6IzdNELTBVcBEg==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "requires": { - "@jest/schemas": "^29.4.2", + "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", "react-is": "^18.0.0" }, @@ -14333,19 +17595,25 @@ } }, "punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "peer": true }, + "pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true + }, "qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.12.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.12.0.tgz", + "integrity": "sha512-trVZiI6RMOkO476zLGaBIzszOdFPnCCXHPG9kn0yuS1uz6xdVxPfZdB3vUig9pxPFDM9BRAgz/YUIVQ1/vuiUg==", "dev": true, "requires": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" } }, "queue-microtask": { @@ -14375,6 +17643,15 @@ "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "optional": true + } } }, "react-is": { @@ -14416,13 +17693,6 @@ "picomatch": "^2.2.1" } }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "peer": true - }, "release-zalgo": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", @@ -14439,9 +17709,9 @@ "dev": true }, "require-in-the-middle": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.2.0.tgz", - "integrity": "sha512-3TLx5TGyAY6AOqLBoXmHkNql0HIf2RGbuMgCDT2WO/uGVAPJs6h7Kl+bN6TIZGd9bWhWPwnDnTHGtW8Iu77sdw==", + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/require-in-the-middle/-/require-in-the-middle-7.3.0.tgz", + "integrity": "sha512-nQFEv9gRw6SJAwWD2LrL0NmQvAcO7FBwJbwmr2ttPAacfy0xuiOjE5zt+zM4xDyuyvUaxBi/9gb2SoCyNEVJcw==", "requires": { "debug": "^4.1.1", "module-details-from-path": "^1.0.3", @@ -14455,11 +17725,11 @@ "dev": true }, "resolve": { - "version": "1.22.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", - "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "requires": { - "is-core-module": "^2.9.0", + "is-core-module": "^2.13.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" } @@ -14471,18 +17741,27 @@ "dev": true, "requires": { "resolve-from": "^5.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } } }, "resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "peer": true }, "resolve.exports": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.0.tgz", - "integrity": "sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz", + "integrity": "sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==", "dev": true }, "reusify": { @@ -14501,16 +17780,6 @@ "glob": "^7.1.3" }, "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -14524,15 +17793,6 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } } } }, @@ -14558,15 +17818,18 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.3.0.tgz", + "integrity": "sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==", "dev": true }, "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==" + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", + "requires": { + "lru-cache": "^6.0.0" + } }, "serialize-javascript": { "version": "6.0.0", @@ -14583,6 +17846,20 @@ "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", "dev": true }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, "setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -14608,21 +17885,21 @@ "integrity": "sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==" }, "side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", "dev": true, "requires": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" } }, "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", - "dev": true + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" }, "simple-concat": { "version": "1.0.1", @@ -14683,6 +17960,39 @@ "rimraf": "^3.0.0", "signal-exit": "^3.0.2", "which": "^2.0.1" + }, + "dependencies": { + "foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + } + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + } } }, "sprintf-js": { @@ -14733,13 +18043,28 @@ } }, "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" + }, + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "requires": { + "ansi-regex": "^6.0.1" + } + } } }, "string-width-cjs": { @@ -14750,6 +18075,13 @@ "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + } } }, "strip-ansi": { @@ -14781,19 +18113,18 @@ "dev": true }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", - "dev": true, - "optional": true + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true }, "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { - "has-flag": "^4.0.0" + "has-flag": "^3.0.0" } }, "supports-preserve-symlinks-flag": { @@ -14829,9 +18160,9 @@ }, "dependencies": { "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", "dev": true, "optional": true, "requires": { @@ -14853,16 +18184,6 @@ "minimatch": "^3.0.4" }, "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, "glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -14876,15 +18197,6 @@ "once": "^1.3.0", "path-is-absolute": "^1.0.0" } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } } } }, @@ -14896,13 +18208,10 @@ "peer": true }, "tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, - "requires": { - "rimraf": "^3.0.0" - } + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "dev": true }, "tmpl": { "version": "1.0.5", @@ -14925,9 +18234,9 @@ } }, "ts-jest": { - "version": "29.0.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.0.5.tgz", - "integrity": "sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==", + "version": "29.1.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.1.2.tgz", + "integrity": "sha512-br6GJoH/WUX4pu7FbZXuWGKGNDuU7b8Uj77g/Sp7puZV6EXzuByl6JrECvm0MzVzSTkSHWTihsXt+5XYER5b+g==", "dev": true, "requires": { "bs-logger": "0.x", @@ -14936,25 +18245,22 @@ "json5": "^2.2.3", "lodash.memoize": "4.x", "make-error": "1.x", - "semver": "7.x", + "semver": "^7.5.3", "yargs-parser": "^21.0.1" }, "dependencies": { - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "requires": { - "lru-cache": "^6.0.0" - } + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true } } }, "tslib": { - "version": "2.5.3", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.3.tgz", - "integrity": "sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==" + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "tslint": { "version": "5.20.1", @@ -14977,51 +18283,15 @@ "tsutils": "^2.29.0" }, "dependencies": { - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "color-name": "1.1.3" + "sprintf-js": "~1.0.2" } }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", @@ -15048,29 +18318,21 @@ "path-is-absolute": "^1.0.0" } }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } + "semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true }, "tslib": { "version": "1.14.1", @@ -15130,15 +18392,16 @@ "dev": true }, "type-fest": { - "version": "0.21.3", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", - "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", - "dev": true + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "peer": true }, "typed-rest-client": { - "version": "1.8.9", - "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.9.tgz", - "integrity": "sha512-uSmjE38B80wjL85UFX3sTYEUlvZ1JgCRhsWj/fJ4rZ0FqDUFoIuodtiVeE+cUqiVTOKPdKrp/sdftD15MDek6g==", + "version": "1.8.11", + "resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.11.tgz", + "integrity": "sha512-5UvfMpd1oelmUPRbbaVnq+rHP7ng2cE4qoQkQeAqxRL6PklkxsM0g32/HL0yfvruK6ojQ5x8EE+HF4YV6DtuCA==", "dev": true, "requires": { "qs": "^6.9.1", @@ -15158,7 +18421,8 @@ "typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==" + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true }, "uc.micro": { "version": "1.0.6", @@ -15173,15 +18437,15 @@ "dev": true }, "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true }, "update-browserslist-db": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz", - "integrity": "sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "dev": true, "requires": { "escalade": "^3.1.1", @@ -15216,22 +18480,14 @@ "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" }, "v8-to-istanbul": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz", - "integrity": "sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", "dev": true, "requires": { "@jridgewell/trace-mapping": "^0.3.12", "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0" - }, - "dependencies": { - "convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true - } + "convert-source-map": "^2.0.0" } }, "vscode-jsonrpc": { @@ -15247,33 +18503,6 @@ "minimatch": "^3.0.4", "semver": "^7.3.5", "vscode-languageserver-protocol": "3.17.2" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "requires": { - "lru-cache": "^6.0.0" - } - } } }, "vscode-languageserver-protocol": { @@ -15304,13 +18533,13 @@ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "requires": { - "isexe": "^2.0.0" + "isexe": "^3.1.1" } }, "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", "dev": true }, "workerpool": { @@ -15320,14 +18549,33 @@ "dev": true }, "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" + }, + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==" + }, + "strip-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "requires": { + "ansi-regex": "^6.0.1" + } + } } }, "wrap-ansi-cjs": { @@ -15338,6 +18586,44 @@ "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + } } }, "wrappy": { @@ -15354,6 +18640,14 @@ "requires": { "imurmurhash": "^0.1.4", "signal-exit": "^3.0.7" + }, + "dependencies": { + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + } } }, "xml": { @@ -15396,9 +18690,9 @@ "dev": true }, "yargs": { - "version": "17.6.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", - "integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, "requires": { "cliui": "^8.0.1", @@ -15408,12 +18702,37 @@ "string-width": "^4.2.3", "y18n": "^5.0.5", "yargs-parser": "^21.1.1" + }, + "dependencies": { + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true + } } }, "yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", "dev": true }, "yargs-unparser": { @@ -15433,6 +18752,12 @@ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", "dev": true + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true } } }, diff --git a/clients/cobol-lsp-vscode-extension/package.json b/clients/cobol-lsp-vscode-extension/package.json index b8fb235b9d..b14868df76 100644 --- a/clients/cobol-lsp-vscode-extension/package.json +++ b/clients/cobol-lsp-vscode-extension/package.json @@ -4,7 +4,7 @@ "description": "Autocomplete, highlighting and diagnostics for COBOL code and copybooks.", "author": "Broadcom", "license": "EPL-2.0", - "version": "2.1.1", + "version": "2.1.2", "preview": false, "publisher": "BroadcomMFD", "engines": { @@ -41,40 +41,52 @@ "commands": [ { "command": "cobol-lsp.cpy-manager.fetch-copybook", - "title": "Fetch copybook" + "category": "COBOL", + "title": "Fetch Copybook" }, { "command": "cobol-lsp.cpy-manager.goto-settings", - "title": "Open Copybook location settings" + "category": "COBOL", + "title": "Open Copybook Location Settings" }, { "command": "cobol-lsp.serverRuntime.goto-settings", - "title": "Open serverRuntime settings" + "category": "COBOL", + "title": "Open Server Runtime Settings" }, { "command": "cobol-lsp.dialects.goto-settings", - "title": "Open Dialects settings" + "category": "COBOL", + "title": "Open Dialect Settings" }, { "command": "cobol-lsp.commentLine.toggle", + "category": "COBOL", "title": "Toggle COBOL Line Comment" }, { "command": "cobol-lsp.commentLine.comment", - "title": "Add Cobol Line Comment" + "category": "COBOL", + "title": "Add COBOL Line Comment" }, { "command": "cobol-lsp.commentLine.uncomment", + "category": "COBOL", "title": "Remove COBOL Line Comment" }, { "command": "cobol-lsp.clear.downloaded.copybooks", - "title": "Clear downloaded copybooks" + "category": "COBOL", + "title": "Clear Downloaded Copybooks" }, { "command": "cobol-lsp.snippets.insertSnippets", "title": "Insert COBOL Snippet", "category": "Snippets" + }, + { + "command": "cobol-lsp.open.copybook.internalfolder", + "title": "Open Copybooks Internal Folder" } ], "languages": [ @@ -92,6 +104,27 @@ ], "configuration": "./syntaxes/lang-config.json", "firstLine": "^[0-9 ]{6}([*].*|[ Dd] *([Ii][Dd]([Ee][Nn][Tt][Ii][Ff][Ii][Cc][Aa][Tt][Ii][Oo][Nn])? +[Dd][Ii][Vv][Ii][Ss][Ii][Oo][Nn][. ]|[0-9][0-9] +[@#$A-Z][-A-Z0-9]*[. ]|[*](CBL|PROCESS) ).*)$|^([0-9].{5})?[ ]*(CBL|PROCESS) " + }, + { + "id": "expcobol", + "aliases": [ + "EXP-COBOL" + ], + "configuration": "./syntaxes/lang-config.json" + }, + { + "id": "hpcobol", + "extensions": [ + ".hpcbl", + ".hpcobol", + ".hp", + "ecobol" + ], + "aliases": [ + "HP-COBOL" + ], + "configuration": "./syntaxes/lang-config-hp.json", + "firstLine": "^[ ]( *([Ii][Dd]([Ee][Nn][Tt][Ii][Ff][Ii][Cc][Aa][Tt][Ii][Oo][Nn])? +[Dd][Ii][Vv][Ii][Ss][Ii][Oo][Nn][.].*?)$|^\\?.*" } ], "grammars": [ @@ -103,6 +136,14 @@ "meta.embedded.block.html": "html" } }, + { + "language": "expcobol", + "scopeName": "source.cobol", + "path": "./syntaxes/COBOL.tmLanguage.json", + "embeddedLanguages": { + "meta.embedded.block.html": "html" + } + }, { "scopeName": "meta.embedded.block.cics", "path": "./syntaxes/CICS.tmLanguage.json", @@ -119,6 +160,14 @@ "injectTo": [ "source.cobol" ] + }, + { + "language": "hpcobol", + "scopeName": "source.hpcobol", + "path": "./syntaxes/HP.COBOL.tmLanguage.json", + "embeddedLanguages": { + "meta.embedded.block.html": "html" + } } ], "configuration": { @@ -427,6 +476,25 @@ 80 ], "editor.wordSeparators": "!\"#$%&'()*+,./:;<=>?@[\\]^`{|}~" + }, + "[expcobol]": { + "editor.guides.indentation": false, + "editor.rulers": [ + 7, + 11, + 72, + 80 + ], + "editor.wordSeparators": "!\"#$%&'()*+,./:;<=>?@[\\]^`{|}~" + }, + "[hpcobol]": { + "editor.guides.indentation": false, + "editor.rulers": [ + 1, + 5, + 132 + ], + "editor.wordSeparators": "!\"#$%&'()*+,./:;<=>?@[\\]^`{|}~" } }, "keybindings": [ @@ -475,10 +543,10 @@ }, "dependencies": { "@code4z/cobol-dialect-api": "file:../cobol-dialect-api", - "glob": "10.2.7", - "iconv-lite": "^0.6.3", - "micromatch": "4.0.5", "@vscode/extension-telemetry": "^0.8.2", + "glob": "10.3.10", + "iconv-lite": "^0.6.3", + "micromatch": "^4.0.7", "vscode-languageclient": "8.0.2" }, "devDependencies": { @@ -504,5 +572,8 @@ "ts-jest": "^29.0.1", "tslint": "^5.18.0", "typescript": "^4.9.4" + }, + "overrides": { + "isexe": "^3.1.1" } } diff --git a/clients/cobol-lsp-vscode-extension/src/__mocks__/getE4EMock.utility.ts b/clients/cobol-lsp-vscode-extension/src/__mocks__/getE4EMock.utility.ts new file mode 100644 index 0000000000..2f36a7c04b --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/__mocks__/getE4EMock.utility.ts @@ -0,0 +1,187 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ + +import { + E4E, + e4eResponse, + EndevorElement, + EndevorMember, +} from "../type/e4eApi.d"; + +export const e4eMock: E4E = { + getConfiguration: jest.fn().mockReturnValue({ + pgms: [ + { + program: "program", + pgroup: "pgroup", + }, + ], + pgroups: [ + { + name: "pgroup", + libs: [ + { dataset: "dataset" }, + { + environment: "environment", + stage: "stage", + system: "system", + subsystem: "subsystem", + type: "type", + use_map: false, + }, + ], + }, + ], + }), + getProfileInfo: jest.fn().mockReturnValue({ + profile: "profile", + instance: "instance", + }), + isEndevorElement: jest.fn().mockReturnValue(true), + listElements: jest.fn().mockReturnValue([ + ["copybook", "fingerprint"], + ["copybook2", "fingerprint2"], + ]), + listMembers: jest.fn().mockReturnValue([ + { + dataset: "dataset", + member: "copybook", + }, + ]), + onDidChangeElement: jest.fn(), + getElement: jest.fn().mockReturnValue(["content", "fingerprint"]), + getMember: jest.fn().mockReturnValue("content"), +}; + +export const e4eErrorMock: E4E = { + getConfiguration: jest.fn().mockReturnValue({ + pgms: { + program: "program", + pgroup: "pgroup", + }, + pgroups: [ + { + name: "string", + libs: [ + { dataset: "dataset" }, + { + environment: "environment", + stage: "stage", + system: "system", + subsystem: "subsystem", + type: "type", + use_map: false, + }, + ], + }, + ], + }), + getProfileInfo: jest.fn().mockReturnValue({ + profile: "profile", + instance: "string", + }), + isEndevorElement: jest.fn().mockReturnValue(true), + listElements: jest.fn().mockReturnValue(["filename", "fingerprint"]), + listMembers: jest.fn().mockReturnValue(["member"]), + onDidChangeElement: jest.fn(), + getElement: jest.fn().mockReturnValue(new Error("Error")), + getMember: jest.fn().mockReturnValue(new Error("Error")), +}; + +export const e4eResponseMock: e4eResponse = { + api: e4eMock, + profile: { instance: "instance", profile: "profile" }, + uri: "document-uri", + elements: { + ["copybook"]: { + use_map: false, + environment: "environment", + stage: "stage", + system: "system", + subsystem: "subsystem", + type: "type", + element: "copybook", + fingerprint: "fingerprint", + }, + ["copybook2"]: { + dataset: "dataset", + member: "copybook", + }, + } as { [key: string]: EndevorElement | EndevorMember }, +}; +export const e4eResponseMockDataSetPrior: e4eResponse = { + api: e4eMock, + profile: { instance: "instance", profile: "profile" }, + uri: "document-uri", + elements: { + ["copybook"]: { + dataset: "dataset", + member: "copybook", + }, + ["copybook2"]: { + use_map: false, + environment: "environment", + stage: "stage", + system: "system", + subsystem: "subsystem", + type: "type", + element: "copybook", + fingerprint: "fingerprint", + }, + } as { [key: string]: EndevorElement | EndevorMember }, +}; + +export const e4eErrorResponseMock: e4eResponse = { + api: e4eErrorMock, + profile: { instance: "instance", profile: "profile" }, + uri: "document-uri", + elements: { + ["copybook"]: { + use_map: false, + environment: "environment", + stage: "stage", + system: "system", + subsystem: "subsystem", + type: "type", + element: "copybook", + fingerprint: "fingerprint", + }, + ["copybook2"]: { + dataset: "dataset", + member: "copybook", + }, + } as { [key: string]: EndevorElement | EndevorMember }, +}; + +export const e4eErrorResponseMockDataSetPrior: e4eResponse = { + api: e4eErrorMock, + profile: { instance: "instance", profile: "profile" }, + uri: "document-uri", + elements: { + ["copybook"]: { + dataset: "dataset", + member: "copybook", + }, + ["copybook2"]: { + use_map: false, + environment: "environment", + stage: "stage", + system: "system", + subsystem: "subsystem", + type: "type", + element: "copybook", + fingerprint: "fingerprint", + }, + } as { [key: string]: EndevorElement | EndevorMember }, +}; diff --git a/clients/cobol-lsp-vscode-extension/src/__mocks__/getZoweExplorerMock.utility.ts b/clients/cobol-lsp-vscode-extension/src/__mocks__/getZoweExplorerMock.utility.ts new file mode 100644 index 0000000000..2eb0c58dd8 --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/__mocks__/getZoweExplorerMock.utility.ts @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ + +export const getContentMock = jest.fn(); +export const getUSSContentsMock = jest.fn(); +export const allMemberMock = jest.fn().mockReturnValue({ + apiResponse: { + items: [ + { + member: "copybook", + }, + { member: "DATASET2" }, + ], + }, +}); +const error = new Error("Error"); +(error as any).mDetails = { + errorCode: 401, +}; +export const allMemberErrorMock = jest.fn().mockRejectedValue(error); +export const mvsApiMock = jest.fn().mockReturnValue({ + allMembers: allMemberMock, + getContents: getContentMock, +}); + +export const mvsApiMockWithError = jest.fn().mockReturnValue({ + allMembers: allMemberErrorMock, + getContents: getContentMock, +}); + +export const allUSSFilemembers = jest.fn().mockReturnValue({ + apiResponse: { + items: [ + { name: "uss_copybook" }, + { name: "uss_withExt.cpy" }, + { name: "USS_DATASET2" }, + ], + }, +}); +export const ussApiMock = jest.fn().mockReturnValue({ + fileList: allUSSFilemembers, + getContents: getUSSContentsMock, +}); +const ussApiMockWithError = jest.fn().mockReturnValue({ + fileList: allMemberErrorMock, + getContents: getUSSContentsMock, +}); +export const zoweExplorerMock: IApiRegisterClient = { + getExplorerExtenderApi: jest.fn().mockReturnValue({ + getProfilesCache: jest.fn().mockReturnValue({ + loadNamedProfile: jest.fn().mockReturnValue({ + profile: { encoding: undefined, name: "profile" }, + }), + }), + }), + getMvsApi: mvsApiMock, + getUssApi: ussApiMock, + registeredApiTypes: jest.fn().mockReturnValue([]), +}; + +export const zoweExplorerErrorMock = { + getExplorerExtenderApi: jest.fn().mockReturnValue({ + getProfilesCache: jest.fn().mockReturnValue({ + loadNamedProfile: jest.fn().mockReturnValue({ + profile: { encoding: undefined, name: "profile" }, + }), + }), + }), + getMvsApi: mvsApiMockWithError, + getUssApi: ussApiMockWithError, + registeredApiTypes: jest.fn().mockReturnValue([]), +}; diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/commands/ClearCopybookCacheCommand.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/commands/ClearCopybookCacheCommand.spec.ts index 413e406ff7..463d15d76c 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/commands/ClearCopybookCacheCommand.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/commands/ClearCopybookCacheCommand.spec.ts @@ -14,10 +14,31 @@ import * as path from "path"; import { clearCache } from "../../commands/ClearCopybookCacheCommand"; +import * as vscode from "vscode"; jest.mock("vscode", () => ({ Uri: { parse: jest.fn().mockReturnValue(path.join("tmp-ws", ".c4z", ".copybooks")), + file: jest.fn().mockReturnValue({ + fsPath: path.join(__dirname, ".zowe"), + with: jest + .fn() + .mockImplementation( + (change: { + scheme?: string; + authority?: string; + path?: string; + query?: string; + fragment?: string; + }) => { + return { + path: change.path, + fsPath: change.path, + with: jest.fn().mockReturnValue({ path: change.path }), + }; + }, + ), + }), }, window: { setStatusBarMessage: jest.fn().mockResolvedValue(true), @@ -68,7 +89,7 @@ describe("Tests downloaded copybook cache clear", () => { it("checks running command multiple times doesn't produce error", () => { expect(() => { for (let index = 0; index < 3; index++) { - clearCache(); + clearCache(vscode.Uri.file("/storagePath")); } }).not.toThrowError(); }); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/commands/FetchCopybookCommandTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/commands/FetchCopybookCommandTest.spec.ts index 35ee99b14d..5d31e1f616 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/commands/FetchCopybookCommandTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/commands/FetchCopybookCommandTest.spec.ts @@ -21,25 +21,28 @@ import { TelemetryService } from "../../services/reporter/TelemetryService"; import { Utils } from "../../services/util/Utils"; jest.mock("../../services/reporter/TelemetryService"); -jest.mock("../../services/copybook/CopybookDownloadService"); -Utils.getZoweExplorerAPI = jest.fn(); +Utils.getZoweExplorerAPI = jest.fn().mockReturnValue({}); -const copybookDownloadService: CopybookDownloadService = - new CopybookDownloadService(); const copybook: string = "cobyBookTest"; const progName: string = "progNameTest"; -test("Test fetchCopybookCommand calls telementry services and coprbook download service with proper input", () => { +test("Test fetchCopybookCommand calls telementry services and copybook download service with proper input", async () => { + const copybookDownloadService: CopybookDownloadService = + new CopybookDownloadService( + "./storage-path", + {} as any as IApiRegisterClient, + undefined, + ); + copybookDownloadService.downloadCopybooks = jest.fn(); expect(fetchCopybookCommand).toBeTruthy(); fetchCopybookCommand(copybook, copybookDownloadService, progName); - expect(TelemetryService.registerEvent).toBeCalledWith( + expect(TelemetryService.registerEvent).toHaveBeenCalledWith( "Fetch copybook", ["COBOL", "copybook", "quickfix"], "The user tries to resolve a copybook that is not currently found", ); - expect(copybookDownloadService.downloadCopybooks).toBeCalledWith( + expect(copybookDownloadService.downloadCopybooks).toHaveBeenCalledWith( progName, [new CopybookName(copybook, "COBOL")], - false, ); }); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/extensionTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/extensionTest.spec.ts index 887687d2c0..4d1e514c71 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/extensionTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/extensionTest.spec.ts @@ -22,6 +22,7 @@ import { LanguageClientService } from "../services/LanguageClientService"; import { TelemetryService } from "../services/reporter/TelemetryService"; import { SnippetCompletionProvider } from "../services/snippetcompletion/SnippetCompletionProvider"; import { Utils } from "../services/util/Utils"; +import { E4ECopybookService } from "../services/copybook/E4ECopybookService"; jest.mock("../commands/SmartTabCommand"); jest.mock("../commands/FetchCopybookCommand"); @@ -31,7 +32,6 @@ jest.mock("../services/copybook/CopybookDownloadService"); jest.mock("../commands/ClearCopybookCacheCommand"); jest.mock("../services/Settings", () => ({ - createFileWithGivenPath: jest.fn(), initializeSettings: jest.fn(), SettingsService: { serverRuntime: jest @@ -44,6 +44,7 @@ jest.mock("../services/Settings", () => ({ })); Utils.getZoweExplorerAPI = jest.fn(); +E4ECopybookService.getE4EAPI = jest.fn().mockResolvedValue(undefined); jest.mock("vscode", () => ({ commands: { registerCommand: jest @@ -87,6 +88,12 @@ jest.mock("vscode", () => ({ .fn() .mockReturnValue("onDidChangeConfiguration"), workspaceFolders: [{ uri: { fsPath: "ws-path" } } as any], + fs: { + createDirectory: jest.fn(), + }, + }, + Uri: { + file: jest.fn().mockReturnValue("workspaceFolder2"), }, })); @@ -94,13 +101,10 @@ jest.mock("vscode-languageclient", () => ({ LanguageClient: jest.fn(), })); jest.mock("../services/reporter/TelemetryService"); -jest.mock("../services/copybook/CopybookMessageHandler", () => ({ - resolveCopybookHandler: jest.fn(), - downloadCopybookHandler: jest.fn(), -})); const context: any = { subscriptions: [], + globalStorageUri: { fsPath: "/storagePath" }, }; beforeEach(() => { @@ -117,7 +121,7 @@ describe("Check plugin extension for cobol starts successfully.", () => { "Extension activation event was triggered", ); - expect(vscode.commands.registerCommand).toBeCalledTimes(9); + expect(vscode.commands.registerCommand).toBeCalledTimes(10); expect(fetchCopybookCommand).toHaveBeenCalled(); expect(gotoCopybookSettings).toHaveBeenCalled(); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/LanguageClientServiceTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/LanguageClientServiceTest.spec.ts index 2acb413d6a..e1aca5996f 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/LanguageClientServiceTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/LanguageClientServiceTest.spec.ts @@ -22,6 +22,7 @@ import { LanguageClientService } from "../../services/LanguageClientService"; import { NativeExecutableService } from "../../services/nativeLanguageClient/nativeExecutableService"; import { TelemetryService } from "../../services/reporter/TelemetryService"; import { Utils } from "../../services/util/Utils"; +import { EXP_LANGUAGE_ID, HP_LANGUAGE_ID } from "../../constants"; jest.mock("../../services/reporter/TelemetryService"); jest.mock("../../services/copybook/CopybookURI"); @@ -39,9 +40,10 @@ jest.mock("vscode", () => ({ }, Uri: { file: jest.fn().mockReturnValue({ - fsPath: "path", + fsPath: "/storagePath", }), }, + RelativePattern: jest.fn().mockReturnValue(undefined), })); jest.mock("vscode-languageclient/node", () => ({ LanguageClient: jest.fn(), @@ -67,7 +69,10 @@ beforeEach(() => { const SERVER_STOPPED_MSG = "server stopped"; describe("LanguageClientService positive scenario", () => { beforeEach(() => { - languageClientService = new LanguageClientService(jest.fn() as any); + languageClientService = new LanguageClientService( + jest.fn() as any, + vscode.Uri.file("/storagePath"), + ); new JavaCheck().isJavaInstalled = jest.fn().mockResolvedValue(true); vscode.workspace.getConfiguration(expect.any(String)).get = jest .fn() @@ -140,7 +145,7 @@ describe("LanguageClientService positive scenario", () => { options: { detached: false }, }, { - documentSelector: [SERVER_ID], + documentSelector: [SERVER_ID, EXP_LANGUAGE_ID, HP_LANGUAGE_ID], outputChannel: expect.any(Function), synchronize: { fileEvents: [undefined, undefined], @@ -163,11 +168,11 @@ describe("LanguageClientService positive scenario", () => { SERVER_DESC, expect.any(Function), { - documentSelector: [SERVER_ID], + documentSelector: [SERVER_ID, EXP_LANGUAGE_ID, HP_LANGUAGE_ID], outputChannel: expect.any(Function), synchronize: { - fileEvents: [undefined, undefined], + fileEvents: [undefined, undefined, undefined], }, }, ); @@ -235,7 +240,10 @@ describe("LanguageClientService negative scenario.", () => { test("LSP port not defined and jar path doesn't exists", async () => { (fs.existsSync as any) = jest.fn().mockReturnValue(false); try { - await new LanguageClientService(jest.fn() as any).checkPrerequisites(); + await new LanguageClientService( + jest.fn() as any, + vscode.Uri.file("/storagePath"), + ).checkPrerequisites(); } catch (error: any) { expect(error.toString()).toBe("Error: LSP server for cobol not found"); } diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/SettingsTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/SettingsTest.spec.ts index 74c28050f5..021864c2c9 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/SettingsTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/SettingsTest.spec.ts @@ -14,33 +14,14 @@ import * as fs from "fs-extra"; import * as path from "path"; import * as vscode from "vscode"; -import { C4Z_FOLDER, GITIGNORE_FILE } from "../../constants"; -import { - createFileWithGivenPath, - SettingsService, -} from "../../services/Settings"; +import { SettingsService } from "../../services/Settings"; import { SettingsUtils } from "../../services/util/SettingsUtils"; const fsPath = "tmp-ws"; -let wsPath: string; -let c4zPath: string; -let filePath: string; - beforeAll(() => { (vscode.workspace.workspaceFolders as any) = [ - { uri: { fsPath, path: fsPath } } as any, + { uri: { fsPath: makefsPath(fsPath), path: makePath(fsPath) } } as any, ]; - const firstWorkspaceFolder = vscode.workspace.workspaceFolders![0]; - if (!firstWorkspaceFolder) return; - wsPath = path.join(firstWorkspaceFolder.uri.fsPath); - c4zPath = path.join(wsPath, C4Z_FOLDER); - filePath = path.join(c4zPath, GITIGNORE_FILE); -}); - -afterAll(() => { - if (fs.existsSync(wsPath)) { - fs.remove(wsPath); - } }); jest.mock("vscode", () => ({ @@ -54,40 +35,36 @@ jest.mock("vscode", () => ({ workspace: {}, })); -describe(".gitignore file in .c4z folder tests", () => { - it("Create .gitignore file if not exists", () => { - createFileWithGivenPath(C4Z_FOLDER, GITIGNORE_FILE, "/**"); - - expect(fs.existsSync(wsPath)).toEqual(true); - expect(fs.existsSync(c4zPath)).toEqual(true); - expect(fs.existsSync(filePath)).toEqual(true); - }); - - it("Modify .gitignore file if exists", () => { - const pattern = "srs/*\n.sds/*"; - createFileWithGivenPath(C4Z_FOLDER, GITIGNORE_FILE, pattern); - const found = fs - .readFileSync(filePath) - .toString() - .split("\n") - .filter((e) => e.trim().length > 0) - .map((e) => e.trim()) - .indexOf(pattern); - - expect(found).toBeGreaterThanOrEqual(-1); - }); - - it("workspace not exist", () => { - (vscode.workspace.workspaceFolders as any) = []; - const createFile = jest.fn(); - createFileWithGivenPath(C4Z_FOLDER, GITIGNORE_FILE, "/**"); - - expect(createFile).toHaveBeenCalledTimes(0); - expect(vscode.workspace.workspaceFolders![0]).toBe(undefined); - }); -}); +function makefsPath(p: string): string { + return path.join(process.platform == "win32" ? "a:" : "", p); +} +function makePath(p: string): string { + return (process.platform == "win32" ? "/a:" : "") + p; +} describe("SettingsService evaluate variables", () => { + beforeAll(() => { + (vscode.workspace.workspaceFolders as vscode.WorkspaceFolder[]) = [ + { + uri: { + path: makePath("/tmp-ws"), + scheme: "", + authority: "", + query: "", + fragment: "", + fsPath: makefsPath("/tmp-ws"), + with: function (): vscode.Uri { + throw new Error("Function not implemented."); + }, + toJSON: function () { + throw new Error("Function not implemented."); + }, + }, + name: "workspace", + index: 0, + }, + ]; + }); test("Evaluate fileBasenameNoExtension", () => { vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ get: jest.fn().mockReturnValue(["copybook/${fileBasenameNoExtension}"]), @@ -96,7 +73,7 @@ describe("SettingsService evaluate variables", () => { "file:///program", "COBOL", ); - expect(paths[0]).toEqual("copybook/program"); + expect(paths[0]).toEqual(makefsPath("/tmp-ws/copybook/program")); }); test("Evaluate fileBasenameNoExtension", () => { @@ -107,18 +84,19 @@ describe("SettingsService evaluate variables", () => { "file:///program.cbl", "COBOL", ); - expect(paths[0]).toEqual("copybook/program"); + expect(paths[0]).toEqual(makefsPath("/tmp-ws/copybook/program")); }); test("Evaluate fileBasenameNoExtension with extension and dots", () => { vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ get: jest.fn().mockReturnValue(["copybook/${fileBasenameNoExtension}"]), }); + const paths = SettingsService.getCopybookLocalPath( "file:///program.file.cbl", "COBOL", ); - expect(paths[0]).toEqual("copybook/program.file"); + expect(paths[0]).toEqual(makefsPath("/tmp-ws/copybook/program.file")); }); test("Get local settings for a dialect", () => { @@ -156,7 +134,6 @@ test("getWorkspaceFoldersPath return an array of paths", () => { const paths = SettingsUtils.getWorkspaceFoldersPath(); expect(paths).toStrictEqual(["/ws-vscode"]); }); - test("json validation", () => { expect(SettingsUtils.isValidJSON(undefined)).toBeFalsy(); expect(SettingsUtils.isValidJSON("{}")).toBeTruthy(); @@ -240,3 +217,26 @@ describe("SettingsService returns correct Copybook Configuration Values", () => expect(configuredValue[0]).toBe("configured-cobol-settings"); }); }); +describe("SettingsService prepares local search folders", () => { + test("returns all paths are transformed into absolutes", () => { + const paths = [makefsPath("/absolute"), "relative"]; + expect( + SettingsService.prepareLocalSearchFolders(paths, [ + makefsPath("/workspacePath"), + ]), + ).toEqual([makefsPath("/absolute"), makefsPath("/workspacePath/relative")]); + }); + test("all workspace paths concatanated into relative paths", () => { + const paths = [makefsPath("/absolute"), "relative"]; + expect( + SettingsService.prepareLocalSearchFolders(paths, [ + makefsPath("/workspacePath"), + makefsPath("/workspacePath2"), + ]), + ).toEqual([ + makefsPath("/absolute"), + makefsPath("/workspacePath/relative"), + makefsPath("/workspacePath2/relative"), + ]); + }); +}); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookDownloadServiceTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookDownloadServiceTest.spec.ts index 9017fc0a79..4fb2a8c780 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookDownloadServiceTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookDownloadServiceTest.spec.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 Broadcom. + * Copyright (c) 2024 Broadcom. * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. * * This program and the accompanying materials are made @@ -12,578 +12,210 @@ * Broadcom, Inc. - initial API and implementation */ -import anything = jasmine.anything; -import * as fs from "fs-extra"; -import * as path from "path"; -import * as Path from "path"; -import * as vscode from "vscode"; -import { - C4Z_FOLDER, - COPYBOOKS_FOLDER, - DOWNLOAD_QUEUE_LOCKED_ERROR_MSG, - INSTALL_ZOWE, - PROFILE_NAME_PLACEHOLDER, - PROVIDE_PROFILE_MSG, - UNLOCK_DOWNLOAD_QUEUE_MSG, - ZOWE_EXT_MISSING_MSG, -} from "../../../constants"; -import { - CopybookDownloadService, - CopybookName, -} from "../../../services/copybook/CopybookDownloadService"; -import { CopybookProfile } from "../../../services/copybook/DownloadQueue"; -import { TelemetryService } from "../../../services/reporter/TelemetryService"; +import { DEFAULT_DIALECT, PROVIDE_PROFILE_MSG } from "../../../constants"; +import { CopybookDownloadService } from "../../../services/copybook/CopybookDownloadService"; import { ProfileUtils } from "../../../services/util/ProfileUtils"; -import clearAllMocks = jest.clearAllMocks; -import { SettingsService } from "../../../services/Settings"; -import { CopybookURI } from "../../../services/copybook/CopybookURI"; import { Utils } from "../../../services/util/Utils"; +import * as vscode from "vscode"; +import { + zoweExplorerErrorMock, + zoweExplorerMock, +} from "../../../__mocks__/getZoweExplorerMock.utility"; +import { DownloadUtil } from "../../../services/copybook/downloader/DownloadUtil"; -const profile = "zoweProfile"; -const wrongCredProfile = "wrongCredProfile"; -const copybookProfile = new CopybookProfile( - "filename", - "copybook", - SettingsService.DEFAULT_DIALECT, - profile, - false, -); -const downloadQueueLockedErrorMsg = DOWNLOAD_QUEUE_LOCKED_ERROR_MSG.replace( - PROFILE_NAME_PLACEHOLDER, - wrongCredProfile, -); - +jest.mock("../../../services/reporter/TelemetryService"); (vscode.workspace.workspaceFolders as any) = [ { uri: { fsPath: "/projects" } } as any, ]; -vscode.window.showInformationMessage = () => - Promise.resolve("Download Copybooks"); -vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ - get: jest.fn().mockReturnValue(undefined), -}); -(vscode.ProgressLocation as any) = { Notification: "notify" }; - -Utils.getZoweExplorerAPI = jest.fn(); -const getContentMock = jest.fn(); -const getUSSContentsMock = jest.fn(); -const getZoweExplorerMock = ( - forError: boolean = false, - mentionedError?: any, -) => { - const error = new Error("Error"); - (error as any).mDetails = { - errorCode: 401, - }; - const allMemberMock = forError - ? jest.fn().mockRejectedValue(mentionedError ? mentionedError : error) - : jest.fn().mockReturnValue({ - apiResponse: { - items: [ - { - member: "copybook", - }, - { member: "DATASET2" }, - ], - }, - }); - const allUSSFilemembers = forError - ? jest.fn().mockRejectedValue(mentionedError ? mentionedError : error) - : jest.fn().mockReturnValue({ - apiResponse: { - items: [ - { name: "uss_copybook" }, - { name: "uss_withExt.cpy" }, - { name: "USS_DATASET2" }, - ], - }, - }); - return jest.fn().mockReturnValue({ - getExplorerExtenderApi: jest.fn().mockReturnValue({ - getProfilesCache: jest.fn().mockReturnValue({ - loadNamedProfile: jest.fn().mockReturnValue({ - profile: { encoding: undefined, name: "profile" }, - }), - }), - }), - getMvsApi: jest.fn().mockReturnValue({ - allMembers: allMemberMock, - getContents: getContentMock, - }), - getUssApi: jest.fn().mockReturnValue({ - fileList: allUSSFilemembers, - getContents: getUSSContentsMock, - }), - }); -}; -beforeEach(() => { - jest.clearAllMocks(); -}); +Utils.getZoweExplorerAPI = jest.fn().mockReturnValue(zoweExplorerMock); -jest.mock("../../../services/reporter/TelemetryService"); - -describe("Test fetchCopybook against bad and correct configurations", () => { - it("downloadCopybookFromMFUsingZowe is correctly invokes USS API's", async () => { - Utils.getZoweExplorerAPI = getZoweExplorerMock(); - SettingsService.getCopybookFileEncoding = jest.fn().mockReturnValue("1147"); - await (CopybookDownloadService as any).downloadCopybookFromMFUsingZowe( - "HLQ.DSN1", - copybookProfile, - true, - ); - expect(getUSSContentsMock).toBeCalledWith(`HLQ.DSN1/copybook`, { - binary: true, - file: Path.join( - CopybookURI.createDatasetPath(profile, "HLQ.DSN1"), - "copybook", - ), - returnEtag: true, - }); +describe("Tests copybook download service", () => { + DownloadUtil.areCopybookDownloadConfigurationsPresent = jest + .fn() + .mockReturnValue(true); + beforeEach(() => { + jest.clearAllMocks(); }); - it("downloadCopybookFromMFUsingZowe is correctly invoked", async () => { - Utils.getZoweExplorerAPI = getZoweExplorerMock(); - await (CopybookDownloadService as any).downloadCopybookFromMFUsingZowe( - "HLQ.DSN1", - copybookProfile, - ); - expect(getContentMock).toBeCalledWith(`HLQ.DSN1(copybook)`, { - binary: true, - file: Path.join( - CopybookURI.createDatasetPath(profile, "HLQ.DSN1"), - "copybook", - ), - returnEtag: true, + describe("checks the prerequisites are checked before invoking download", () => { + beforeEach(() => { + jest.clearAllMocks(); }); - }); - - it("Given a copybook name that is a valid member on MF, the fetchCopybook correctly invoke download from MF", async () => { - (CopybookDownloadService as any).downloadCopybookFromMFUsingZowe = - jest.fn(); - Utils.getZoweExplorerAPI = getZoweExplorerMock(); - const result = await (CopybookDownloadService as any).fetchCopybook( - "HLQ.DSN1", - copybookProfile, - ); - expect(result).toBe(true); - }); - - it("Given a copybook name that is a valid USS member on MF, the fetchCopybook correctly invoke download from MF", async () => { - const ussCopybookProfile = new CopybookProfile( - "filename", - "uss_copybook", - SettingsService.DEFAULT_DIALECT, - profile, - false, - ); - (CopybookDownloadService as any).downloadCopybookFromMFUsingZowe = - jest.fn(); - Utils.getZoweExplorerAPI = getZoweExplorerMock(); - const result = await (CopybookDownloadService as any).fetchCopybook( - "HLQ.DSN1", - ussCopybookProfile, - true, - ); - expect(result).toBe(true); - }); - - it("Given a copybook name with extension that is a valid USS member on MF, the fetchCopybook correctly invoke download from MF", async () => { - const ussCopybookProfile = new CopybookProfile( - "filename", - "uss_withExt", - SettingsService.DEFAULT_DIALECT, - profile, - false, - ); - (CopybookDownloadService as any).downloadCopybookFromMFUsingZowe = - jest.fn(); - Utils.getZoweExplorerAPI = getZoweExplorerMock(); - const result = await (CopybookDownloadService as any).fetchCopybook( - "HLQ.DSN1", - ussCopybookProfile, - true, - ); - expect(result).toBe(true); - }); - it("checks if handleCopybook can't find copybook, it shows a popup to update settings", async () => { - const err = new Error("Error"); - Utils.getZoweExplorerAPI = getZoweExplorerMock(true, err); - vscode.window.showErrorMessage = jest.fn(); - const spyOnErrorMessage = jest.spyOn(vscode.window, "showErrorMessage"); - spyOnErrorMessage.mockResolvedValue("Change settings" as any); - const result = await (CopybookDownloadService as any).fetchCopybook( - "TEST", - copybookProfile, - ); - expect(result).toBeFalsy(); - expect(spyOnErrorMessage).toBeCalledWith(err.message); - expect(vscode.window.showErrorMessage).toBeCalledWith(err.message); - }); -}); -describe("Receiving an error from zowe api layer, copybooks are not retrivied and user is correctly notified", () => { - describe("Suite of tests related to handleCopybook", () => { - it("handleCopybook delete copybook from its internal queue if the copybook is a valid member on MF", async () => { - (CopybookDownloadService as any).fetchCopybook = jest + it("checks download fails when provided profile is not a valid profile", async () => { + const downloadService = new CopybookDownloadService( + "storage-path", + {} as any as IApiRegisterClient, + undefined, + ); + (ProfileUtils as any).getProfileNameForCopybook = jest .fn() - .mockReturnValue(true); - - const errorQueue: Set = new Set(); - errorQueue.add("copybook"); - const progress = { report: jest.fn(), increment: jest.fn() }; - await (CopybookDownloadService as any).handleCopybook( - progress, - "DSNAME1", - copybookProfile, - errorQueue, + .mockReturnValue("unknown-profile"); + (ProfileUtils as any).getAvailableProfiles = jest + .fn() + .mockReturnValue("profile"); + (downloadService as any).processDownloadError = jest.fn(); + await downloadService.downloadCopybooks("document-uri", [ + { name: "copybook-name", dialect: DEFAULT_DIALECT }, + ]); + expect((downloadService as any).processDownloadError).toBeCalledWith( + `${PROVIDE_PROFILE_MSG} Provided invalid profile name: unknown-profile`, ); - expect(errorQueue.size).toBe(0); }); - }); - - describe("Suite of tests related to handleCopybooks", () => { - const progress = { report: jest.fn(), increment: jest.fn() }; - vscode.window.showErrorMessage = jest.fn(); - it("handleCopybooks shows progress report", async () => { - (CopybookDownloadService as any).needsUserNotification = jest + it("checks download fails when provided profile is not provided", async () => { + const downloadService = new CopybookDownloadService( + "storage-path", + {} as any as IApiRegisterClient, + undefined, + ); + (CopybookDownloadService as any).checkWorkspace = jest .fn() .mockReturnValue(true); - const handleCopybook = ((CopybookDownloadService as any).handleCopybook = - jest.fn()); - SettingsService.getDsnPath = jest.fn().mockReturnValue(["dataset"]); - await (CopybookDownloadService as any).handleCopybooks( - [copybookProfile], - new Set(), - progress, - ); - expect(progress.report).toBeCalledWith({ - message: "Looking in dataset. 1 copybook(s) left.", - }); - - expect(handleCopybook).toBeCalledWith( - progress, - "dataset", - copybookProfile, - new Set(), - false, + (ProfileUtils as any).getProfileNameForCopybook = jest + .fn() + .mockReturnValue(""); + (ProfileUtils as any).getAvailableProfiles = jest + .fn() + .mockReturnValue("profile"); + (downloadService as any).processDownloadError = jest.fn(); + await downloadService.downloadCopybooks("document-uri", [ + { name: "copybook-name", dialect: DEFAULT_DIALECT }, + ]); + expect((downloadService as any).processDownloadError).toBeCalledWith( + `${PROVIDE_PROFILE_MSG}`, ); }); - it("handleCopybooks throws error incase download fails", async () => { - (CopybookDownloadService as any).needsUserNotification = jest + it("checks profile with invalid credentials do not trigger download", async () => { + vscode.window.showErrorMessage = jest.fn(); + const downloadService = new CopybookDownloadService( + "storage-path", + zoweExplorerErrorMock, + undefined, + ); + (ProfileUtils as any).getProfileNameForCopybook = jest .fn() - .mockReturnValue(true); - (CopybookDownloadService as any).handleCopybook = jest + .mockReturnValue("profile"); + (ProfileUtils as any).getAvailableProfiles = jest .fn() - .mockRejectedValue(new Error("error")); - await (CopybookDownloadService as any).handleCopybooks( - [copybookProfile], - new Set(), - progress, + .mockReturnValue("profile"); + (downloadService as any).processDownloadError = jest.fn(); + DownloadUtil.isProfileLocked = jest.fn().mockReturnValue(false); + await downloadService.downloadCopybooks("document-uri", [ + { name: "copybook-name", dialect: DEFAULT_DIALECT }, + ]); + expect(vscode.window.showErrorMessage).toHaveBeenCalledWith( + "Incorrect credentials in Zowe profile profile.", ); - expect(vscode.window.showErrorMessage).toBeCalledWith("Error: error"); }); - }); - - describe("Suite of tests related to handleQueue", () => { - const cbd = new CopybookDownloadService(); - beforeEach(() => { - clearAllMocks(); - SettingsService.getDsnPath = jest.fn().mockReturnValue(["dataset"]); - SettingsService.getUssPath = jest - .fn() - .mockReturnValue(["/test/uss/path"]); + it("checks no profile checks are done when download configurations are not configured", async () => { vscode.window.showErrorMessage = jest.fn(); - }); - it("handleQueue popup ZoweError", async () => { - const error = new Error("Error"); - (CopybookDownloadService as any).handleCopybooks = jest + const downloadService = new CopybookDownloadService( + "storage-path", + zoweExplorerErrorMock, + undefined, + ); + (ProfileUtils as any).getProfileNameForCopybook = jest .fn() - .mockRejectedValue(error); - await (cbd as any).handleQueue(copybookProfile, new Set(), null); - expect(vscode.window.showErrorMessage).toHaveBeenCalledWith( - "Error: Error", + .mockReturnValue("profile"); + (ProfileUtils as any).getAvailableProfiles = jest + .fn() + .mockReturnValue("profile"); + (downloadService as any).processDownloadError = jest.fn(); + DownloadUtil.areCopybookDownloadConfigurationsPresent = jest + .fn() + .mockReturnValue(false); + expect( + await downloadService.downloadCopybooks("document-uri", [ + { name: "copybook-name", dialect: DEFAULT_DIALECT }, + ]), + ).toBe(undefined); + expect(vscode.window.showErrorMessage).not.toHaveBeenCalledWith( + "Incorrect credentials in Zowe profile profile.", ); }); - it("handleQueue triggers call for USS copybook download", async () => { - (CopybookDownloadService as any).handleCopybooks = jest + it("checks locked profile do not trigger download", async () => { + const downloadService = new CopybookDownloadService( + "storage-path", + zoweExplorerErrorMock, + undefined, + ); + (ProfileUtils as any).getProfileNameForCopybook = jest .fn() - .mockReturnValue({}); - const errSet = new Set(); - errSet.add("copybook"); - await (cbd as any).handleQueue(copybookProfile, new Set(), null); + .mockReturnValue("profile"); + (ProfileUtils as any).getAvailableProfiles = jest + .fn() + .mockReturnValue("profile"); + DownloadUtil.isProfileLocked = jest.fn().mockReturnValue(true); + (downloadService as any).processDownloadError = jest.fn(); expect( - (CopybookDownloadService as any).handleCopybooks, - ).toHaveBeenLastCalledWith([copybookProfile], errSet, null, true); + await downloadService.downloadCopybooks("document-uri", [ + { name: "copybook-name", dialect: DEFAULT_DIALECT }, + ]), + ).toBe(undefined); }); }); -}); - -describe("Test the creation of folders that contains copybooks downloaded from MF against correct configuration in settings provided by the user", () => { - function setupScenario() { - const testFolder = path.join( - __dirname, - C4Z_FOLDER, - COPYBOOKS_FOLDER, - "profile", - "dataset", - ); - const copybookURIPath = path.join(testFolder, "copybook" + ".cpy"); - const copybooksDownloadService: CopybookDownloadService = - new CopybookDownloadService(); - - (CopybookURI.createCopybookPath as any) = jest - .fn() - .mockReturnValue(copybookURIPath); - (CopybookURI.createDatasetPath as any) = jest - .fn() - .mockReturnValue(testFolder); - return { copybookURIPath, copybooksDownloadService }; - } - - function cleanupScenario() { - fs.remove(path.join(__dirname, C4Z_FOLDER)); - } - - test("With a valid configuration of dataset, zoweExplorerAPI is invoked with correct params", async () => { - Utils.getZoweExplorerAPI = getZoweExplorerMock(); - setupScenario(); - await (CopybookDownloadService as any).downloadCopybookFromMFUsingZowe( - "dataset", - "copybook", - "profile", - ); - cleanupScenario(); - }); -}); - -describe("Test downloadCopybook user interaction", () => { - const copybooksDownloadService = new CopybookDownloadService(); - SettingsService.getDsnPath = jest.fn().mockReturnValue(["dataset"]); - const queuePush = jest.fn(); - - beforeEach(() => { - (CopybookDownloadService as any).checkWorkspace = jest - .fn() - .mockReturnValue(true); - (copybooksDownloadService as any).queue.push = queuePush; - (copybooksDownloadService as any).lockedProfile = new Set([ - wrongCredProfile, - ]); - vscode.window.showErrorMessage = jest.fn().mockResolvedValue(undefined); - (CopybookDownloadService as any).isEligibleForCopybookDownload = jest - .fn() - .mockReturnValue(true); - Utils.getZoweExplorerAPI = getZoweExplorerMock(); - }); - - it("test zowe install is required for copybook download", async () => { - Utils.getZoweExplorerAPI = jest.fn().mockResolvedValue(undefined); - (CopybookDownloadService as any).checkWorkspace = jest - .fn() - .mockReturnValue(false); - (CopybookDownloadService as any).isEligibleForCopybookDownload = jest - .fn() - .mockReturnValue(true); - await copybooksDownloadService.downloadCopybooks( - "fileName", - [new CopybookName("copybook", "dialect")], - false, - ); - expect(vscode.window.showErrorMessage).toBeCalledWith( - ZOWE_EXT_MISSING_MSG, - INSTALL_ZOWE, - ); - expect(queuePush).not.toBeCalled(); - }); - test("check download fails when ZE is not installed", async () => { - (CopybookDownloadService as any).checkWorkspace = jest - .fn() - .mockReturnValue(false); - Utils.getZoweExplorerAPI = jest.fn().mockReturnValue(undefined); - (CopybookDownloadService as any).isEligibleForCopybookDownload = jest - .fn() - .mockReturnValue(true); - await copybooksDownloadService.downloadCopybooks( - "fileName", - [new CopybookName("copybook", "dialect")], - false, - ); - expect(vscode.window.showErrorMessage).toBeCalledWith( - "Zowe Explorer version 1.15.0 or higher is required to download copybooks from the mainframe.", - "Install Zowe Explorer", - ); - expect(queuePush).not.toBeCalled(); - }); - - test("check workspace fail", async () => { - (CopybookDownloadService as any).checkWorkspace = jest - .fn() - .mockReturnValue(false); - await copybooksDownloadService.downloadCopybooks( - "fileName", - [new CopybookName("copybook", "dialect")], - false, - ); - expect(vscode.window.showErrorMessage).not.toBeCalled(); - expect(queuePush).not.toBeCalled(); - }); - - test("check profile not found", async () => { - ProfileUtils.getAvailableProfiles = jest.fn().mockReturnValue([]); - ProfileUtils.getProfileNameForCopybook = jest - .fn() - .mockReturnValue(undefined); - await copybooksDownloadService.downloadCopybooks( - "fileName", - [new CopybookName("copybook", "dialect")], - false, - ); - expect(vscode.window.showErrorMessage).toBeCalledWith( - "Please specify a valid Zowe Explorer profile to download copybooks from the mainframe.", - "Change settings", - ); - expect(queuePush).not.toBeCalled(); - }); - - test("check profile not found with user interaction", async () => { - ProfileUtils.getAvailableProfiles = jest.fn().mockReturnValue([]); - ProfileUtils.getProfileNameForCopybook = jest - .fn() - .mockReturnValue(undefined); - await copybooksDownloadService.downloadCopybooks( - "fileName", - [new CopybookName("copybook", "dialect")], - false, - ); - expect(vscode.window.showErrorMessage).toBeCalledWith( - PROVIDE_PROFILE_MSG, - anything(), - ); - expect(queuePush).not.toBeCalled(); - }); - - test("check good path", async () => { - ProfileUtils.getAvailableProfiles = jest.fn().mockReturnValue(["profile"]); - ProfileUtils.getProfileNameForCopybook = jest + it("checks download resolver is invoked with right parameters", async () => { + (ProfileUtils as any).getProfileNameForCopybook = jest .fn() .mockReturnValue("profile"); - await copybooksDownloadService.downloadCopybooks("fileName", [ - new CopybookName("copybook", "dialect"), - ]); - expect(vscode.window.showErrorMessage).not.toBeCalled(); - expect(queuePush).toBeCalledWith( - "fileName", - "copybook", - "dialect", - "profile", - true, - ); - }); - - test("check locked profile", async () => { - ProfileUtils.getAvailableProfiles = jest - .fn() - .mockReturnValue([wrongCredProfile]); - ProfileUtils.getProfileNameForCopybook = jest - .fn() - .mockReturnValue(wrongCredProfile); - await copybooksDownloadService.downloadCopybooks("fileName", [ - new CopybookName("copybook", "dialect"), - ]); - expect(vscode.window.showErrorMessage).not.toBeCalled(); - expect(queuePush).not.toBeCalled(); - }); - - test("check locked profile and user kept it locked", async () => { - ProfileUtils.getAvailableProfiles = jest + (ProfileUtils as any).getAvailableProfiles = jest .fn() - .mockReturnValue([wrongCredProfile]); - ProfileUtils.getProfileNameForCopybook = jest + .mockReturnValue("profile"); + DownloadUtil.isProfileLocked = jest.fn().mockReturnValue(false); + DownloadUtil.checkForInvalidCredProfile = jest.fn().mockReturnValue(false); + DownloadUtil.areCopybookDownloadConfigurationsPresent = jest .fn() - .mockReturnValue(wrongCredProfile); - await copybooksDownloadService.downloadCopybooks( - "fileName", - [new CopybookName("copybook", "dialect")], - false, - ); - expect(vscode.window.showErrorMessage).toBeCalledWith( - downloadQueueLockedErrorMsg, - anything(), - ); - expect(queuePush).not.toBeCalled(); - expect((copybooksDownloadService as any).lockedProfile).toContain( - wrongCredProfile, + .mockReturnValue(true); + const downloadService = new CopybookDownloadService( + "storage-path", + {} as any as IApiRegisterClient, + undefined, ); - }); - - test("queue locked and user unlocked it", async () => { - ProfileUtils.getAvailableProfiles = jest + DownloadUtil.checkForInvalidCredProfile = jest.fn().mockReturnValue(false); + (downloadService as any).downloadResolver.downloadCopybook = jest .fn() - .mockReturnValue([wrongCredProfile]); - ProfileUtils.getProfileNameForCopybook = jest - .fn() - .mockReturnValue(wrongCredProfile); - vscode.window.showErrorMessage = jest - .fn() - .mockResolvedValue(UNLOCK_DOWNLOAD_QUEUE_MSG); - await copybooksDownloadService.downloadCopybooks( - "fileName", - [new CopybookName("copybook", "dialect")], - false, - ); - expect(vscode.window.showErrorMessage).toBeCalledWith( - downloadQueueLockedErrorMsg, - anything(), - ); - expect(queuePush).toBeCalledWith( - "fileName", - "copybook", - "dialect", - wrongCredProfile, - false, - ); - expect((copybooksDownloadService as any).lockedProfile).not.toContain( - wrongCredProfile, - ); - }); -}); - -describe("Test copybook download process", () => { - it("checks copybook download Service is called within the scope of vscode progress bar", async () => { - const cbd = new CopybookDownloadService(); - vscode.window.withProgress = jest.fn(); + .mockResolvedValue(true); + (downloadService as any).updateDownloadProgress = jest.fn(); (vscode.ProgressLocation as any) = { Notification: "notify" }; - await (cbd as any).run(copybookProfile, new Set(), 1234); - expect(vscode.window.withProgress).toBeCalled(); - }); - - it("checks copybook download Service calls the handle queue to resolve copybook", async () => { - const cbd = new CopybookDownloadService(); - const createErrorMessageForCopybooks = (( - CopybookDownloadService as any - ).createErrorMessageForCopybooks = jest.fn()); - const handleQueue = ((cbd as any).handleQueue = jest.fn()); - const telementryRegisterEvent = ((TelemetryService as any).registerEvent = - jest.fn()); - const telemetryMessage = (TelemetryService.calculateTimeElapsed = jest - .fn() - .mockReturnValue("1234")); - (cbd as any).queue.push = jest.fn(); - const progress = { report: jest.fn() }; - const errors = new Set(); - errors.add("test"); - await (cbd as any).process(progress, copybookProfile, errors, 1234); - expect(handleQueue).toBeCalledWith(copybookProfile, errors, progress); - expect(telemetryMessage).toBeCalled(); - expect(telementryRegisterEvent).toBeCalledWith( - "Download copybooks from MF", - ["copybook", "COBOL", "experiment-tag"], - "total time to search copybooks on MF", - new Map().set("time elapsed", "1234"), - ); + vscode.window.withProgress = jest + .fn() + .mockImplementation( + async ( + _options: any, + processDownload: (progress?: any) => Promise, + ) => { + return await processDownload(); + }, + ); + await downloadService.downloadCopybooks("document-uri", [ + { name: "copybook-name", dialect: DEFAULT_DIALECT }, + ]); + expect( + (downloadService as any).downloadResolver.downloadCopybook, + ).toHaveBeenCalledWith( + { name: "copybook-name", dialect: DEFAULT_DIALECT }, + "document-uri", + ); + }); + + it("checks vscode progess notification is updated on callback", async () => { + const downloadService = new CopybookDownloadService( + "storage-path", + {} as any as IApiRegisterClient, + undefined, + ); + const mockProgress = { + report: jest.fn(), + }; + (downloadService as any).updateDownloadProgress(mockProgress, 10, 5); + expect(mockProgress.report).toHaveBeenCalledWith({ + increment: 50, + message: "50%", + }); }); }); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts index 0be6f1e0dc..7e4e65940b 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts @@ -15,77 +15,203 @@ import { resolveCopybookHandler } from "../../../services/copybook/CopybookMessageHandler"; import { CopybookURI } from "../../../services/copybook/CopybookURI"; import { SettingsService } from "../../../services/Settings"; -import { searchCopybookInWorkspace } from "../../../services/util/FSUtils"; import * as vscode from "vscode"; import { Utils } from "../../../services/util/Utils"; +import { E4ECopybookService } from "../../../services/copybook/E4ECopybookService"; +import { + e4eMock, + e4eResponseMock, + e4eResponseMockDataSetPrior, +} from "../../../__mocks__/getE4EMock.utility"; +import path = require("path"); +import { globSync } from "glob"; +import * as fs from "fs"; vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ get: jest.fn().mockReturnValue("testProfile"), }); Utils.getZoweExplorerAPI = jest.fn(); +jest.mock("glob"); +jest.mock("url", () => { + return { + URL: jest.fn().mockImplementation((x) => { + return { href: x }; + }), + }; +}); +(globSync as any) = jest.fn().mockImplementation((x: any) => [x]); +(fs.realpathSync.native as any) = jest.fn().mockImplementation((x: any) => x); +(vscode.Uri.file as any) = jest.fn().mockImplementation((x: any) => { + return { fsPath: x }; +}); + +const outputChannel: vscode.OutputChannel = { + name: "COBOL Language Support", + append: jest.fn(), + appendLine: jest.fn(), + replace: jest.fn(), + clear: jest.fn(), + show: jest.fn(), + hide: jest.fn(), + dispose: jest.fn(), +}; describe("Test the copybook message handler", () => { it("checks local present copybooks are resolved", async () => { SettingsService.getCopybookExtension = jest.fn().mockReturnValue([".cpy"]); SettingsService.getCopybookLocalPath = jest .fn() - .mockReturnValue("/configured/path/from/setting"); - (searchCopybookInWorkspace as any) = jest - .fn() - .mockReturnValue("copybook content"); + .mockReturnValue(["/configured/path/from/setting"]); + expect( await resolveCopybookHandler( + "/storagePath", + outputChannel, "cobolFileName", "copybookName", "dialectType", ), - ).toBe("copybook content"); + ).toBe( + "file://" + + path.resolve( + "/configured", + "path", + "from", + "setting", + "copybookName.cpy", + ), + ); }); it("checks downloaded copybooks are resolved", async () => { SettingsService.getCopybookExtension = jest.fn().mockReturnValue([".cpy"]); - SettingsService.getCopybookLocalPath = jest.fn().mockReturnValue(""); + SettingsService.getCopybookLocalPath = jest.fn().mockReturnValue([]); SettingsService.getDsnPath = jest .fn() .mockReturnValue(["/configured/path"]); - CopybookURI.createDatasetPath = jest - .fn() - .mockReturnValue(["/downloaded/copybook/path"]); - (searchCopybookInWorkspace as any) = jest - .fn() - .mockReturnValueOnce("") - .mockReturnValueOnce("Downloaded copybook content"); expect( await resolveCopybookHandler( + "/storagePath", + outputChannel, "cobolFileName", "copybookName", "dialectType", ), - ).toBe("Downloaded copybook content"); + ).toBe( + "file://" + + path.resolve( + "/storagePath", + ".zowe", + ".copybooks", + "testProfile", + "configured", + "path", + "copybookName", + ), + ); }); it("checks USS downloaded copybooks are resolved", async () => { SettingsService.getCopybookExtension = jest.fn().mockReturnValue([".cpy"]); - SettingsService.getCopybookLocalPath = jest.fn().mockReturnValue(""); + SettingsService.getCopybookLocalPath = jest.fn().mockReturnValue([]); SettingsService.getDsnPath = jest.fn().mockReturnValue([]); SettingsService.getUssPath = jest .fn() .mockReturnValue(["/configured/path"]); - CopybookURI.createDatasetPath = jest - .fn() - .mockReturnValue(["/downloaded/copybook/path"]); - (searchCopybookInWorkspace as any) = jest - .fn() - .mockReturnValueOnce("") - .mockReturnValueOnce("") - .mockReturnValue("Downloaded USS copybook content"); + expect( await resolveCopybookHandler( + "/storagePath", + outputChannel, "cobolFileName", "copybookName", "dialectType", ), - ).toBe("Downloaded USS copybook content"); + ).toBe( + "file://" + + path.resolve( + "/storagePath", + ".zowe", + ".copybooks", + "testProfile", + "configured", + "path", + "copybookName", + ), + ); + }); + it("checks E4E downloaded member copybooks are resolved", async () => { + vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ + get: jest.fn().mockReturnValue(""), + }); + (vscode.workspace.workspaceFolders as any) = undefined; + (globSync as any) = jest.fn().mockImplementation((x: any) => [x]); + E4ECopybookService.getE4EAPI = jest.fn().mockResolvedValue(e4eMock); + e4eMock.isEndevorElement = jest.fn().mockResolvedValue(true); + const spyAsString = jest.spyOn(Utils, "profileAsString"); + const spyGetEnvironmentPath = jest.spyOn(CopybookURI, "getEnviromentPath"); + E4ECopybookService.getE4EClient = jest + .fn() + .mockResolvedValue(e4eResponseMockDataSetPrior); + const target = await resolveCopybookHandler( + "/storagePath", + outputChannel, + "cobolFileName", + "copybook", + "dialectType", + ); + expect(target).toEqual( + "file://" + + path.resolve( + "/storagePath", + ".e4e", + ".copybooks", + "instance.profile", + "dataset", + "copybook", + ), + ); + expect(spyAsString).toHaveBeenCalled(); + expect(spyGetEnvironmentPath).not.toHaveBeenCalled(); + }); + it("checks E4E downloaded element copybooks are resolved", async () => { + (vscode.workspace.workspaceFolders as any) = undefined; + (fs.realpathSync.native as any) = jest + .fn() + .mockImplementation((x: any) => x); + (vscode.Uri.file as any) = jest.fn().mockImplementation((x: any) => { + return { fsPath: x }; + }); + E4ECopybookService.getE4EAPI = jest.fn().mockResolvedValue(e4eMock); + e4eMock.isEndevorElement = jest.fn().mockResolvedValue(true); + + const spyGetEnvironmentPath = jest.spyOn(CopybookURI, "getEnviromentPath"); + E4ECopybookService.getE4EClient = jest + .fn() + .mockResolvedValue(e4eResponseMock); + const target = await resolveCopybookHandler( + "/storagePath", + outputChannel, + "cobolFileName", + "copybook", + "dialectType", + ); + expect(target).toEqual( + "file://" + + path.resolve( + "/storagePath", + ".e4e", + ".copybooks", + "instance.profile", + "environment", + "stage", + "system", + "subsystem", + "type", + "copybook", + ), + ); + expect(spyGetEnvironmentPath).toHaveBeenCalled(); }); }); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookResolveURITest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookResolveURITest.spec.ts index e29be21f66..bc0058b4cd 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookResolveURITest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookResolveURITest.spec.ts @@ -17,13 +17,15 @@ import { globSync } from "glob"; import * as fs from "fs-extra"; import * as path from "path"; import * as vscode from "vscode"; -import { COPYBOOK_EXT_ARRAY } from "../../../constants"; +import { COPYBOOK_EXT_ARRAY, ZOWE_FOLDER } from "../../../constants"; import { CopybookURI } from "../../../services/copybook/CopybookURI"; import { SettingsService } from "../../../services/Settings"; import * as fsUtils from "../../../services/util/FSUtils"; import { ProfileUtils } from "../../../services/util/ProfileUtils"; import { SettingsUtils } from "../../../services/util/SettingsUtils"; import { Utils } from "../../../services/util/Utils"; +import { resolveCopybookHandler } from "../../../services/copybook/CopybookMessageHandler"; +import { E4ECopybookService } from "../../../services/copybook/E4ECopybookService"; const copybookName: string = "NSTCOPY1"; const copybookNameWithExtension: string = "NSTCOPY2.CPY"; @@ -41,9 +43,15 @@ jest.mock("vscode", () => ({ file: jest.fn().mockImplementation((str: string) => { return { fsPath: str, + toString: jest.fn().mockReturnValue(str), }; }), }, + window: { + createOutputChannel: jest.fn().mockReturnValue({ + appendLine: jest.fn(), + }), + }, workspace: {}, })); @@ -52,6 +60,7 @@ vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ get: jest.fn().mockReturnValue(undefined), }); Utils.getZoweExplorerAPI = jest.fn(); +E4ECopybookService.getE4EAPI = jest.fn(); // file utils function createFile(filename: string, folderPath: string): string { @@ -70,6 +79,9 @@ function removeFolder(targetPath: string) { return false; } +const outputChannel = vscode.window.createOutputChannel( + "COBOL Language Support", +); async function buildResultArrayFrom( settingsMockValue: string[] | undefined, filename: string, @@ -90,10 +102,10 @@ async function buildResultArrayFrom( const result = await (CopybookURI as any).createPathForCopybookDownloaded( filename, SettingsService.DEFAULT_DIALECT, + path.join("downloadFolder", ZOWE_FOLDER), ); return result.length; } - beforeEach(() => { jest.clearAllMocks(); }); @@ -108,17 +120,23 @@ afterAll(() => { describe("Resolve local copybook against bad configuration of target folders", () => { test("given an empty list of folders, the copybook is not retrieved", () => { expect( - fsUtils.searchCopybookInWorkspace(copybookName, [], COPYBOOK_EXT_ARRAY), + fsUtils.searchCopybookInExtensionFolder( + copybookName, + [], + COPYBOOK_EXT_ARRAY, + __dirname, + ), ).toBe(undefined); (globSync as any) = jest.fn().mockReturnValue((x: any) => x); }); test("given a folder that not contains copybooks, the target copybook is not retrieved", () => { (globSync as any) = jest.fn().mockReturnValue([]); expect( - fsUtils.searchCopybookInWorkspace( + fsUtils.searchCopybookInExtensionFolder( copybookName, [__dirname], COPYBOOK_EXT_ARRAY, + __dirname, ), ).toBe(undefined); (globSync as any) = jest.fn().mockReturnValue((x: any) => x); @@ -126,10 +144,11 @@ describe("Resolve local copybook against bad configuration of target folders", ( test("given a not empty folder, a copybook that is not present in that folder is not retrivied and the uri returned is undefined", () => { (globSync as any) = jest.fn().mockReturnValue([]); expect( - fsUtils.searchCopybookInWorkspace( + fsUtils.searchCopybookInExtensionFolder( "NSTCPY2", [CPY_FOLDER_NAME], COPYBOOK_EXT_ARRAY, + __dirname, ), ).toBeUndefined(); (globSync as any) = jest.fn().mockReturnValue((x: any) => x); @@ -139,10 +158,11 @@ describe("Resolve local copybook present in one or more folders specified by the test("given a folder that contains the target copybook, it is found and its uri is returned", () => { (globSync as any) = jest.fn().mockReturnValue([copybookName]); expect( - fsUtils.searchCopybookInWorkspace( + fsUtils.searchCopybookInExtensionFolder( copybookName, [CPY_FOLDER_NAME], COPYBOOK_EXT_ARRAY, + __dirname, ), ).toBeDefined(); (globSync as any) = jest.fn().mockReturnValue((x: any) => x); @@ -150,10 +170,11 @@ describe("Resolve local copybook present in one or more folders specified by the test("given two times the same folder that contains the target copybook, one uri is still returned", () => { (globSync as any) = jest.fn().mockReturnValue([copybookName]); expect( - fsUtils.searchCopybookInWorkspace( + fsUtils.searchCopybookInExtensionFolder( copybookName, [CPY_FOLDER_NAME], COPYBOOK_EXT_ARRAY, + __dirname, ), ).toBeDefined(); (globSync as any) = jest.fn().mockReturnValue((x: any) => x); @@ -161,10 +182,11 @@ describe("Resolve local copybook present in one or more folders specified by the test("Given a copybook with extension on filesystem, the uri is correctly returned", () => { (globSync as any) = jest.fn().mockReturnValue(["NSTCOPY2.CPY"]); expect( - fsUtils.searchCopybookInWorkspace( + fsUtils.searchCopybookInExtensionFolder( "NSTCOPY2", [CPY_FOLDER_NAME], COPYBOOK_EXT_ARRAY, + __dirname, ), ).toBeDefined(); (globSync as any) = jest.fn().mockReturnValue((x: any) => x); @@ -175,10 +197,11 @@ describe("Resolve local copybook present in one or more folders specified by the createDirectory(dir); createFile(copybookNameWithExtension, dir); expect( - fsUtils.searchCopybookInWorkspace( + fsUtils.searchCopybookInExtensionFolder( "NSTCOPY2", [RELATIVE_CPY_FOLDER_NAME], COPYBOOK_EXT_ARRAY, + __dirname, ), ).toBeDefined(); removeFolder(dir); @@ -187,10 +210,11 @@ describe("Resolve local copybook present in one or more folders specified by the test("Given a valid absolute path for copybook with extension on filesystem, the uri is correctly returned", () => { (globSync as any) = jest.fn().mockReturnValue(["NSTCOPY2.CPY"]); expect( - fsUtils.searchCopybookInWorkspace( + fsUtils.searchCopybookInExtensionFolder( "NSTCOPY2", [path.normalize(folderPath)], COPYBOOK_EXT_ARRAY, + __dirname, ), ).toBeDefined(); (globSync as any) = jest.fn().mockReturnValue((x: any) => x); @@ -232,14 +256,19 @@ describe("Prioritize search criteria for copybooks test suite", () => { }); } - const spySearchInWorkspace = jest.spyOn(fsUtils, "searchCopybookInWorkspace"); + const spySearchInWorkspace = jest.spyOn( + fsUtils, + "searchCopybookInExtensionFolder", + ); test("With only a local folder defined in the settings.json, the search is applied locally", async () => { vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ get: jest.fn().mockReturnValue([CPY_FOLDER_NAME]), }); SettingsService.getCopybookExtension = jest.fn().mockReturnValue([""]); (globSync as any) = jest.fn().mockReturnValue([copybookName]); - const uri: string = await CopybookURI.resolveCopybookURI( + const uri: string | undefined = await resolveCopybookHandler( + "/storagePath", + outputChannel, copybookName, "PRGNAME", "COBOL", @@ -248,43 +277,47 @@ describe("Prioritize search criteria for copybooks test suite", () => { expect(spySearchInWorkspace).toBeCalledTimes(1); (globSync as any) = jest.fn().mockReturnValue((x: any) => x); }); - test("With no settings provided, two search strategies are applied and function return an empty string", async () => { + test("With no settings provided, two search strategies are applied and function return undefined", async () => { (globSync as any) = jest.fn().mockReturnValue([]); provideMockValueForLocalAndDSN("", ""); ProfileUtils.getProfileNameForCopybook = jest .fn() .mockReturnValue(undefined); - const uri: string = await CopybookURI.resolveCopybookURI( + const uri: string | undefined = await resolveCopybookHandler( + "/storagePath", + outputChannel, copybookName, "PRGNAME", "COBOL", ); - expect(uri).toBe(""); - expect(spySearchInWorkspace).toBeCalledTimes(2); + expect(uri).toBe(undefined); + + expect(spySearchInWorkspace).toHaveBeenCalledTimes(7); + (globSync as any) = jest.fn().mockReturnValue((x: any) => x); + }); + test("With both local and dsn references defined in the settings.json, the search is applied on local resources first", async () => { + (globSync as any) = jest.fn().mockReturnValue([copybookName]); + + const uri: string | undefined = await resolveCopybookHandler( + "/storagePath", + outputChannel, + copybookName, + "PRGNAME", + "COBOL", + ); + expect(uri).not.toBe(""); + expect(spySearchInWorkspace).toHaveBeenCalledTimes(7); (globSync as any) = jest.fn().mockReturnValue((x: any) => x); }); - test( - "With both local and dsn references defined in the settings.json, the search is applied on local resources" + - "first", - async () => { - (globSync as any) = jest.fn().mockReturnValue([copybookName]); - provideMockValueForLocalAndDSN(CPY_FOLDER_NAME, ""); - const uri: string = await CopybookURI.resolveCopybookURI( - copybookName, - "PRGNAME", - "COBOL", - ); - expect(uri).not.toBe(""); - expect(spySearchInWorkspace).toBeCalledTimes(1); - (globSync as any) = jest.fn().mockReturnValue((x: any) => x); - }, - ); test("With only a local folder defined for the dialect in the settings.json, the search is applied locally", async () => { vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ get: jest.fn().mockReturnValue([CPY_FOLDER_NAME]), }); + (globSync as any) = jest.fn().mockReturnValue([copybookName]); - const uri: string = await CopybookURI.resolveCopybookURI( + const uri: string | undefined = await resolveCopybookHandler( + "/storagePath", + outputChannel, copybookName, "PRGNAME", "DIALECT", diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookURITest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookURITest.spec.ts index b291185f9f..05c16afb76 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookURITest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookURITest.spec.ts @@ -26,22 +26,28 @@ describe("CopybooksPathGenerator tests", () => { it("creates copybook path", () => { expect( - CopybookURI.createCopybookPath(profile, dataset, "copybook"), + CopybookURI.createCopybookPath( + profile, + dataset, + "copybook", + "downloadFolder", + ), ).toEqual( path.join( - "/", - "projects", - ".c4z", + "downloadFolder", + ".zowe", ".copybooks", "profile", "dataset", - "copybook.cpy", + "copybook", ), ); }); it("creates dataset path", () => { - expect(CopybookURI.createDatasetPath(profile, dataset)).toEqual( - path.join("/projects", ".c4z", ".copybooks", "profile", "dataset"), + expect( + CopybookURI.createDatasetPath(profile, dataset, "downloadFolder"), + ).toEqual( + path.join("downloadFolder", ".zowe", ".copybooks", "profile", "dataset"), ); }); }); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/DownloadQueueTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/DownloadQueueTest.spec.ts deleted file mode 100644 index 3be89bf244..0000000000 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/DownloadQueueTest.spec.ts +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2020 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - */ -import { DownloadQueue } from "../../../services/copybook/DownloadQueue"; -import { SettingsService } from "../../../services/Settings"; - -describe("Check download queue", () => { - const documentUri = "filename"; - const element = "Test"; - const profile = "profile"; - const elementExtra = "Test_Extra"; - it("can add elements to queue", async () => { - const queue: DownloadQueue = new DownloadQueue(); - queue.push( - documentUri, - element, - SettingsService.DEFAULT_DIALECT, - profile, - false, - ); - const e = await queue.pop(); - expect(e).toEqual({ - copybook: element, - dialectType: SettingsService.DEFAULT_DIALECT, - documentUri, - profile, - quiet: false, - }); - expect(0).toEqual(queue.length); - }); - it("can wait", async () => { - const queue: DownloadQueue = new DownloadQueue(); - const result = queue.pop().then((e) => { - expect(e).toEqual({ - copybook: element, - dialectType: SettingsService.DEFAULT_DIALECT, - documentUri, - profile, - quiet: true, - }); - }); - queue.push( - documentUri, - element, - SettingsService.DEFAULT_DIALECT, - profile, - true, - ); - await result; - expect(0).toEqual(queue.length); - }); - it("can have more then one element", async () => { - const queue: DownloadQueue = new DownloadQueue(); - queue.push( - documentUri, - element, - SettingsService.DEFAULT_DIALECT, - profile, - true, - ); - queue.push( - documentUri, - elementExtra, - SettingsService.DEFAULT_DIALECT, - profile, - false, - ); - expect(await queue.pop()).toEqual({ - copybook: elementExtra, - dialectType: SettingsService.DEFAULT_DIALECT, - documentUri, - profile, - quiet: false, - }); - expect(1).toEqual(queue.length); - expect(await queue.pop()).toEqual({ - copybook: element, - dialectType: SettingsService.DEFAULT_DIALECT, - documentUri, - profile, - quiet: true, - }); - expect(0).toEqual(queue.length); - }); - it("can ignore duplicates", async () => { - const queue: DownloadQueue = new DownloadQueue(); - queue.push( - documentUri, - element, - SettingsService.DEFAULT_DIALECT, - profile, - false, - ); - queue.push( - documentUri, - element, - SettingsService.DEFAULT_DIALECT, - profile, - false, - ); - expect(1).toEqual(queue.length); - }); - it("saves both elements with different quiet flag", async () => { - const queue: DownloadQueue = new DownloadQueue(); - queue.push( - documentUri, - element, - SettingsService.DEFAULT_DIALECT, - profile, - false, - ); - queue.push( - documentUri, - element, - SettingsService.DEFAULT_DIALECT, - profile, - true, - ); - expect(2).toEqual(queue.length); - }); - it("can stop", async () => { - const queue: DownloadQueue = new DownloadQueue(); - queue.stop(); - expect(0).toEqual(queue.length); - }); - it("can stop async", async () => { - const queue: DownloadQueue = new DownloadQueue(); - const result = queue.pop().then((e) => { - expect(e).toEqual(undefined); - }); - queue.stop(); - await result; - expect(0).toEqual(queue.length); - }); -}); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts new file mode 100644 index 0000000000..a886110a44 --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +import * as vscode from "vscode"; +import { E4ECopybookService } from "../../../services/copybook/E4ECopybookService"; +import { e4eMock } from "../../../__mocks__/getE4EMock.utility"; +import { Utils } from "../../../services/util/Utils"; + +describe("e4e copybook service tests", () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + it("checks valid e4e api retrieved", async () => { + const ext = { exports: { ...e4eMock }, activate: jest.fn() }; + vscode.extensions.getExtension = jest.fn().mockReturnValue(ext); + + const spyValidate = jest.spyOn(Utils, "validateE4E"); + const api = await E4ECopybookService.getE4EAPI(); + expect(spyValidate).toHaveBeenCalled(); + expect(api).toEqual(e4eMock); + }); + + it("check getE4EClient assembles client correctly / check getE4EClient returns already assembled client once called with same Uri ", async () => { + E4ECopybookService.getE4EAPI = jest.fn().mockReturnValue(e4eMock); + await E4ECopybookService.getE4EClient("document-uri"); + const spyApi = jest.spyOn(E4ECopybookService, "getE4EAPI"); + expect(spyApi).toHaveBeenCalledTimes(1); + await E4ECopybookService.getE4EClient("document-uri"); + expect(spyApi).toHaveBeenCalledTimes(1); + await E4ECopybookService.getE4EClient("new-uri"); + expect(spyApi).toHaveBeenCalledTimes(2); + }); +}); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForDsnTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForDsnTest.spec.ts new file mode 100644 index 0000000000..c5f349bae6 --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForDsnTest.spec.ts @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ + +import { CopybookDownloaderForDsn } from "../../../../services/copybook/downloader/CopybookDownloaderForDsn"; +import { ProfileUtils } from "../../../../services/util/ProfileUtils"; +import { + zoweExplorerMock, + allMemberMock, + getContentMock, +} from "../../../../__mocks__/getZoweExplorerMock.utility"; +import * as vscode from "vscode"; +import { TextEncoder } from "util"; +import { SettingsService } from "../../../../services/Settings"; + +(vscode.workspace as any) = { + fs: { + readFile: jest + .fn() + .mockReturnValue(new TextEncoder().encode("copybook content")), + writeFile: jest.fn(), + }, + workspaceFolders: [{ uri: { fsPath: "/projects" } } as any], +}; +jest.mock("../../../../services/reporter/TelemetryService"); +describe("Tests Copybook download from DNS", () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe("checks if the copybook is eligible to dowload passed on user settings", () => { + const downloader = new CopybookDownloaderForDsn( + "storage-path", + zoweExplorerMock, + ); + beforeEach(() => { + jest.clearAllMocks(); + }); + + it("checks eligibility based on profile settings", async () => { + ProfileUtils.getProfileNameForCopybook = jest + .fn() + .mockReturnValue(undefined); + let isEligible = await downloader.isEligibleForDownload( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + "DNS.PATH", + ); + expect(isEligible).toBeFalsy(); + ProfileUtils.getProfileNameForCopybook = jest + .fn() + .mockReturnValue("test-profile"); + isEligible = await downloader.isEligibleForDownload( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + "DNS.PATH", + ); + expect(isEligible).toBeTruthy(); + }); + + it("checks eligibility based on DSN settings", async () => { + ProfileUtils.getProfileNameForCopybook = jest + .fn() + .mockReturnValue("test-profile"); + let isEligible = await downloader.isEligibleForDownload( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + undefined, + ); + expect(isEligible).toBeFalsy(); + isEligible = await downloader.isEligibleForDownload( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + "DNS.PATH", + ); + expect(isEligible).toBeTruthy(); + }); + }); + + describe("checks the copybook download using ZE DSN API's", () => { + const downloader = new CopybookDownloaderForDsn( + "storage-path", + zoweExplorerMock, + ); + it("checks not eligible copybook are not downloaded", async () => { + downloader.isEligibleForDownload = jest.fn().mockReturnValue(false); + const isDowloaded = await downloader.downloadCopybook( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + "DNS.PATH", + ); + expect(isDowloaded).toBeFalsy(); + }); + + it("checks eligible copybook which are not present in the DSN provided do not invoke ZE Api's", async () => { + downloader.isEligibleForDownload = jest.fn().mockReturnValue(true); + const isDowloaded = await downloader.downloadCopybook( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + "DNS.PATH", + ); + expect(isDowloaded).toBeFalsy(); + }); + + it("checks eligible copybook invoke appropriate ZE Api's", async () => { + ProfileUtils.getProfileNameForCopybook = jest + .fn() + .mockReturnValue("test-profile"); + downloader.isEligibleForDownload = jest.fn().mockReturnValue(true); + (downloader as any).checkForLockedProfile = jest + .fn() + .mockReturnValue(true); + SettingsService.getCopybookFileEncoding = jest + .fn() + .mockReturnValue("utf8"); + vscode.Uri.joinPath = jest + .fn() + .mockReturnValue({ fsPath: "profile/dsn.path/copybook" }); + + const isDowloaded = await downloader.downloadCopybook( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + "DNS.PATH", + ); + expect(allMemberMock).toHaveBeenCalledWith("DNS.PATH"); + expect(getContentMock).toHaveBeenCalledWith("DNS.PATH(copybook)", { + file: "profile/dsn.path/copybook", + binary: true, + returnEtag: true, + encoding: "utf8", + }); + expect(isDowloaded).toBeTruthy(); + }); + }); +}); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForE4E.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForE4E.spec.ts new file mode 100644 index 0000000000..6bf12b7727 --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForE4E.spec.ts @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +import { CopybookDownloaderForE4E } from "../../../../services/copybook/downloader/CopybookDownloaderForE4E"; +import * as path from "path"; +import * as fs from "node:fs"; +import { + e4eErrorResponseMock, + e4eErrorResponseMockDataSetPrior, + e4eResponseMock, + e4eResponseMockDataSetPrior, +} from "../../../../__mocks__/getE4EMock.utility"; + +jest.mock("node:fs", () => ({ + promises: { + writeFile: jest.fn(), + }, + mkdirSync: jest.fn(), + existsSync: jest.fn(), +})); + +import * as vscode from "vscode"; +const e4eDownloader = new CopybookDownloaderForE4E("/storagePath", undefined); + +describe("e4e copybook downloader tests", () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + it("checks copybook downloaded into correct path", () => { + expect( + (CopybookDownloaderForE4E as any).getCopybookPath( + "Instance.Instance", + "pgm", + "/storagePath", + "Copy.cpy", + ), + ).toEqual( + path.join( + "/storagePath", + ".e4e", + ".copybooks", + "Instance.Instance", + "pgm", + "Copy", + ), + ); + expect(fs.mkdirSync).toHaveBeenCalledWith( + path.join( + "/storagePath", + ".e4e", + ".copybooks", + "Instance.Instance", + "pgm", + ), + { recursive: true }, + ); + }); + it("checks not to try to download any if member or element not available in e4e", async () => { + const spyDownloadDataset = jest.spyOn(e4eDownloader, "downloadDatasetE4E"); + const spyDownloadElement = jest.spyOn(e4eDownloader, "downloadElementE4E"); + await e4eDownloader.downloadCopybookE4E( + { name: "NoCopybook", dialect: "COBOL" }, + e4eResponseMock, + ); + expect(spyDownloadDataset).not.toHaveBeenCalled(); + expect(spyDownloadElement).not.toHaveBeenCalled(); + }); + it("check download performed with respect to configuration order", async () => { + const spyDownloadDataset = jest.spyOn(e4eDownloader, "downloadDatasetE4E"); + const spyDownloadElement = jest.spyOn(e4eDownloader, "downloadElementE4E"); + await e4eDownloader.downloadCopybookE4E( + { name: "copybook", dialect: "COBOL" }, + e4eResponseMock, + ); + expect(spyDownloadElement).toHaveBeenCalledWith(e4eResponseMock, { + use_map: false, + environment: "environment", + stage: "stage", + system: "system", + subsystem: "subsystem", + type: "type", + element: "copybook", + fingerprint: "fingerprint", + }); + expect(spyDownloadDataset).not.toHaveBeenCalled(); + }); + it("check download performed only for element when no member matches", async () => { + const spyDownloadDataset = jest.spyOn(e4eDownloader, "downloadDatasetE4E"); + const spyDownloadElement = jest.spyOn(e4eDownloader, "downloadElementE4E"); + await e4eDownloader.downloadCopybookE4E( + { name: "copybook", dialect: "COBOL" }, + e4eResponseMock, + ); + expect(spyDownloadElement).toHaveBeenCalledWith(e4eResponseMock, { + use_map: false, + environment: "environment", + stage: "stage", + system: "system", + subsystem: "subsystem", + type: "type", + element: "copybook", + fingerprint: "fingerprint", + }); + expect(spyDownloadDataset).not.toHaveBeenCalled(); + }); + it("check downloadDatasetE4E does not perform IO in case of Error", async () => { + vscode.Uri.parse = jest + .fn() + .mockReturnValue({ fsPath: "/storagePath/document-uri" }); + await e4eDownloader.downloadCopybookE4E( + { name: "copybook", dialect: "COBOL" }, + e4eErrorResponseMockDataSetPrior, + ); + const spyGetMember = jest.spyOn( + e4eErrorResponseMockDataSetPrior.api, + "getMember", + ); + expect(spyGetMember).toHaveBeenCalled(); + expect(fs.promises.writeFile).not.toHaveBeenCalled(); + }); + it("check downloadElementE4E does not perform IO in case of Error", async () => { + vscode.Uri.parse = jest + .fn() + .mockReturnValue({ fsPath: "/storagePath/document-uri" }); + await e4eDownloader.downloadCopybookE4E( + { name: "copybook", dialect: "COBOL" }, + e4eErrorResponseMock, + ); + const spyGetElement = jest.spyOn(e4eErrorResponseMock.api, "getElement"); + expect(spyGetElement).toHaveBeenCalled(); + expect(fs.promises.writeFile).not.toHaveBeenCalled(); + }); + it("check downloadDatasetE4E nominal performs writeFile with correct path and content", async () => { + vscode.Uri.parse = jest + .fn() + .mockReturnValue({ fsPath: "/storagePath/document-uri" }); + await e4eDownloader.downloadCopybookE4E( + { name: "copybook", dialect: "COBOL" }, + e4eResponseMockDataSetPrior, + ); + const spyGetgetMember = jest.spyOn( + e4eResponseMockDataSetPrior.api, + "getMember", + ); + expect(spyGetgetMember).toHaveBeenCalledWith( + { instance: "instance", profile: "profile" }, + { dataset: "dataset", member: "copybook" }, + ); + expect(fs.promises.writeFile).toHaveBeenCalledWith( + path.join( + "/storagePath", + ".e4e", + ".copybooks", + "instance.profile", + "dataset", + "copybook", + ), + "content", + ); + }); +}); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForUssTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForUssTest.spec.ts new file mode 100644 index 0000000000..109a101090 --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/CopybookDownloaderForUssTest.spec.ts @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ + +import { ProfileUtils } from "../../../../services/util/ProfileUtils"; +import { + zoweExplorerMock, + allUSSFilemembers, + getUSSContentsMock, +} from "../../../../__mocks__/getZoweExplorerMock.utility"; +import * as vscode from "vscode"; +import { TextEncoder } from "util"; +import { SettingsService } from "../../../../services/Settings"; +import { CopybookDownloaderForUss } from "../../../../services/copybook/downloader/CopybookDownloaderForUss"; + +(vscode.workspace as any) = { + fs: { + readFile: jest + .fn() + .mockReturnValue(new TextEncoder().encode("copybook content")), + writeFile: jest.fn(), + }, + workspaceFolders: [{ uri: { fsPath: "/projects" } } as any], +}; +jest.mock("../../../../services/reporter/TelemetryService"); +describe("Tests Copybook download from USS", () => { + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe("checks if the copybook is eligible to dowload passed on user settings", () => { + const downloader = new CopybookDownloaderForUss( + "storage-path", + zoweExplorerMock, + ); + beforeEach(() => { + jest.clearAllMocks(); + }); + + it("checks eligibility based on profile settings", async () => { + ProfileUtils.getProfileNameForCopybook = jest + .fn() + .mockReturnValue(undefined); + let isEligible = await downloader.isEligibleForDownload( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + "DNS.PATH", + ); + expect(isEligible).toBeFalsy(); + ProfileUtils.getProfileNameForCopybook = jest + .fn() + .mockReturnValue("test-profile"); + isEligible = await downloader.isEligibleForDownload( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + "DNS.PATH", + ); + expect(isEligible).toBeTruthy(); + }); + + it("checks eligibility based on DSN settings", async () => { + ProfileUtils.getProfileNameForCopybook = jest + .fn() + .mockReturnValue("test-profile"); + let isEligible = await downloader.isEligibleForDownload( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + undefined, + ); + expect(isEligible).toBeFalsy(); + isEligible = await downloader.isEligibleForDownload( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + "DNS.PATH", + ); + expect(isEligible).toBeTruthy(); + }); + }); + + describe("checks the copybook download using ZE DSN API's", () => { + const downloader = new CopybookDownloaderForUss( + "storage-path", + zoweExplorerMock, + ); + it("checks not eligible copybook are not downloaded", async () => { + downloader.isEligibleForDownload = jest.fn().mockReturnValue(false); + const isDowloaded = await downloader.downloadCopybook( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + "/uss/path", + ); + expect(isDowloaded).toBeFalsy(); + }); + + it("checks eligible copybook which are not present in the DSN provided do not invoke ZE Api's", async () => { + downloader.isEligibleForDownload = jest.fn().mockReturnValue(true); + const isDowloaded = await downloader.downloadCopybook( + { name: "copybook-name", dialect: "COBOL" }, + "document-uri", + "/uss/path", + ); + expect(isDowloaded).toBeFalsy(); + }); + + it("checks eligible copybook invoke appropriate ZE Api's", async () => { + ProfileUtils.getProfileNameForCopybook = jest + .fn() + .mockReturnValue("test-profile"); + downloader.isEligibleForDownload = jest.fn().mockReturnValue(true); + (downloader as any).checkForLockedProfile = jest + .fn() + .mockReturnValue(true); + SettingsService.getCopybookFileEncoding = jest + .fn() + .mockReturnValue("utf8"); + vscode.Uri.joinPath = jest + .fn() + .mockReturnValue({ fsPath: "profile/uss/path/copybook" }); + + const isDowloaded = await downloader.downloadCopybook( + { name: "uss_copybook", dialect: "COBOL" }, + "document-uri", + "/uss/path", + ); + expect(allUSSFilemembers).toHaveBeenCalledWith("/uss/path"); + expect(getUSSContentsMock).toHaveBeenCalledWith( + "/uss/path/uss_copybook", + { + file: "profile/uss/path/copybook", + binary: true, + encoding: "utf8", + returnEtag: true, + }, + ); + expect(isDowloaded).toBeTruthy(); + }); + }); +}); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts new file mode 100644 index 0000000000..d27ccec8a5 --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ + +import { SettingsService } from "../../../../services/Settings"; +import { DownloadStrategyResolver } from "../../../../services/copybook/downloader/DownloadStrategyResolver"; +import { zoweExplorerMock } from "../../../../__mocks__/getZoweExplorerMock.utility"; +import { e4eMock } from "../../../../__mocks__/getE4EMock.utility"; +import { E4ECopybookService } from "../../../../services/copybook/E4ECopybookService"; + +jest.mock("../../../../services/reporter/TelemetryService"); + +describe("tests download resolver", () => { + const downloader = new DownloadStrategyResolver( + "storage-path", + zoweExplorerMock, + e4eMock, + ); + beforeEach(() => { + jest.clearAllMocks(); + }); + + describe("checks order of resolution [E4E, DSN and USS order]", () => { + const downloader = new DownloadStrategyResolver( + "storage-path", + zoweExplorerMock, + e4eMock, + ); + beforeEach(() => { + jest.clearAllMocks(); + }); + it("checks the order of copybook resolution - DNS followed by USS)", async () => { + (downloader as any).dsnDownloader.downloadCopybook = jest + .fn() + .mockReturnValue(false); + (downloader as any).ussDownloader.downloadCopybook = jest.fn(); + (downloader as any).fetchDownloadSettings = jest + .fn() + .mockReturnValue({ dsnPaths: ["dns"], ussPaths: ["uss"] }); + await downloader.downloadCopybook( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + ); + expect( + (downloader as any).dsnDownloader.downloadCopybook, + ).toHaveBeenCalledWith( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + "dns", + ); + expect( + (downloader as any).ussDownloader.downloadCopybook, + ).toHaveBeenCalledWith( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + "uss", + ); + }); + + it("checks the order of copybook resolution - USS is not called when DNS resolves)", async () => { + (downloader as any).dsnDownloader.downloadCopybook = jest + .fn() + .mockReturnValue(true); + (downloader as any).ussDownloader.downloadCopybook = jest.fn(); + (downloader as any).fetchDownloadSettings = jest + .fn() + .mockReturnValue({ dsnPaths: ["dns"], ussPaths: ["uss"] }); + await downloader.downloadCopybook( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + ); + expect( + (downloader as any).dsnDownloader.downloadCopybook, + ).toHaveBeenCalledWith( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + "dns", + ); + expect( + (downloader as any).ussDownloader.downloadCopybook, + ).toHaveBeenCalledTimes(0); + }); + }); + + it("checks resolver is able to fetch settings", () => { + SettingsService.getDsnPath = jest.fn().mockReturnValue(["dsn"]); + SettingsService.getUssPath = jest.fn().mockReturnValue(["uss"]); + const settings = (downloader as any).fetchDownloadSettings( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + ); + expect(settings).toEqual({ dsnPaths: ["dsn"], ussPaths: ["uss"] }); + }); + + it("checks the order of resolution is same as the one provided in user settings", async () => { + (downloader as any).dsnDownloader.downloadCopybook = jest + .fn() + .mockReturnValueOnce(false) + .mockReturnValue(true); + (downloader as any).ussDownloader.downloadCopybook = jest.fn(); + (downloader as any).fetchDownloadSettings = jest + .fn() + .mockReturnValue({ dsnPaths: ["dsn", "dsn-2"], ussPaths: [] }); + await downloader.downloadCopybook( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + ); + expect( + (downloader as any).dsnDownloader.downloadCopybook, + ).toHaveBeenCalledWith( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + "dsn", + ); + expect( + (downloader as any).dsnDownloader.downloadCopybook, + ).toHaveBeenCalledWith( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + "dsn-2", + ); + }); + + describe("checks successful resolution calls callback method", () => { + const downloader = new DownloadStrategyResolver( + "storage-path", + zoweExplorerMock, + e4eMock, + ); + beforeEach(() => { + jest.clearAllMocks(); + }); + + it("resolution from dsn, calls callback method", async () => { + (downloader as any).dsnDownloader.downloadCopybook = jest + .fn() + .mockReturnValue(true); + (downloader as any).fetchDownloadSettings = jest + .fn() + .mockReturnValue({ dsnPaths: ["dns"], ussPaths: ["uss"] }); + await downloader.downloadCopybook( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + ); + expect( + (downloader as any).dsnDownloader.downloadCopybook, + ).toHaveBeenCalledWith( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + "dns", + ); + }); + + it("resolution from uss, calls callback method", async () => { + (downloader as any).dsnDownloader.downloadCopybook = jest + .fn() + .mockReturnValue(false); + (downloader as any).ussDownloader.downloadCopybook = jest + .fn() + .mockReturnValue(true); + (downloader as any).fetchDownloadSettings = jest + .fn() + .mockReturnValue({ dsnPaths: ["dns"], ussPaths: ["uss"] }); + await downloader.downloadCopybook( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + ); + expect( + (downloader as any).dsnDownloader.downloadCopybook, + ).toHaveBeenCalledWith( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + "dns", + ); + expect( + (downloader as any).ussDownloader.downloadCopybook, + ).toHaveBeenCalledWith( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + "uss", + ); + }); + it("checks the order of copybook resolution - USS and DSN is not called when E4E resolves)", async () => { + (downloader as any).e4eDownloader.downloadCopybookE4E = jest + .fn() + .mockReturnValue(Promise.resolve()); + (downloader as any).dsnDownloader.downloadCopybook = jest + .fn() + .mockReturnValue(false); + (downloader as any).ussDownloader.downloadCopybook = jest + .fn() + .mockReturnValue(false); + (E4ECopybookService as any).getE4EClient = jest.fn().mockReturnValue({}); + await downloader.downloadCopybook( + { name: "copybook", dialect: "COBOL" }, + "document-uri", + ); + expect( + (downloader as any).e4eDownloader.downloadCopybookE4E, + ).toHaveBeenCalledWith({ name: "copybook", dialect: "COBOL" }, {}); + expect( + (downloader as any).dsnDownloader.downloadCopybook, + ).toHaveBeenCalledTimes(0); + expect( + (downloader as any).ussDownloader.downloadCopybook, + ).toHaveBeenCalledTimes(0); + }); + }); +}); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/nativeLanguageClient/serverRuntimeCodeActionProvider.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/nativeLanguageClient/serverRuntimeCodeActionProvider.spec.ts new file mode 100644 index 0000000000..72d4fa99db --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/nativeLanguageClient/serverRuntimeCodeActionProvider.spec.ts @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ + +import * as vscode from "vscode"; +import { Range } from "../../../__mocks__/vscode"; +import { ServerRuntimeCodeActionProvider } from "../../../services/nativeLanguageClient/serverRuntimeCodeActionProvider"; + +jest.mock("../../../services/reporter/TelemetryService"); +describe("Tests the server code actions", () => { + it("checks that no code action is provided when diagnostics is empty", async () => { + const codeActionProvider = new ServerRuntimeCodeActionProvider(); + const { doc, context, token } = getCodeactionMockObjects([]); + const codeActions = await codeActionProvider.provideCodeActions( + doc, + new Range(), + context, + token, + ); + expect(codeActions.length).toBe(0); + }); + + it("checks that no code action is provided when diagnostics is a syntax error and not a setup issue", async () => { + const codeActionProvider = new ServerRuntimeCodeActionProvider(); + const { doc, context, token } = getCodeactionMockObjects([ + { + range: new Range(), + message: "some syntax error", + severity: 0, + code: "syntax error", + }, + ]); + const codeActions = await codeActionProvider.provideCodeActions( + doc, + new Range(), + context, + token, + ); + expect(codeActions.length).toBe(0); + }); + + it("checks that code actions are provided when the diagnostics are related to the server type configuration", async () => { + const codeActionProvider = new ServerRuntimeCodeActionProvider(); + const { doc, context, token } = getCodeactionMockObjects([ + { + range: new Range(), + message: "server configuration error", + severity: 0, + code: "incompatible server type", + }, + ]); + (vscode.CodeActionKind as any) = { + QuickFix: "quickfix", + }; + (vscode.CodeAction as any) = jest.fn(); + const codeActions = await codeActionProvider.provideCodeActions( + doc, + new Range(), + context, + token, + ); + expect(codeActions.length).toBe(2); + }); +}); + +function getCodeactionMockObjects(diagnostics: vscode.Diagnostic[]) { + const doc = { + uri: { fsPath: "ws-path" }, + fileName: "test-file", + lineAt: jest.fn().mockReturnValue({ text: "" }), + } as any; + const context = { + triggerKind: 1, + diagnostics: diagnostics, + only: undefined, + }; + const token = { + isCancellationRequested: false, + onCancellationRequested: jest.fn(), + }; + return { doc, context, token }; +} diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/util/ProfileUtilsTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/util/ProfileUtilsTest.spec.ts index a125b759ad..52f2f3d855 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/util/ProfileUtilsTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/util/ProfileUtilsTest.spec.ts @@ -31,6 +31,24 @@ const getZoweExplorerMock = () => { ]), loadNamedProfile: jest.fn().mockReturnValue("profile"), }), + ussFileProvider: { + openFiles: { + "COBOLFI2.cbl": { + profile: { + name: "profile-1", + }, + }, + }, + }, + datasetProvider: { + openFiles: { + "COBOLFILE.cbl": { + profile: { + name: "profile-1", + }, + }, + }, + }, }), registeredApiTypes: jest.fn().mockReturnValue(["zosmf"]), }); @@ -41,6 +59,7 @@ describe("Test profile Utils", () => { const profile = "profile"; it("checks a profile passed through settings is always given preference over profile from doc path for copybook download", async () => { Utils.getZoweExplorerAPI = getZoweExplorerMock(); + vscode.Uri.parse = jest.fn().mockImplementation((arg) => arg); (vscode.workspace.textDocuments as any) = []; (vscode.workspace.textDocuments as any).push({ fileName: path.join(profile, programName), @@ -56,6 +75,7 @@ describe("Test profile Utils", () => { it("checks that profile is fetched from the settings if not a ZE downloaded file", async () => { Utils.getZoweExplorerAPI = getZoweExplorerMock(); + vscode.Uri.parse = jest.fn().mockImplementation((arg) => arg); (vscode.workspace.textDocuments as any) = []; (vscode.workspace.textDocuments as any).push({ fileName: path.join("profileX", programName), diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/util/SubroutineUtilsTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/util/SubroutineUtilsTest.spec.ts index 39512c01c6..785e5340df 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/util/SubroutineUtilsTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/util/SubroutineUtilsTest.spec.ts @@ -13,9 +13,9 @@ */ import * as vscode from "vscode"; -import { resolveSubroutineURI } from "../../../services/util/SubroutineUtils"; -import { searchCopybookInWorkspace } from "../../../services/util/FSUtils"; +import { searchCopybookInExtensionFolder } from "../../../services/util/FSUtils"; import { COBOL_EXT_ARRAY } from "../../../constants"; +import { resolveSubroutineURI } from "../../../services/util/SubroutineUtils"; describe("SubroutineUtils", () => { it("search in workspace by name", () => { @@ -23,14 +23,17 @@ describe("SubroutineUtils", () => { vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ get: jest.fn().mockReturnValue(folders), }); - (searchCopybookInWorkspace as any) = jest.fn().mockReturnValue("theURI"); + (searchCopybookInExtensionFolder as any) = jest + .fn() + .mockReturnValue("theURI"); - const uri = resolveSubroutineURI("name"); + const uri = resolveSubroutineURI("/storagePath", "name"); expect(uri).toBe("theURI"); - expect(searchCopybookInWorkspace).toBeCalledWith( + expect(searchCopybookInExtensionFolder).toBeCalledWith( "name", folders, COBOL_EXT_ARRAY, + "/storagePath", ); }); }); diff --git a/clients/cobol-lsp-vscode-extension/src/commands/ClearCopybookCacheCommand.ts b/clients/cobol-lsp-vscode-extension/src/commands/ClearCopybookCacheCommand.ts index 5d65149c12..922f3c38db 100644 --- a/clients/cobol-lsp-vscode-extension/src/commands/ClearCopybookCacheCommand.ts +++ b/clients/cobol-lsp-vscode-extension/src/commands/ClearCopybookCacheCommand.ts @@ -16,27 +16,31 @@ import * as path from "node:path"; import * as vscode from "vscode"; import { FileType } from "vscode"; import { - C4Z_FOLDER, CLEARING_COPYBOOK_CACHE, COPYBOOK_CACHE_CLEARED_INFO, COPYBOOKS_FOLDER, + E4E_FOLDER, + ZOWE_FOLDER, } from "../constants"; +import { Utils } from "../services/util/Utils"; /** - * Clears the downloaded copybook cache folder ({workspace}/.c4z/.copybooks). + * Clears the downloaded copybook cache folder ({globalStoragePath}/.zowe/.copybooks). * */ -export function clearCache() { +export function clearCache(uri: vscode.Uri) { vscode.window.setStatusBarMessage( CLEARING_COPYBOOK_CACHE, Promise.resolve().then( () => { - const firstWorkspaceFolder = vscode.workspace.workspaceFolders![0]; - const folderUri = firstWorkspaceFolder!.uri; - const fileUri = folderUri.with({ - path: path.join(folderUri.fsPath, C4Z_FOLDER, COPYBOOKS_FOLDER), + const zoweFileUri = uri.with({ + path: path.join(uri.fsPath, ZOWE_FOLDER, COPYBOOKS_FOLDER), }); - deleteFolderContent(fileUri); + const e4eFileUri = uri.with({ + path: path.join(uri.fsPath, E4E_FOLDER, COPYBOOKS_FOLDER), + }); + deleteFolderContent(vscode.Uri.file(zoweFileUri.fsPath)); + deleteFolderContent(vscode.Uri.file(e4eFileUri.fsPath)); vscode.window.showInformationMessage(COPYBOOK_CACHE_CLEARED_INFO); }, () => diff --git a/clients/cobol-lsp-vscode-extension/src/commands/FetchCopybookCommand.ts b/clients/cobol-lsp-vscode-extension/src/commands/FetchCopybookCommand.ts index 6ca0ac976e..05054cf9e3 100644 --- a/clients/cobol-lsp-vscode-extension/src/commands/FetchCopybookCommand.ts +++ b/clients/cobol-lsp-vscode-extension/src/commands/FetchCopybookCommand.ts @@ -27,9 +27,7 @@ export function fetchCopybookCommand( ["COBOL", "copybook", "quickfix"], "The user tries to resolve a copybook that is not currently found", ); - downloader.downloadCopybooks( - programName, - [new CopybookName(copybook, "COBOL")], - false, - ); + downloader.downloadCopybooks(programName, [ + new CopybookName(copybook, "COBOL"), + ]); } diff --git a/clients/cobol-lsp-vscode-extension/src/commands/UpdateCobolProgramRuler.ts b/clients/cobol-lsp-vscode-extension/src/commands/UpdateCobolProgramRuler.ts new file mode 100644 index 0000000000..c43bba703c --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/commands/UpdateCobolProgramRuler.ts @@ -0,0 +1,67 @@ +// /* +// * Copyright (c) 2024 Broadcom. +// * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. +// * +// * This program and the accompanying materials are made +// * available under the terms of the Eclipse Public License 2.0 +// * which is available at https://www.eclipse.org/legal/epl-2.0/ +// * +// * SPDX-License-Identifier: EPL-2.0 +// * +// * Contributors: +// * Broadcom, Inc. - initial API and implementation +// */ + +// import * as vscode from "vscode"; +// import { SettingsService } from "../services/Settings"; +// import { integer } from "vscode-languageclient"; + +// export interface LayoutStructure { +// sequence_length?: integer; +// indicator_length?: integer; +// area_a_length?: integer; +// area_b_length?: integer; +// comment_area?: integer; +// } + +// // export enum Layout { +// // IBM = "IBM", +// // HP = "HP" +// // } + +// // export const layoutMappingObject: Record = { +// // [Layout.IBM]: { sequence_length: 6, indicator_length: 1, area_a_length: 4, area_b_length: 61, comment_area: 8 }, +// // [Layout.HP]: { sequence_length: 0, indicator_length: 1, area_a_length: 4, area_b_length: 127, comment_area: 0 } +// // } + +// // export function updateCobolEditorRuler() { +// // const configuration = vscode.workspace.getConfiguration(); + +// // const rulers = SettingsService.getCobolProgramLayout(); +// // const seqLen = rulers?.sequence_length ?? 6; +// // const indcatorLen = rulers?.indicator_length ?? 1; +// // const areaA = rulers?.area_a_length ?? 4; +// // const areaB = rulers?.area_b_length ?? 61; +// // const commentLen = rulers?.comment_area ?? 8; +// // const rulerIndex = [ +// // seqLen, +// // seqLen + indcatorLen, +// // seqLen + indcatorLen + areaA, +// // seqLen + indcatorLen + areaA + areaB, +// // seqLen + indcatorLen + areaA + areaB + commentLen, +// // ]; +// // const updatedRules = { +// // ...(configuration.get("[cobol]") as { +// // "editor.guides.indentation": integer; +// // "editor.rulers": integer[]; +// // "editor.wordSeparators": string; +// // }), +// // "editor.rulers": rulerIndex, +// // }; +// // configuration.update( +// // "[cobol]", +// // updatedRules, +// // vscode.ConfigurationTarget.Workspace, +// // true, +// // ); +// // } diff --git a/clients/cobol-lsp-vscode-extension/src/constants.ts b/clients/cobol-lsp-vscode-extension/src/constants.ts index c11a93a591..62cf748f37 100644 --- a/clients/cobol-lsp-vscode-extension/src/constants.ts +++ b/clients/cobol-lsp-vscode-extension/src/constants.ts @@ -29,13 +29,15 @@ export const SERVER_PORT = "cobol-lsp.server.port"; export const SERVER_RUNTIME = "cobol-lsp.serverRuntime"; export const DIALECT_LIBS = "cobol-lsp.dialect.libs"; export const PATHS_LOCAL_KEY = "paths-local"; -export const PATHS_ZOWE = "paths-dsn"; +export const PATHS_DSN = "paths-dsn"; export const PATHS_USS = "paths-uss"; export const COBOL_PRGM_LAYOUT = "cobol-lsp.cobol.program.layout"; export const C4Z_FOLDER: string = ".c4z"; export const COPYBOOKS_FOLDER: string = ".copybooks"; export const GITIGNORE_FILE: string = ".gitignore"; export const LANGUAGE_ID = "cobol"; +export const EXP_LANGUAGE_ID = "expcobol"; +export const HP_LANGUAGE_ID = "hpcobol"; export const PROFILE_NAME_PLACEHOLDER = ""; export const DOWNLOAD_QUEUE_LOCKED_ERROR_MSG = `Invalid credentials for profile: ${PROFILE_NAME_PLACEHOLDER}. Copybook retrieval is blocked. Ensure the profile contains correct credentials.`; export const UNLOCK_DOWNLOAD_QUEUE_MSG = "Unblock and retry"; @@ -66,6 +68,15 @@ export const INSTALL_ZOWE = "Install Zowe Explorer"; export const DEFAULT_DIALECT = "COBOL"; export const CLEARING_COPYBOOK_CACHE = "Clearing downloaded copybook cache"; export const COPYBOOK_CACHE_CLEARED_INFO = "Downloaded copybooks removed"; +export const ZOWE_FOLDER: string = ".zowe"; +export const FAIL_CREATE_COPYBOOK_FOLDER_MSG = `Failed to create copybook internal folder`; +export const FAIL_CREATE_GLOBAL_STORAGE_MSG = `Failed to create extension global storage folder`; +export const E4E_SCHEME: string = "ndvr"; +export const OUTPUT_MSG_SEARCH_LOCATION = "Looking for location => "; +export const E4E_FOLDER: string = ".e4e"; +export const DATASET = "dataset"; +export const ENVIRONMENT = "environment"; +export const USE_MAP = "MAP"; export enum PUNCH_CARD { SEQUENCE_AREA_END_POS = 6, diff --git a/clients/cobol-lsp-vscode-extension/src/extension.ts b/clients/cobol-lsp-vscode-extension/src/extension.ts index 7eff6f074f..f7f69e6e90 100644 --- a/clients/cobol-lsp-vscode-extension/src/extension.ts +++ b/clients/cobol-lsp-vscode-extension/src/extension.ts @@ -18,7 +18,12 @@ import { isV1RuntimeDialectDetail } from "./dialect/utils"; import { fetchCopybookCommand } from "./commands/FetchCopybookCommand"; import { gotoCopybookSettings } from "./commands/OpenSettingsCommand"; -import { LANGUAGE_ID } from "./constants"; +import { + FAIL_CREATE_COPYBOOK_FOLDER_MSG, + FAIL_CREATE_GLOBAL_STORAGE_MSG, + LANGUAGE_ID, + ZOWE_FOLDER, +} from "./constants"; import { CopybookDownloadService } from "./services/copybook/CopybookDownloadService"; import { CopybooksCodeActionProvider } from "./services/copybook/CopybooksCodeActionProvider"; @@ -40,6 +45,9 @@ import { import { resolveSubroutineURI } from "./services/util/SubroutineUtils"; import { ServerRuntimeCodeActionProvider } from "./services/nativeLanguageClient/serverRuntimeCodeActionProvider"; import { ConfigurationWatcher } from "./services/util/ConfigurationWatcher"; +import * as path from "node:path"; +import { Utils } from "./services/util/Utils"; +import { E4ECopybookService } from "./services/copybook/E4ECopybookService"; interface __AnalysisApi { analysis(uri: string, text: string): Promise; @@ -49,13 +57,32 @@ let languageClientService: LanguageClientService; let outputChannel: vscode.OutputChannel; const API_VERSION: string = "1.0.0"; -function initialize() { +async function initialize(context: vscode.ExtensionContext) { // We need lazy initialization to be able to mock this for unit testing - const copyBooksDownloader = new CopybookDownloadService(); outputChannel = vscode.window.createOutputChannel("COBOL Language Support"); - languageClientService = new LanguageClientService(outputChannel); + try { + await vscode.workspace.fs.createDirectory(context.globalStorageUri); + } catch (error) { + const message = `${FAIL_CREATE_GLOBAL_STORAGE_MSG}: ${error}`; + outputChannel.appendLine(message); + throw Error(message); + } + const copyBooksDownloader = new CopybookDownloadService( + context.globalStorageUri.fsPath, + await Utils.getZoweExplorerAPI(), + await E4ECopybookService.getE4EAPI(), + outputChannel, + ); + languageClientService = new LanguageClientService( + outputChannel, + context.globalStorageUri, + ); const configurationWatcher = new ConfigurationWatcher(); - return { copyBooksDownloader, configurationWatcher }; + + return { + copyBooksDownloader, + configurationWatcher, + }; } export function getChannel(): vscode.OutputChannel { @@ -66,7 +93,9 @@ export async function activate( context: vscode.ExtensionContext, ): Promise<__ExtensionApi & __AnalysisApi> { DialectRegistry.clear(); - const { copyBooksDownloader, configurationWatcher } = initialize(); + const { copyBooksDownloader, configurationWatcher } = await initialize( + context, + ); initSmartTab(context); TelemetryService.registerEvent( @@ -74,13 +103,10 @@ export async function activate( ["bootstrap", "experiment-tag"], "Extension activation event was triggered", ); - copyBooksDownloader.start(); // Register Commands registerCommands(context, copyBooksDownloader); - context.subscriptions.push(copyBooksDownloader); - registerCodeActions(context); context.subscriptions.push( @@ -112,11 +138,15 @@ export async function activate( // Custom client handlers languageClientService.addRequestHandler( "cobol/resolveSubroutine", - resolveSubroutineURI, + resolveSubroutineURI.bind(undefined, context.globalStorageUri.fsPath), ); languageClientService.addRequestHandler( "copybook/resolve", - resolveCopybookHandler, + resolveCopybookHandler.bind( + undefined, + context.globalStorageUri.fsPath, + outputChannel, + ), ); languageClientService.addRequestHandler( "copybook/download", @@ -234,7 +264,7 @@ function registerCommands( vscode.commands.registerCommand( "cobol-lsp.clear.downloaded.copybooks", () => { - clearCache(); + clearCache(context.globalStorageUri); }, ), ); @@ -277,6 +307,29 @@ function registerCommands( ), ), ); + + context.subscriptions.push( + vscode.commands.registerCommand( + "cobol-lsp.open.copybook.internalfolder", + async () => { + const copybookFolder = vscode.Uri.file( + path.join(context.globalStorageUri.fsPath, ZOWE_FOLDER), + ); + try { + await vscode.workspace.fs.createDirectory(copybookFolder); + await vscode.commands.executeCommand( + "revealFileInOS", + copybookFolder, + ); + } catch (error) { + vscode.window.showErrorMessage(FAIL_CREATE_COPYBOOK_FOLDER_MSG); + outputChannel.appendLine( + `${FAIL_CREATE_COPYBOOK_FOLDER_MSG} : ${error}`, + ); + } + }, + ), + ); } function registerCodeActions(context: vscode.ExtensionContext) { diff --git a/clients/cobol-lsp-vscode-extension/src/services/LanguageClientService.ts b/clients/cobol-lsp-vscode-extension/src/services/LanguageClientService.ts index 79d78361d0..3e642c2512 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/LanguageClientService.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/LanguageClientService.ts @@ -25,7 +25,7 @@ import { LanguageClientOptions, StreamInfo, } from "vscode-languageclient/node"; -import { LANGUAGE_ID } from "../constants"; +import { HP_LANGUAGE_ID, EXP_LANGUAGE_ID, LANGUAGE_ID } from "../constants"; import { JavaCheck } from "./JavaCheck"; import { NativeExecutableService } from "./nativeLanguageClient/nativeExecutableService"; import { TelemetryService } from "./reporter/TelemetryService"; @@ -41,7 +41,10 @@ export class LanguageClientService { private isNativeBuildEnabled: boolean = false; private executableService: NativeExecutableService; - constructor(private outputChannel: vscode.OutputChannel) { + constructor( + private outputChannel: vscode.OutputChannel, + private storagePath: vscode.Uri, + ) { const ext = vscode.extensions.getExtension(extensionId)!; this.executablePath = join( ext.extensionPath, @@ -130,13 +133,15 @@ export class LanguageClientService { private createClientOptions(): LanguageClientOptions { return { - documentSelector: [LANGUAGE_ID], + documentSelector: [LANGUAGE_ID, EXP_LANGUAGE_ID, HP_LANGUAGE_ID], outputChannel: this.outputChannel, synchronize: { fileEvents: [ vscode.workspace.createFileSystemWatcher("**/pgm_conf.json"), vscode.workspace.createFileSystemWatcher("**/proc_grps.json"), - vscode.workspace.createFileSystemWatcher("**/.copybooks/**/*"), + vscode.workspace.createFileSystemWatcher( + new vscode.RelativePattern(this.storagePath, "**/*"), + ), ], }, }; diff --git a/clients/cobol-lsp-vscode-extension/src/services/ProcessorGroups.ts b/clients/cobol-lsp-vscode-extension/src/services/ProcessorGroups.ts index 715e5d9a28..5abf8cb86c 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/ProcessorGroups.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/ProcessorGroups.ts @@ -20,7 +20,7 @@ import { globSync } from "glob"; import { Uri } from "vscode"; import { backwardSlashRegex, - cleanWorkspaceFolder, + cleanWorkspaceFolderName, normalizePath, } from "./util/FSUtils"; @@ -52,7 +52,7 @@ export function loadProcessorGroupCopybookPathsConfig( .map((folder) => globSync( config.map((ele) => ele.replace(backwardSlashRegex, "/")), - { cwd: cleanWorkspaceFolder(folder) }, + { cwd: cleanWorkspaceFolderName(folder) }, ).map((s) => normalizePath(s)), ) .reduce((acc, curVal) => { diff --git a/clients/cobol-lsp-vscode-extension/src/services/Settings.ts b/clients/cobol-lsp-vscode-extension/src/services/Settings.ts index 1c7385092c..3d3399c38b 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/Settings.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/Settings.ts @@ -15,11 +15,12 @@ import * as fs from "node:fs"; import * as path from "node:path"; import * as vscode from "vscode"; +import { Utils } from "./util/Utils"; import { COPYBOOK_EXTENSIONS, PATHS_LOCAL_KEY, PATHS_USS, - PATHS_ZOWE, + PATHS_DSN, SERVER_PORT, SERVER_RUNTIME, SETTINGS_CPY_EXTENSIONS, @@ -46,49 +47,7 @@ import { loadProcessorGroupSqlBackendConfig, } from "./ProcessorGroups"; import { getProgramNameFromUri } from "./util/FSUtils"; -import { integer } from "vscode-languageclient"; - -/** - * New file (e.g .gitignore) will be created or edited if exits, under project folder - * (e.g. workspace/.c4z) with given pattern - * @param folderPath - * @param fileName - * @param pattern - */ -export function createFileWithGivenPath( - folderPath: string, - fileName: string, - pattern: string, -): void { - if ( - !vscode.workspace.workspaceFolders || - !vscode.workspace.workspaceFolders[0] - ) { - return; - } - const ws = vscode.workspace.workspaceFolders![0]; - const ch4zPath = path.join(ws.uri.fsPath, folderPath); - const filePath = path.join(ch4zPath, fileName); - try { - if (fs.existsSync(filePath)) { - const notFound = fs - .readFileSync(filePath) - .toString() - .split("\n") - .filter((e) => e.trim().length > 0) - .map((e) => e.trim()) - .every((v) => v !== pattern); - if (notFound) { - fs.appendFileSync(filePath, "\n" + pattern); - } - } else { - fs.mkdirSync(ch4zPath, { recursive: true }); - fs.writeFileSync(filePath, pattern); - } - } catch (e: any) { - vscode.window.showErrorMessage("File error: " + e.toString()); - } -} +import { SettingsUtils } from "./util/SettingsUtils"; export class TabRule { // tslint:disable-next-line:no-unnecessary-initializer @@ -154,6 +113,8 @@ export function configHandler(request: any): Array { } else { result.push(cfg); } + } else if (item.section === COBOL_PRGM_LAYOUT) { + result.push(SettingsService.getCobolProgramLayout()); } else { result.push(vscode.workspace.getConfiguration().get(item.section)); } @@ -191,7 +152,7 @@ export class SettingsService { ): string[] { const pgPaths = loadProcessorGroupCopybookPaths(documentUri, dialectType); const cobolFileName = getProgramNameFromUri(documentUri); - return [ + let paths: string[] = [ ...SettingsService.evaluateVariable( pgPaths, "fileBasenameNoExtension", @@ -203,6 +164,9 @@ export class SettingsService { dialectType, ), ]; + const wsFolders = SettingsUtils.getWorkspaceFoldersPath(true); + + return SettingsService.prepareLocalSearchFolders(paths, wsFolders); } public static getCopybookExtension( @@ -237,7 +201,7 @@ export class SettingsService { */ public static getDsnPath(documentUri: string, dialectType: string): string[] { return SettingsService.getCopybookConfigValues( - PATHS_ZOWE, + PATHS_DSN, documentUri, dialectType, ); @@ -309,7 +273,7 @@ export class SettingsService { * Return the code page for the copybook file encoding supplied by user * @returns string */ - public static getCopybookFileEncoding() { + public static getCopybookFileEncoding(): string | undefined { return vscode.workspace .getConfiguration(SETTINGS_CPY_SECTION) .get("copybook-file-encoding"); @@ -343,15 +307,7 @@ export class SettingsService { return vscode.workspace.getConfiguration().get(SERVER_RUNTIME); } - public static getCobolProgramLayout(): - | { - sequence_length?: integer; - indicator_length?: integer; - area_a_length?: integer; - area_b_length?: integer; - comment_area?: integer; - } - | undefined { + public static getCobolProgramLayout() { return vscode.workspace.getConfiguration().get(COBOL_PRGM_LAYOUT); } @@ -394,4 +350,18 @@ export class SettingsService { programFile, ); } + public static prepareLocalSearchFolders( + paths: string[], + wsFolders: string[], + ): string[] { + const result = []; + for (const p of paths) { + if (path.isAbsolute(p)) result.push(p); + else + wsFolders.forEach((wsFolder) => { + result.push(path.join(wsFolder, p)); + }); + } + return result; + } } diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookDownloadService.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookDownloadService.ts index 7f87fe0fb9..ba0e33a40b 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookDownloadService.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookDownloadService.ts @@ -12,499 +12,47 @@ * Broadcom, Inc. - initial API and implementation */ -import * as fs from "node:fs"; -import * as iconv from "iconv-lite"; -import * as Path from "node:path"; import * as vscode from "vscode"; -import { - C4Z_FOLDER, - DOWNLOAD_QUEUE_LOCKED_ERROR_MSG, - GITIGNORE_FILE, - INSTALL_ZOWE, - INVALID_CREDENTIALS_ERROR_MSG, - PATHS_USS, - PATHS_ZOWE, - PROFILE_NAME_PLACEHOLDER, - PROVIDE_PROFILE_MSG, - SETTINGS_CPY_SECTION, - UNLOCK_DOWNLOAD_QUEUE_MSG, - ZOWE_EXT_MISSING_MSG, -} from "../../constants"; -import { TelemetryService } from "../reporter/TelemetryService"; -import { createFileWithGivenPath, SettingsService } from "../Settings"; +import { DownloadStrategyResolver } from "./downloader/DownloadStrategyResolver"; +import { PROVIDE_PROFILE_MSG } from "../../constants"; import { ProfileUtils } from "../util/ProfileUtils"; -import { Utils } from "../util/Utils"; -import { CopybookURI } from "./CopybookURI"; -import { CopybookProfile, DownloadQueue } from "./DownloadQueue"; -import { TelemetryEventMeasurements } from "../reporter/model/TelemetryEvent"; +import { DownloadUtil } from "./downloader/DownloadUtil"; +import { E4ECopybookService } from "./E4ECopybookService"; +import { E4E } from "../../type/e4eApi"; export class CopybookName { - public constructor(public name: string, public dialect: string) {} + constructor(public name: string, public dialect: string) {} } -const experimentTag = "experiment-tag"; -export class CopybookDownloadService implements vscode.Disposable { - public static checkWorkspace(): boolean { - const workspaceFolders = vscode.workspace.workspaceFolders!; - if (workspaceFolders && workspaceFolders.length === 0) { - vscode.window.showErrorMessage("No workspace folder opened."); - return false; - } - return true; - } - - private static completedDownload: number = 0; - private static totalDownload: number = 0; - - private static processDownloadError(title: string) { - const actionSettings = "Change settings"; - vscode.window.showErrorMessage(title, actionSettings).then((action) => { - if (action === actionSettings) { - vscode.commands.executeCommand("cobol-lsp.cpy-manager.goto-settings"); - } - }); - } +export class CopybookDownloadService { + private downloadResolver: DownloadStrategyResolver; - private static needsUserNotification(queue: CopybookProfile[]): boolean { - return queue.find((profile) => !profile.quiet) !== undefined; - } - - private static async showQueueLockedDialog( - profileName: string, - ): Promise { - const action = await vscode.window.showErrorMessage( - DOWNLOAD_QUEUE_LOCKED_ERROR_MSG.replace( - PROFILE_NAME_PLACEHOLDER, - profileName, - ), - UNLOCK_DOWNLOAD_QUEUE_MSG, - ); - return action === UNLOCK_DOWNLOAD_QUEUE_MSG; - } - - private static isInvalidCredentials(e: any) { - return e?.mDetails?.errorCode === 401; - } - - private static async fetchCopybook( - dataset: string, - copybookProfile: CopybookProfile, - isUSS: boolean, - ): Promise { - let members: string[] = []; - try { - members = await CopybookDownloadService.getAllMembers( - dataset, - copybookProfile.profile, - isUSS, - ); - } catch (error: any) { - if (CopybookDownloadService.isInvalidCredentials(error)) { - throw error; - } - if (!copybookProfile.quiet) { - vscode.window.showErrorMessage(error.message); - } - return false; - } - const remoteCopybook = CopybookDownloadService.getRemoteCopybookName( - members, - copybookProfile.getCopybook(), - ); - if (!remoteCopybook) { - return false; - } - copybookProfile.updateCopybook(remoteCopybook); - await CopybookDownloadService.downloadCopybookFromMFUsingZowe( - dataset, - copybookProfile, - isUSS, - ); - return true; - } - - private static getRemoteCopybookName( - members: string[], - copybookName: string, - ) { - return members.find( - (ele) => - CopybookDownloadService.getFilenameWithoutExtension( - ele, - ).toUpperCase() === copybookName.toUpperCase(), - ); - } - - private static getFilenameWithoutExtension(ele: string) { - return ele.substring( - 0, - ele.lastIndexOf(".") !== -1 ? ele.lastIndexOf(".") : ele.length, - ); - } - - private static async getAllMembers( - dataset: string, - profileName: string, - isUSS: boolean, + constructor( + storagePath: string, + private explorerAPI: IApiRegisterClient | undefined, + private e4eAPI: E4E | undefined, + private outputChannel?: vscode.OutputChannel, ) { - let members: string[]; - const zoweExplorerApi = await Utils.getZoweExplorerAPI(); - const loadedProfile = zoweExplorerApi - .getExplorerExtenderApi() - .getProfilesCache() - .loadNamedProfile(profileName); - if (isUSS) { - const response = await zoweExplorerApi - .getUssApi(loadedProfile) - .fileList(dataset); - members = response.apiResponse.items.map((el) => el.name); - } else { - const response = await zoweExplorerApi - .getMvsApi(loadedProfile) - .allMembers(dataset); - members = response.apiResponse.items.map((el) => el.member); - } - return members; - } - - private static async downloadCopybookFromMFUsingZowe( - dataset: string, - copybookprofile: CopybookProfile, - isUSS: boolean, - ) { - const copybookPath = CopybookURI.createCopybookPath( - copybookprofile.profile, - dataset, - copybookprofile.getCopybook(), - ); - if (!fs.existsSync(copybookPath)) { - try { - // create .gitignore file within .c4z folder - createFileWithGivenPath(C4Z_FOLDER, GITIGNORE_FILE, "/**"); - await CopybookDownloadService.downloadCopybookContent( - dataset, - copybookprofile.getCopybook(), - copybookprofile.profile, - isUSS, - ); - } catch (err: any) { - if (CopybookDownloadService.needsUserNotification([copybookprofile])) { - vscode.window.showErrorMessage(err.message); - } - } - } - } - - private static async downloadCopybookContent( - dataset: string, - copybook: string, - profileName: string, - isUSS: boolean, - ) { - const zoweExplorerApi = await Utils.getZoweExplorerAPI(); - const loadedProfile = zoweExplorerApi - .getExplorerExtenderApi() - .getProfilesCache() - .loadNamedProfile(profileName); - const downloadBinary = !!SettingsService.getCopybookFileEncoding(); - const filePath = Path.join( - CopybookURI.createDatasetPath(profileName, dataset), - copybook.substring( - 0, - copybook.indexOf(".") !== -1 ? copybook.indexOf(".") : copybook.length, - ), - ); - - const downloadOptions = { - file: filePath, - binary: downloadBinary, - returnEtag: true, - }; - if (!SettingsService.getCopybookFileEncoding()) { - (downloadOptions as any).encoding = loadedProfile.profile.encoding; - } - - if (isUSS) { - await zoweExplorerApi - .getUssApi(loadedProfile) - .getContents(`${dataset}/${copybook}`, downloadOptions); - } else { - await zoweExplorerApi - .getMvsApi(loadedProfile) - .getContents(`${dataset}(${copybook})`, downloadOptions); - } - - if (downloadBinary) { - let newContent = iconv.decode( - fs.readFileSync(filePath), - SettingsService.getCopybookFileEncoding() as string, - ); - if (!isUSS) { - // Based on assumption - Most of source code on z/OS is 80 characters per record - JCL, HLASM, COBOL - // Can be exposed later on as a setting. - newContent = newContent.replace(/.{80}/g, `$&\n`); - } - fs.writeFileSync(filePath, newContent); - } - } - - private static async handleCopybooks( - toDownload: CopybookProfile[], - errors: Set, - progress: vscode.Progress<{ message?: string; increment?: number }>, - isUSS: boolean = false, - ) { - const promises: Promise[] = []; - try { - for (const cp of toDownload) { - const datasets = isUSS - ? SettingsService.getUssPath(cp.documentUri, cp.dialectType) - : SettingsService.getDsnPath(cp.documentUri, cp.dialectType); - for (const dataset of datasets) { - if (CopybookDownloadService.needsUserNotification(toDownload)) { - progress.report({ - message: - "Looking in " + - dataset + - ". " + - toDownload.length + - " copybook(s) left.", - }); - } - promises.push( - CopybookDownloadService.handleCopybook( - progress, - dataset, - cp, - errors, - isUSS, - ), - ); - } - } - await Promise.all(promises); - } catch (e: any) { - if (CopybookDownloadService.isInvalidCredentials(e)) { - throw e; - } - if (CopybookDownloadService.needsUserNotification(toDownload)) { - vscode.window.showErrorMessage(e.toString()); - } - } - } - - private static async handleCopybook( - progress: vscode.Progress<{ message?: string; increment?: number }>, - dataset: string, - cp: CopybookProfile, - errors: Set, - isUSS: boolean, - ) { - try { - const fetchResult = await CopybookDownloadService.fetchCopybook( - dataset, - cp, - isUSS, - ); - if (fetchResult) { - this.updateDownloadProgress(progress, errors, cp); - } - } catch (e: any) { - if (CopybookDownloadService.isInvalidCredentials(e)) { - throw e; - } - if (!cp.quiet) { - vscode.window.showErrorMessage(e.toString()); - } - } - } - - private static updateDownloadProgress( - progress: vscode.Progress<{ message?: string; increment?: number }>, - errors: Set, - cp: CopybookProfile, - ) { - errors.delete( - CopybookDownloadService.getFilenameWithoutExtension(cp.getCopybook()), - ); - this.completedDownload++; - const downloadPercent = Math.round( - (this.completedDownload / this.totalDownload) * 100, - ); - progress.report({ - increment: downloadPercent, - message: downloadPercent + "%", - }); - } - - private static isEligibleForCopybookDownload(dialects: string[]): boolean { - const dsnPath: string[] | undefined = vscode.workspace - .getConfiguration(SETTINGS_CPY_SECTION) - .get(PATHS_ZOWE); - - const dialectsDsn: string[] | undefined = []; - dialects.forEach((d) => { - const dialectDsn: string[] | undefined = vscode.workspace - .getConfiguration(SETTINGS_CPY_SECTION) - .get(d + "." + PATHS_ZOWE); - if (dialectDsn) { - dialectsDsn.push(...dialectDsn); - } - }); - - const ussPath: string[] | undefined = vscode.workspace - .getConfiguration(SETTINGS_CPY_SECTION) - .get(PATHS_USS); - const providedProfile: string | undefined = vscode.workspace - .getConfiguration(SETTINGS_CPY_SECTION) - .get("profiles"); - return ( - (dsnPath && dsnPath.length > 0) || - (ussPath && ussPath?.length > 0) || - (providedProfile && providedProfile.length > 0) || - dialectsDsn?.length > 0 + this.downloadResolver = new DownloadStrategyResolver( + storagePath, + this.explorerAPI, + this.e4eAPI, + this.outputChannel, ); } - private queue: DownloadQueue = new DownloadQueue(); - private lockedProfile: Set = new Set(); - - /** - * This method is invoked by {@link CopybookURI#resolveCopybookURI} when the target copybbok is not found on - * local workspaces and should be added in the download queue for copybooks that the LSP client will try - * to download from MF - * @param documentUri URI of the document open in workspace - * @param copybookNames list of names of the copybooks required by the LSP server - * @param quiet flag described that interaction with a user is not allowed - */ public async downloadCopybooks( documentUri: string, copybookNames: CopybookName[], - quiet: boolean = true, ): Promise { - const dialects: string[] = [ - ...new Set( - copybookNames - .map((n) => n.dialect.toLocaleLowerCase()) - .filter((n) => n !== undefined), - ), - ]; - - if (!CopybookDownloadService.isEligibleForCopybookDownload(dialects)) { - return; - } - const explorerAPI = await Utils.getZoweExplorerAPI(); if ( - CopybookDownloadService.isEligibleForCopybookDownload(dialects) && - !explorerAPI + !(await this.isPrerequisiteForDownloadSatisfied( + documentUri, + copybookNames, + )) ) { - if (!quiet) { - vscode.window - .showErrorMessage(ZOWE_EXT_MISSING_MSG, INSTALL_ZOWE) - .then((action) => { - if (action === INSTALL_ZOWE) { - vscode.commands.executeCommand( - "workbench.extensions.search", - "zowe.vscode-extension-for-zowe", - ); - } - }); - } - return; - } - - if (!CopybookDownloadService.checkWorkspace()) { return; } - const profile = await ProfileUtils.getProfileNameForCopybook(documentUri); - const availableProfiles = ProfileUtils.getAvailableProfiles(explorerAPI); - - if (!profile || availableProfiles.indexOf(profile) < 0) { - if (!quiet) { - const providedProfile: string | undefined = - SettingsService.getProfileName(); - const message = providedProfile - ? `${PROVIDE_PROFILE_MSG} Provided invalid profile name: ${providedProfile}` - : `${PROVIDE_PROFILE_MSG}`; - CopybookDownloadService.processDownloadError(message); - } - return; - } - - if (this.lockedProfile.has(profile)) { - if (quiet) { - return; - } - if (await CopybookDownloadService.showQueueLockedDialog(profile)) { - this.lockedProfile.delete(profile); - } else { - return; - } - } - - copybookNames.forEach((copybook) => { - this.queue.push( - documentUri, - copybook.name, - copybook.dialect, - profile, - quiet, - ); - }); - } - - public async start() { - let startTime: number | null = null; - const errors = new Set(); - while (true) { - const element: CopybookProfile | undefined = await this.queue.pop(); - if (!element) { - // undefined element means that service is disposed - return; - } - if (startTime === null) { - startTime = Date.now(); - } - startTime = await this.run(element, errors, startTime); - } - } - - public dispose() { - this.queue.stop(); - } - - private async process( - progress: vscode.Progress<{ message?: string; increment?: number }>, - element: CopybookProfile, - errors: Set, - startTime: number, - ) { - { - await this.handleQueue(element, errors, progress); - - if (this.queue.length === 0 && errors.size > 0) { - errors.clear(); - } - - if (this.queue.length === 0) { - TelemetryService.registerEvent( - "Download copybooks from MF", - ["copybook", "COBOL", experimentTag], - "total time to search copybooks on MF", - new Map().set( - "time elapsed", - TelemetryService.calculateTimeElapsed(startTime, Date.now()), - ) as unknown as TelemetryEventMeasurements, - ); - } - } - } - - private async run( - element: CopybookProfile, - errors: Set, - startTime: number, - ) { await vscode.window.withProgress( { location: vscode.ProgressLocation.Notification, @@ -512,77 +60,98 @@ export class CopybookDownloadService implements vscode.Disposable { }, async ( progress: vscode.Progress<{ message?: string; increment?: number }>, - ) => this.process(progress, element, errors, startTime), + ) => { + await this.processCopybookDownload( + progress, + documentUri, + copybookNames, + ); + }, ); - return startTime; } - private async handleQueue( - element: CopybookProfile, - errors: Set, + private async processCopybookDownload( progress: vscode.Progress<{ message?: string; increment?: number }>, - ) { - const toDownload: CopybookProfile[] = [element]; - while (this.queue.length > 0) { - const downloadItem = await this.queue.pop(); - if (downloadItem) { - toDownload.push(downloadItem); - } + documentUri: string, + copybookNames: CopybookName[], + ): Promise { + const totalCopybooksToDownload = copybookNames.length; + let processedCopybooks = 0; + + await Promise.all( + copybookNames.map(async (copybookName) => { + await this.downloadResolver!.downloadCopybook( + copybookName, + documentUri, + ).finally(() => { + processedCopybooks++; + this.updateDownloadProgress( + progress, + totalCopybooksToDownload, + processedCopybooks, + ); + }); + }), + ).catch((err) => { + vscode.window.showErrorMessage(err.message); + }); + } + + private async isPrerequisiteForDownloadSatisfied( + documentUri: string, + copybookNames: CopybookName[], + ): Promise { + if (await E4ECopybookService.getE4EClient(documentUri)) { + return true; } - toDownload.map((cp) => cp.getCopybook()).forEach((cb) => errors.add(cb)); - CopybookDownloadService.totalDownload = toDownload.length; - CopybookDownloadService.completedDownload = 0; - try { - await CopybookDownloadService.handleCopybooks( - toDownload, - errors, - progress, - ); + if ( + !DownloadUtil.areCopybookDownloadConfigurationsPresent( + documentUri, + copybookNames, + ) + ) + return false; + if (!this.explorerAPI) return false; + const profile = await ProfileUtils.getProfileNameForCopybook(documentUri); + const availableProfiles = ProfileUtils.getAvailableProfiles( + this.explorerAPI!, + ); + if (!profile || !availableProfiles.includes(profile)) { + const message = profile + ? `${PROVIDE_PROFILE_MSG} Provided invalid profile name: ${profile}` + : `${PROVIDE_PROFILE_MSG}`; + this.processDownloadError(message); + return false; + } + return ( + !(await DownloadUtil.isProfileLocked(profile)) && + !(await DownloadUtil.checkForInvalidCredProfile( + profile!, + this.explorerAPI, + )) + ); + } - const toDownloadUSS = toDownload - .filter((cp) => errors.has(cp.getCopybook())) - .map((cp) => cp); - const quiteModeOffCopybooks = toDownloadUSS - .filter((cp) => !cp.quiet) - .map((cp) => cp.getCopybook()); - errors.forEach((ele) => { - if (!quiteModeOffCopybooks.includes(ele)) { - errors.delete(ele); - } - }); - if (toDownloadUSS.length > 0) { - await CopybookDownloadService.handleCopybooks( - toDownloadUSS, - errors, - progress, - true, - ); - } - } catch (e: any) { - let errorMessage = e.toString(); - if (CopybookDownloadService.isInvalidCredentials(e)) { - errorMessage = INVALID_CREDENTIALS_ERROR_MSG.replace( - PROFILE_NAME_PLACEHOLDER, - element.profile, - ); - this.lockedProfile.add(element.profile); - this.queue.clean(); - TelemetryService.registerEvent( - "invalidCredentials", - ["copybook", "COBOL", "experiment-tag"], - "Zowe credentials is not valid", - ); + private processDownloadError(title: string): void { + const actionSettings = "Change settings"; + vscode.window.showErrorMessage(title, actionSettings).then((action) => { + if (action === actionSettings) { + vscode.commands.executeCommand("cobol-lsp.cpy-manager.goto-settings"); } + }); + } - TelemetryService.registerExceptionEvent( - undefined, - errorMessage, - ["copybook", "COBOL", experimentTag], - "There is an issue with zowe api layer", - ); - if (CopybookDownloadService.needsUserNotification(toDownload)) { - vscode.window.showErrorMessage(errorMessage); - } - } + private updateDownloadProgress( + progress: vscode.Progress<{ message?: string; increment?: number }>, + totalDownload: number, + completedDownload: number, + ): void { + const downloadPercent = Math.round( + (completedDownload / totalDownload) * 100, + ); + progress.report({ + increment: downloadPercent, + message: downloadPercent + "%", + }); } } diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts index 8cf3a877dc..1a3212f12f 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts @@ -11,13 +11,26 @@ * Contributors: * Broadcom, Inc. - initial API and implementation */ - +import * as vscode from "vscode"; import { SettingsService } from "../Settings"; -import { searchCopybookInWorkspace } from "../util/FSUtils"; +import { + getProgramNameFromUri, + searchCopybookInExtensionFolder, +} from "../util/FSUtils"; import { CopybookURI } from "./CopybookURI"; import { CopybookName } from "./CopybookDownloadService"; -import { Uri } from "vscode"; import * as path from "path"; +import { + DATASET, + E4E_FOLDER, + E4E_SCHEME, + ENVIRONMENT, + USE_MAP, + ZOWE_FOLDER, +} from "../../constants"; +import { E4ECopybookService } from "./E4ECopybookService"; +import { Utils } from "../util/Utils"; +import { CopybookDownloaderForE4E } from "./downloader/CopybookDownloaderForE4E"; enum CopybookFolderKind { "local", @@ -26,44 +39,67 @@ enum CopybookFolderKind { } export async function resolveCopybookHandler( + storagePath: string, + outputChannel: vscode.OutputChannel, documentUri: string, copybookName: string, dialectType: string, ): Promise { let result: string | undefined; - result = searchCopybook(documentUri, copybookName, dialectType); + const e4eApi = await E4ECopybookService.getE4EAPI(); + if (e4eApi && e4eApi.isEndevorElement(documentUri)) { + result = await getE4ECopyBookLocation( + copybookName, + documentUri, + storagePath, + outputChannel, + ); + return result; + } + result = await searchCopybook( + documentUri, + copybookName, + dialectType, + storagePath, + ); // check in subfolders under .copybooks (copybook downloaded from MF) if (!result) { - result = searchCopybookInWorkspace( + result = searchCopybookInExtensionFolder( copybookName, await CopybookURI.createPathForCopybookDownloaded( documentUri, dialectType, + path.join(storagePath, ZOWE_FOLDER), ), SettingsService.getCopybookExtension(documentUri), + storagePath, ); } return result; } -function searchCopybook( +async function searchCopybook( documentUri: string, copybookName: string, dialectType: string, + storagePath: string, ) { let result: string | undefined; + for (let i = 0; i < Object.values(CopybookFolderKind).length; i++) { const folderKind = Object.values(CopybookFolderKind)[i]; const targetFolder = getTargetFolderForCopybook( folderKind, documentUri, dialectType, + storagePath, ); const allowedExtensions = resolveAllowedExtensions(folderKind, documentUri); - result = searchCopybookInWorkspace( + result = searchCopybookInExtensionFolder( copybookName, targetFolder, allowedExtensions, + storagePath, ); if (result) { return result; @@ -76,6 +112,7 @@ function getTargetFolderForCopybook( folderKind: string | CopybookFolderKind, documentUri: string, dialectType: string, + storagePath: string, ) { let result: string[] = []; const profile = SettingsService.getProfileName()!; @@ -85,12 +122,14 @@ function getTargetFolderForCopybook( break; case CopybookFolderKind[CopybookFolderKind["downloaded-dsn"]]: result = SettingsService.getDsnPath(documentUri, dialectType).map( - (dnsPath) => CopybookURI.createDatasetPath(profile, dnsPath), + (dnsPath) => + CopybookURI.createDatasetPath(profile, dnsPath, storagePath), ); break; case CopybookFolderKind[CopybookFolderKind["downloaded-uss"]]: result = SettingsService.getUssPath(documentUri, dialectType).map( - (dnsPath) => CopybookURI.createDatasetPath(profile, dnsPath), + (dnsPath) => + CopybookURI.createDatasetPath(profile, dnsPath, storagePath), ); break; } @@ -104,11 +143,13 @@ function resolveAllowedExtensions( switch (folderKind) { case "downloaded-dsn": case "downloaded-uss": + case E4E_SCHEME: return [""]; default: return SettingsService.getCopybookExtension(documentUri); } } + export function downloadCopybookHandler( this: any, cobolFileName: string, @@ -124,3 +165,40 @@ export function downloadCopybookHandler( quietMode, ); } + +async function getE4ECopyBookLocation( + copybookName: string, + documentUri: string, + storagePath: string, + outputChannel: vscode.OutputChannel, +) { + const config = await E4ECopybookService.getE4EClient( + documentUri, + outputChannel, + ); + if (!config) { + throw Error; + } + const first = config.elements[copybookName]; + if (!first) return; + let use_map; + let instance; + if (DATASET in first) { + instance = Utils.profileAsString(config.profile); + use_map = first.dataset; + } else if (ENVIRONMENT in first) { + use_map = first.use_map ? USE_MAP : ""; + instance = CopybookURI.getEnviromentPath(first, config.profile); + } else return; + const allowedExtensions = resolveAllowedExtensions(E4E_SCHEME, documentUri); + const targetFolder = [ + CopybookURI.createDatasetPath(instance, use_map, storagePath, E4E_FOLDER), + ]; + + return searchCopybookInExtensionFolder( + copybookName, + targetFolder, + allowedExtensions, + storagePath, + ); +} diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookURI.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookURI.ts index c4d5563944..354a0cd19b 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookURI.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookURI.ts @@ -12,85 +12,42 @@ * Broadcom, Inc. - initial API and implementation */ import * as path from "node:path"; -import * as vscode from "vscode"; -import { C4Z_FOLDER, COPYBOOKS_FOLDER } from "../../constants"; +import { COPYBOOKS_FOLDER, ZOWE_FOLDER } from "../../constants"; import { SettingsService } from "../Settings"; -import { - getProgramNameFromUri, - searchCopybookInWorkspace, -} from "../util/FSUtils"; +import { getProgramNameFromUri } from "../util/FSUtils"; import { ProfileUtils } from "../util/ProfileUtils"; +import { EndevorType, ResolvedProfile } from "../../type/e4eApi.d"; +import { Utils } from "../util/Utils"; /** * This class is responsible to identify from which source resolve copybooks required by the server. */ export class CopybookURI { - /** - * This function will try to resolve a given copybook name applying a two-step search strategy: - * - search it on folders provided by the user in the setting.json - * - search in the folder where the extension download copybooks from MF (.copybooks) - * If it's not found in the previous steps than the user is notified and needs to download it from MF - * or update the setting.json with an additional folder on the workspace where to search this missed copybook. - * @param copybookName Name of the required copybook - * @param documentUri URI of the cobol file opened in the IDE - * @param dialectType name of the cobol dialect type - */ - public static async resolveCopybookURI( - copybookName: string, - documentUri: string, - dialectType: string, - ): Promise { - // check on local paths provided by the user - let result: string; - const copybookFolders: string[] = SettingsService.getCopybookLocalPath( - documentUri, - dialectType, - ); - result = - searchCopybookInWorkspace( - copybookName, - copybookFolders, - SettingsService.getCopybookExtension(documentUri), - ) || ""; - // check in subfolders under .copybooks (copybook downloaded from MF) - if (!result) { - result = - searchCopybookInWorkspace( - copybookName, - await CopybookURI.createPathForCopybookDownloaded( - documentUri, - dialectType, - ), - SettingsService.getCopybookExtension(documentUri), - ) || ""; - } - return result; - } - public static createCopybookPath( profileName: string, dataset: string, copybook: string, + downloadFolder: string, ): string { - const rootPath = vscode.workspace.workspaceFolders![0].uri.fsPath; const copybookDirPath = path.join( - rootPath, - C4Z_FOLDER, + downloadFolder, + ZOWE_FOLDER, COPYBOOKS_FOLDER, profileName, dataset, ); - return path.join(copybookDirPath, copybook + ".cpy"); + return path.join(copybookDirPath, copybook); } public static createDatasetPath( profileName: string, dataset: string, + downloadFolder: string, + source: string = ZOWE_FOLDER, ): string { - const rootPath = vscode.workspace.workspaceFolders![0].uri.fsPath; return path.join( - rootPath, - C4Z_FOLDER, + downloadFolder, + source, COPYBOOKS_FOLDER, profileName, dataset, @@ -98,14 +55,15 @@ export class CopybookURI { } /** * This method produce an array with element that following the schema - * "file://[WORKSPACE_FOLDER]/.c4z/.copybooks/PROFILE/DATASET" or - * "file://[WORKSPACE_FOLDER]/.c4z/.copybooks/PROFILE/USS" + * "file://[EXTENSION_FOLDER]/.zowe/.copybooks/PROFILE/DATASET" or + * "file://[EXTENSION_FOLDER]/.zowe/.copybooks/PROFILE/USS" * @param profile represent a name of a folder within the .copybooks folder that have the same name as the * connection name needed to download copybooks from mainframe. */ public static async createPathForCopybookDownloaded( documentUri: string, dialectType: string, + downloadFolder: string, ): Promise { const filename = getProgramNameFromUri(documentUri, true); const profile = await ProfileUtils.getProfileNameForCopybook(filename); @@ -119,8 +77,7 @@ export class CopybookURI { result = Object.assign([], datasets); result.forEach( (value, index) => - (result[index] = - C4Z_FOLDER + "/" + COPYBOOKS_FOLDER + "/" + profile + "/" + value), + (result[index] = path.join(downloadFolder, profile, value)), ); } @@ -132,10 +89,24 @@ export class CopybookURI { if (profile && ussPaths) { Object.assign([], ussPaths).forEach( (value, index) => - (result[index + baseIndex] = - C4Z_FOLDER + "/" + COPYBOOKS_FOLDER + "/" + profile + "/" + value), + (result[index + baseIndex] = path.join( + downloadFolder, + profile, + value, + )), ); } return result; } + + public static getEnviromentPath(type: EndevorType, profile: ResolvedProfile) { + return path.join( + Utils.profileAsString(profile), + type.environment, + type.stage, + type.system, + type.subsystem, + type.type, + ); + } } diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybooksCodeActionProvider.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybooksCodeActionProvider.ts index 1104fcdc96..f810422365 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybooksCodeActionProvider.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybooksCodeActionProvider.ts @@ -17,10 +17,10 @@ import { TelemetryService } from "../reporter/TelemetryService"; export class CopybooksCodeActionProvider implements vscode.CodeActionProvider { public async provideCodeActions( - doc: vscode.TextDocument, - range: vscode.Range | vscode.Selection, + _doc: vscode.TextDocument, + _range: vscode.Range | vscode.Selection, context: vscode.CodeActionContext, - token: vscode.CancellationToken, + _token: vscode.CancellationToken, ): Promise> { if (!this.shouldHaveCodeAction(context)) { return []; diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/DownloadQueue.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/DownloadQueue.ts deleted file mode 100644 index 5858ebaf0f..0000000000 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/DownloadQueue.ts +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2020 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - */ - -export class CopybookProfile { - private copybook: any; - constructor( - readonly documentUri: string, - copybook: string, - readonly dialectType: string, - readonly profile: string, - readonly quiet: boolean, - ) { - this.copybook = copybook; - } - - public equals(other: CopybookProfile): boolean { - return ( - this.documentUri == other.documentUri && - this.copybook == other.copybook && - this.dialectType == other.dialectType && - this.profile == other.profile && - this.quiet == other.quiet - ); - } - - public updateCopybook(copybook: string) { - this.copybook = copybook; - } - - public getCopybook() { - return this.copybook; - } -} - -export class DownloadQueue { - private queue: CopybookProfile[] = []; - private resolve: any; - - public push( - documentUri: string, - copybook: string, - dialectType: string, - profile: string, - quiet: boolean, - ): void { - if (this.resolve) { - this.resolve( - new CopybookProfile(documentUri, copybook, dialectType, profile, quiet), - ); - this.resolve = undefined; - } else { - const copybookProfile = new CopybookProfile( - documentUri, - copybook, - dialectType, - profile, - quiet, - ); - for (const item of this.queue) { - if (copybookProfile.equals(item)) { - return; - } - } - this.queue.push(copybookProfile); - } - } - - public async pop(): Promise { - if (this.queue.length > 0) { - return Promise.resolve(this.queue.pop()); - } - return new Promise((resolve, reject) => { - this.resolve = resolve; - }); - } - - public get length(): number { - return this.queue.length; - } - - public clean(): void { - this.queue = []; - } - - public stop(): void { - if (this.resolve) { - this.resolve(undefined); - } - } -} diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/E4ECopybookService.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/E4ECopybookService.ts new file mode 100644 index 0000000000..97e2d9bbfb --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/E4ECopybookService.ts @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +import * as vscode from "vscode"; +import { + DATASET, + ENVIRONMENT, + OUTPUT_MSG_SEARCH_LOCATION, +} from "../../constants"; +import { + E4E, + e4eResponse, + E4EExternalConfigurationResponse, + defaultConfigs, + EndevorElement, + EndevorMember, + ResolvedProfile, + EndevorType, +} from "../../type/e4eApi.d"; +import { Utils } from "../util/Utils"; + +export class E4ECopybookService { + private static E4EConfigs = new Map(); + + public static async getE4EAPI(): Promise { + const ext = vscode.extensions.getExtension( + "BroadcomMFD.explorer-for-endevor", + ); + if (!ext) { + return undefined; + } + try { + if (!ext.isActive) await ext.activate(); + const e4e = ext.exports; + if (Utils.validateE4E(e4e)) return e4e; + } catch (_err) {} + return undefined; + } + + public static async getE4EClient( + uri: string, + outputChannel?: vscode.OutputChannel, + ): Promise { + const config = this.E4EConfigs.get(uri); + if (config) { + return config; + } + const e4e = await this.getE4EAPI(); + + if (!e4e || !e4e.isEndevorElement(uri)) return undefined; + + const profile = await e4e.getProfileInfo(uri); + if (profile instanceof Error) throw profile; + + const result: E4EExternalConfigurationResponse | Error = + await e4e.getConfiguration(uri, defaultConfigs); + if (result instanceof Error) throw result; + + const candidate = result.pgroups.find( + (x) => x.name === result.pgms[0].pgroup, + ); + if (!candidate) throw Error("Invalid configuration"); + + const libs = candidate.libs as (EndevorElement | EndevorMember)[]; + let elements: { [key: string]: EndevorElement | EndevorMember } = {}; + const promises: Promise[] = []; + + for (const lib of libs) { + if (DATASET in lib) { + promises.push(this.getMembers(e4e, profile, lib.dataset)); + } + if (ENVIRONMENT in lib) { + promises.push(this.getElements(e4e, profile, lib)); + } + } + for await (const promise of promises) { + if (promise instanceof Error) { + outputChannel?.appendLine(promise.message); + } else { + for (const pro of promise) { + if (DATASET in pro && !elements[pro.member]) { + elements[pro.member] = pro; + } else if (ENVIRONMENT in pro && !elements[pro.element]) + elements[pro.element] = pro; + } + } + } + + this.writeLocationLogs(candidate?.libs, outputChannel); + + const response = { + profile: profile, + api: e4e, + uri: uri, + elements: elements, + }; + this.E4EConfigs.set(uri, response); + return response; + } + + private static writeLocationLogs( + entries: any[], + outputChannel?: vscode.OutputChannel, + ) { + entries.forEach((libEntry) => { + outputChannel?.appendLine( + OUTPUT_MSG_SEARCH_LOCATION + JSON.stringify(libEntry), + ); + }); + } + + private static async getMembers( + e4e: E4E, + profile: ResolvedProfile, + dataset: string, + ): Promise { + const list = await e4e.listMembers(profile, { dataset }); + if (list instanceof Error) return list; + + return list.map((str) => ({ + dataset: dataset, + member: str, + })); + } + private static async getElements( + e4e: E4E, + profile: ResolvedProfile, + lib: EndevorType, + ): Promise { + const list = await e4e.listElements(profile, lib); + if (list instanceof Error) return list; + + return list.map(([filename, fingerprint]) => ({ + environment: lib.environment, + element: filename, + use_map: lib.use_map ? true : false, + stage: lib.stage, + system: lib.system, + subsystem: lib.subsystem, + type: lib.type, + fingerprint: fingerprint, + })); + } +} diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForDsn.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForDsn.ts new file mode 100644 index 0000000000..59cc789bc4 --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForDsn.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +import { ProfileUtils } from "../../util/ProfileUtils"; +import { CopybookName } from "../CopybookDownloadService"; +import { DownloadUtil } from "./DownloadUtil"; +import { ZoweExplorerDownloader } from "./ZoweExplorerDownloader"; + +/** + * Copybook downloader from MVS using Zowe Explorer + */ +export class CopybookDownloaderForDsn extends ZoweExplorerDownloader { + constructor(storagePath: string, explorerAPI: IApiRegisterClient) { + super(storagePath, explorerAPI); + } + /** + * Checks if the file could be downloaded using the Zowe explorer from MVS + * @param copybookName Copybook to be downloaded. + * @param documentUri cobol programs which needs copybook + * @param dsnPath dsnpath in mainframe. + */ + async isEligibleForDownload( + _copybookName: CopybookName, + documentUri: string, + dsnPath: string | undefined, + ): Promise { + const providedProfile = await ProfileUtils.getProfileNameForCopybook( + documentUri, + ); + return !!(dsnPath && providedProfile); + } + + /** + * Downloads a file from the passed dns based on Zowe explorer + * + * @param copybookName Copybook to be downloaded. + * @param documentUri cobol programs which needs copybook + * @param dsnPath dsnpath in mainframe. + */ + async downloadCopybook( + copybookName: CopybookName, + documentUri: string, + dsnPath: string, + ): Promise { + const providedProfile = await ProfileUtils.getProfileNameForCopybook( + documentUri, + ); + + if (await this.isEligibleForDownload(copybookName, documentUri, dsnPath)) { + const memberList = await this.getAllMembers(providedProfile!, dsnPath); + const remoteCopybook = DownloadUtil.getRemoteCopybookName( + memberList, + copybookName.name, + ); + return !!( + remoteCopybook && + (await this.downloadCopybookFromMFUsingZowe( + dsnPath, + remoteCopybook, + providedProfile!, + )) + ); + } + return false; + } + + private async getAllMembers(profileName: string, dataset: string) { + const response = await this.explorerAPI + .getMvsApi(DownloadUtil.loadProfile(profileName, this.explorerAPI)) + .allMembers(dataset); + return response.apiResponse.items.map((el: any) => el.member); + } + + /** + * Downloads file using Zowe explorer from MVS based on passed parameters + * @param dataset dataset name + * @param member member name + * @param profileName ZE profile name + */ + override async downloadCopybookContent( + dataset: string, + member: string, + profileName: string, + ) { + const loadedProfile = DownloadUtil.loadProfile( + profileName, + this.explorerAPI, + ); + const downloadOptions = this.getDownloadOptions( + profileName, + dataset, + member, + loadedProfile, + ); + + await this.explorerAPI + .getMvsApi(loadedProfile) + .getContents( + `${dataset}(${DownloadUtil.getFilenameWithoutExtension(member)})`, + { ...downloadOptions, file: downloadOptions.file.fsPath }, + ); + await this.encodeDownloadedContent( + downloadOptions.file, + downloadOptions.encoding, + true, + ); + } +} diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForE4E.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForE4E.ts new file mode 100644 index 0000000000..d7dee6885c --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForE4E.ts @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +import * as vscode from "vscode"; +import * as fs from "node:fs"; +import * as Path from "node:path"; +import { + EndevorElement, + EndevorMember, + e4eResponse, +} from "../../../type/e4eApi.d"; +import { CopybookURI } from "../CopybookURI"; +import { DATASET, E4E_FOLDER, ENVIRONMENT, USE_MAP } from "../../../constants"; +import { CopybookName } from "../CopybookDownloadService"; +import { Utils } from "../../util/Utils"; + +export class CopybookDownloaderForE4E { + constructor( + private storagePath: string, + private outputChannel: vscode.OutputChannel | undefined, + ) {} + + public async downloadCopybookE4E( + copybookName: CopybookName, + endevorApi: e4eResponse, + ) { + const first = endevorApi.elements[copybookName.name]; + + if (!first) { + this.outputChannel?.appendLine( + `Failed to find ${copybookName} in Endevor`, + ); + } else if (DATASET in first) + await this.downloadDatasetE4E(endevorApi, first); + else if (ENVIRONMENT in first) + await this.downloadElementE4E(endevorApi, first); + } + + public async downloadElementE4E( + endevorApi: e4eResponse, + element: EndevorElement, + ) { + try { + const use_map = element.use_map ? USE_MAP : ""; + const instance = CopybookURI.getEnviromentPath( + element, + endevorApi.profile, + ); + const filePath: string = CopybookDownloaderForE4E.getCopybookPath( + instance, + use_map, + this.storagePath, + element.element, + ); + element.element = element.element; + const resultElement = await endevorApi.api.getElement( + endevorApi.profile, + element, + ); + + if (resultElement instanceof Error) { + this.outputChannel?.appendLine(resultElement.message); + } else { + await fs.promises.writeFile(filePath, resultElement[0]); + } + } catch (err: any) { + vscode.window.showErrorMessage(err.message); + } + } + + public async downloadDatasetE4E( + endevorApi: e4eResponse, + member: EndevorMember, + ) { + try { + const instance = Utils.profileAsString(endevorApi.profile); + const filePath: string = CopybookDownloaderForE4E.getCopybookPath( + instance, + member.dataset, + this.storagePath, + member.member, + ); + + const memberContent = await endevorApi.api.getMember(endevorApi.profile, { + dataset: member.dataset, + member: member.member, + }); + + if (memberContent instanceof Error) { + this.outputChannel?.appendLine(memberContent.message); + } else { + await fs.promises.writeFile(filePath, memberContent); + } + } catch (err: any) { + vscode.window.showErrorMessage(err.message); + } + } + + private static getCopybookPath( + instance: string, + mapped: string, + downloadFolder: string, + copybook: string, + ): string { + let folder = CopybookURI.createDatasetPath( + instance, + mapped, + downloadFolder, + E4E_FOLDER, + ); + + if (!fs.existsSync(folder)) fs.mkdirSync(folder, { recursive: true }); + + folder = Path.join( + folder, + copybook.substring( + 0, + copybook.indexOf(".") !== -1 ? copybook.indexOf(".") : copybook.length, + ), + ); + + return folder; + } +} diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForUss.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForUss.ts new file mode 100644 index 0000000000..80c0d5a3c9 --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/CopybookDownloaderForUss.ts @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +import { ProfileUtils } from "../../util/ProfileUtils"; +import { CopybookName } from "../CopybookDownloadService"; +import { DownloadUtil } from "./DownloadUtil"; +import { ZoweExplorerDownloader } from "./ZoweExplorerDownloader"; + +/** + * Copybook downloader from USS using Zowe Explorer + */ +export class CopybookDownloaderForUss extends ZoweExplorerDownloader { + constructor(storagePath: string, explorerAPI: IApiRegisterClient) { + super(storagePath, explorerAPI); + } + + /** + * Checks if the file could be downloaded using the Zowe explorer from USS + * @param copybookName Copybook to be downloaded. + * @param documentUri cobol programs which needs copybook + * @param dsnPath dsnpath in mainframe. + */ + async isEligibleForDownload( + _copybookName: CopybookName, + documentUri: string, + ussPath: string | undefined, + ): Promise { + const providedProfile = await ProfileUtils.getProfileNameForCopybook( + documentUri, + ); + return !!(ussPath && providedProfile); + } + + /** + * Downloads a file from USS using Zowe explorer + * + * @param copybookName Copybook to be downloaded. + * @param documentUri cobol programs which needs copybook + * @param ussPath ussPath in mainframe. + */ + async downloadCopybook( + copybookName: CopybookName, + documentUri: string, + ussPath: string, + ): Promise { + const providedProfile = await ProfileUtils.getProfileNameForCopybook( + documentUri, + ); + if (await this.isEligibleForDownload(copybookName, documentUri, ussPath)) { + const memberList = await this.getAllMembers(providedProfile!, ussPath); + const remoteCopybook = DownloadUtil.getRemoteCopybookName( + memberList, + copybookName.name, + ); + return !!( + remoteCopybook && + (await this.downloadCopybookFromMFUsingZowe( + ussPath, + remoteCopybook, + providedProfile!, + )) + ); + } + return false; + } + + private async getAllMembers(profileName: string, dataset: string) { + const response = await this.explorerAPI + .getUssApi(DownloadUtil.loadProfile(profileName, this.explorerAPI)) + .fileList(dataset); + return response.apiResponse.items.map((el: any) => el.name); + } + + /** + * Downloads file using Zowe explorer from USS based on passed parameters + * @param dataset dataset name + * @param member member name + * @param profileName ZE profile name + */ + override async downloadCopybookContent( + dataset: string, + member: string, + profileName: string, + ): Promise { + const loadedProfile = DownloadUtil.loadProfile( + profileName, + this.explorerAPI, + ); + const downloadOptions = this.getDownloadOptions( + profileName, + dataset, + member, + loadedProfile, + ); + + await this.explorerAPI + .getUssApi(loadedProfile) + .getContents(`${dataset}/${member}`, { + ...downloadOptions, + file: downloadOptions.file.fsPath, + }); + + await this.encodeDownloadedContent( + downloadOptions.file, + downloadOptions.encoding, + ); + } +} diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts new file mode 100644 index 0000000000..019a415db5 --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +import * as vscode from "vscode"; +import { E4E } from "../../../type/e4eApi"; +import { SettingsService } from "../../Settings"; +import { CopybookName } from "../CopybookDownloadService"; +import { E4ECopybookService } from "../E4ECopybookService"; +import { CopybookDownloaderForDsn } from "./CopybookDownloaderForDsn"; +import { CopybookDownloaderForUss } from "./CopybookDownloaderForUss"; +import { CopybookDownloaderForE4E } from "./CopybookDownloaderForE4E"; + +/** + * Copybook downloader from E4E Api or using Zowe Explorer MVS & USS Api based on configuration + */ +export class DownloadStrategyResolver { + private readonly dsnDownloader?: CopybookDownloaderForDsn; + private readonly ussDownloader?: CopybookDownloaderForUss; + private readonly e4eDownloader?: CopybookDownloaderForE4E; + + constructor( + storagePath: string, + explorerApi: IApiRegisterClient | undefined, + e4eApi: E4E | undefined, + outputChannel?: vscode.OutputChannel, + ) { + if (e4eApi) { + this.e4eDownloader = new CopybookDownloaderForE4E( + storagePath, + outputChannel, + ); + } + if (explorerApi) { + this.ussDownloader = new CopybookDownloaderForUss( + storagePath, + explorerApi, + ); + this.dsnDownloader = new CopybookDownloaderForDsn( + storagePath, + explorerApi, + ); + } + } + + /** + * Downloads a file using E4E Api or Zowe Explorer Api based on provided configuration + * + * @param copybookName Copybook to be downloaded. + * @param documentUri cobol programs which needs copybook + * @param callback callback function + */ + async downloadCopybook( + copybookName: CopybookName, + documentUri: string, + ): Promise { + const e4e = await E4ECopybookService.getE4EClient(documentUri); + if (this.e4eDownloader && e4e) { + await this.e4eDownloader.downloadCopybookE4E(copybookName, e4e); + return true; + } + + const { dsnPaths, ussPaths } = this.fetchDownloadSettings( + copybookName, + documentUri, + ); + + if (this.dsnDownloader) { + const dsnSuccess = await this.downloadFromPaths( + this.dsnDownloader, + copybookName, + documentUri, + dsnPaths, + ); + if (dsnSuccess) return true; + } + + if (this.ussDownloader) { + return this.downloadFromPaths( + this.ussDownloader, + copybookName, + documentUri, + ussPaths, + ); + } + + return false; + } + + private async downloadFromPaths( + downloader: CopybookDownloaderForDsn | CopybookDownloaderForUss, + copybook: CopybookName, + documentUri: string, + paths: string[] | undefined, + ): Promise { + if (!paths) return false; + + for (const path of paths) { + const success = await downloader.downloadCopybook( + copybook, + documentUri, + path, + ); + if (success) return true; + } + + return false; + } + + private fetchDownloadSettings( + copybookName: CopybookName, + documentUri: string, + ): { dsnPaths: string[]; ussPaths: string[] } { + const dsnPaths = SettingsService.getDsnPath( + documentUri, + copybookName.dialect, + ); + const ussPaths = SettingsService.getUssPath( + documentUri, + copybookName.dialect, + ); + return { dsnPaths, ussPaths }; + } +} diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadUtil.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadUtil.ts new file mode 100644 index 0000000000..35204e32c8 --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadUtil.ts @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +import * as vscode from "vscode"; +import { TelemetryService } from "../../reporter/TelemetryService"; +import { + DOWNLOAD_QUEUE_LOCKED_ERROR_MSG, + INVALID_CREDENTIALS_ERROR_MSG, + PROFILE_NAME_PLACEHOLDER, + UNLOCK_DOWNLOAD_QUEUE_MSG, +} from "../../../constants"; +import { ZoweExplorerDownloader } from "./ZoweExplorerDownloader"; +import { CopybookName } from "../CopybookDownloadService"; +import { SettingsService } from "../../Settings"; + +/** + * Utility class for downloading copybooks + */ +export class DownloadUtil { + public static getRemoteCopybookName(members: string[], copybookName: string) { + const copybookNameUpperCase = copybookName.toUpperCase(); + return members.find( + (ele) => + DownloadUtil.getFilenameWithoutExtension(ele).toUpperCase() === + copybookNameUpperCase, + ); + } + + /** + * Retrieves a filename excluding extension for a passed file name + * @param ele filename + * @returns filename excluding extension + */ + public static getFilenameWithoutExtension(ele: string) { + return ele.substring( + 0, + ele.lastIndexOf(".") !== -1 ? ele.lastIndexOf(".") : ele.length, + ); + } + + /** + * Checks if path exists + * @param path path + * @returns boolean + */ + public static async checkPathExists(path: string): Promise { + try { + await vscode.workspace.fs.stat(vscode.Uri.file(path)); + return true; // Path exists + } catch (error) { + return false; + } + } + + /** + * returns true if the passed profile has invalid credentials, false otherwise + * @param profileName + * @param explorerAPI + * @returns true if the passed profile has invalid credentials, false otherwise + */ + public static async checkForInvalidCredProfile( + profileName: string, + explorerAPI: IApiRegisterClient, + ): Promise { + if ( + ZoweExplorerDownloader.profileStore.get(profileName) === "valid-profile" + ) { + return false; + } + + try { + const profile = this.loadProfile(profileName, explorerAPI); + await explorerAPI.getUssApi(profile).fileList("/"); + } catch (error) { + this.checkForInvalidCredentials(error, profileName); + return true; + } + + ZoweExplorerDownloader.profileStore.set(profileName, "valid-profile"); + return false; + } + + /** + * returns IProfileLoaded from a passed profile name + * @param profileName + * @param explorerAPI + * @returns IProfileLoaded + */ + public static loadProfile( + profileName: string, + explorerAPI: IApiRegisterClient, + ): IProfileLoaded { + return explorerAPI + .getExplorerExtenderApi() + .getProfilesCache() + .loadNamedProfile(profileName); + } + + private static checkForInvalidCredentials(e: any, profileName: string) { + if (this.isInvalidCredentials(e)) { + ZoweExplorerDownloader.profileStore.set(profileName, "locked-profile"); + const errorMessage = INVALID_CREDENTIALS_ERROR_MSG.replace( + PROFILE_NAME_PLACEHOLDER, + profileName, + ); + vscode.window.showErrorMessage(errorMessage); + } + + TelemetryService.registerExceptionEvent( + undefined, + JSON.stringify(e), + ["copybook", "COBOL", "experiment-tag"], + "There is an issue with zowe api layer", + ); + } + + /** + * checks if a zowe profile is locked due to invalid credentials + * @param profileName + * @returns True is zowe profile is locked, false otherwise + */ + public static async isProfileLocked(profileName: string): Promise { + const profileStatus = ZoweExplorerDownloader.profileStore.get(profileName); + if (profileStatus === "valid-profile" || !profileStatus) { + return false; + } + + const shouldUnlock = await this.showQueueLockedDialog(profileName); + if (shouldUnlock) { + ZoweExplorerDownloader.profileStore.delete(profileName); + } + + return shouldUnlock; + } + + /** + * checks if copybook download configurations are present + * @param documentUri + * @param copybookNames + * @returns true if if copybook download configurations are present, fasle otherwise + */ + public static areCopybookDownloadConfigurationsPresent( + documentUri: string, + copybookNames: CopybookName[], + ): boolean { + const dialects = new Set( + copybookNames.map((n) => n.dialect?.toLocaleUpperCase()).filter(Boolean), + ); + + for (const dialect of dialects) { + const dsnPath = SettingsService.getDsnPath(documentUri, dialect); + const ussPath = SettingsService.getUssPath(documentUri, dialect); + if ((dsnPath?.length ?? 0) > 0 || (ussPath?.length ?? 0) > 0) { + return true; + } + } + + return false; + } + + private static async showQueueLockedDialog( + profileName: string, + ): Promise { + const action = await vscode.window.showErrorMessage( + DOWNLOAD_QUEUE_LOCKED_ERROR_MSG.replace( + PROFILE_NAME_PLACEHOLDER, + profileName, + ), + UNLOCK_DOWNLOAD_QUEUE_MSG, + ); + + return action === UNLOCK_DOWNLOAD_QUEUE_MSG; + } + + private static isInvalidCredentials(e: any) { + return e?.mDetails?.errorCode === 401; + } +} diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/ZoweExplorerDownloader.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/ZoweExplorerDownloader.ts new file mode 100644 index 0000000000..53ea8659d8 --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/ZoweExplorerDownloader.ts @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +import * as vscode from "vscode"; +import { DownloadUtil } from "./DownloadUtil"; +import * as iconv from "iconv-lite"; +import { SettingsService } from "../../Settings"; +import { CopybookURI } from "../CopybookURI"; + +export abstract class ZoweExplorerDownloader { + public static profileStore: Map = + new Map(); + + constructor( + private readonly storagePath: string, + protected readonly explorerAPI: IApiRegisterClient, + ) {} + + protected abstract downloadCopybookContent( + dataset: string, + member: string, + profileName: string, + ): Promise; + + protected getDownloadOptions( + profileName: string, + dataset: string, + member: string, + loadedProfile: IProfileLoaded, + ) { + const downloadBinary = !!SettingsService.getCopybookFileEncoding(); + const baseUri = vscode.Uri.file( + CopybookURI.createDatasetPath(profileName, dataset, this.storagePath), + ); + const filePath = vscode.Uri.joinPath(baseUri, member); + const encoding = downloadBinary + ? SettingsService.getCopybookFileEncoding() + : loadedProfile.profile.encoding; + return { + file: filePath, + binary: downloadBinary, + returnEtag: true, + encoding, + }; + } + + protected async encodeDownloadedContent( + filePath: vscode.Uri, + encoding: string | undefined, + insertNewLineOn80Char: boolean = false, + ) { + const fileContents = await vscode.workspace.fs.readFile(filePath); + if (encoding) { + let newContent = iconv.decode(Buffer.from(fileContents), encoding); + + if (insertNewLineOn80Char) { + // Based on assumption - Most of source code on z/OS is 80 characters per record - JCL, HLASM, COBOL + // Can be exposed later on as a setting. + newContent = newContent.replace(/.{80}/g, `$&\n`); + } + const writeData = Buffer.from(newContent, "utf8"); + await vscode.workspace.fs.writeFile(filePath, writeData); + } + } + + protected async downloadCopybookFromMFUsingZowe( + dataset: string, + member: string, + profileName: string, + ): Promise { + const copybookPath = CopybookURI.createCopybookPath( + profileName, + dataset, + member, + this.storagePath, + ); + + if (!(await DownloadUtil.checkPathExists(copybookPath))) { + try { + await this.downloadCopybookContent(dataset, member, profileName); + return true; + } catch (err: any) { + vscode.window.showErrorMessage(err.message); + } + } + + return false; + } +} diff --git a/clients/cobol-lsp-vscode-extension/src/services/util/FSUtils.ts b/clients/cobol-lsp-vscode-extension/src/services/util/FSUtils.ts index 5dd6285f58..98c212b21d 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/util/FSUtils.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/util/FSUtils.ts @@ -12,71 +12,13 @@ * Broadcom, Inc. - initial API and implementation */ -import { existsSync, readdirSync } from "fs"; import * as fs from "fs"; import * as path from "path"; import { globSync, hasMagic } from "glob"; import * as urlUtil from "url"; -import { SettingsUtils } from "./SettingsUtils"; import { Uri } from "vscode"; import * as vscode from "vscode"; - -/** - * This method is responsible to return a valid URI without extension if the extension is not provided or an URI - * that contains an allowed extension. - * @param folder is the first part of the URI referred to the folder defined in the setting.json - * @param entityName is the name of entity identified by the LSP server that needs to be found locally - * @param extensions an optional parameter to produce an URI of an allowed extension list, verifying that - * this URI really exists on FS. - * - */ -export function getURIFrom( - folder: string, - entityName: string, - extensions?: string[], -): urlUtil.URL | undefined { - if (!extensions) { - const url = new urlUtil.URL(path.join(folder, entityName)); - if (existsSync(url)) { - return url; - } - } else { - const fileList = readdirSync(new urlUtil.URL(folder)); - for (const extension of extensions) { - const copybookFileWithExtension = (entityName + extension).toUpperCase(); - const found = fileList.find( - (filename) => - filename.toUpperCase() === copybookFileWithExtension.toUpperCase(), - ); - if (found) { - return new urlUtil.URL(path.join(folder, found)); - } - } - } -} - -/** - * This function construct an URI from a valid resource provided from the setting configuration - * @param resource represent the file to search within the workspace folder list - * @return an URI representation of the file or undefined if not found - */ -export function getURIFromResource(resource: string): urlUtil.URL[] { - const uris: urlUtil.URL[] = []; - for (const workspaceFolderPath of SettingsUtils.getWorkspaceFoldersPath()) { - const workspaceFolder = cleanWorkspaceFolder(workspaceFolderPath); - const uri = isAbsolute(resource) - ? urlUtil.pathToFileURL(resource) - : new urlUtil.URL( - path.normalize(path.join("file://" + workspaceFolder, resource)), - ); - - if (fs.existsSync(uri)) { - uris.push(uri); - } - } - return uris; -} - +import { Utils } from "./Utils"; /** * This method scans the list of folders as given input and find the required entity name within the folder. * If found returns its URI representation @@ -84,26 +26,25 @@ export function getURIFromResource(resource: string): urlUtil.URL[] { * @param copybookFolders list of folders from where to search the copybook * @param extensions list of possible copybooks extensions */ -export function searchCopybookInWorkspace( +export function searchCopybookInExtensionFolder( copybookName: string, copybookFolders: string[] | undefined, extensions: string[] | undefined, + storagePath: string, ): string | undefined { - for (const workspaceFolderPath of SettingsUtils.getWorkspaceFoldersPath()) { - if (!copybookFolders || !extensions) return undefined; - const workspaceFolder = cleanWorkspaceFolder(workspaceFolderPath); - for (const p of copybookFolders) { - for (const ext of extensions) { - const searchResult = globSearch(workspaceFolder, p, copybookName, ext); - if (searchResult) { - const root = path.parse(searchResult).root; - const urlPath = searchResult - .substring(root.length) - .split(path.sep) - .map((s) => encodeURIComponent(s)) - .join(path.sep); - return new urlUtil.URL("file://" + root + urlPath).href; - } + if (!copybookFolders || !extensions) return undefined; + const extensionFolder = cleanWorkspaceFolderName(storagePath); + for (const p of copybookFolders) { + for (const ext of extensions) { + const searchResult = globSearch(extensionFolder, p, copybookName, ext); + if (searchResult) { + const root = path.parse(searchResult).root; + const urlPath = searchResult + .substring(root.length) + .split(path.sep) + .map((s) => encodeURIComponent(s)) + .join(path.sep); + return new urlUtil.URL("file://" + root + urlPath).href; } } } @@ -112,7 +53,7 @@ export function searchCopybookInWorkspace( export const backwardSlashRegex = new RegExp("\\\\", "g"); -export function cleanWorkspaceFolder(workspaceFolderPath: string) { +export function cleanWorkspaceFolderName(workspaceFolderPath: string) { return workspaceFolderPath.replace(/\/(.*:)/, "$1"); } @@ -126,7 +67,7 @@ function globSearch( copybookName: string, ext: string, ): string | undefined { - const pathName: string = isAbsolute(resource) + const pathName: string = path.isAbsolute(resource) ? resource : path.normalize(path.join(workspaceFolder, resource)); const segments = pathName.split(path.sep); @@ -144,7 +85,7 @@ function globSearch( .replace(backwardSlashRegex, "/"); const normalizePathName = pathName.replace(backwardSlashRegex, "/"); let pattern = - normalizePathName === cwd + normalizePathName === cwd && !Utils.isUNCPath(normalizePathName) ? "" : normalizePathName.replace(cwd.endsWith("/") ? cwd : cwd + "/", ""); const suffix = @@ -163,25 +104,9 @@ export function getProgramNameFromUri( uri: string, includeExt: boolean = false, ): string { - const fullPath = Uri.parse(uri).fsPath; + const fullPath = Uri.parse(uri, true).fsPath; if (includeExt) { return path.basename(fullPath); } return path.basename(fullPath, path.extname(fullPath)); } - -function isAbsolute(resource: string): boolean { - return path.resolve(resource) === path.normalize(resource); -} - -/** - * This method delete the folder's content. - * @param pathToClear represents the folder to be cleaned. - */ -export function cleanDirectory(pathToClear: string) { - if (fs.existsSync(pathToClear)) { - readdirSync(pathToClear).forEach((f) => - fs.rmSync(path.join(pathToClear, `${f}`), { recursive: true }), - ); - } -} diff --git a/clients/cobol-lsp-vscode-extension/src/services/util/ProfileUtils.ts b/clients/cobol-lsp-vscode-extension/src/services/util/ProfileUtils.ts index 2d0117d755..b085981848 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/util/ProfileUtils.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/util/ProfileUtils.ts @@ -25,14 +25,12 @@ export class ProfileUtils { if (!zoweExplorerApi) { return undefined; } - return ProfileUtils.getValidProfileForCopybookDownload( - cobolFileName, - ProfileUtils.getAvailableProfiles(zoweExplorerApi), - ); + return ProfileUtils.getValidProfileForCopybookDownload(cobolFileName); } public static getAvailableProfiles(zoweExplorerApi: IApiRegisterClient) { let availableProfiles: string[] = []; + if (!zoweExplorerApi) return availableProfiles; zoweExplorerApi.registeredApiTypes().forEach((profileType) => { availableProfiles = availableProfiles.concat( zoweExplorerApi @@ -45,13 +43,11 @@ export class ProfileUtils { return availableProfiles; } - private static getValidProfileForCopybookDownload( + private static async getValidProfileForCopybookDownload( programName: string, - availableProfiles: string[], - ): string | undefined { - const profileFromDoc = ProfileUtils.getProfileFromDocument( + ): Promise { + const profileFromDoc = await ProfileUtils.getProfileFromDocument( programName, - availableProfiles, ); const passedProfile = SettingsService.getProfileName(); if (!passedProfile && profileFromDoc) { @@ -60,36 +56,29 @@ export class ProfileUtils { return passedProfile; } - private static getProfileFromDocument( + private static async getProfileFromDocument( programName: string, - availableProfiles: string[], - ): string | undefined { - for (const doc of vscode.workspace.textDocuments) { - const openName = path.basename(doc.fileName); - if (unescape(programName) === openName) { - const profile = ProfileUtils.tryGetProfileFromDocumentPath( - doc.fileName, - availableProfiles, - ); - if (profile) { - return profile; + ): Promise { + const vscodeOpenedDoc = vscode.workspace.textDocuments.find((doc) => + doc.fileName.endsWith(programName), + ); + if (!vscodeOpenedDoc) return; + + const zoweExplorerApi = await Utils.getZoweExplorerAPI(); + const allOpenedFilesThroughZoweExplorer = zoweExplorerApi + ? { + ...zoweExplorerApi.getExplorerExtenderApi().ussFileProvider.openFiles, + ...zoweExplorerApi.getExplorerExtenderApi().datasetProvider.openFiles, } - } - } - return undefined; - } + : []; - private static tryGetProfileFromDocumentPath( - docPath: string, - availableProfiles: string[], - ): string | undefined { - const segments: string[] = docPath.split(path.sep); - if (segments.length < 2) { - return undefined; - } - const profileName = segments[segments.length - 2]; - if (availableProfiles.indexOf(profileName) >= 0) { - return profileName; + const cobolLsDocPath = vscode.Uri.parse(vscodeOpenedDoc.fileName).fsPath; + for (const [path, profile] of Object.entries( + allOpenedFilesThroughZoweExplorer, + )) { + if (cobolLsDocPath === vscode.Uri.parse(path).fsPath) { + return profile.profile.name; + } } return undefined; } diff --git a/clients/cobol-lsp-vscode-extension/src/services/util/SettingsUtils.ts b/clients/cobol-lsp-vscode-extension/src/services/util/SettingsUtils.ts index 6375a80c11..202e8f504a 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/util/SettingsUtils.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/util/SettingsUtils.ts @@ -22,14 +22,16 @@ export class SettingsUtils { fsPath: boolean | undefined = undefined, ): string[] { const result: string[] = []; - const workspaceFolders = vscode.workspace.workspaceFolders!; - workspaceFolders.forEach((workspaceFolder) => { - result.push( - fsPath === undefined - ? workspaceFolder.uri.path - : workspaceFolder.uri.fsPath, - ); - }); + const workspaceFolders = vscode.workspace.workspaceFolders; + if (workspaceFolders) { + workspaceFolders.forEach((workspaceFolder) => { + result.push( + fsPath === undefined + ? workspaceFolder.uri.path + : workspaceFolder.uri.fsPath, + ); + }); + } return result; } } diff --git a/clients/cobol-lsp-vscode-extension/src/services/util/SubroutineUtils.ts b/clients/cobol-lsp-vscode-extension/src/services/util/SubroutineUtils.ts index 71759b6887..eb4a96d1e9 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/util/SubroutineUtils.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/util/SubroutineUtils.ts @@ -11,8 +11,7 @@ * Contributors: * Broadcom, Inc. - initial API and implementation */ - -import { searchCopybookInWorkspace } from "./FSUtils"; +import { searchCopybookInExtensionFolder } from "./FSUtils"; import { COBOL_EXT_ARRAY } from "../../constants"; import { SettingsService } from "../Settings"; @@ -22,8 +21,16 @@ import { SettingsService } from "../Settings"; * @param name the name of subroutine * @return subroutine file URI if it was found or undefined otherwise */ -export function resolveSubroutineURI(name: string): string { +export function resolveSubroutineURI( + storagePath: string, + name: string, +): string { const folders: string[] | undefined = SettingsService.getSubroutineLocalPath(); - return searchCopybookInWorkspace(name, folders, COBOL_EXT_ARRAY)!; + return searchCopybookInExtensionFolder( + name, + folders, + COBOL_EXT_ARRAY, + storagePath, + )!; } diff --git a/clients/cobol-lsp-vscode-extension/src/services/util/Utils.ts b/clients/cobol-lsp-vscode-extension/src/services/util/Utils.ts index 751d29f896..0903511fcf 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/util/Utils.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/util/Utils.ts @@ -13,10 +13,12 @@ */ import * as vscode from "vscode"; +import { E4E, ResolvedProfile } from "../../type/e4eApi"; /** * This class collects utility methods for general purpose activities */ +const nameof = (name: keyof T) => name; export class Utils { /** * This method provides a quick way to verify if the input is null or undefined. @@ -27,17 +29,56 @@ export class Utils { public static isNullOrUndefined(content: string): boolean { return content === null || content === undefined; } + /** + * Based on below refrences + * Ref : https://stackoverflow.com/questions/6344936/validation-of-unc-path-using-javascript + * Ref : https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/62e862f4-2a51-452e-8eeb-dc4ff5ee33cc?redirectedfrom=MSDN + */ + private static UNC_PATH_REGEX = + /^\\\\([^\\:\|\[\]\/";<>+=,?* _]+)\\([\u0020-\u0021\u0023-\u0029\u002D-\u002E\u0030-\u0039\u0040-\u005A\u005E-\u007B\u007E-\u00FF]{1,80})(((?:\\[\u0020-\u0021\u0023-\u0029\u002D-\u002E\u0030-\u0039\u0040-\u005A\u005E-\u007B\u007E-\u00FF]{1,255})+?|)(?:\\((?:[\u0020-\u0021\u0023-\u0029\u002B-\u002E\u0030-\u0039\u003B\u003D\u0040-\u005B\u005D-\u007B]{1,255}){1}(?:\:(?=[\u0001-\u002E\u0030-\u0039\u003B-\u005B\u005D-\u00FF]|\:)(?:([\u0001-\u002E\u0030-\u0039\u003B-\u005B\u005D-\u00FF]+(?!\:)|[\u0001-\u002E\u0030-\u0039\u003B-\u005B\u005D-\u00FF]*)(?:\:([\u0001-\u002E\u0030-\u0039\u003B-\u005B\u005D-\u00FF]+)|))|)))|)$/; - public static async getZoweExplorerAPI(): Promise { - const ext = vscode.extensions.getExtension( + public static async getZoweExplorerAPI(): Promise< + IApiRegisterClient | undefined + > { + const extension = vscode.extensions.getExtension( "Zowe.vscode-extension-for-zowe", ); - if (!ext) { - return Promise.resolve( - undefined, - ) as unknown as Promise; + if (!extension) { + return undefined; + } + + try { + await extension.activate(); + return extension.exports as IApiRegisterClient; + } catch { + return undefined; } - await ext.activate(); - return ext.exports as any; + } + + /** + * Checks is a path is a UNC path + * @param path to be checked + * @returns true if passed path is UNC path, false otherwise + */ + public static isUNCPath(path: string) { + return this.UNC_PATH_REGEX.test(path); + } + public static validateE4E(e4e: any): e4e is E4E { + const valid = + e4e instanceof Object && + nameof("listElements") in e4e && + nameof("getElement") in e4e && + nameof("listMembers") in e4e && + nameof("getMember") in e4e && + nameof("isEndevorElement") in e4e && + nameof("getProfileInfo") in e4e && + nameof("getConfiguration") in e4e && + nameof("onDidChangeElement") in e4e; + if (!valid) throw Error("incompatible interface"); + return valid; + } + + public static profileAsString(profile: ResolvedProfile) { + return `${profile.instance}.${profile.profile}`; } } diff --git a/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.test.ts b/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.test.ts index 0caecf9c06..809dad0e9d 100644 --- a/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.test.ts +++ b/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.test.ts @@ -236,9 +236,9 @@ suite("Integration Test Suite", function () { assert.strictEqual(diagnostics.length, 1); helper.assertRangeIsEqual( diagnostics[0].range, - range(pos(28, 22), pos(28, 29)), + range(pos(29, 7), pos(29, 14)), ); - assert.ok(diagnostics[0].message.includes("Missing token")); + assert.ok(diagnostics[0].message.includes("A period was assumed before")); await helper.deleteLine(editor, 28); await helper.insertString( editor, @@ -352,13 +352,13 @@ suite("Integration Test Suite", function () { await helper.insertString(editor, pos(40, 21), "\n Mov"); await helper.waitFor( - () => vscode.languages.getDiagnostics(editor.document.uri).length === 4, + () => vscode.languages.getDiagnostics(editor.document.uri).length === 3, ); diagnostics = vscode.languages.getDiagnostics(editor.document.uri); - assert.strictEqual(diagnostics.length, 4); + assert.strictEqual(diagnostics.length, 3); assert.ok( diagnostics[2].message.includes( - "A misspelled word, maybe you want to put MOVE", + "The following token must start in Area A: Mov", ), ); }, @@ -559,13 +559,10 @@ suite("Integration Test Suite", function () { copyDiagnostics = vscode.languages.getDiagnostics(copybookUri); assert.strictEqual( copyDiagnostics.length, - 1, + 2, "got: " + JSON.stringify(diagnostics), ); - assert.strictEqual( - copyDiagnostics[0].message, - "Extraneous input 'VvvALUE'", - ); + assert.strictEqual(copyDiagnostics[1].message, "Syntax error on 'VvvALUE'"); }) .timeout(helper.TEST_TIMEOUT) .slow(1000); diff --git a/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.user1.test.ts b/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.user1.test.ts index be8251f905..84fe3eb513 100644 --- a/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.user1.test.ts +++ b/clients/cobol-lsp-vscode-extension/src/test/suite/lsp.spec.user1.test.ts @@ -63,7 +63,7 @@ suite("Tests with USER1.cbl", function () { ); assert.strictEqual(result.length, 1); assert.ok( - result[0].uri.fsPath === editor.document.fileName && + result[0].uri.fsPath.includes(editor.document.fileName) && result[0].range.start.line === 31 && result[0].range.start.character === 7, "Checks behavior of go to definition action", @@ -78,7 +78,7 @@ suite("Tests with USER1.cbl", function () { ); assert.ok( result.length === 3 && - result[0].uri.fsPath === editor.document.fileName && + result[0].uri.fsPath.includes(editor.document.fileName) && result[0].range.start.line === 20 && result[1].range.start.line === 34 && result[2].range.start.line === 42, @@ -94,7 +94,7 @@ suite("Tests with USER1.cbl", function () { ); assert.ok( result.length === 3 && - result[0].uri.fsPath === editor.document.fileName && + result[0].uri.fsPath.includes(editor.document.fileName) && result[0].range.start.line === 20 && result[1].range.start.line === 34 && result[2].range.start.line === 42, diff --git a/clients/cobol-lsp-vscode-extension/src/test/suite/replacingstatement.spec.test.ts b/clients/cobol-lsp-vscode-extension/src/test/suite/replacingstatement.spec.test.ts index 6038145057..5c9daca115 100644 --- a/clients/cobol-lsp-vscode-extension/src/test/suite/replacingstatement.spec.test.ts +++ b/clients/cobol-lsp-vscode-extension/src/test/suite/replacingstatement.spec.test.ts @@ -161,7 +161,7 @@ suite("TF35623: Support for Replacing and Mapping statement", function () { ); let diagnostics = vscode.languages.getDiagnostics(editor.document.uri); const message = diagnostics[0].message; - assert.match(message, /^Missing token SECTION at procedureSectionHeader/); + assert.match(message, /^A period was assumed before/); }, ); }); diff --git a/clients/cobol-lsp-vscode-extension/src/type/codeLayout.d.ts b/clients/cobol-lsp-vscode-extension/src/type/codeLayout.d.ts new file mode 100644 index 0000000000..103bc7b7da --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/type/codeLayout.d.ts @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ + +/** + * Type for a cobol code layout + */ +interface LayoutStructure { + sequence_length?: integer; + indicator_length?: integer; + area_a_length?: integer; + area_b_length?: integer; + comment_area?: integer; +} diff --git a/clients/cobol-lsp-vscode-extension/src/type/e4eApi.d.ts b/clients/cobol-lsp-vscode-extension/src/type/e4eApi.d.ts new file mode 100644 index 0000000000..7ed0be2ada --- /dev/null +++ b/clients/cobol-lsp-vscode-extension/src/type/e4eApi.d.ts @@ -0,0 +1,144 @@ +type Filename = string; +type Fingerprint = string; +type MemberName = string; +type Content = string; + +export const enum ProcessorConfigurationType { + COBOL = "COBOL", +} +interface EndevorElement { + use_map: boolean; + environment: string; + stage: string; + system: string; + subsystem: string; + type: string; + element: string; + fingerprint: string; +} +interface EndevorMember { + dataset: string; + member: string; +} +interface EndevorType { + use_map: boolean; + environment: string; + stage: string; + system: string; + subsystem: string; + type: string; +} + +type TypeOrArray = T | T[]; +function asArray(o: TypeOrArray) { + if (Array.isArray(o)) return o; + return [o]; +} + +export type ResolvedProfile = { + profile: string; + instance: string; +}; + +export type ExternalConfigurationOptions = { + compiler: string; + preprocessor: string[]; + type: string; +}; + +export const defaultConfigs: ExternalConfigurationOptions = { + compiler: "IGYCRCTL", + preprocessor: ["DSNHPC", "DFHECP1$"], + type: ProcessorConfigurationType.COBOL, +}; + +export interface E4E { + isEndevorElement: (uri: string) => boolean; + getProfileInfo: ( + uriStringOrPartialProfile: Partial | string, + ) => Promise; + listElements: ( + profile: ResolvedProfile, + type: { + use_map: boolean; + environment: string; + stage: string; + system: string; + subsystem: string; + type: string; + }, + ) => Promise<[Filename, Fingerprint][] | Error>; + getElement: ( + profile: ResolvedProfile, + type: { + use_map: boolean; + environment: string; + stage: string; + system: string; + subsystem: string; + type: string; + element: string; + fingerprint: string; + }, + ) => Promise<[Content, Fingerprint] | Error>; + listMembers: ( + profile: ResolvedProfile, + type: { + dataset: string; + }, + ) => Promise; + getMember: ( + profile: ResolvedProfile, + type: { + dataset: string; + member: string; + }, + ) => Promise; + getConfiguration: ( + sourceUri: string, + options: ExternalConfigurationOptions, + ) => Promise; + onDidChangeElement: vscode.Event; +} + +type E4EExternalConfigurationResponse = { + pgms: ReadonlyArray<{ + program: string; + pgroup: string; + options?: { + [key: string]: string; + }; + }>; + pgroups: ReadonlyArray<{ + name: string; + libs: ( + | { + dataset: string; + } + | { + environment: string; + stage: string; + system: string; + subsystem: string; + type: string; + use_map: boolean; + } + )[]; + options?: { + [key: string]: string; + }; + preprocessor?: TypeOrArray<{ + name: string; + options?: { + [key: string]: string; + }; + }>; + }>; +}; + +interface e4eResponse { + api: E4E; + profile: ResolvedProfile; + uri: string; + elements: { [key: string]: EndevorElement | EndevorMember }; +} diff --git a/clients/cobol-lsp-vscode-extension/src/type/zoweApi.d.ts b/clients/cobol-lsp-vscode-extension/src/type/zoweApi.d.ts index 5c9745364a..cc3a1d5977 100644 --- a/clients/cobol-lsp-vscode-extension/src/type/zoweApi.d.ts +++ b/clients/cobol-lsp-vscode-extension/src/type/zoweApi.d.ts @@ -24,6 +24,12 @@ interface IApiRegisterClient { interface IApiExplorerExtender { getProfilesCache(): ProfilesCache; + datasetProvider: { + openFiles: { [label: string]: { profile: { name: string } } }; + }; + ussFileProvider: { + openFiles: { [label: string]: { profile: { name: string } } }; + }; } interface ProfilesCache { diff --git a/clients/cobol-lsp-vscode-extension/syntaxes/CICS.tmLanguage.json b/clients/cobol-lsp-vscode-extension/syntaxes/CICS.tmLanguage.json index 5f53beda2f..41ae05c39f 100644 --- a/clients/cobol-lsp-vscode-extension/syntaxes/CICS.tmLanguage.json +++ b/clients/cobol-lsp-vscode-extension/syntaxes/CICS.tmLanguage.json @@ -30,7 +30,7 @@ ] }, "cics-keywords": { - "match": "(?.*", + "name": "comment.line.cobol.floating" + }, + "number-constant": { + "match": "(?` \n\t", + "surroundingPairs": [ + ["{", "}"], + ["[", "]"], + ["(", ")"], + ["'", "'"], + ["\"", "\""], + ["`", "`"] + ] +} diff --git a/clients/cobol-lsp-vscode-extension/tsconfig.json b/clients/cobol-lsp-vscode-extension/tsconfig.json index 46ec6d9a23..d8110ae1d4 100644 --- a/clients/cobol-lsp-vscode-extension/tsconfig.json +++ b/clients/cobol-lsp-vscode-extension/tsconfig.json @@ -25,7 +25,7 @@ "strictPropertyInitialization": true, "alwaysStrict": true, "strict": true, - "lib": ["es6"], + "lib": ["es6", "es2016"], "module": "commonjs", "moduleResolution": "node", "outDir": "out", diff --git a/server/common/pom.xml b/server/common/pom.xml index f25baa634a..6493a9b83d 100644 --- a/server/common/pom.xml +++ b/server/common/pom.xml @@ -21,7 +21,7 @@ 4.0.0 common org.eclipse.lsp.cobol - 1.0.7 + 1.0.8 8 @@ -35,8 +35,6 @@ 1.6.0 5.10.0 3.0.0-M3 - 2.7 - 4.3.0 0.8.11 UTF-8 UTF-8 @@ -224,28 +222,6 @@ - - org.codehaus.mojo - cobertura-maven-plugin - ${maven.cobertura.plugin.version} - - xml - 256m - true - - - org/eclipse/lsp/**/*.class - - - - - - - org.eluder.coveralls - coveralls-maven-plugin - ${maven.coveralls.plugin.version} - - org.jacoco jacoco-maven-plugin diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/LanguageEngineFacade.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/LanguageEngineFacade.java index a113053023..c2b65098e3 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/LanguageEngineFacade.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/LanguageEngineFacade.java @@ -27,4 +27,18 @@ public interface LanguageEngineFacade { * @return list of LSP diagnostic object used to display errors in the editor */ AnalysisResult analyze(String uri, String text, AnalysisConfig analysisConfig); + + /** + * Analyze the document for a specific cobol dialect (language id) + * and find syntax/semantic errors, variables, paragraphs etc. + * + * @param uri - URI of the processing document to define positions and errors properly + * @param text of document opened in the client editor + * @param analysisConfig contains analysis processing features info and copybook config with + * following information: target backend sql server, copybook processing mode which reflect + * the sync status of the document (DID_OPEN|DID_CHANGE) + * @param languageId + * @return a model containing full analysis result, e.g. errors and semantic elements + */ + AnalysisResult analyze(String uri, String text, AnalysisConfig analysisConfig, String languageId); } diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/benchmark/BenchmarkSession.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/benchmark/BenchmarkSession.java index f852f989fe..8789f510f2 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/benchmark/BenchmarkSession.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/benchmark/BenchmarkSession.java @@ -1,3 +1,17 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ package org.eclipse.lsp.cobol.common.benchmark; import lombok.extern.slf4j.Slf4j; diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/benchmark/BenchmarkSessionProvider.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/benchmark/BenchmarkSessionProvider.java new file mode 100644 index 0000000000..94e52aa2a6 --- /dev/null +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/benchmark/BenchmarkSessionProvider.java @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.common.benchmark; + +/** + * Provides BenchmarkSession object + */ +public interface BenchmarkSessionProvider { + BenchmarkSession getBenchmarkSession(); +} diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/copybook/CopybookService.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/copybook/CopybookService.java index 3b08812738..d1494ff507 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/copybook/CopybookService.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/copybook/CopybookService.java @@ -14,11 +14,15 @@ */ package org.eclipse.lsp.cobol.common.copybook; +import java.util.Collection; +import java.util.Collections; +import java.util.Set; + +import com.google.common.collect.ImmutableSet; import lombok.NonNull; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; -import java.util.Collection; - /** * Provide API definition to search for copybooks files. The service also caches copybook to reduce * filesystem load. @@ -28,24 +32,26 @@ public interface CopybookService { /** Remove all the stored copybook. */ void invalidateCache(); + void invalidateCache(CopybookId copybookId); + /** * Retrieve and return the copybook by its name. * Returns a CopybookModel and preprocessed errors for the resolved copybook wrapped inside {@link ResultWithErrors}. * - * @param copybookId - the id of the copybook to be retrieved - * @param copybookName - the name of the copybook to be retrieved + * @param copybookId - the id of the copybook to be retrieved + * @param copybookName - the name of the copybook to be retrieved * @param programDocumentUri - the currently processing program document - * @param documentUri - the currently processing document that contains the copy statement - * @param preprocess - indicates if copybook needs to be preprocessed after resolving + * @param documentUri - the currently processing document that contains the copy statement + * @param preprocessor - Cleanup preprocessor that will be used for new copybooks or null * @return a CopybookModel wrapped inside {@link ResultWithErrors} which contains copybook name, its URI and the content. - * Wrapped errors are preprocessed errors for the returned CopybookModel. + * Wrapped errors are preprocessed errors for the returned CopybookModel. */ ResultWithErrors resolve( - @NonNull CopybookId copybookId, - @NonNull CopybookName copybookName, - @NonNull String programDocumentUri, - @NonNull String documentUri, - boolean preprocess); + @NonNull CopybookId copybookId, + @NonNull CopybookName copybookName, + @NonNull String programDocumentUri, + @NonNull String documentUri, + CleanerPreprocessor preprocessor); /** * Store the copybookModel in cache. Copybook depends on a document from where it is imported. @@ -58,9 +64,9 @@ ResultWithErrors resolve( * Store the copybookModel in cache. Copybook depends on a document from where it is imported. * * @param copybookModel the copybook model - * @param doCleanUp is copybook clean up required before storing copybookModel. + * @param preprocessor - Cleanup preprocessor that will be used for new copybooks or null */ - void store(CopybookModel copybookModel, boolean doCleanUp); + void store(CopybookModel copybookModel, CleanerPreprocessor preprocessor); /** * Send downloading requests to the Client for copybooks not presented locally, if any. @@ -70,4 +76,13 @@ ResultWithErrors resolve( * @param processingMode copybook processing mode. */ void sendCopybookDownloadRequest(String documentUri, Collection copybookUris, CopybookProcessingMode processingMode); + + /** + * Get the list of copybook used by a document + * + * @param documentUri current document uri. + * @return Set of all the {@link CopybookModel} used by the passed document + */ + Set getCopybookUsage(String documentUri); + } diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/CobolLanguageId.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/CobolLanguageId.java new file mode 100644 index 0000000000..7c75da14df --- /dev/null +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/CobolLanguageId.java @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.common.dialects; + +import java.util.*; +import java.util.stream.Collectors; + +/** Enum of supported Cobol language id's */ +public enum CobolLanguageId { + COBOL("cobol", new CobolProgramLayout(6, 1, 4, 61, 8)), + EXPERIMENTAL_COBOL("expcobol", new CobolProgramLayout(6, 1, 4, 61, 8)), + HP_COBOL("hpcobol", new CobolProgramLayout(0, 1, 4, 127, 0)); + + private final CobolProgramLayout layout; + private final String id; + public static final Map MAPPER = + Arrays.stream(CobolLanguageId.values()) + .collect(Collectors.toMap(CobolLanguageId::getId, id -> id)); + + CobolLanguageId(String id, CobolProgramLayout layout) { + this.id = id; + this.layout = layout; + } + + public CobolProgramLayout getLayout() { + return layout; + } + + public String getId() { + return id; + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout/CobolProgramLayout.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/CobolProgramLayout.java similarity index 55% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout/CobolProgramLayout.java rename to server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/CobolProgramLayout.java index d88f20e911..b4d226e39b 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout/CobolProgramLayout.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/CobolProgramLayout.java @@ -12,12 +12,11 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.service.settings.layout; +package org.eclipse.lsp.cobol.common.dialects; import java.util.regex.Pattern; import lombok.Builder; import lombok.Getter; -import org.eclipse.lsp.cobol.core.preprocessor.ProcessingConstants; /** * This class represents a cobol program line layout .{0,%s})(?.{0,%s})(?.{0,%s})(?.{0,%s})(?.{0,%s})(?.*)$", - sequenceLength, indicatorLength, areaALength, areaBLength, commentAreaLength)); + String.format( + "^(?.{0,%s})(?.{0,%s})(?.{0,%s})(?.{0,%s})(?.{0,%s})(?.*)$", + sequenceLength, indicatorLength, areaALength, areaBLength, commentAreaLength)); + } + + private final Integer areaALength; + private final Integer areaBLength; + private final Integer commentAreaLength; + + public CobolProgramLayout( + Integer sequenceLength, + Integer indicatorLength, + Integer areaALength, + Integer areaBLength, + Integer commentAreaLength) { + this.sequenceLength = sequenceLength; + this.indicatorLength = indicatorLength; + this.areaALength = areaALength; + this.areaBLength = areaBLength; + this.commentAreaLength = commentAreaLength; } } diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/DialectProcessingContext.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/DialectProcessingContext.java index 6469742449..fd04a79e39 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/DialectProcessingContext.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/DialectProcessingContext.java @@ -19,6 +19,7 @@ import lombok.Builder; import lombok.Value; import org.eclipse.lsp.cobol.common.AnalysisConfig; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; import org.eclipse.lsp.cobol.common.model.tree.Node; @@ -29,5 +30,7 @@ public class DialectProcessingContext { AnalysisConfig config; String programDocumentUri; ExtendedDocument extendedDocument; + CleanerPreprocessor preprocessor; @Builder.Default List dialectNodes = new ArrayList<>(); + @Builder.Default String languageId = "cobol"; } diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/TrueDialectService.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/TrueDialectService.java new file mode 100644 index 0000000000..2058ddef41 --- /dev/null +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/dialects/TrueDialectService.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.common.dialects; + +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; +import org.eclipse.lsp.cobol.common.benchmark.BenchmarkSessionProvider; +import org.eclipse.lsp.cobol.common.pipeline.Pipeline; + +/** + * True Dialects Service, based on different language ids + */ +public interface TrueDialectService { + /** + * Returns the pipeline for a dialect based on a given language id + * @param languageId a language id of a dialect + * @return the pipeline for a dialect + */ + Pipeline getPipeline(CobolLanguageId languageId); + + /** + * Returns the cleanup preprocessor for a dialect, based on a given language id + * @param languageId a language id of a dialect + * @return the cleanup preprocessor + */ + CleanerPreprocessor getPreprocessor(CobolLanguageId languageId); + +} diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/file/WorkspaceFileService.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/file/WorkspaceFileService.java index 711c8fa13f..a218914930 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/file/WorkspaceFileService.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/file/WorkspaceFileService.java @@ -15,11 +15,6 @@ package org.eclipse.lsp.cobol.common.file; import com.google.common.collect.ImmutableList; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.lsp.cobol.common.utils.ImplicitCodeUtils; - -import javax.annotation.Nullable; import java.io.*; import java.net.URI; import java.net.URISyntaxException; @@ -37,6 +32,10 @@ import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; +import javax.annotation.Nullable; +import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.lsp.cobol.common.utils.ImplicitCodeUtils; /** * This service implements API for low-level file systems access. It mainly oriented to work with @@ -94,7 +93,12 @@ public String getContentByPath(@NonNull Path path) { @Nullable public Path getPathFromURI(@NonNull String uri) { try { - return Paths.get(new URI(uri).normalize()); + String decodedUri = uri.replace(" ", "%20"); + Path path = Paths.get(new URI(decodedUri).normalize()); + if (path.startsWith("\\") || path.startsWith("/")) { + path = Paths.get(new URI(decodedUri).getPath()); // + } + return path; } catch (URISyntaxException e) { LOG.error("Cannot find file by given URI: {}", uri, e); return null; diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/ExtendedText.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/ExtendedText.java index 5dcea541b8..54b100453f 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/ExtendedText.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/ExtendedText.java @@ -23,6 +23,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; +import java.util.function.Consumer; /** * Extended Text contains information about original text and current text with the mapping @@ -85,6 +86,16 @@ public Location mapLocation(Range range) { throw new RuntimeException("Cannot find original position"); } + /** + * Perform operation for the text lines + * @param operation - operation to be performed on the test lines + */ + public void perform(Consumer operation) { + for (ExtendedTextLine line : lines) { + operation.accept(line); + } + } + /** * Inserts an extended text to the given line number * @param line - a line number to insert diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/ExtendedTextLine.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/ExtendedTextLine.java index 9d3be6cfc3..1443485354 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/ExtendedTextLine.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/ExtendedTextLine.java @@ -24,7 +24,7 @@ /** * Extended Text Line with symbols */ -class ExtendedTextLine { +public class ExtendedTextLine { @Getter private final List characters = new ArrayList<>(); diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/MappedCharacter.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/MappedCharacter.java index 988fbb2ebc..bd504672d1 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/MappedCharacter.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/mapping/MappedCharacter.java @@ -28,7 +28,7 @@ */ @Data @AllArgsConstructor -class MappedCharacter { +public class MappedCharacter { private final UUID id = UUID.randomUUID(); private char character; private Position originalPosition; diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/NodeType.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/NodeType.java index 31582e231a..ab42ec5a17 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/NodeType.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/NodeType.java @@ -73,5 +73,6 @@ public enum NodeType { VARIABLE_DEFINITION_NAME, VARIABLE_USAGE, WRITE_STATEMENT, - XML_PARSE + XML_PARSE, + XML_GENERATE } diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/CopyNode.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/CopyNode.java index 39ddb1fc2f..9faee0e8d9 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/CopyNode.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/CopyNode.java @@ -15,6 +15,9 @@ package org.eclipse.lsp.cobol.common.model.tree; import com.google.common.collect.ImmutableList; +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.ToString; @@ -23,10 +26,6 @@ import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; -import java.util.LinkedList; -import java.util.List; -import java.util.Optional; - /** The class represents the copyBookNode. */ @ToString(callSuper = true) @Getter @@ -54,7 +53,8 @@ public CopyNode(Locality statementLocality, Location nameLocation, String copyBo @Override public List getDefinitions() { - return Optional.ofNullable(uri).map(u -> ImmutableList.of(new Location(u, new Range(new Position(), new Position())))) + return Optional.ofNullable(uri) + .map(u -> ImmutableList.of(new Location(u, new Range(new Position(), new Position())))) .orElse(ImmutableList.of()); } diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/JsonGenerateNode.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/JsonGenerateNode.java index 5fe6f3246c..8c6700d547 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/JsonGenerateNode.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/JsonGenerateNode.java @@ -53,7 +53,6 @@ public JsonGenerateNode( this.identifier5 = identifier5; this.phases = phases; } - /** Stores the phrase-1 Format of JSON generate statements */ @AllArgsConstructor @Getter diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/XmlGenerateNode.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/XmlGenerateNode.java new file mode 100644 index 0000000000..7f7c613bf8 --- /dev/null +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/model/tree/XmlGenerateNode.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2023 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.common.model.tree; + +import java.util.List; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.ToString; +import org.eclipse.lsp.cobol.common.model.Locality; +import org.eclipse.lsp.cobol.common.model.NodeType; +import org.eclipse.lsp.cobol.common.model.tree.variable.VariableNameAndLocality; + +/** XML generate node */ +@ToString(callSuper = true) +@Getter +@EqualsAndHashCode(callSuper = true) +public class XmlGenerateNode extends Node { + private final VariableNameAndLocality identifier1; + private final VariableNameAndLocality identifier2; + private final VariableNameAndLocality identifier3; + private final VariableNameAndLocality identifier4; + private final VariableNameAndLocality identifier5; + private final List identifier6; + private final List identifier7; + private final List identifier8; + + public XmlGenerateNode( + Locality location, + VariableNameAndLocality identifier1, + VariableNameAndLocality identifier2, + VariableNameAndLocality identifier3, + VariableNameAndLocality identifier4, + VariableNameAndLocality identifier5, + List identifier6, + List identifier7, + List identifier8) { + super(location, NodeType.XML_GENERATE); + this.identifier1 = identifier1; + this.identifier2 = identifier2; + this.identifier3 = identifier3; + this.identifier4 = identifier4; + this.identifier5 = identifier5; + this.identifier6 = identifier6; + this.identifier7 = identifier7; + this.identifier8 = identifier8; + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/Pipeline.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/Pipeline.java similarity index 77% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/Pipeline.java rename to server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/Pipeline.java index 3f3c695e6d..e63d8e70ae 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/Pipeline.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/Pipeline.java @@ -12,10 +12,10 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.engine.pipeline; +package org.eclipse.lsp.cobol.common.pipeline; import lombok.extern.slf4j.Slf4j; -import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.common.benchmark.BenchmarkSessionProvider; import java.util.*; @@ -23,14 +23,14 @@ * Processing pipeline functionality */ @Slf4j -public class Pipeline { - private final List> stages = new LinkedList<>(); +public class Pipeline { + private final List> stages = new LinkedList<>(); /** * Adds a new stage to the pipeline * * @param stage - pipeline processing stage */ - public void add(Stage stage) { + public void add(Stage stage) { stages.add(stage); } @@ -40,7 +40,7 @@ public void add(Stage stage) { * @param context - pipeline context * @return - a final result of the pipeline processing */ - public PipelineResult run(AnalysisContext context) { + public PipelineResult run(C context) { StageResult result = StageResult.empty(); for (Stage stage : stages) { diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/PipelineResult.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/PipelineResult.java similarity index 92% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/PipelineResult.java rename to server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/PipelineResult.java index e092bf1b3c..178c0ffd07 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/PipelineResult.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/PipelineResult.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.engine.pipeline; +package org.eclipse.lsp.cobol.common.pipeline; import lombok.RequiredArgsConstructor; import lombok.Value; diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/Stage.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/Stage.java similarity index 75% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/Stage.java rename to server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/Stage.java index 227b3df40f..561e749381 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/Stage.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/Stage.java @@ -12,21 +12,21 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.engine.pipeline; +package org.eclipse.lsp.cobol.common.pipeline; -import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.common.benchmark.BenchmarkSessionProvider; /** * Processing Pipeline Stage */ -public interface Stage { +public interface Stage { /** * Runs a processing stage * @param context - pipeline processing context * @param prevStageResult - previous stage result * @return the result of the current stage processing */ - StageResult run(AnalysisContext context, StageResult prevStageResult); + StageResult run(C context, StageResult prevStageResult); /** * Returns the name of the stage diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/StageResult.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/StageResult.java similarity index 95% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/StageResult.java rename to server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/StageResult.java index 7a9dddb019..731b53c733 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/StageResult.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/pipeline/StageResult.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.engine.pipeline; +package org.eclipse.lsp.cobol.common.pipeline; import lombok.AllArgsConstructor; import lombok.Value; diff --git a/server/common/src/main/java/org/eclipse/lsp/cobol/common/utils/RangeUtils.java b/server/common/src/main/java/org/eclipse/lsp/cobol/common/utils/RangeUtils.java index 2d5dd45c63..222cc4af66 100644 --- a/server/common/src/main/java/org/eclipse/lsp/cobol/common/utils/RangeUtils.java +++ b/server/common/src/main/java/org/eclipse/lsp/cobol/common/utils/RangeUtils.java @@ -17,6 +17,7 @@ import lombok.experimental.UtilityClass; import org.eclipse.lsp.cobol.common.model.Locality; +import org.eclipse.lsp.cobol.common.model.tree.CopyNode; import org.eclipse.lsp.cobol.common.model.tree.Node; import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; @@ -37,6 +38,13 @@ public class RangeUtils { */ public static Optional findNodeByPosition(Node node, String uri, Position position) { Node candidate = null; + if (isFromCopybook(uri, node)) { + if (node.getChildren().isEmpty()) { + return Optional.of(node); + } + candidate = node; + } + if (isInside(uri, position, node.getLocality())) { if (node.getChildren().isEmpty()) { return Optional.of(node); @@ -53,6 +61,14 @@ public static Optional findNodeByPosition(Node node, String uri, Position return candidate == null ? Optional.empty() : Optional.of(candidate); } + private boolean isFromCopybook(String uri, Node node) { + if (!(node instanceof CopyNode)) { + return false; + } + CopyNode copyNode = (CopyNode) node; + return uri.equals(copyNode.getUri()); + } + /** * Test if one position is after the another position. * diff --git a/server/dialect-daco/src/main/java/org/eclipse/lsp/cobol/dialects/daco/DaCoMaidProcessor.java b/server/dialect-daco/src/main/java/org/eclipse/lsp/cobol/dialects/daco/DaCoMaidProcessor.java index 39f357b460..5fcf584066 100644 --- a/server/dialect-daco/src/main/java/org/eclipse/lsp/cobol/dialects/daco/DaCoMaidProcessor.java +++ b/server/dialect-daco/src/main/java/org/eclipse/lsp/cobol/dialects/daco/DaCoMaidProcessor.java @@ -14,7 +14,12 @@ */ package org.eclipse.lsp.cobol.dialects.daco; +import static org.eclipse.lsp.cobol.common.error.ErrorSeverity.ERROR; + import com.google.common.collect.ImmutableList; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.antlr.v4.runtime.CharStreams; @@ -29,10 +34,10 @@ import org.eclipse.lsp.cobol.common.dialects.CobolDialect; import org.eclipse.lsp.cobol.common.dialects.DialectOutcome; import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorCodes; import org.eclipse.lsp.cobol.common.error.ErrorSeverity; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.common.error.SyntaxError; -import org.eclipse.lsp.cobol.common.error.ErrorCodes; import org.eclipse.lsp.cobol.common.message.MessageService; import org.eclipse.lsp.cobol.common.model.Locality; import org.eclipse.lsp.cobol.common.model.tree.CopyNode; @@ -43,12 +48,6 @@ import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static org.eclipse.lsp.cobol.common.error.ErrorSeverity.ERROR; - /** Handles copy maid logic */ @Slf4j @RequiredArgsConstructor @@ -212,7 +211,7 @@ private CopyNode createMaidCopybookNode( copybookName, context.getExtendedDocument().getUri(), context.getExtendedDocument().getUri(), - true); + context.getPreprocessor()); CopybookModel copybookModel = resolvedCopybook.getResult(); DaCoCopyNode cbNode = diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestAdjustCopyMaidNumbers.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestAdjustCopyMaidNumbers.java index e241a964a7..80e4dd9587 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestAdjustCopyMaidNumbers.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestAdjustCopyMaidNumbers.java @@ -18,8 +18,8 @@ import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; @@ -33,7 +33,7 @@ class TestAdjustCopyMaidNumbers { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidDoesNotShowMissingCopybookOnStatementWithoutNumber.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidDoesNotShowMissingCopybookOnStatementWithoutNumber.java index ac5bbcc044..712673d56e 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidDoesNotShowMissingCopybookOnStatementWithoutNumber.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidDoesNotShowMissingCopybookOnStatementWithoutNumber.java @@ -16,8 +16,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.common.error.ErrorCodes; +import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; @@ -32,7 +32,7 @@ class TestCopyMaidDoesNotShowMissingCopybookOnStatementWithoutNumber { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidIsNotResolvedInProcedureDivision.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidIsNotResolvedInProcedureDivision.java index c438c11fa6..ebc3edb27a 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidIsNotResolvedInProcedureDivision.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidIsNotResolvedInProcedureDivision.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; @@ -26,7 +26,7 @@ class TestCopyMaidIsNotResolvedInProcedureDivision { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithKmkRequestsCorrectFile.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithKmkRequestsCorrectFile.java index ebc15f4664..24447c47a0 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithKmkRequestsCorrectFile.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithKmkRequestsCorrectFile.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; @@ -29,7 +29,7 @@ class TestCopyMaidWithKmkRequestsCorrectFile { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithQualifierHasCorrectDefinition.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithQualifierHasCorrectDefinition.java index 99212ebccf..ca203ccbb3 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithQualifierHasCorrectDefinition.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithQualifierHasCorrectDefinition.java @@ -14,29 +14,29 @@ */ package org.eclipse.lsp.cobol.dialects.daco.usecases; +import static java.util.stream.Collectors.toList; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import org.eclipse.lsp.cobol.common.model.tree.CopyNode; import org.eclipse.lsp.cobol.common.model.NodeType; +import org.eclipse.lsp.cobol.common.model.tree.CopyNode; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; +import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.dialects.daco.utils.Fixtures; import org.eclipse.lsp.cobol.dialects.idms.IdmsDialect; import org.eclipse.lsp.cobol.test.CobolText; -import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp.cobol.test.engine.UseCaseUtils; -import org.eclipse.lsp.cobol.dialects.daco.utils.Fixtures; import org.eclipse.lsp4j.Diagnostic; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import static java.util.stream.Collectors.toList; - /** COPY MAID copybook definitions should have correct URIs */ class TestCopyMaidWithQualifierHasCorrectDefinition { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithRedefinesGroupVariable.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithRedefinesGroupVariable.java index 67a147d02b..dbf5661f32 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithRedefinesGroupVariable.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithRedefinesGroupVariable.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; @@ -29,7 +29,7 @@ class TestCopyMaidWithRedefinesGroupVariable { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWRK.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWRK.java index aa0f2ef849..bf30cfba05 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWRK.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWRK.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; @@ -29,7 +29,7 @@ class TestCopyMaidWithWRK { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkDifferentCase.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkDifferentCase.java index 3891765db1..f645c83b41 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkDifferentCase.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkDifferentCase.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; @@ -26,7 +26,7 @@ class TestCopyMaidWithWrkDifferentCase { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkDoesNotTakeNameFrom88.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkDoesNotTakeNameFrom88.java index 65cadc052d..948c7e3d53 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkDoesNotTakeNameFrom88.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkDoesNotTakeNameFrom88.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; @@ -26,7 +26,7 @@ class TestCopyMaidWithWrkDoesNotTakeNameFrom88 { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkRedefines.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkRedefines.java index df91e2b4a2..86ac2f721e 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkRedefines.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkRedefines.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; @@ -29,7 +29,7 @@ class TestCopyMaidWithWrkRedefines { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShortName.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShortName.java index 10c444c24e..f45bb32ef6 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShortName.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShortName.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; @@ -26,7 +26,7 @@ class TestCopyMaidWithWrkShortName { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorAfterFiller.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorAfterFiller.java index e5eedaf261..768064abc6 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorAfterFiller.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorAfterFiller.java @@ -18,8 +18,8 @@ import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; @@ -30,7 +30,7 @@ class TestCopyMaidWithWrkShowsErrorAfterFiller { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorAfterVariableWithoutName.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorAfterVariableWithoutName.java index c364fb6572..8433b2989e 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorAfterVariableWithoutName.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorAfterVariableWithoutName.java @@ -18,8 +18,8 @@ import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; @@ -30,7 +30,7 @@ class TestCopyMaidWithWrkShowsErrorAfterVariableWithoutName { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorOnShortVariableName.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorOnShortVariableName.java index 12614124ca..1771bdd0e2 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorOnShortVariableName.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkShowsErrorOnShortVariableName.java @@ -18,8 +18,8 @@ import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; @@ -30,7 +30,7 @@ class TestCopyMaidWithWrkShowsErrorOnShortVariableName { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkThreeCharsSuffix.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkThreeCharsSuffix.java index de077a86b4..81c01c7a63 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkThreeCharsSuffix.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestCopyMaidWithWrkThreeCharsSuffix.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; @@ -26,7 +26,7 @@ class TestCopyMaidWithWrkThreeCharsSuffix { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDaCoRcu.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDaCoRcu.java index 83fb6e2cbf..b962a955d4 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDaCoRcu.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDaCoRcu.java @@ -24,7 +24,7 @@ class TestDaCoRcu { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDaCoWhenKeywordTerminator.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDaCoWhenKeywordTerminator.java index 5d50737e9c..d4e838d451 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDaCoWhenKeywordTerminator.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDaCoWhenKeywordTerminator.java @@ -26,7 +26,7 @@ public class TestDaCoWhenKeywordTerminator { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestOnRcuRangeException.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestOnRcuRangeException.java index 5d087855a3..92017d3338 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestOnRcuRangeException.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestOnRcuRangeException.java @@ -17,15 +17,15 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; -import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp.cobol.dialects.daco.utils.Fixtures; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; /** This test covers case with overlap locations in mapping */ class TestOnRcuRangeException { static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" + " 01 {$*A} PIC X.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestReadTransaction.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestReadTransaction.java index b573372e01..182910b930 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestReadTransaction.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestReadTransaction.java @@ -24,7 +24,7 @@ class TestReadTransaction { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " PROCEDURE DIVISION.\n" + " {#*FOO}.\n" + " READ TRANSACTION\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestUserDefinedSections.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestUserDefinedSections.java index 46f1608c96..1f5876c8e9 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestUserDefinedSections.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestUserDefinedSections.java @@ -32,7 +32,7 @@ class TestUserDefinedSections { private static final String TEXT_GOTO = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " IDMS-CONTROL SECTION.\n" + " PROTOCOL. MODE ABC.\n" diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/utils/UseCaseInitializerService.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/utils/UseCaseInitializerService.java index 4245041e33..8976d36c0b 100644 --- a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/utils/UseCaseInitializerService.java +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/utils/UseCaseInitializerService.java @@ -27,16 +27,15 @@ import com.google.inject.multibindings.Multibinder; import com.google.inject.name.Names; import java.util.concurrent.CompletableFuture; -import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.LanguageEngineFacade; import org.eclipse.lsp.cobol.common.SubroutineService; import org.eclipse.lsp.cobol.common.action.CodeActionProvider; import org.eclipse.lsp.cobol.common.copybook.CopybookService; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.common.file.FileSystemService; import org.eclipse.lsp.cobol.common.file.WorkspaceFileService; import org.eclipse.lsp.cobol.core.engine.dialects.DialectDiscoveryService; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessorImpl; +import org.eclipse.lsp.cobol.dialects.TrueDialectServiceImpl; import org.eclipse.lsp.cobol.domain.modules.DatabusModule; import org.eclipse.lsp.cobol.domain.modules.EngineModule; import org.eclipse.lsp.cobol.lsp.DisposableLSPStateService; @@ -75,14 +74,15 @@ public Injector createInjector() { new AbstractModule() { @Override protected void configure() { + bind(TrueDialectService.class).to(TrueDialectServiceImpl.class); + bind(LanguageEngineFacade.class).to(CobolLanguageEngineFacade.class); bind(CopybookService.class).to(CopybookServiceImpl.class); bind(SettingsService.class).toInstance(mockSettingsService); bind(FileSystemService.class).toInstance(new WorkspaceFileService()); bind(CobolLanguageClient.class).toInstance(languageClient); bind(SubroutineService.class).to(SubroutineServiceImpl.class); - bind(TextPreprocessor.class).to(TextPreprocessorImpl.class); - bind(CleanerPreprocessor.class).to(TextPreprocessorImpl.class); + bind(WatcherService.class).to(WatcherServiceImpl.class); bind(DialectDiscoveryService.class).to(ExplicitDialectDiscoveryService.class); bind(CopybookIdentificationService.class) diff --git a/server/dialect-idms/pom.xml b/server/dialect-idms/pom.xml index 33e99789e0..c169342475 100644 --- a/server/dialect-idms/pom.xml +++ b/server/dialect-idms/pom.xml @@ -39,8 +39,6 @@ 5.6.0 1.6.0 5.10.0 - 2.7 - 4.3.0 0.8.11 3.0.0-M3 UTF-8 @@ -238,28 +236,6 @@ - - org.codehaus.mojo - cobertura-maven-plugin - ${maven.cobertura.plugin.version} - - xml - 256m - true - - - org/eclipse/lsp/**/*.class - - - - - - - org.eluder.coveralls - coveralls-maven-plugin - ${maven.coveralls.plugin.version} - - org.jacoco jacoco-maven-plugin diff --git a/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookService.java b/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookService.java index d26974668f..901dd5bce3 100644 --- a/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookService.java +++ b/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookService.java @@ -24,6 +24,7 @@ import org.antlr.v4.runtime.CommonTokenStream; import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.copybook.CopybookModel; import org.eclipse.lsp.cobol.common.copybook.CopybookName; @@ -44,6 +45,7 @@ class IdmsCopybookService { private final String programDocumentUri; private final CopybookService copybookService; + private final CleanerPreprocessor preprocessor; private final CopybookProcessingMode copybookProcessingMode; private final ParseTreeListener treeListener; private final MessageService messageService; @@ -95,7 +97,7 @@ private ResultWithErrors> processNodes(CopybookModel copybookModel, i parser.setErrorHandler(new CobolErrorStrategy(messageService)); parser.addParseListener(treeListener); - IdmsCopybookVisitor visitor = new IdmsCopybookVisitor(copybookService, copybookProcessingMode, treeListener, messageService, + IdmsCopybookVisitor visitor = new IdmsCopybookVisitor(copybookService, preprocessor, copybookProcessingMode, treeListener, messageService, programDocumentUri, copybookModel.getUri(), parentLevel, processedCopybooks); ParserRuleContext node = parser.startRule(); diff --git a/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookVisitor.java b/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookVisitor.java index 509ef0acba..6c02f761ad 100644 --- a/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookVisitor.java +++ b/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookVisitor.java @@ -29,6 +29,7 @@ import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.ParseTreeListener; import org.antlr.v4.runtime.tree.TerminalNode; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.copybook.*; import org.eclipse.lsp.cobol.common.error.SyntaxError; @@ -51,17 +52,17 @@ @RequiredArgsConstructor class IdmsCopybookVisitor extends IdmsCopyParserBaseVisitor> { private final CopybookService copybookService; - private final CopybookProcessingMode copybookProcessingMode; + private final CleanerPreprocessor preprocessor; private final IdmsCopybookService idmsCopybookService; private final String programDocumentUri; private final String documentUri; private final int parentLevel; - private final Set processedCopybooks; @Getter private final List errors = new LinkedList<>(); private int firstCopybookLevel = 0; IdmsCopybookVisitor(CopybookService copybookService, + CleanerPreprocessor preprocessor, CopybookProcessingMode copybookProcessingMode, ParseTreeListener treeListener, MessageService messageService, @@ -70,12 +71,11 @@ class IdmsCopybookVisitor extends IdmsCopyParserBaseVisitor> { int parentLevel, Set processedCopybooks) { this.copybookService = copybookService; - this.copybookProcessingMode = copybookProcessingMode; + this.preprocessor = preprocessor; this.programDocumentUri = programDocumentUri; this.documentUri = documentUri; this.parentLevel = parentLevel; - this.processedCopybooks = processedCopybooks; - idmsCopybookService = new IdmsCopybookService(programDocumentUri, copybookService, + idmsCopybookService = new IdmsCopybookService(programDocumentUri, copybookService, preprocessor, copybookProcessingMode, treeListener, messageService, processedCopybooks); } @@ -90,7 +90,7 @@ public List visitCopyIdmsStatement(IdmsCopyParser.CopyIdmsStatementContext copybookName, programDocumentUri, documentUri, - true); + preprocessor); CopybookModel copybookModel = resolvedCopybook.getResult(); Locality locality = IdmsParserHelper.buildNameRangeLocality(optionsContext, copybookName.getDisplayName(), documentUri); errors.addAll(resolvedCopybook.getErrors()); diff --git a/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsDialect.java b/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsDialect.java index 194d1d76a6..c8ee678931 100644 --- a/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsDialect.java +++ b/server/dialect-idms/src/main/java/org/eclipse/lsp/cobol/dialects/idms/IdmsDialect.java @@ -15,6 +15,7 @@ package org.eclipse.lsp.cobol.dialects.idms; import com.google.common.collect.ImmutableList; +import java.util.*; import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.CommonTokenStream; import org.apache.commons.lang3.tuple.Pair; @@ -36,8 +37,6 @@ import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; -import java.util.*; - /** Process the text according to the IDMS rules */ public final class IdmsDialect implements CobolDialect { public static final String NAME = "IDMS"; @@ -80,11 +79,11 @@ private void insertIdmsCopybook(DialectProcessingContext ctx, ExtendedDocument e Deque copybookStack) { CopybookName copybookName = new CopybookName(cb.getName(), IdmsDialect.NAME); ResultWithErrors resolvedCopybook = copybookService.resolve( - copybookName.toCopybookId(programDocumentUri), - copybookName, - programDocumentUri, - currentUri, - true); + copybookName.toCopybookId(programDocumentUri), + copybookName, + programDocumentUri, + currentUri, + ctx.getPreprocessor()); CopybookModel copybookModel = resolvedCopybook.getResult(); if (copybookModel.getUri() == null || copybookModel.getContent() == null) { diff --git a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookServiceTest.java b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookServiceTest.java index d119489ed5..27a4b81e6b 100644 --- a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookServiceTest.java +++ b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookServiceTest.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Set; import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.copybook.*; import org.eclipse.lsp.cobol.common.error.SyntaxError; @@ -46,6 +47,8 @@ class IdmsCopybookServiceTest { private ParseTreeListener treeListener; @Mock private MessageService messageService; + @Mock + private CleanerPreprocessor preprocessor; private Set processedCopybooks; private IdmsCopybookService service; @@ -53,7 +56,8 @@ class IdmsCopybookServiceTest { @BeforeEach void init() { processedCopybooks = new HashSet<>(); - service = new IdmsCopybookService("uri", copybookService, CopybookProcessingMode.ENABLED, + service = new IdmsCopybookService("uri", copybookService, preprocessor, + CopybookProcessingMode.ENABLED, treeListener, messageService, processedCopybooks); } diff --git a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookVisitorTest.java b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookVisitorTest.java index dcbc1fa674..0e3d66f4aa 100644 --- a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookVisitorTest.java +++ b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/IdmsCopybookVisitorTest.java @@ -17,7 +17,6 @@ import static org.eclipse.lsp.cobol.dialects.idms.IdmsCopyParser.*; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.Mockito.mock; @@ -25,13 +24,12 @@ import com.google.common.collect.ImmutableList; import java.util.Collections; -import java.util.HashSet; import java.util.List; -import java.util.Set; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.TerminalNode; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.copybook.*; import org.eclipse.lsp.cobol.common.model.NodeType; @@ -55,14 +53,13 @@ class IdmsCopybookVisitorTest { private CopybookService copybookService; @Mock private IdmsCopybookService idmsCopybookService; + @Mock + private CleanerPreprocessor preprocessor; private IdmsCopybookVisitor visitor; @BeforeEach void init() { - Set processedCopybooks = new HashSet<>(); - - visitor = new IdmsCopybookVisitor(copybookService, CopybookProcessingMode.ENABLED, - idmsCopybookService, PROGRAM_DOCUMENT_URI, "documentUri", 1, processedCopybooks); + visitor = new IdmsCopybookVisitor(copybookService, preprocessor, idmsCopybookService, PROGRAM_DOCUMENT_URI, "documentUri", 1); } @Test @@ -72,7 +69,7 @@ void testVisitCopyIdmsStatement() { IdmsCopyParser.CopyIdmsSourceContext sourceContext = mock(IdmsCopyParser.CopyIdmsSourceContext.class); CopybookName expectedCopybookName = new CopybookName("copybook", "IDMS"); when(copybookService.resolve(any(CopybookId.class), any(CopybookName.class), anyString(), anyString(), - anyBoolean())) + any())) .thenReturn( new ResultWithErrors<>( new CopybookModel(expectedCopybookName.toCopybookId(PROGRAM_DOCUMENT_URI), expectedCopybookName, null, null), diff --git a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestCopyIdmsVariablesForNotAllowedLevels.java b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestCopyIdmsVariablesForNotAllowedLevels.java index 8321723602..d82f845245 100644 --- a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestCopyIdmsVariablesForNotAllowedLevels.java +++ b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestCopyIdmsVariablesForNotAllowedLevels.java @@ -15,8 +15,13 @@ package org.eclipse.lsp.cobol.dialects.idms.usecases; +import static org.eclipse.lsp4j.DiagnosticSeverity.Warning; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; import org.eclipse.lsp.cobol.common.AnalysisResult; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.common.model.tree.ProgramNode; @@ -35,12 +40,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -import static org.eclipse.lsp4j.DiagnosticSeverity.Warning; - /** Test the variables for IDMS copybooks are not modified if adjusted levels are greater than 48 */ public class TestCopyIdmsVariablesForNotAllowedLevels { @@ -113,7 +112,7 @@ void noAdjustmentWhenAdjustedLevelGreaterThan49() { Collections.singletonList( new DiagnosticRelatedInformation( new Location( - "file:///c:/workspace/document.cbl", + "file:c:/workspace/document.cbl", new Range(new Position(9, 11), new Position(9, 29))), "Copy IDMS source"))); diff --git a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestDelete.java b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestDelete.java index 19348ac154..0976d742a5 100644 --- a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestDelete.java +++ b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestDelete.java @@ -16,15 +16,14 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import java.util.stream.Stream; import org.eclipse.lsp.cobol.dialects.idms.utils.DialectConfigs; -import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp.cobol.dialects.idms.utils.Fixtures; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import java.util.stream.Stream; - /** These test for variations of valid DELETE statements */ class TestDelete { @@ -34,7 +33,7 @@ class TestDelete { + " ENVIRONMENT DIVISION.\r\n" + " INPUT-OUTPUT SECTION.\r\n" + " FILE-CONTROL.\r\n" - + " SELECT {$SCRATCH} ASSIGN TO TEST \r\n" + + " SELECT {$SCRATCH} ASSIGN TO TEST2 \r\n" + " ORGANIZATION IS LINE SEQUENTIAL \r\n" + " ACCESS MODE IS SEQUENTIAL. \r\n" + " DATA DIVISION. \r\n" diff --git a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestIdmsCopy.java b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestIdmsCopy.java index d33155d519..47b0bf05b1 100644 --- a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestIdmsCopy.java +++ b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestIdmsCopy.java @@ -14,19 +14,19 @@ */ package org.eclipse.lsp.cobol.dialects.idms.usecases; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.AnalysisResult; import org.eclipse.lsp.cobol.common.model.NodeType; -import org.eclipse.lsp.cobol.dialects.idms.IdmsDialect; import org.eclipse.lsp.cobol.common.model.tree.variable.ElementaryItemNode; -import org.eclipse.lsp.cobol.test.CobolText; -import org.eclipse.lsp.cobol.common.AnalysisResult; +import org.eclipse.lsp.cobol.dialects.idms.IdmsDialect; import org.eclipse.lsp.cobol.dialects.idms.utils.DialectConfigs; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; - /** * These test for COPY IDMS statements in FILE SECTION, WS/LINKAGE SECTIONS AND PROCEDURE DIVISION */ @@ -123,7 +123,7 @@ class TestIdmsCopy { " 01 {$*MRB-ABCMAP}.\n" + " 03 {$*MRB-ABCMAP-ID} PIC X(8).\n"; private static final String CB_NAME5 = "FL002"; - private static final String CB5 = " FD {$*EMP-FILE}.\n" + " RECORD CONTAINS 80.\n"; + private static final String CB5 = " FD {$*EMP-FILE}\n" + " RECORD CONTAINS 80.\n"; private static final String CB6 = " 05 {$*SKILL}.\n" + " 10 {$*SKILL-ID-0455} PIC 9(4).\n"; diff --git a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestIdmsReadyAfterIfNotProducesError.java b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestIdmsReadyAfterIfNotProducesError.java index b1dfff547b..750daca29f 100644 --- a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestIdmsReadyAfterIfNotProducesError.java +++ b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/usecases/TestIdmsReadyAfterIfNotProducesError.java @@ -17,15 +17,15 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.dialects.idms.utils.DialectConfigs; -import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp.cobol.dialects.idms.utils.Fixtures; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; /** This test checks that the IDMS READY statement is parsed correctly after the IF statement */ class TestIdmsReadyAfterIfNotProducesError { private static final String TEXT = " identification division.\n" - + " program-id. test.\n" + + " program-id. test1.\n" + " data division.\n" + " working-storage section.\n" + " 01 {$*AN-IDMS-AREA} USAGE IS POINTER.\n" diff --git a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/utils/UseCaseInitializerService.java b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/utils/UseCaseInitializerService.java index 26ceb3e5d2..cfed67b781 100644 --- a/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/utils/UseCaseInitializerService.java +++ b/server/dialect-idms/src/test/java/org/eclipse/lsp/cobol/dialects/idms/utils/UseCaseInitializerService.java @@ -27,16 +27,15 @@ import com.google.inject.multibindings.Multibinder; import com.google.inject.name.Names; import java.util.concurrent.CompletableFuture; -import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.LanguageEngineFacade; import org.eclipse.lsp.cobol.common.SubroutineService; import org.eclipse.lsp.cobol.common.action.CodeActionProvider; import org.eclipse.lsp.cobol.common.copybook.CopybookService; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.common.file.FileSystemService; import org.eclipse.lsp.cobol.common.file.WorkspaceFileService; import org.eclipse.lsp.cobol.core.engine.dialects.DialectDiscoveryService; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessorImpl; +import org.eclipse.lsp.cobol.dialects.TrueDialectServiceImpl; import org.eclipse.lsp.cobol.domain.modules.DatabusModule; import org.eclipse.lsp.cobol.domain.modules.EngineModule; import org.eclipse.lsp.cobol.lsp.DisposableLSPStateService; @@ -76,14 +75,13 @@ public Injector createInjector() { new AbstractModule() { @Override protected void configure() { + bind(TrueDialectService.class).to(TrueDialectServiceImpl.class); bind(LanguageEngineFacade.class).to(CobolLanguageEngineFacade.class); bind(CopybookService.class).to(CopybookServiceImpl.class); bind(SettingsService.class).toInstance(mockSettingsService); bind(FileSystemService.class).toInstance(new WorkspaceFileService()); bind(CobolLanguageClient.class).toInstance(languageClient); bind(SubroutineService.class).to(SubroutineServiceImpl.class); - bind(TextPreprocessor.class).to(TextPreprocessorImpl.class); - bind(CleanerPreprocessor.class).to(TextPreprocessorImpl.class); bind(WatcherService.class).to(WatcherServiceImpl.class); bind(DialectDiscoveryService.class).to(ExplicitDialectDiscoveryService.class); bind(CopybookIdentificationService.class) diff --git a/server/engine/pom.xml b/server/engine/pom.xml index 5751af2c50..69ade14f45 100644 --- a/server/engine/pom.xml +++ b/server/engine/pom.xml @@ -48,9 +48,7 @@ 4.7.5 4.7 3.2.0 - 2.7 3.7.0 - 4.3.0 0.8.11 3.0.2 3.0.0-M3 @@ -75,7 +73,9 @@ org.eclipse.lsp.cobol test - test + + + provided 1.0-SNAPSHOT @@ -293,29 +293,6 @@ - - - org.codehaus.mojo - cobertura-maven-plugin - ${maven.cobertura.plugin.version} - - xml - 256m - true - - - org/eclipse/lsp/**/*.class - - - - - - - org.eluder.coveralls - coveralls-maven-plugin - ${maven.coveralls.plugin.version} - - org.jacoco jacoco-maven-plugin @@ -342,6 +319,18 @@ report + + verify + + report-aggregate + + + + **/jacoco.exec + + ${project.reporting.outputDirectory}/jacoco-aggregate + + @@ -564,22 +553,4 @@ - - - - - org.codehaus.mojo - cobertura-maven-plugin - ${maven.cobertura.plugin.version} - - - - cobertura - - - - - - - \ No newline at end of file diff --git a/server/engine/src/main/antlr4/org/eclipse/lsp/cics/parser/CICSParser.g4 b/server/engine/src/main/antlr4/org/eclipse/lsp/cics/parser/CICSParser.g4 index e4c65b4386..84e0e5eb59 100644 --- a/server/engine/src/main/antlr4/org/eclipse/lsp/cics/parser/CICSParser.g4 +++ b/server/engine/src/main/antlr4/org/eclipse/lsp/cics/parser/CICSParser.g4 @@ -15,7 +15,7 @@ parser grammar CICSParser; options {tokenVocab = CICSLexer; superClass = MessageServiceParser;} startRule: .*? ((cicsExecBlock | cicsDfhRespLiteral | cicsDfhValueLiteral) .*?) * EOF; -compilerDirective: (.*? compilerXOpts)* EOF; +compilerDirective: (.*? compilerXOpts)* .*? EOF; cicsExecBlock: EXEC CICS allCicsRule END_EXEC DOT? | EXEC CICS (allCicsRule | invalidInput)+ END_EXEC DOT? | EXEC CICS END_EXEC DOT? diff --git a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolPreprocessor.g4 b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolPreprocessor.g4 index 490ff18ee5..c152a028c9 100644 --- a/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolPreprocessor.g4 +++ b/server/engine/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolPreprocessor.g4 @@ -36,7 +36,7 @@ copyStatement // sql include statement includeStatement - : EXEC SQL INCLUDE copySource END_EXEC DOT_FS + : EXEC SQL INCLUDE copySource END_EXEC DOT_FS? ; // ++Include statement diff --git a/server/engine/src/main/antlr4/org/eclipse/lsp/db2/parser/Db2SqlLexer.g4 b/server/engine/src/main/antlr4/org/eclipse/lsp/db2/parser/Db2SqlLexer.g4 index e1b81e2af2..7139987a9d 100644 --- a/server/engine/src/main/antlr4/org/eclipse/lsp/db2/parser/Db2SqlLexer.g4 +++ b/server/engine/src/main/antlr4/org/eclipse/lsp/db2/parser/Db2SqlLexer.g4 @@ -866,7 +866,7 @@ WS : [ \t\f]+ -> channel(HIDDEN); //SQL comments SQLLINECOMMENT - : SQLLINECOMMENTCHAR ~[\r\n]* NEWLINE -> channel(HIDDEN) + : SQLLINECOMMENTCHAR ~[\r\n]* {_input.LA(1) == NEWLINE}? ; // treat all the non-processed tokens as errors diff --git a/server/engine/src/main/antlr4/org/eclipse/lsp/db2/parser/Db2SqlParser.g4 b/server/engine/src/main/antlr4/org/eclipse/lsp/db2/parser/Db2SqlParser.g4 index 2b219cbe93..288a6a5513 100644 --- a/server/engine/src/main/antlr4/org/eclipse/lsp/db2/parser/Db2SqlParser.g4 +++ b/server/engine/src/main/antlr4/org/eclipse/lsp/db2/parser/Db2SqlParser.g4 @@ -18,9 +18,9 @@ options {tokenVocab = Db2SqlLexer; superClass = MessageServiceParser;} startRule: .*? (execRule .*?) * EOF; //startIncludeRule: .*? (includeStatement .*?)* EOF; -execRule: EXEC SQL sqlCode END_EXEC DOT_FS? - | EXEC SQL END_EXEC DOT_FS? - | EXEC SQLIMS sqlCode END_EXEC DOT_FS? // TODO: check when should this grammar be activated. Probably based on some compiler directives +execRule: EXEC SQL sqlCode END_EXEC + | EXEC SQL END_EXEC + | EXEC SQLIMS sqlCode END_EXEC // TODO: check when should this grammar be activated. Probably based on some compiler directives | {notifyError("cobolParser.missingEndExec");} EXEC SQL sqlCode DOT_FS? EOF | {notifyError("cobolParser.missingEndExec");} EXEC SQL; diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/Cli.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/Cli.java index 81ad51d875..590b3173b3 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/Cli.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/Cli.java @@ -27,27 +27,29 @@ import org.eclipse.lsp.cobol.cli.di.CliModule; import org.eclipse.lsp.cobol.cli.modules.CliClientProvider; import org.eclipse.lsp.cobol.common.AnalysisConfig; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.SubroutineService; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkService; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkSession; import org.eclipse.lsp.cobol.common.benchmark.Measurement; import org.eclipse.lsp.cobol.common.copybook.CopybookProcessingMode; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.common.error.SyntaxError; import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; import org.eclipse.lsp.cobol.common.mapping.ExtendedText; import org.eclipse.lsp.cobol.common.message.MessageService; import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; -import org.eclipse.lsp.cobol.core.engine.pipeline.Pipeline; -import org.eclipse.lsp.cobol.core.engine.pipeline.PipelineResult; -import org.eclipse.lsp.cobol.core.engine.pipeline.StageResult; -import org.eclipse.lsp.cobol.core.engine.pipeline.stages.*; +import org.eclipse.lsp.cobol.common.pipeline.Pipeline; +import org.eclipse.lsp.cobol.common.pipeline.PipelineResult; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; import org.eclipse.lsp.cobol.core.engine.processor.AstProcessor; import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessor; import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; +import org.eclipse.lsp.cobol.dialects.ibm.*; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.eclipse.lsp4j.Location; @@ -92,7 +94,7 @@ private enum Action { @Override public Integer call() throws Exception { Injector diCtx = Guice.createInjector(new CliModule()); - Pipeline pipeline = setupPipeline(diCtx, action); + Pipeline pipeline = setupPipeline(diCtx, action); CliClientProvider cliClientProvider = diCtx.getInstance(CliClientProvider.class); if (cpyPaths != null) { @@ -101,7 +103,7 @@ public Integer call() throws Exception { cliClientProvider.setCpyExt(Arrays.asList(cpyExt)); // Cleaning up - TextPreprocessor preprocessor = diCtx.getInstance(TextPreprocessor.class); + CleanerPreprocessor preprocessor = diCtx.getInstance(TrueDialectService.class).getPreprocessor(CobolLanguageId.COBOL); BenchmarkService benchmarkService = diCtx.getInstance(BenchmarkService.class); if (src == null) { @@ -115,7 +117,7 @@ public Integer call() throws Exception { new AnalysisContext( new ExtendedDocument(resultWithErrors.getResult(), text), createAnalysisConfiguration(), - benchmarkService.startSession()); + benchmarkService.startSession(), documentUri, text, CobolLanguageId.COBOL); ctx.getAccumulatedErrors().addAll(resultWithErrors.getErrors()); PipelineResult pipelineResult = pipeline.run(ctx); Gson gson = new GsonBuilder().setPrettyPrinting().create(); @@ -188,7 +190,7 @@ private static AnalysisConfig createAnalysisConfiguration() { return AnalysisConfig.defaultConfig(CopybookProcessingMode.ENABLED); } - private static Pipeline setupPipeline(Injector diCtx, Action action) { + private static Pipeline setupPipeline(Injector diCtx, Action action) { DialectService dialectService = diCtx.getInstance(DialectService.class); MessageService messageService = diCtx.getInstance(MessageService.class); GrammarPreprocessor grammarPreprocessor = diCtx.getInstance(GrammarPreprocessor.class); @@ -200,10 +202,12 @@ private static Pipeline setupPipeline(Injector diCtx, Action action) { AstProcessor astProcessor = diCtx.getInstance(AstProcessor.class); CodeLayoutStore layoutStore = diCtx.getInstance(CodeLayoutStore.class); - Pipeline pipeline = new Pipeline(); + CleanerPreprocessor preprocessor = diCtx.getInstance(TrueDialectService.class).getPreprocessor(CobolLanguageId.COBOL); + + Pipeline pipeline = new Pipeline<>(); pipeline.add(new CompilerDirectivesStage(messageService)); - pipeline.add(new DialectProcessingStage(dialectService)); - pipeline.add(new PreprocessorStage(grammarPreprocessor)); + pipeline.add(new DialectProcessingStage(dialectService, preprocessor)); + pipeline.add(new PreprocessorStage(grammarPreprocessor, preprocessor)); if (action == Action.analysis) { pipeline.add(new ImplicitDialectProcessingStage(dialectService)); pipeline.add(new ParserStage(messageService, parseTreeListener)); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/di/CliModule.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/di/CliModule.java index 350a98436f..e4258f5414 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/di/CliModule.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/di/CliModule.java @@ -15,6 +15,9 @@ package org.eclipse.lsp.cobol.cli.di; +import static com.google.inject.multibindings.Multibinder.newSetBinder; +import static com.google.inject.name.Names.named; + import com.google.inject.AbstractModule; import com.google.inject.assistedinject.FactoryModuleBuilder; import com.google.inject.multibindings.Multibinder; @@ -29,6 +32,7 @@ import org.eclipse.lsp.cobol.common.benchmark.BenchmarkService; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkServiceImpl; import org.eclipse.lsp.cobol.common.copybook.CopybookService; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.common.file.FileSystemService; import org.eclipse.lsp.cobol.common.file.WorkspaceFileService; import org.eclipse.lsp.cobol.common.message.LocaleStore; @@ -37,22 +41,13 @@ import org.eclipse.lsp.cobol.core.engine.dialects.DialectDiscoveryService; import org.eclipse.lsp.cobol.core.messages.LocaleStoreImpl; import org.eclipse.lsp.cobol.core.messages.PropertiesMessageService; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessorImpl; +import org.eclipse.lsp.cobol.dialects.TrueDialectServiceImpl; import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessor; import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessorImpl; import org.eclipse.lsp.cobol.core.preprocessor.delegates.copybooks.GrammarPreprocessorListenerFactory; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReader; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReaderImpl; import org.eclipse.lsp.cobol.core.preprocessor.delegates.replacement.ReplacePreprocessorFactory; import org.eclipse.lsp.cobol.core.preprocessor.delegates.replacement.ReplacingService; import org.eclipse.lsp.cobol.core.preprocessor.delegates.replacement.ReplacingServiceImpl; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineIndicatorProcessorImpl; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineReWriter; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.CobolLinesTransformation; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.ContinuationLineTransformation; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriter; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriterImpl; import org.eclipse.lsp.cobol.core.visitor.InterruptingTreeListener; import org.eclipse.lsp.cobol.lsp.DisposableLSPStateService; import org.eclipse.lsp.cobol.lsp.jrpc.CobolLanguageClient; @@ -79,22 +74,16 @@ import org.eclipse.lsp.cobol.service.settings.SettingsService; import org.eclipse.lsp.cobol.service.settings.SettingsServiceImpl; -import static com.google.inject.multibindings.Multibinder.newSetBinder; -import static com.google.inject.name.Names.named; - /** This module provides DI bindings for COBOL language engine part. */ public class CliModule extends AbstractModule { @Override protected void configure() { - bind(TextPreprocessor.class).to(TextPreprocessorImpl.class); + bind(TrueDialectService.class).to(TrueDialectServiceImpl.class); + bind(GrammarPreprocessor.class).to(GrammarPreprocessorImpl.class); install(new FactoryModuleBuilder().build(GrammarPreprocessorListenerFactory.class)); install(new FactoryModuleBuilder().build(ReplacePreprocessorFactory.class)); bind(ReplacingService.class).to(ReplacingServiceImpl.class); - bind(CobolLineReader.class).to(CobolLineReaderImpl.class); - bind(CobolLineWriter.class).to(CobolLineWriterImpl.class); - bind(CobolLinesTransformation.class).to(ContinuationLineTransformation.class); - bind(CobolLineReWriter.class).to(CobolLineIndicatorProcessorImpl.class); bind(MessageService.class).to(PropertiesMessageService.class); bind(LocaleStore.class).to(LocaleStoreImpl.class); bind(ConfigurationService.class).to(CachingConfigurationService.class); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/CobolLanguageEngine.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/CobolLanguageEngine.java index a586a2ed94..dbb550081b 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/CobolLanguageEngine.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/CobolLanguageEngine.java @@ -26,15 +26,13 @@ import java.util.*; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; -import org.antlr.v4.runtime.tree.ParseTreeListener; import org.eclipse.lsp.cobol.common.*; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkService; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkSession; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.common.error.ErrorCodes; import org.eclipse.lsp.cobol.common.error.ErrorSeverity; import org.eclipse.lsp.cobol.common.error.SyntaxError; -import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; -import org.eclipse.lsp.cobol.common.mapping.ExtendedText; import org.eclipse.lsp.cobol.common.mapping.OriginalLocation; import org.eclipse.lsp.cobol.common.message.MessageService; import org.eclipse.lsp.cobol.common.model.tree.CopyNode; @@ -43,19 +41,13 @@ import org.eclipse.lsp.cobol.common.utils.ImplicitCodeUtils; import org.eclipse.lsp.cobol.common.utils.ThreadInterruptionUtil; import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; -import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; import org.eclipse.lsp.cobol.core.engine.errors.ErrorFinalizerService; -import org.eclipse.lsp.cobol.core.engine.pipeline.Pipeline; -import org.eclipse.lsp.cobol.core.engine.pipeline.PipelineResult; -import org.eclipse.lsp.cobol.core.engine.pipeline.StageResult; -import org.eclipse.lsp.cobol.core.engine.pipeline.stages.*; -import org.eclipse.lsp.cobol.core.engine.processor.AstProcessor; -import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessor; +import org.eclipse.lsp.cobol.common.pipeline.Pipeline; +import org.eclipse.lsp.cobol.common.pipeline.PipelineResult; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.dialects.ibm.ProcessingResult; import org.eclipse.lsp.cobol.lsp.handlers.HandlerUtility; -import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; -import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.eclipse.lsp.cobol.service.utils.ServerTypeUtil; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.Location; @@ -72,47 +64,21 @@ public class CobolLanguageEngine { private static final int FIRST_LINE_SEQ_AND_EXTRA_OP = 8; - private final TextPreprocessor preprocessor; private final MessageService messageService; private final ErrorFinalizerService errorFinalizerService; private final BenchmarkService benchmarkService; - private final Pipeline pipeline; + private final TrueDialectService trueDialectService; @Inject public CobolLanguageEngine( - TextPreprocessor preprocessor, - GrammarPreprocessor grammarPreprocessor, + TrueDialectService trueDialectService, MessageService messageService, - ParseTreeListener treeListener, - SubroutineService subroutineService, - CachingConfigurationService cachingConfigurationService, - DialectService dialectService, - AstProcessor astProcessor, - SymbolsRepository symbolsRepository, ErrorFinalizerService errorFinalizerService, - BenchmarkService benchmarkService, - CodeLayoutStore codeLayoutStore) { - this.preprocessor = preprocessor; + BenchmarkService benchmarkService) { this.messageService = messageService; this.errorFinalizerService = errorFinalizerService; this.benchmarkService = benchmarkService; - - this.pipeline = new Pipeline(); - this.pipeline.add(new DialectCompilerDirectiveStage(dialectService)); - this.pipeline.add(new CompilerDirectivesStage(messageService)); - this.pipeline.add(new DialectProcessingStage(dialectService)); - this.pipeline.add(new PreprocessorStage(grammarPreprocessor)); - this.pipeline.add(new ImplicitDialectProcessingStage(dialectService)); - this.pipeline.add(new ParserStage(messageService, treeListener)); - this.pipeline.add( - new TransformTreeStage( - symbolsRepository, - messageService, - subroutineService, - cachingConfigurationService, - dialectService, - astProcessor, - codeLayoutStore)); + this.trueDialectService = trueDialectService; } private static AnalysisResult toAnalysisResult( @@ -142,7 +108,7 @@ private static AnalysisResult toAnalysisResult( /** * Collect diagnostics for each document, used in the analysis - the main COBOL file and all the - * copybooks. If there were no errors for some URI, then provide an empty list to clean-up the + * copybooks. If there were no errors for some URI, then provide an empty list to clean up the * errors after the previous analysis. * * @param diagnostics - list of found syntax and semantic errors @@ -161,17 +127,18 @@ private static Map> collectDiagnosticsForAffectedDocume /** * Perform syntax and semantic analysis for the given text document * - * @param documentUri unique resource identifier of the processed document - * @param text the content of the document that should be processed + * @param documentUri unique resource identifier of the processed document + * @param text the content of the document that should be processed * @param analysisConfig contains analysis processing features info and copybook config with - * following information: target backend sql server, copybook processing mode which reflect - * the sync status of the document (DID_OPEN|DID_CHANGE) + * following information: target backend sql server, copybook processing mode which reflect + * the sync status of the document (DID_OPEN|DID_CHANGE) + * @param languageId language identifier * @return Semantic information wrapper object and list of syntax error that might send back to - * the client + * the client */ @NonNull public AnalysisResult run( - @NonNull String documentUri, @NonNull String text, @NonNull AnalysisConfig analysisConfig) { + @NonNull String documentUri, @NonNull String text, @NonNull AnalysisConfig analysisConfig, CobolLanguageId languageId) { ThreadInterruptionUtil.checkThreadInterrupted(); if (isEmpty(text)) { return AnalysisResult.builder().build(); @@ -182,13 +149,10 @@ public AnalysisResult run( getErrorForIncompatibleServerTypeAndDialects(documentUri), documentUri); } - // Cleaning up - ResultWithErrors resultWithErrors = preprocessor.cleanUpCode(documentUri, text); BenchmarkSession session = benchmarkService.startSession(); - AnalysisContext ctx = - new AnalysisContext( - new ExtendedDocument(resultWithErrors.getResult(), text), analysisConfig, session); - ctx.getAccumulatedErrors().addAll(resultWithErrors.getErrors()); + AnalysisContext ctx = new AnalysisContext(analysisConfig, session, documentUri, text, languageId); + + Pipeline pipeline = trueDialectService.getPipeline(languageId); PipelineResult pipelineResult = pipeline.run(ctx); StageResult result = pipelineResult.getLastStageResult(); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/analysis/AnalysisContext.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/analysis/AnalysisContext.java index 86e5755d27..22537deceb 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/analysis/AnalysisContext.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/analysis/AnalysisContext.java @@ -14,31 +14,49 @@ */ package org.eclipse.lsp.cobol.core.engine.analysis; +import java.util.*; import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.eclipse.lsp.cobol.common.AnalysisConfig; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkSession; +import org.eclipse.lsp.cobol.common.benchmark.BenchmarkSessionProvider; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.SyntaxError; import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; import org.eclipse.lsp.cobol.common.model.tree.Node; import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; -import java.util.*; - /** * Contains related to analysis state */ -@RequiredArgsConstructor @Slf4j @Getter -public class AnalysisContext { - private final ExtendedDocument extendedDocument; +@RequiredArgsConstructor +public class AnalysisContext implements BenchmarkSessionProvider { + private @Setter ExtendedDocument extendedDocument; private final AnalysisConfig config; private final List accumulatedErrors = new ArrayList<>(); private final BenchmarkSession benchmarkSession; + private final String documentUri; + private final String text; + private final CobolLanguageId languageId; - private @Setter List dialectNodes; + private @Setter List dialectNodes = new ArrayList<>(); private @Setter CopybooksRepository copybooksRepository; + + public AnalysisContext(ExtendedDocument extendedDocument, + AnalysisConfig config, + BenchmarkSession benchmarkSession, + String documentUri, + String text, + CobolLanguageId languageId) { + this.extendedDocument = extendedDocument; + this.config = config; + this.benchmarkSession = benchmarkSession; + this.documentUri = documentUri; + this.text = text; + this.languageId = languageId; + } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/dialects/DialectService.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/dialects/DialectService.java index 8e4a323e90..a6a26eedd1 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/dialects/DialectService.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/dialects/DialectService.java @@ -18,7 +18,12 @@ import com.google.gson.JsonElement; import com.google.inject.Inject; import com.google.inject.Singleton; +import java.util.*; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Predicate; +import java.util.stream.Collectors; import org.eclipse.lsp.cobol.common.AnalysisConfig; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.DialectRegistryItem; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.copybook.CopybookModel; @@ -42,11 +47,6 @@ import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; -import java.util.*; -import java.util.concurrent.atomic.AtomicBoolean; -import java.util.function.Predicate; -import java.util.stream.Collectors; - /** Dialect utility class */ @Singleton public class DialectService { @@ -139,7 +139,7 @@ public ResultWithErrors processImplicitDialects( * @param ctx a {@link AnalysisContext} class * @param dialectProcessingContext is a DialectProcessingContext class with all needed data for * dialect processing - * @return a error while extending the document + * @return an error while extending the document */ public List extendImplicitDialects( AnalysisContext ctx, DialectProcessingContext dialectProcessingContext) { @@ -262,7 +262,7 @@ private LinkedList sortDialects(List dialects) { * Returns dialect object by name * * @param dialectName is a dialect name - * @return a dialect is it's possible + * @return a dialect if it is possible */ public Optional getDialectByName(String dialectName) { return Optional.ofNullable(dialectSuppliers.get(dialectName)); @@ -365,15 +365,16 @@ public List getWatchingFolderSettings() { /** * Add pre-defined copybooks from dialects to the copybook repository. * - * @param config {@link AnalysisConfig} + * @param config {@link AnalysisConfig} + * @param preprocessor - dialect specific preprocessor */ - public void addDialectPredefinedCopybooks(AnalysisConfig config) { + public void addDialectPredefinedCopybooks(AnalysisConfig config, CleanerPreprocessor preprocessor) { List dialects = new ArrayList<>(); config.getDialects().forEach(dialect -> getDialectByName(dialect).ifPresent(dialects::add)); dialects.addAll(getActiveImplicitDialects(config)); for (CobolDialect dialect : dialects) { List predefinedCopybook = dialect.getPredefinedCopybook(config); - predefinedCopybook.forEach(model -> copybookService.store(model, true)); + predefinedCopybook.forEach(model -> copybookService.store(model, preprocessor)); } } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/JsonGenerateProcess.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/JsonGenerateProcess.java index fd9a84c193..50c90fba58 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/JsonGenerateProcess.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/JsonGenerateProcess.java @@ -23,6 +23,7 @@ import org.eclipse.lsp.cobol.common.processor.ProcessingContext; import org.eclipse.lsp.cobol.common.processor.Processor; import org.eclipse.lsp.cobol.core.engine.symbols.SymbolAccumulatorService; +import org.eclipse.lsp.cobol.core.model.NodeUtils; import org.eclipse.lsp.cobol.core.model.VariableUsageUtils; import org.eclipse.lsp.cobol.common.model.tree.JsonGenerateNode; import org.eclipse.lsp.cobol.common.model.tree.variables.ConditionDataNameNode; @@ -39,10 +40,6 @@ /** Apply all the validation for the JSON Generate statement and return found errors. */ public class JsonGenerateProcess implements Processor { - // TODO: remove undetermined once effective data type calculation is corrected - public static final ImmutableList ALPHANUMERIC_DATA_TYPES = - ImmutableList.of( - EffectiveDataType.STRING, EffectiveDataType.INTEGER, EffectiveDataType.UNDETERMINED); public static final ImmutableList IDENTIFIER3_DATA_TYPES = ImmutableList.of(EffectiveDataType.INTEGER, EffectiveDataType.REAL, EffectiveDataType.UNDETERMINED); private final SymbolAccumulatorService symbolAccumulatorService; @@ -399,7 +396,7 @@ private void semanticAnalysisForIdentifier1( if (identifier1Definitions.get(0) instanceof ElementaryItemNode) { ElementaryItemNode foundDefinitionNode = (ElementaryItemNode) identifier1Definitions.get(0); boolean isNational = foundDefinitionNode.getUsageFormat() == UsageFormat.NATIONAL; - if (!(ALPHANUMERIC_DATA_TYPES.contains(foundDefinitionNode.getEffectiveDataType()) + if (!(NodeUtils.ALPHANUMERIC_DATA_TYPES.contains(foundDefinitionNode.getEffectiveDataType()) || isNational) || foundDefinitionNode.isJustified() || foundDefinitionNode.isDynamicLength()) { @@ -433,32 +430,9 @@ private void semanticAnalysisForIdentifier1( } private void verifyIdentifier1GroupItem(List definitions, List identifier1, ProcessingContext ctx) { - boolean isGroupItemAlphanumeric = - definitions - .get(0) - .getDepthFirstStream() - .filter(ElementaryItemNode.class::isInstance) - .map(ElementaryItemNode.class::cast) - .anyMatch(node -> ALPHANUMERIC_DATA_TYPES.contains(node.getEffectiveDataType()) || node.getUsageFormat() == UsageFormat.NATIONAL); - - boolean isGroupItemDynamic = - definitions - .get(0) - .getDepthFirstStream() - .filter(ElementaryItemNode.class::isInstance) - .map(ElementaryItemNode.class::cast) - .anyMatch(ElementaryNode::isDynamicLength); - - boolean isGroupItemJustified = - definitions - .get(0) - .getDepthFirstStream() - .filter(ElementaryItemNode.class::isInstance) - .map(ElementaryItemNode.class::cast) - .anyMatch(ElementaryNode::isJustified); - - - if (!isGroupItemAlphanumeric || isGroupItemDynamic || isGroupItemJustified) { + if (!NodeUtils.isNodeAlphanumeric(definitions.get(0)) + || NodeUtils.checkIfNodeHasDynamicGroupItem(definitions.get(0)) + || NodeUtils.checkIfNodeHasJustifiedGroupItem(definitions.get(0))) { ctx.getErrors() .add( SyntaxError.syntaxError() @@ -466,7 +440,7 @@ private void verifyIdentifier1GroupItem(List definitions, List { + private final CobolProgramLayout programLayout; + + public VariableWithLevelCheck(CobolProgramLayout programLayout) { + this.programLayout = programLayout; + } + @Override public void accept(VariableWithLevelNode node, ProcessingContext ctx) { + int areaAFinish = programLayout.getSequenceLength() + programLayout.getIndicatorLength() + programLayout.getAreaALength() - 1; if ((node.getLevel() == LEVEL_01 || node.getLevel() == LEVEL_77) - && node.getLocality().getRange().getStart().getCharacter() > AREA_A_FINISH) { + && node.getLocality().getRange().getStart().getCharacter() > areaAFinish) { ctx.getErrors().add(node.getError(MessageTemplate.of(AREA_A_WARNING, node.getName()))); } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/XmlGenerateProcess.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/XmlGenerateProcess.java new file mode 100644 index 0000000000..8af39b6034 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/XmlGenerateProcess.java @@ -0,0 +1,641 @@ +/* + * Copyright (c) 2023 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.core.engine.processors; + +import com.google.common.collect.ImmutableList; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.common.message.MessageTemplate; +import org.eclipse.lsp.cobol.common.model.tree.XmlGenerateNode; +import org.eclipse.lsp.cobol.common.model.tree.variable.*; +import org.eclipse.lsp.cobol.common.processor.ProcessingContext; +import org.eclipse.lsp.cobol.common.processor.Processor; +import org.eclipse.lsp.cobol.core.engine.symbols.SymbolAccumulatorService; +import org.eclipse.lsp.cobol.core.model.NodeUtils; +import org.eclipse.lsp.cobol.core.model.VariableUsageUtils; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static java.util.stream.Collectors.groupingBy; +import static org.eclipse.lsp.cobol.common.OutlineNodeNames.FILLER_NAME; + +/** Apply all validation of XML Generate Statement. */ +public class XmlGenerateProcess implements Processor { + public static final ImmutableList IDENTIFIER3_DATA_TYPES = + ImmutableList.of( + EffectiveDataType.INTEGER, EffectiveDataType.REAL, EffectiveDataType.UNDETERMINED); + private final SymbolAccumulatorService symbolAccumulatorService; + + public XmlGenerateProcess(SymbolAccumulatorService symbolAccumulatorService) { + this.symbolAccumulatorService = symbolAccumulatorService; + } + + @Override + public void accept(XmlGenerateNode xmlGenerateNode, ProcessingContext processingContext) { + List identifier1Nodes = + VariableUsageUtils.getVariableUsageNode(xmlGenerateNode, xmlGenerateNode.getIdentifier1()); + if (identifier1Nodes.isEmpty()) return; + List identifier1FoundDefinitions = + VariableUsageUtils.getDefinitionNode( + symbolAccumulatorService, xmlGenerateNode, identifier1Nodes); + + semanticAnalysisForIdentifier1( + processingContext, identifier1Nodes, identifier1FoundDefinitions); + List identifier2Nodes = + VariableUsageUtils.getVariableUsageNode(xmlGenerateNode, xmlGenerateNode.getIdentifier2()); + if (identifier2Nodes.isEmpty()) return; + List identifier2FoundDefinitions = + VariableUsageUtils.getDefinitionNode( + symbolAccumulatorService, xmlGenerateNode, identifier2Nodes); + if (identifier2FoundDefinitions.isEmpty()) return; + semanticAnalysisForIdentifier2( + processingContext, + identifier2Nodes, + identifier2FoundDefinitions, + identifier1FoundDefinitions); + + if (Objects.nonNull(xmlGenerateNode.getIdentifier3())) { + List identifier3Nodes = + VariableUsageUtils.getVariableUsageNode( + xmlGenerateNode, xmlGenerateNode.getIdentifier3()); + if (identifier3Nodes.isEmpty()) return; + List identifier3FoundDefinitions = + VariableUsageUtils.getDefinitionNode( + symbolAccumulatorService, xmlGenerateNode, identifier3Nodes); + semanticAnalysisForIdentifier3( + processingContext, + identifier3Nodes, + identifier3FoundDefinitions, + identifier2FoundDefinitions, + identifier1FoundDefinitions); + + if (Objects.nonNull(xmlGenerateNode.getIdentifier4())) { + + List identifier4Nodes = + VariableUsageUtils.getVariableUsageNode( + xmlGenerateNode, xmlGenerateNode.getIdentifier4()); + if (identifier4Nodes.isEmpty()) return; + List identifier4FoundDefinitions = + VariableUsageUtils.getDefinitionNode( + symbolAccumulatorService, xmlGenerateNode, identifier4Nodes); + semanticAnalysisForIdentifier4( + processingContext, + identifier4Nodes, + identifier4FoundDefinitions, + identifier1FoundDefinitions, + identifier3FoundDefinitions); + } + if (Objects.nonNull(xmlGenerateNode.getIdentifier5())) { + + List identifier5Nodes = + VariableUsageUtils.getVariableUsageNode( + xmlGenerateNode, xmlGenerateNode.getIdentifier5()); + if (identifier5Nodes.isEmpty()) return; + List identifier5FoundDefinitions = + VariableUsageUtils.getDefinitionNode( + symbolAccumulatorService, xmlGenerateNode, identifier5Nodes); + semanticAnalysisForIdentifier5( + processingContext, + identifier5Nodes, + identifier5FoundDefinitions, + identifier1FoundDefinitions, + identifier3FoundDefinitions); + } + + if (Objects.nonNull(xmlGenerateNode.getIdentifier6()) + && !xmlGenerateNode.getIdentifier6().isEmpty()) { + semanticAnalysisForIdentifier6( + xmlGenerateNode, processingContext, identifier2FoundDefinitions); + } + + if (Objects.nonNull(xmlGenerateNode.getIdentifier7()) + && !xmlGenerateNode.getIdentifier7().isEmpty()) { + semanticAnalysisForIdentifier7( + xmlGenerateNode, processingContext, identifier2FoundDefinitions); + } + + if (Objects.nonNull(xmlGenerateNode.getIdentifier8()) + && !xmlGenerateNode.getIdentifier8().isEmpty()) { + semanticAnalysisForIdentifier8( + xmlGenerateNode, processingContext, identifier2FoundDefinitions); + } + } + } + + private void semanticAnalysisForIdentifier8( + XmlGenerateNode xmlGenerateNode, + ProcessingContext ctx, + List identifier2FoundDefinitions) { + List identifier8Nodes = + VariableUsageUtils.getVariableUsageNode(xmlGenerateNode, xmlGenerateNode.getIdentifier8()); + identifier8Nodes.forEach( + identifier8 -> { + List foundDefinitionsForIdentifier8 = + VariableUsageUtils.getDefinitionNode( + symbolAccumulatorService, + xmlGenerateNode, + Collections.singletonList(identifier8)); + if (foundDefinitionsForIdentifier8.isEmpty() || identifier2FoundDefinitions.isEmpty()) { + return; + } + + boolean isIdentifier8SubsetOfIdentifier2 = + identifier2FoundDefinitions + .get(0) + .getDepthFirstStream() + .anyMatch(node -> node.equals(foundDefinitionsForIdentifier8.get(0))); + if (!isIdentifier8SubsetOfIdentifier2) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier8.getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "xmlParseProcess.identifier7", + identifier8.getNodeType(), + identifier2FoundDefinitions.get(0).getName())) + .build()); + } + }); + } + + private void semanticAnalysisForIdentifier7( + XmlGenerateNode xmlGenerateNode, + ProcessingContext ctx, + List identifier2FoundDefinitions) { + + List identifier7Nodes = + VariableUsageUtils.getVariableUsageNode(xmlGenerateNode, xmlGenerateNode.getIdentifier7()); + identifier7Nodes.forEach( + identifier7 -> { + List foundDefinitionsForIdentifier7 = + VariableUsageUtils.getDefinitionNode( + symbolAccumulatorService, + xmlGenerateNode, + Collections.singletonList(identifier7)); + if (foundDefinitionsForIdentifier7.isEmpty() || identifier2FoundDefinitions.isEmpty()) { + return; + } + + boolean isIdentifier7SubsetOfIdentifier2 = + identifier2FoundDefinitions + .get(0) + .getDepthFirstStream() + .anyMatch(node -> node.equals(foundDefinitionsForIdentifier7.get(0))); + if (!isIdentifier7SubsetOfIdentifier2) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier7.getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "xmlParseProcess.identifier7", + identifier7.getNodeType(), + identifier2FoundDefinitions.get(0).getName())) + .build()); + } + }); + } + + private void semanticAnalysisForIdentifier6( + XmlGenerateNode xmlGenerateNode, + ProcessingContext ctx, + List identifier2FoundDefinitions) { + List identifier6Nodes = + VariableUsageUtils.getVariableUsageNode(xmlGenerateNode, xmlGenerateNode.getIdentifier6()); + identifier6Nodes.forEach( + identifier6 -> { + List foundDefinitionsForIdentifier6 = + VariableUsageUtils.getDefinitionNode( + symbolAccumulatorService, + xmlGenerateNode, + Collections.singletonList(identifier6)); + if (foundDefinitionsForIdentifier6.isEmpty() || identifier2FoundDefinitions.isEmpty()) { + return; + } + + boolean isIdentifier6SubsetOfIdentifier2 = + identifier2FoundDefinitions + .get(0) + .getDepthFirstStream() + .anyMatch(node -> node.equals(foundDefinitionsForIdentifier6.get(0))); + if (!isIdentifier6SubsetOfIdentifier2) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier6.getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "xmlParseProcess.identifier6", + identifier6.getName(), + identifier2FoundDefinitions.get(0).getName())) + .build()); + } + }); + } + + private void semanticAnalysisForIdentifier5( + ProcessingContext ctx, + List identifier5Nodes, + List identifier5FoundDefinitions, + List identifier1FoundDefinitions, + List identifier3FoundDefinitions) { + if (identifier5FoundDefinitions.isEmpty()) return; + if (identifier5FoundDefinitions.get(0) instanceof ElementaryNode) { + ElementaryNode foundDefinitionNode = + (ElementaryNode) identifier5FoundDefinitions.get(0); + boolean isNational = foundDefinitionNode.getUsageFormat() == UsageFormat.NATIONAL; + if (!(NodeUtils.ALPHANUMERIC_DATA_TYPES.contains(foundDefinitionNode.getEffectiveDataType()) + || isNational) + || foundDefinitionNode.isJustified() + || foundDefinitionNode.isDynamicLength()) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier5Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "jsonGenProcess.identifier1.elementaryItemError", + identifier5Nodes.get(0).getName())) + .build()); + } + + } else { + + if (VariableUsageUtils.checkForNoOverlapBetweenNodes( + identifier5FoundDefinitions.get(0), identifier1FoundDefinitions.get(0))) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier5Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "xmlGenProcess.identifier2.overlap", + identifier1FoundDefinitions.get(0).getName(), + identifier5Nodes.get(0).getName())) + .build()); + } + + if (VariableUsageUtils.checkForNoOverlapBetweenNodes( + identifier5FoundDefinitions.get(0), identifier3FoundDefinitions.get(0))) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier5Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "xmlGenProcess.identifier2.overlap", + identifier3FoundDefinitions.get(0).getName(), + identifier5Nodes.get(0).getName())) + .build()); + } + } + } + + private void semanticAnalysisForIdentifier4( + ProcessingContext ctx, + List identifier4Nodes, + List identifier3FoundDefinitions, + List identifier1FoundDefinitions, + List identifier4FoundDefinitions) { + if (identifier4FoundDefinitions.isEmpty()) return; + if (identifier4FoundDefinitions.get(0) instanceof ElementaryNode) { + ElementaryNode foundDefinitionNode = + (ElementaryNode) identifier4FoundDefinitions.get(0); + boolean isNational = foundDefinitionNode.getUsageFormat() == UsageFormat.NATIONAL; + if (!(NodeUtils.ALPHANUMERIC_DATA_TYPES.contains(foundDefinitionNode.getEffectiveDataType()) + || isNational) + || foundDefinitionNode.isJustified() + || foundDefinitionNode.isDynamicLength()) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier4Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "jsonGenProcess.identifier1.elementaryItemError", + identifier4Nodes.get(0).getName())) + .build()); + } + + } else { + if (VariableUsageUtils.checkForNoOverlapBetweenNodes( + identifier4FoundDefinitions.get(0), identifier1FoundDefinitions.get(0))) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier4Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "xmlGenProcess.identifier2.overlap", + identifier1FoundDefinitions.get(0).getName(), + identifier4Nodes.get(0).getName())) + .build()); + } + + if (VariableUsageUtils.checkForNoOverlapBetweenNodes( + identifier4FoundDefinitions.get(0), identifier3FoundDefinitions.get(0))) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier4Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "xmlGenProcess.identifier2.overlap", + identifier3FoundDefinitions.get(0).getName(), + identifier4Nodes.get(0).getName())) + .build()); + } + } + } + + private void semanticAnalysisForIdentifier3( + ProcessingContext ctx, + List identifier3Nodes, + List identifier3FoundDefinitions, + List identifier2FoundDefinitions, + List identifier1FoundDefinitions) { + if (identifier3FoundDefinitions.isEmpty()) return; + + if (!identifier1FoundDefinitions.isEmpty() + && VariableUsageUtils.checkForNoOverlapBetweenNodes( + identifier3FoundDefinitions.get(0), identifier1FoundDefinitions.get(0))) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier3Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "xmlGenProcess.identifier2.overlap", + identifier3Nodes.get(0).getName(), + identifier2FoundDefinitions.get(0).getName())) + .build()); + } + + if (!identifier2FoundDefinitions.isEmpty() + && VariableUsageUtils.checkForNoOverlapBetweenNodes( + identifier3FoundDefinitions.get(0), identifier2FoundDefinitions.get(0))) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier3Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "xmlGenProcess.identifier2.overlap", + identifier3Nodes.get(0).getName(), + identifier2FoundDefinitions.get(0).getName())) + .build()); + + if (identifier3FoundDefinitions.get(0) instanceof ElementaryNode) { + ElementaryNode node = (ElementaryNode) identifier3FoundDefinitions.get(0); + if (!IDENTIFIER3_DATA_TYPES.contains(node.getEffectiveDataType())) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier3Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "jsonGenProcess.identifier3.dataType", + identifier3Nodes.get(0).getName())) + .build()); + } + } else { + boolean isValidGroupItem = + identifier3FoundDefinitions + .get(0) + .getDepthFirstStream() + .filter(ElementaryNode.class::isInstance) + .map(ElementaryNode.class::cast) + .allMatch( + iden3 -> + IDENTIFIER3_DATA_TYPES.contains(iden3.getEffectiveDataType()) + && !iden3.getPicClause().toUpperCase().contains("P")); + if (!isValidGroupItem) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier3Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "jsonGenProcess.identifier3.dataType", + identifier3Nodes.get(0).getName())) + .build()); + } + } + } + } + + private void semanticAnalysisForIdentifier2( + ProcessingContext ctx, + List identifier2Nodes, + List identifier2FoundDefnitions, + List identifier1FoundDefinitions) { + // checking for overlap between identifier1 and identifier2 + if (!identifier2FoundDefnitions.isEmpty() + && !identifier1FoundDefinitions.isEmpty() + && VariableUsageUtils.checkForNoOverlapBetweenNodes( + identifier2FoundDefnitions.get(0), identifier1FoundDefinitions.get(0))) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier2Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "xmlGenProcess.identifier2.overlap", + identifier2Nodes.get(0).getName(), + identifier1FoundDefinitions.get(0).getName() + )) + .build()); + } + + // validation of elementary items + if (identifier2FoundDefnitions.get(0) instanceof ElementaryNode) { + ElementaryNode foundDefinitionNode = + (ElementaryNode) identifier2FoundDefnitions.get(0); + if (foundDefinitionNode.getName().equals(FILLER_NAME) + || foundDefinitionNode.getName().trim().isEmpty() + || isRenameClause(foundDefinitionNode) + || foundDefinitionNode.isDynamicLength()) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier2Nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "xmlParse.identifier2.dataType", identifier2Nodes.get(0).getName())) + .build()); + } + } else { + validateIdentifier2Group(ctx, identifier2Nodes, identifier2FoundDefnitions); + } + } + + private void validateIdentifier2Group( + ProcessingContext ctx, List nodes, List definitions) { + boolean isNonUniqueChildren = + getElementaryNodeStreamForIdentifier2(definitions) + .collect(groupingBy(VariableWithLevelNode::getName)) + .entrySet() + .stream() + .anyMatch(e -> e.getValue().size() > 1); + + boolean isGroupItemValid = + getElementaryNodeStreamForIdentifier2(definitions).findAny().isPresent() + && !isNonUniqueChildren; + + boolean isGroupItemDynamic = + definitions + .get(0) + .getDepthFirstStream() + .filter(ElementaryItemNode.class::isInstance) + .map(ElementaryItemNode.class::cast) + .anyMatch(ElementaryNode::isDynamicLength); + + if (!isGroupItemValid || isGroupItemDynamic) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(nodes.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "jsonGenProcess.identifier2.groupItemError", nodes.get(0).getName())) + .build()); + } + } + + private Stream getElementaryNodeStreamForIdentifier2( + List definitions) { + List childItems = new ArrayList<>(); + List collect = + definitions.get(0).getChildren().stream() + .filter(VariableWithLevelNode.class::isInstance) + .map(VariableWithLevelNode.class::cast) + .filter(node -> node.getLevel() != 66) + .filter(node -> !node.isRedefines()) + .filter( + node -> !(node.getName().trim().equals("") || node.getName().equals(FILLER_NAME))) + .collect(Collectors.toList()); + collect.forEach( + node -> { + if (node instanceof UsageClause) { + UsageClause currentNode = (UsageClause) node; + boolean isProperUsageForIden2 = + !ImmutableList.of( + UsageFormat.POINTER, + UsageFormat.FUNCTION_POINTER, + UsageFormat.PROCEDURE_POINTER, + UsageFormat.OBJECT_REFERENCE) + .contains(currentNode.getUsageFormat()); + if (isProperUsageForIden2) { + childItems.add(node); + } + } else { + childItems.add(node); + } + }); + return childItems.stream(); + } + + private boolean isRenameClause(ElementaryNode foundDefinitionNode) { + return foundDefinitionNode.getLevel() == 66; + } + + private void semanticAnalysisForIdentifier1( + ProcessingContext ctx, + List identifier1, + List identifier1Definitions) { + if (identifier1Definitions.isEmpty()) return; + if (identifier1Definitions.get(0) instanceof ElementaryNode) { + ElementaryNode foundDefinitionNode = (ElementaryNode) identifier1Definitions.get(0); + boolean isNational = foundDefinitionNode.getUsageFormat() == UsageFormat.NATIONAL; + if (!(NodeUtils.ALPHANUMERIC_DATA_TYPES.contains(foundDefinitionNode.getEffectiveDataType()) + || isNational) + || foundDefinitionNode.isJustified() + || foundDefinitionNode.isDynamicLength()) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier1.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of( + "jsonGenProcess.identifier1.elementaryItemError", + identifier1.get(0).getName())) + .build()); + } + + } else { + if (identifier1Definitions.get(0) instanceof VariableWithLevelNode) { + verifyIdentifier1GroupItem(identifier1Definitions, identifier1, ctx); + } + } + } + + private void verifyIdentifier1GroupItem( + List definitions, List identifier1, ProcessingContext ctx) { + if (!NodeUtils.isNodeAlphanumeric(definitions.get(0)) + || NodeUtils.checkIfNodeHasDynamicGroupItem(definitions.get(0)) + || NodeUtils.checkIfNodeHasJustifiedGroupItem(definitions.get(0))) { + ctx.getErrors() + .add( + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(identifier1.get(0).getLocality().toOriginalLocation()) + .messageTemplate( + MessageTemplate.of("jsonParseProcess.identifier1.groupItemError", identifier1.get(0).getName())) + .build()); + } + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/messages/CobolLSPropertiesResourceBundle.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/messages/CobolLSPropertiesResourceBundle.java index 5bf80425ea..7a994d230c 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/messages/CobolLSPropertiesResourceBundle.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/messages/CobolLSPropertiesResourceBundle.java @@ -60,12 +60,16 @@ public void updateMessageResourceBundle(DialectRegistryItem dialectRegistryItem) private Properties load(DialectRegistryItem dialectRegistryItem, Locale locale) throws IOException { Properties properties = new Properties(); - List resourceName = toSuspectedBundleNames(locale); - Collections.reverse(resourceName); - LOG.debug("URI for dialect jar:" + dialectRegistryItem.getUri()); - InputStream validResources = - getDialectResources(resourceName, dialectRegistryItem.getUri()); - properties.load(validResources); + try { + List resourceName = toSuspectedBundleNames(locale); + Collections.reverse(resourceName); + LOG.debug("URI for dialect jar:" + dialectRegistryItem.getUri()); + InputStream validResources = + getDialectResources(resourceName, dialectRegistryItem.getUri()); + properties.load(validResources); + } catch (Exception e) { + + } return properties; } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/NodeUtils.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/NodeUtils.java new file mode 100644 index 0000000000..6b95bf3cb7 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/model/NodeUtils.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2020 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.core.model; + +import com.google.common.collect.ImmutableList; +import lombok.experimental.UtilityClass; +import org.eclipse.lsp.cobol.common.model.tree.Node; +import org.eclipse.lsp.cobol.common.model.tree.variable.EffectiveDataType; +import org.eclipse.lsp.cobol.common.model.tree.variable.ElementaryItemNode; +import org.eclipse.lsp.cobol.common.model.tree.variable.ElementaryNode; +import org.eclipse.lsp.cobol.common.model.tree.variable.UsageFormat; + +/** + * This class provides few utility methods for {@link org.eclipse.lsp.cobol.common.model.tree.Node} + */ +@UtilityClass +public class NodeUtils { + // TODO: remove undetermined once effective data type calculation is corrected + public static final ImmutableList ALPHANUMERIC_DATA_TYPES = + ImmutableList.of( + EffectiveDataType.STRING, EffectiveDataType.INTEGER, EffectiveDataType.UNDETERMINED); + + /** + * Checks if the passed node is a Alphanumeric variable node + * @param node Node to check + * @return True if node is an alphanumeric variable, false otherwise + */ + public boolean isNodeAlphanumeric(Node node) { + return node.getDepthFirstStream() + .filter(ElementaryItemNode.class::isInstance) + .map(ElementaryItemNode.class::cast) + .anyMatch( + node1 -> + ALPHANUMERIC_DATA_TYPES.contains(node1.getEffectiveDataType()) + || node1.getUsageFormat() == UsageFormat.NATIONAL); + } + + /** + * checks is the passed node is a dynamic group item variable + * @param node Node to check + * @return True if node is an dynamic group variable, false otherwise + */ + public boolean checkIfNodeHasDynamicGroupItem(Node node) { + return node.getDepthFirstStream() + .filter(ElementaryItemNode.class::isInstance) + .map(ElementaryItemNode.class::cast) + .anyMatch(ElementaryNode::isDynamicLength); + } + + /** + * checks if the passed node is a justified group item + * @param node to check + * @return True if node is an justified group variable, false otherwise + */ + public boolean checkIfNodeHasJustifiedGroupItem(Node node) { + return node.getDepthFirstStream() + .filter(ElementaryItemNode.class::isInstance) + .map(ElementaryItemNode.class::cast) + .anyMatch(ElementaryNode::isJustified); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/TextPreprocessor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/TextPreprocessor.java deleted file mode 100644 index b381899abb..0000000000 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/TextPreprocessor.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2020 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * - */ -package org.eclipse.lsp.cobol.core.preprocessor; - -import org.eclipse.lsp.cobol.common.ResultWithErrors; -import org.eclipse.lsp.cobol.common.mapping.ExtendedText; - -/** - * This interface describes the text preprocessor which prepares the given string for analysis by - * the grammar - */ -public interface TextPreprocessor { - - /** - * Check and clean of the code as per cobol program structure. - * - * @param documentUri unique resource identifier of the processed document - * @param cobolCode the content of the document that should be processed - * @return modified code wrapped object and list of syntax error that might send back to the - * client - */ - ResultWithErrors cleanUpCode(String documentUri, String cobolCode); -} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/GrammarPreprocessor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/GrammarPreprocessor.java index 59803982ea..772e7c8b9f 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/GrammarPreprocessor.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/GrammarPreprocessor.java @@ -15,6 +15,7 @@ package org.eclipse.lsp.cobol.core.preprocessor.delegates; import lombok.NonNull; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; @@ -26,8 +27,9 @@ public interface GrammarPreprocessor { * applying related semantic analysis * * @param context - preprocessor context + * @param preprocessor - dialect specific preprocessor * @return extended document with copybooks and related errors */ @NonNull - ResultWithErrors preprocess(@NonNull PreprocessorContext context); + ResultWithErrors preprocess(@NonNull PreprocessorContext context, @NonNull CleanerPreprocessor preprocessor); } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/GrammarPreprocessorImpl.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/GrammarPreprocessorImpl.java index da871563d8..715a5c2c2f 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/GrammarPreprocessorImpl.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/GrammarPreprocessorImpl.java @@ -21,6 +21,7 @@ import org.antlr.v4.runtime.CommonTokenStream; import org.antlr.v4.runtime.Lexer; import org.antlr.v4.runtime.tree.ParseTreeWalker; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.error.SyntaxError; import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; @@ -55,12 +56,12 @@ public GrammarPreprocessorImpl( @NonNull @Override - public ResultWithErrors preprocess(@NonNull PreprocessorContext context) { + public ResultWithErrors preprocess(@NonNull PreprocessorContext context, @NonNull CleanerPreprocessor preprocessor) { List errors = new ArrayList<>(); String replacedCode = replace(context.getCurrentDocument(), context.getHierarchy()).unwrap(errors::addAll); - return preprocess(context, replacedCode).accumulateErrors(errors); + return preprocess(context, preprocessor, replacedCode).accumulateErrors(errors); } private ResultWithErrors replace(ExtendedDocument extendedDocument, CopybookHierarchy hierarchy) { @@ -76,11 +77,12 @@ private ResultWithErrors replace(ExtendedDocument extendedDocument, Copy private ResultWithErrors preprocess( PreprocessorContext context, + CleanerPreprocessor preprocessor, String code) { ThreadInterruptionUtil.checkThreadInterrupted(); BufferedTokenStream tokens = makeTokens(code); - GrammarPreprocessorListener listener = listenerFactory.create(context); + GrammarPreprocessorListener listener = listenerFactory.create(context, preprocessor); CobolPreprocessor parser = new CobolPreprocessor(tokens); parser.removeErrorListeners(); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/CopybookPreprocessorService.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/CopybookPreprocessorService.java index dbcb860e70..f582a57a88 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/CopybookPreprocessorService.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/CopybookPreprocessorService.java @@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j; import org.antlr.v4.runtime.ParserRuleContext; import org.apache.commons.lang3.tuple.Pair; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.copybook.*; import org.eclipse.lsp.cobol.common.error.SyntaxError; @@ -67,19 +68,21 @@ class CopybookPreprocessorService { private final CopybookHierarchy hierarchy; private final ReplacingService replacingService; private final CopybookErrorService copybookErrorService; + private final CleanerPreprocessor preprocessor; private static final String HYPHEN = "-"; private static final String UNDERSCORE = "_"; CopybookPreprocessorService(String programDocumentUri, - GrammarPreprocessor grammarPreprocessor, - ExtendedDocument currentDocument, - CopybookService copybookService, - CopybookProcessingMode copybookConfig, - CopybooksRepository copybooks, - CopybookHierarchy hierarchy, - MessageService messageService, - ReplacingService replacingService) { + GrammarPreprocessor grammarPreprocessor, + ExtendedDocument currentDocument, + CopybookService copybookService, + CopybookProcessingMode copybookConfig, + CopybooksRepository copybooks, + CopybookHierarchy hierarchy, + MessageService messageService, + ReplacingService replacingService, + CleanerPreprocessor preprocessor) { this.programDocumentUri = programDocumentUri; this.grammarPreprocessor = grammarPreprocessor; this.currentDocument = currentDocument; @@ -89,6 +92,7 @@ class CopybookPreprocessorService { this.hierarchy = hierarchy; this.replacingService = replacingService; this.copybookErrorService = new CopybookErrorService(messageService); + this.preprocessor = preprocessor; } void addCopybook(ParserRuleContext ctx, CobolPreprocessor.CopySourceContext copySource, @@ -163,7 +167,7 @@ private ExtendedDocument processCopybookWithReplacement(List PreprocessorContext copybookContext = new PreprocessorContext(programDocumentUri, copybookDocument, copybookConfig, hierarchy, copybooks); List copybookErrors = new LinkedList<>(); - grammarPreprocessor.preprocess(copybookContext).unwrap(copybookErrors::addAll); + grammarPreprocessor.preprocess(copybookContext, preprocessor).unwrap(copybookErrors::addAll); errors.addAll(copybookErrors); List distinct = errors.stream().distinct().collect(Collectors.toList()); @@ -237,7 +241,7 @@ private CopybookModel read(CopybookName copybookName, String documentUri) { copybookName, programDocumentUri, documentUri, - true); + preprocessor); CopybookModel copybookModel = resolvedCopybook.getResult(); if (copybookModel.getContent() == null) { return null; diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/GrammarPreprocessorListenerFactory.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/GrammarPreprocessorListenerFactory.java index 0e7ed54f50..ba7d8ac022 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/GrammarPreprocessorListenerFactory.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/GrammarPreprocessorListenerFactory.java @@ -16,6 +16,7 @@ package org.eclipse.lsp.cobol.core.preprocessor.delegates.copybooks; import lombok.NonNull; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.core.preprocessor.delegates.PreprocessorContext; /** A factory for {@link GrammarPreprocessorListener} */ @@ -25,7 +26,8 @@ public interface GrammarPreprocessorListenerFactory { * the grammar * * @param context - preprocessor context + * @param preprocessor - dialect specific preprocessor * @return a new listener */ - GrammarPreprocessorListenerImpl create(@NonNull PreprocessorContext context); + GrammarPreprocessorListenerImpl create(@NonNull PreprocessorContext context, CleanerPreprocessor preprocessor); } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/GrammarPreprocessorListenerImpl.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/GrammarPreprocessorListenerImpl.java index 37a0f7c123..e95d527321 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/GrammarPreprocessorListenerImpl.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/copybooks/GrammarPreprocessorListenerImpl.java @@ -24,6 +24,7 @@ import lombok.NonNull; import lombok.extern.slf4j.Slf4j; import org.antlr.v4.runtime.ParserRuleContext; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.copybook.CopybookProcessingMode; import org.eclipse.lsp.cobol.common.copybook.CopybookService; @@ -61,6 +62,7 @@ public class GrammarPreprocessorListenerImpl extends CobolPreprocessorBaseListen @Inject GrammarPreprocessorListenerImpl( @Assisted PreprocessorContext context, + @Assisted CleanerPreprocessor preprocessor, GrammarPreprocessor grammarPreprocessor, CopybookService copybookService, MessageService messageService, @@ -75,7 +77,8 @@ public class GrammarPreprocessorListenerImpl extends CobolPreprocessorBaseListen context.getCopybooksRepository(), context.getHierarchy(), messageService, - replacingService); + replacingService, + preprocessor); this.replacingService = replacingService; } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/reader/CobolLineReader.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/reader/CobolLineReader.java index 35290737b9..9c6ca6663e 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/reader/CobolLineReader.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/reader/CobolLineReader.java @@ -14,17 +14,40 @@ */ package org.eclipse.lsp.cobol.core.preprocessor.delegates.reader; -import org.eclipse.lsp.cobol.common.ResultWithErrors; -import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; +import static java.util.Optional.ofNullable; +import static org.eclipse.lsp.cobol.common.error.ErrorSeverity.ERROR; +import static org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum.NORMAL; +import static org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum.PREPROCESSED; +import java.util.*; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import lombok.NonNull; -import java.util.List; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.eclipse.lsp.cobol.common.ResultWithErrors; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.model.Locality; +import org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum; +import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp4j.Position; +import org.eclipse.lsp4j.Range; /** * Preprocessor, which converts strings with COBOL code into a specific entity; analyzes and * processes line indicators. */ -public interface CobolLineReader { +@Slf4j +public abstract class CobolLineReader { + private final MessageService messageService; + + protected CobolLineReader(MessageService messageService) { + this.messageService = messageService; + } + /** * Convert String with COBOL code into CobolLines that are used further in the parsing. * @@ -33,5 +56,175 @@ public interface CobolLineReader { * @return List of COBOL lines with a list of errors if found, or an empty list */ @NonNull - ResultWithErrors> processLines(@NonNull String uri, @NonNull String lines); + public ResultWithErrors> processLines(@NonNull String uri, @NonNull String lines) { + List accumulatedErrors = new ArrayList<>(); + List result = new ArrayList<>(); + try (Scanner scanner = new Scanner(lines)) { + String currentLine; + CobolLine lastCobolLine = null; + int lineNumber = 0; + + while (scanner.hasNextLine()) { + currentLine = scanner.nextLine(); + CobolLine currentCobolLine = + parseLine(currentLine, uri, lineNumber).unwrap(accumulatedErrors::addAll); + + currentCobolLine.setPredecessor(lastCobolLine); + result.add(currentCobolLine); + + lineNumber++; + lastCobolLine = currentCobolLine; + } + } + return new ResultWithErrors<>(result, accumulatedErrors); + } + + protected abstract Pattern getCompilerDirectives(); + + protected abstract Map getIndicator(); + + protected abstract CobolProgramLayout getLayout(); + + @NonNull ResultWithErrors parseLine( + @NonNull String line, @NonNull String uri, int lineNumber) { + List errors = new ArrayList<>(); + CobolLine cobolLine; + + Matcher usualLine = getLayout().getCobolLinePattern().matcher(line); + Matcher directivesLine = getCompilerDirectives().matcher(line); + if (directivesLine.matches()) { + cobolLine = + processCompilerDirectives(line, uri, lineNumber, directivesLine).unwrap(errors::addAll); + } else if (usualLine.matches()) { + cobolLine = processNormalLine(line, uri, lineNumber, usualLine).unwrap(errors::addAll); + } else { + // It is impossible. Pattern must match any line. + LOG.error("The line '{}' can't be parsed.", line); + cobolLine = new CobolLine(); + } + + cobolLine.setNumber(lineNumber); + + return new ResultWithErrors<>(cobolLine, errors); + } + + private ResultWithErrors processCompilerDirectives( + @NonNull String line, @NonNull String uri, int lineNumber, @NonNull Matcher matcher) { + List errors = new ArrayList<>(); + int contentStart = matcher.start("directives"); + String directives = matcher.group("directives"); + checkSequenceArea(line, uri, lineNumber, contentStart).ifPresent(errors::add); + checkLineLength(line, uri, lineNumber).ifPresent(errors::add); + CobolLine cobolLine = new CobolLine(); + cobolLine.setContentAreaA(cleanupString(directives, contentStart)); + cobolLine.setType(PREPROCESSED); + return new ResultWithErrors<>(cobolLine, errors); + } + + private ResultWithErrors processNormalLine( + @NonNull String line, @NonNull String uri, int lineNumber, Matcher matcher) { + List errors = new ArrayList<>(); + CobolLine cobolLine = new CobolLine(); + cobolLine.setSequenceArea(matcher.group("sequence")); + String indicatorArea = matcher.group("indicator"); + cobolLine.setIndicatorArea(indicatorArea); + cobolLine.setType(determineType(indicatorArea, uri, lineNumber).unwrap(errors::addAll)); + cobolLine.setContentAreaA(matcher.group("contentA")); + cobolLine.setContentAreaB(matcher.group("contentB")); + cobolLine.setCommentArea(matcher.group("comment")); + checkLineLength(line, uri, lineNumber).ifPresent(errors::add); + + return new ResultWithErrors<>(cobolLine, errors); + } + + private String cleanupString(@NonNull String line, int contentStart) { + String lineWithoutSequence = StringUtils.repeat(' ', contentStart) + line; + return lineWithoutSequence.length() > getLayout().getSourceCodeLength() + ? lineWithoutSequence.substring(0, getLayout().getSourceCodeLength()) + : lineWithoutSequence; + } + + private ResultWithErrors determineType( + String indicatorArea, String uri, int lineNumber) { + return ofNullable(getIndicator().get(indicatorArea)) + .map(it -> new ResultWithErrors<>(it, Collections.emptyList())) + .orElseGet( + () -> + new ResultWithErrors<>( + NORMAL, + Collections.singletonList( + createError( + uri, + messageService.getMessage("CobolLineReaderImpl.incorrectLineFormat"), + lineNumber, + getLayout().getSequenceLength(), getLayout().getSequenceLength() + 1)))); + } + + @NonNull + private Optional checkLineLength( + @NonNull String line, @NonNull String uri, int lineNumber) { + int maxLineLength = getLayout().getMaxLineLength(); + if (line.length() <= maxLineLength) { + return Optional.empty(); + } + return Optional.of( + createError( + uri, + messageService.getMessage("CobolLineReaderImpl.longLineMsg", maxLineLength), + lineNumber, + maxLineLength, + line.length())); + } + + private Optional checkSequenceArea( + @NonNull String line, @NonNull String uri, int lineNumber, int contentStart) { + if (isSequenceNumberFormatCorrect(line, contentStart)) { + return Optional.empty(); + } + return Optional.of( + createError( + uri, + messageService.getMessage("CompilerDirectivesTransformation.sequenceNumber"), + lineNumber, + 0, + 1)); + } + + private boolean isSequenceNumberFormatCorrect(String line, int contentStart) { + // issue error the sequence must start with a number. + return contentStart < (getLayout().getIndicatorLength() + getLayout().getSequenceLength()) + || StringUtils.isBlank(line.substring(0, contentStart)) + || Character.isDigit(line.charAt(0)); + } + + /** + * Create a syntax error using the given data build its locality + * + * @param uri the document URI + * @param message the error message + * @param lineNumber the error lineNumber + * @param start the error start position + * @param stop the error stop position + * @return the {@link SyntaxError} + */ + @NonNull + private SyntaxError createError( + @NonNull String uri, @NonNull String message, int lineNumber, int start, int stop) { + SyntaxError error = + SyntaxError.syntaxError() + .errorSource(ErrorSource.PREPROCESSING) + .suggestion(message) + .severity(ERROR) + .location( + Locality.builder() + .uri(uri) + .range( + new Range(new Position(lineNumber, start), new Position(lineNumber, stop))) + .recognizer(getClass()) + .build().toOriginalLocation()) + .build(); + + LOG.debug("Syntax error by CobolLineReaderImpl: {}", error.toString()); + return error; + } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/reader/CobolLineReaderImpl.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/reader/CobolLineReaderImpl.java deleted file mode 100644 index a3800f9c90..0000000000 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/reader/CobolLineReaderImpl.java +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) 2020 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * - */ -package org.eclipse.lsp.cobol.core.preprocessor.delegates.reader; - -import static java.util.Optional.ofNullable; -import static org.eclipse.lsp.cobol.common.error.ErrorSeverity.ERROR; -import static org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum.*; - -import com.google.common.collect.ImmutableMap; -import com.google.inject.Inject; -import com.google.inject.Singleton; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import lombok.NonNull; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.eclipse.lsp.cobol.common.ResultWithErrors; -import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.common.error.SyntaxError; -import org.eclipse.lsp.cobol.common.message.MessageService; -import org.eclipse.lsp.cobol.common.model.Locality; -import org.eclipse.lsp.cobol.core.model.*; -import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; -import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; -import org.eclipse.lsp4j.Position; -import org.eclipse.lsp4j.Range; - -/** - * Preprocessor, which converts strings with COBOL code into a specific entity; analyzes and - * processes line indicators. This implementation checks if the lines match the given format and - * raises an error if not. It also puts the entire compiler directive text (excluding the sequence - * area if present) to prevent possible cutting off the line beginning. - */ -@Slf4j -@Singleton -public class CobolLineReaderImpl implements CobolLineReader { - //TODO: check directive rules for HP tandem/GNU - private static final Pattern COMPILER_DIRECTIVE_LINE = - Pattern.compile("(?i)(.{0,6} +|\\s*+)(?(CBL|PROCESS) .+)"); - - // TODO: check these for GNU and HP. Also make it customizable - private static final Map INDICATORS = - new ImmutableMap.Builder() - .put("*", COMMENT) - .put("/", COMMENT) - .put("d", DEBUG) - .put("D", DEBUG) - .put("-", CONTINUATION) - .put("$", COMPILER_DIRECTIVE) - .put(" ", NORMAL) - .put("", NORMAL) - .build(); - - private final MessageService messageService; - private final CodeLayoutStore layoutStore; - - @Inject - public CobolLineReaderImpl(MessageService messageService, CodeLayoutStore layoutStore) { - this.messageService = messageService; - this.layoutStore = layoutStore; - } - - @NonNull - @Override - public ResultWithErrors> processLines( - @NonNull String documentURI, @NonNull String lines) { - List accumulatedErrors = new ArrayList<>(); - List result = new ArrayList<>(); - try (Scanner scanner = new Scanner(lines)) { - String currentLine; - CobolLine lastCobolLine = null; - int lineNumber = 0; - - while (scanner.hasNextLine()) { - currentLine = scanner.nextLine(); - CobolLine currentCobolLine = - parseLine(currentLine, documentURI, lineNumber).unwrap(accumulatedErrors::addAll); - - currentCobolLine.setPredecessor(lastCobolLine); - result.add(currentCobolLine); - - lineNumber++; - lastCobolLine = currentCobolLine; - } - } - return new ResultWithErrors<>(result, accumulatedErrors); - } - - @NonNull - private ResultWithErrors parseLine( - @NonNull String line, @NonNull String uri, int lineNumber) { - List errors = new ArrayList<>(); - CobolLine cobolLine; - - Matcher usualLine = layoutStore.getCodeLayout().getCobolLinePattern().matcher(line); - Matcher directivesLine = COMPILER_DIRECTIVE_LINE.matcher(line); - if (directivesLine.matches()) { - cobolLine = - processCompilerDirectives(line, uri, lineNumber, directivesLine).unwrap(errors::addAll); - } else if (usualLine.matches()) { - cobolLine = processNormalLine(line, uri, lineNumber, usualLine).unwrap(errors::addAll); - } else { - // It is impossible. Pattern must match any line. - LOG.error("The line '{}' can't be parsed.", line); - cobolLine = new CobolLine(); - } - - cobolLine.setNumber(lineNumber); - - return new ResultWithErrors<>(cobolLine, errors); - } - - private ResultWithErrors processCompilerDirectives( - @NonNull String line, @NonNull String uri, int lineNumber, @NonNull Matcher matcher) { - List errors = new ArrayList<>(); - int contentStart = matcher.start("directives"); - String directives = matcher.group("directives"); - checkSequenceArea(line, uri, lineNumber, contentStart).ifPresent(errors::add); - checkLineLength(line, uri, lineNumber).ifPresent(errors::add); - CobolLine cobolLine = new CobolLine(); - cobolLine.setContentAreaA(cleanupString(directives, contentStart)); - cobolLine.setType(PREPROCESSED); - return new ResultWithErrors<>(cobolLine, errors); - } - - private ResultWithErrors processNormalLine( - @NonNull String line, @NonNull String uri, int lineNumber, Matcher matcher) { - List errors = new ArrayList<>(); - CobolLine cobolLine = new CobolLine(); - cobolLine.setSequenceArea(matcher.group("sequence")); - String indicatorArea = matcher.group("indicator"); - cobolLine.setIndicatorArea(indicatorArea); - cobolLine.setType(determineType(indicatorArea, uri, lineNumber).unwrap(errors::addAll)); - cobolLine.setContentAreaA(matcher.group("contentA")); - cobolLine.setContentAreaB(matcher.group("contentB")); - cobolLine.setCommentArea(matcher.group("comment")); - checkLineLength(line, uri, lineNumber).ifPresent(errors::add); - - return new ResultWithErrors<>(cobolLine, errors); - } - - private String cleanupString(@NonNull String line, int contentStart) { - String lineWithoutSequence = StringUtils.repeat(' ', contentStart) + line; - CobolProgramLayout codeLayout = layoutStore.getCodeLayout(); - return lineWithoutSequence.length() > codeLayout.getSourceCodeLength() - ? lineWithoutSequence.substring(0, codeLayout.getSourceCodeLength()) - : lineWithoutSequence; - } - - private ResultWithErrors determineType( - String indicatorArea, String uri, int lineNumber) { - CobolProgramLayout codeLayout = layoutStore.getCodeLayout(); - return ofNullable(INDICATORS.get(indicatorArea)) - .map(it -> new ResultWithErrors<>(it, Collections.emptyList())) - .orElseGet( - () -> - new ResultWithErrors<>( - NORMAL, - Collections.singletonList( - createError( - uri, - messageService.getMessage("CobolLineReaderImpl.incorrectLineFormat"), - lineNumber, - codeLayout.getSequenceLength(), codeLayout.getSequenceLength() + 1)))); - } - - @NonNull - private Optional checkLineLength( - @NonNull String line, @NonNull String uri, int lineNumber) { - int maxLineLength = layoutStore.getCodeLayout().getMaxLineLength(); - if (line.length() <= maxLineLength) { - return Optional.empty(); - } - return Optional.of( - createError( - uri, - messageService.getMessage("CobolLineReaderImpl.longLineMsg", maxLineLength), - lineNumber, - maxLineLength, - line.length())); - } - - private Optional checkSequenceArea( - @NonNull String line, @NonNull String uri, int lineNumber, int contentStart) { - if (isSequenceNumberFormatCorrect(line, contentStart)) { - return Optional.empty(); - } - return Optional.of( - createError( - uri, - messageService.getMessage("CompilerDirectivesTransformation.sequenceNumber"), - lineNumber, - 0, - 1)); - } - - private boolean isSequenceNumberFormatCorrect(String line, int contentStart) { - // issue error the sequence must start with a number. - CobolProgramLayout codeLayout = layoutStore.getCodeLayout(); - return contentStart < (codeLayout.getIndicatorLength() + codeLayout.getSequenceLength()) - || StringUtils.isBlank(line.substring(0, contentStart)) - || Character.isDigit(line.charAt(0)); - } - - /** - * Create a syntax error using the given data build its locality - * - * @param uri the document URI - * @param message the error message - * @param lineNumber the error lineNumber - * @param start the error start position - * @param stop the error stop position - * @return the {@link SyntaxError} - */ - @NonNull - private SyntaxError createError( - @NonNull String uri, @NonNull String message, int lineNumber, int start, int stop) { - SyntaxError error = - SyntaxError.syntaxError() - .errorSource(ErrorSource.PREPROCESSING) - .suggestion(message) - .severity(ERROR) - .location( - Locality.builder() - .uri(uri) - .range( - new Range(new Position(lineNumber, start), new Position(lineNumber, stop))) - .recognizer(getClass()) - .build().toOriginalLocation()) - .build(); - - LOG.debug("Syntax error by CobolLineReaderImpl: {}", error.toString()); - return error; - } -} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/rewriter/CobolLineIndicatorProcessorImpl.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/rewriter/LineIndicatorProcessor.java similarity index 74% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/rewriter/CobolLineIndicatorProcessorImpl.java rename to server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/rewriter/LineIndicatorProcessor.java index f798b441f7..18c504fb7e 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/rewriter/CobolLineIndicatorProcessorImpl.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/rewriter/LineIndicatorProcessor.java @@ -17,7 +17,6 @@ import static org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum.*; import static org.eclipse.lsp.cobol.core.preprocessor.ProcessingConstants.WS; -import com.google.inject.Inject; import java.util.Collections; import java.util.List; import java.util.regex.Matcher; @@ -28,14 +27,13 @@ import org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum; import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; import org.eclipse.lsp.cobol.core.preprocessor.delegates.util.CobolLineUtils; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; -import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; /** * This class processes the indicator area of COBOL lines checking if some operations should be * applied on the content area. */ -public class CobolLineIndicatorProcessorImpl implements CobolLineReWriter { +public abstract class LineIndicatorProcessor implements CobolLineReWriter { private static final String EMPTY_STRING = ""; private static final String DOUBLE_QUOTE_LITERAL = "\"([^\"]|\"\"|'')*+\""; @@ -43,12 +41,7 @@ public class CobolLineIndicatorProcessorImpl implements CobolLineReWriter { public static final Pattern FLOATING_COMMENT_LINE = Pattern.compile("(?.*?)(?\\*>.*)?"); - private final CodeLayoutStore layoutStore; - - @Inject - public CobolLineIndicatorProcessorImpl(CodeLayoutStore layoutStore) { - this.layoutStore = layoutStore; - } + protected abstract CobolProgramLayout getLayout(); /** * Normalizes the lines by stripping the sequence number and line indicator, and interpreting the @@ -60,15 +53,15 @@ public List processLines(final List lines) { return Collections.emptyList(); } return StreamSupport.stream(lines.get(0).spliterator(), false) - .map(line -> line.getType() == PREPROCESSED ? line : processLine(line)) - .collect(Collectors.toList()); + .map(line -> line.getType() == PREPROCESSED ? line : processLine(line)) + .collect(Collectors.toList()); } private CobolLine processLine(final CobolLine line) { CobolLineTypeEnum type = line.getType(); - CobolProgramLayout codeLayout = layoutStore.getCodeLayout(); if (type == COMMENT || type == COMPILER_DIRECTIVE) { - return CobolLineUtils.copyCobolLineWithIndicatorAndContentArea(WS, EMPTY_STRING, line, codeLayout); + return CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( + WS, EMPTY_STRING, line, getLayout()); } String trimmedContentArea = conditionalRightTrimContentArea(line); @@ -78,22 +71,25 @@ private CobolLine processLine(final CobolLine line) { Matcher matchedLine = FLOATING_COMMENT_LINE.matcher(trimmedContentArea); return matchedLine.matches() - ? CobolLineUtils.copyCobolLineWithIndicatorAndContentArea(WS, matchedLine.group("validText"), line, codeLayout) - : CobolLineUtils.copyCobolLineWithIndicatorAndContentArea(WS, trimmedContentArea, line, codeLayout); + ? CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( + WS, matchedLine.group("validText"), line, getLayout()) + : CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( + WS, trimmedContentArea, line, getLayout()); } - private CobolLine processContinuationLine(CobolLine line, String conditionalRightTrimmedContentArea) { + private CobolLine processContinuationLine( + CobolLine line, String conditionalRightTrimmedContentArea) { CobolLine result; final String trimmedContentArea = trimLeadingWhitespace(conditionalRightTrimmedContentArea); - CobolProgramLayout codeLayout = layoutStore.getCodeLayout(); if (StringUtils.isBlank(conditionalRightTrimmedContentArea)) { - result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea(WS, EMPTY_STRING, line, codeLayout); - } - /* - If a line, which is continued on the next line, ends in column 72 with a quotation mark as - the last character ... - */ - else if (checkContentAreaEndsWithQuoteMark(line)) { + result = + CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( + WS, EMPTY_STRING, line, getLayout()); + /* + If a line, which is continued on the next line, ends in column 72 with a quotation mark as + the last character ... + */ + } else if (checkContentAreaEndsWithQuoteMark(line)) { /* ... the continuation line by specification has to startPosition with two consecutive @@ -107,34 +103,32 @@ else if (checkContentAreaEndsWithQuoteMark(line)) { */ result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( - WS, trimLeadingChar(trimmedContentArea), line, codeLayout); - } - /* - However there are non-compliant parsers out there without the two consecutive quotation - marks in the continuation line ... - */ - else { + WS, trimLeadingChar(trimmedContentArea), line, getLayout()); + } else { + /* + However there are non-compliant parsers out there without the two consecutive quotation + marks in the continuation line ... + */ /* ... where we simply remove leading whitespace. */ result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( - WS, trimLeadingWhitespace(conditionalRightTrimmedContentArea), line, codeLayout); + WS, trimLeadingWhitespace(conditionalRightTrimmedContentArea), line, getLayout()); } - } - /* If we are ending with an open literal ... */ - else if (line.getPredecessor() != null && isEndingWithOpenLiteral(line.getPredecessor())) { + } else if (line.getPredecessor() != null && isEndingWithOpenLiteral(line.getPredecessor())) { + /* If we are ending with an open literal ... */ /* ... the continuation line might startPosition with a single quotation mark. This indicates, that the literal from the continued line stays open ... Removing the leading quotation mark to keep the literal open is handled during serialization. */ - result = - CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( - WS, conditionalRightTrimmedContentArea, line, codeLayout); + result = + CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( + WS, conditionalRightTrimmedContentArea, line, getLayout()); } else { result = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( - WS, conditionalRightTrimmedContentArea, line, codeLayout); + WS, conditionalRightTrimmedContentArea, line, getLayout()); } return result; } @@ -163,7 +157,6 @@ private boolean checkContentAreaEndsWithQuoteMark(CobolLine line) { && (CobolLineReWriter.checkStringEndsWithQuoteMark(line.getPredecessor().getContentArea())); } - private String removeStringLiterals(final String contentArea) { return contentArea .replaceAll(DOUBLE_QUOTE_LITERAL, EMPTY_STRING) diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/transformer/CobolLinesTransformation.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/transformer/CobolLinesTransformation.java index 4ab14b7dd5..aaa4f0460c 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/transformer/CobolLinesTransformation.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/transformer/CobolLinesTransformation.java @@ -14,10 +14,10 @@ */ package org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer; +import java.util.List; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; - -import java.util.List; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; /** * Performs transformation operations on the given CobolLines. Requires FormatListener to raise or @@ -33,4 +33,11 @@ public interface CobolLinesTransformation { * @return the transformation result */ ResultWithErrors> transformLines(String documentURI, List lines); + + /** + * gives layout of the program which would get transformed. + * + * @return {@link CobolProgramLayout} + */ + CobolProgramLayout getCodeLayout(); } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/transformer/ContinuationLineTransformation.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/transformer/ContinuationLineTransformation.java index a22bfd5aa3..21fca093bd 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/transformer/ContinuationLineTransformation.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/transformer/ContinuationLineTransformation.java @@ -16,9 +16,8 @@ import static java.util.Optional.ofNullable; import static org.eclipse.lsp.cobol.common.error.ErrorSeverity.ERROR; -import static org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineIndicatorProcessorImpl.FLOATING_COMMENT_LINE; +import static org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.LineIndicatorProcessor.FLOATING_COMMENT_LINE; -import com.google.inject.Inject; import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -35,8 +34,7 @@ import org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum; import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CompilerDirectives; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; -import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; @@ -51,16 +49,13 @@ * the preceding line is assumed to be followed by a space. */ @Slf4j -public class ContinuationLineTransformation implements CobolLinesTransformation { +public abstract class ContinuationLineTransformation implements CobolLinesTransformation { private static final Pattern BLANK_LINE_PATTERN = Pattern.compile("\\s*"); private static final String PSEUDO_TEXT_DELIMITER = "="; private final MessageService messageService; - private final CodeLayoutStore codeLayoutStore; - @Inject - public ContinuationLineTransformation(MessageService messageService, CodeLayoutStore codeLayoutStore) { + public ContinuationLineTransformation(MessageService messageService) { this.messageService = messageService; - this.codeLayoutStore = codeLayoutStore; } @Override @@ -109,7 +104,7 @@ private SyntaxError checkContinuationLine(String uri, int lineNumber, CobolLine private SyntaxError checkCompilerDirectiveContinued( CobolLine cobolLine, String uri, int lineNumber) { if (isCompilerDirectiveStatement(cobolLine)) { - CobolProgramLayout codeLayout = codeLayoutStore.getCodeLayout(); + CobolProgramLayout codeLayout = getCodeLayout(); return SyntaxError.syntaxError() .errorSource(ErrorSource.PREPROCESSING) .severity(ERROR) @@ -240,7 +235,7 @@ private Integer getInvalidIndexOfInlineComment(CobolLine cobolLine) { boolean isMissingSpace = !floatingCommentMatcher.group("validText").endsWith(" "); if (isMissingSpace) { int floatingCommentIndex = floatingCommentMatcher.start("floatingComment"); - return (floatingCommentIndex == 0) ? null : (floatingCommentIndex + codeLayoutStore.getCodeLayout().getSequenceLength()); + return (floatingCommentIndex == 0) ? null : (floatingCommentIndex + getCodeLayout().getSequenceLength()); } return null; } @@ -318,7 +313,7 @@ private SyntaxError registerStringClosingError( } private SyntaxError registerContinuationLineError(String uri, int lineNumber, int countingSpace) { - CobolProgramLayout codeLayout = codeLayoutStore.getCodeLayout(); + CobolProgramLayout codeLayout = getCodeLayout(); int startPosition = codeLayout.getSequenceLength() + codeLayout.getIndicatorLength() + countingSpace; SyntaxError error = SyntaxError.syntaxError().errorSource(ErrorSource.PREPROCESSING) diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/util/CobolLineUtils.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/util/CobolLineUtils.java index beab0be5ff..69c499351c 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/util/CobolLineUtils.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/util/CobolLineUtils.java @@ -23,7 +23,7 @@ import lombok.experimental.UtilityClass; import org.apache.commons.lang3.StringUtils; import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; /** The utility class for CobolLine operations, e.g. copy in different ways */ @UtilityClass diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/writer/CobolLineWriter.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/writer/CobolLineWriter.java index 3a2c4cecf6..d25ca5b459 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/writer/CobolLineWriter.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/writer/CobolLineWriter.java @@ -14,16 +14,27 @@ */ package org.eclipse.lsp.cobol.core.preprocessor.delegates.writer; -import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; -import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; +import static org.eclipse.lsp.cobol.core.preprocessor.ProcessingConstants.NEWLINE; +import static org.eclipse.lsp.cobol.core.preprocessor.ProcessingConstants.WS; +import java.util.Comparator; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import org.apache.commons.lang3.StringUtils; +import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; +import org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum; +import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineReWriter; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp4j.Position; +import org.eclipse.lsp4j.Range; /** * This interface describes a class that should convert a list of COBOL lines to a String for the * further processing */ -public interface CobolLineWriter { +public abstract class CobolLineWriter { /** * Convert a list of COBOL lines into one string @@ -32,5 +43,88 @@ public interface CobolLineWriter { * @param documentUri - uri of the document * @return a string representation of the COBOL program */ - ExtendedDocument serialize(List lines, String documentUri); + public ExtendedDocument serialize(List lines, String documentUri) { + final StringBuilder sb = new StringBuilder(); + final Map acc = new HashMap<>(); + StringBuilder clSb = new StringBuilder(); + Position start = null; + lines.sort(Comparator.comparingInt(CobolLine::getNumber)); + for (final CobolLine line : lines) { + final boolean isContinuationLine = CobolLineTypeEnum.CONTINUATION.equals(line.getType()); + + if (!isContinuationLine) { + if (start != null) { + Position stop = + new Position(line.getNumber() - 1, sb.length() - sb.lastIndexOf("\n") - 1); + Range range = new Range(start, stop); + acc.put(range, clSb.toString()); + clSb = new StringBuilder(); + start = null; + } + process(sb, line); + } + + /* + * check if there is any continuation line and try to concatenate all result them + * without error message to be on a wrong paragraph by adding a newline for each + * concatenated line at the end result concatenated string + */ + if (isContinuationLine) { + if (start == null) { + CobolLine predecessor = line.getPredecessor(); + int col = lineString(predecessor).length(); + start = new Position(predecessor.getNumber(), col); + } + process(sb, line); + clSb.append(removeStartingQuote(line)); + } + } + + ExtendedDocument result = new ExtendedDocument(sb.toString(), documentUri); + acc.forEach(result::replace); + if (start != null) { + CobolLine lastLine = lines.get(lines.size() - 1); + Position stop = new Position(lastLine.getNumber(), sb.length() - sb.lastIndexOf("\n") - 1); + Range range = new Range(start, stop); + result.replace(range, clSb.toString()); + } + result.commitTransformations(); + return result; + } + + protected abstract CobolProgramLayout getLayout(); + + private void process(StringBuilder sb, CobolLine line) { + if (line.getNumber() > 0) { + sb.append(NEWLINE); + } + sb.append(lineString(line)); + } + + private String lineString(CobolLine line) { + StringBuilder sb = new StringBuilder(); + if (line.getType() != CobolLineTypeEnum.PREPROCESSED) { + String blankSequenceArea = StringUtils.repeat(WS, getLayout().getSequenceLength()); + sb.append(blankSequenceArea); + } + sb.append(line.getIndicatorArea()); + sb.append(line.getContentArea()); + return sb.toString(); + } + + /** + * We need to remove the opening quote from a continuation line to concatenate string correctly + */ + private String removeStartingQuote(CobolLine line) { + String continuation = StringUtils.stripStart(line.getContentArea(), null); + if (CobolLineReWriter.checkStringStartsWithQuoteMark(continuation) + && !isContinuedLineQuoted(line)) { + continuation = continuation.substring(1); + } + return continuation; + } + + private boolean isContinuedLineQuoted(CobolLine line) { + return CobolLineReWriter.checkStringEndsWithQuoteMark(line.getPredecessor().getContentArea()); + } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/writer/CobolLineWriterImpl.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/writer/CobolLineWriterImpl.java deleted file mode 100644 index 392b8da506..0000000000 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/writer/CobolLineWriterImpl.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2020 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * - */ -package org.eclipse.lsp.cobol.core.preprocessor.delegates.writer; - -import static org.eclipse.lsp.cobol.core.preprocessor.ProcessingConstants.NEWLINE; -import static org.eclipse.lsp.cobol.core.preprocessor.ProcessingConstants.WS; - -import com.google.inject.Inject; -import java.util.Comparator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.apache.commons.lang3.StringUtils; -import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; -import org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum; -import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineReWriter; -import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; -import org.eclipse.lsp4j.Position; -import org.eclipse.lsp4j.Range; - -/** This class serializes a list of COBOL lines into a String */ -public class CobolLineWriterImpl implements CobolLineWriter { - - private final CodeLayoutStore layoutStore; - - @Inject - public CobolLineWriterImpl(CodeLayoutStore layoutStore) { - this.layoutStore = layoutStore; - } - - @Override - public ExtendedDocument serialize(final List lines, String documentUri) { - final StringBuilder sb = new StringBuilder(); - final Map acc = new HashMap<>(); - StringBuilder clSb = new StringBuilder(); - Position start = null; - lines.sort(Comparator.comparingInt(CobolLine::getNumber)); - for (final CobolLine line : lines) { - final boolean isContinuationLine = CobolLineTypeEnum.CONTINUATION.equals(line.getType()); - - if (!isContinuationLine) { - if (start != null) { - Position stop = new Position(line.getNumber() - 1, sb.length() - sb.lastIndexOf("\n") - 1); - Range range = new Range(start, stop); - acc.put(range, clSb.toString()); - clSb = new StringBuilder(); - start = null; - } - process(sb, line); - } - - /* - * check if there is any continuation line and try to concatenate all result them - * without error message to be on a wrong paragraph by adding a newline for each - * concatenated line at the end result concatenated string - */ - if (isContinuationLine) { - if (start == null) { - CobolLine predecessor = line.getPredecessor(); - int col = lineString(predecessor).length(); - start = new Position(predecessor.getNumber(), col); - } - process(sb, line); - clSb.append(removeStartingQuote(line)); - } - } - - ExtendedDocument result = new ExtendedDocument(sb.toString(), documentUri); - acc.forEach(result::replace); - if (start != null) { - CobolLine lastLine = lines.get(lines.size() - 1); - Position stop = new Position(lastLine.getNumber(), sb.length() - sb.lastIndexOf("\n") - 1); - Range range = new Range(start, stop); - result.replace(range, clSb.toString()); - } - result.commitTransformations(); - return result; - } - - private void process(StringBuilder sb, CobolLine line) { - if (line.getNumber() > 0) { - sb.append(NEWLINE); - } - sb.append(lineString(line)); - } - - private String lineString(CobolLine line) { - StringBuilder sb = new StringBuilder(); - if (line.getType() != CobolLineTypeEnum.PREPROCESSED) { - String blankSequenceArea = StringUtils.repeat(WS, layoutStore.getCodeLayout().getSequenceLength()); - sb.append(blankSequenceArea); - } - sb.append(line.getIndicatorArea()); - sb.append(line.getContentArea()); - return sb.toString(); - } - - /** - * We need to remove the opening quote from a continuation line to concatenate string correctly - */ - private String removeStartingQuote(CobolLine line) { - String continuation = StringUtils.stripStart(line.getContentArea(), null); - if (CobolLineReWriter.checkStringStartsWithQuoteMark(continuation) - && !isContinuedLineQuoted(line)) { - continuation = continuation.substring(1); - } - return continuation; - } - - private boolean isContinuedLineQuoted(CobolLine line) { - return CobolLineReWriter.checkStringEndsWithQuoteMark(line.getPredecessor().getContentArea()); - } -} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/BasicCobolErrorHandler.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/BasicCobolErrorHandler.java new file mode 100644 index 0000000000..47fdf1e02f --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/BasicCobolErrorHandler.java @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.core.strategy; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import lombok.extern.slf4j.Slf4j; +import org.antlr.v4.runtime.*; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.message.MessageServiceProvider; + +/** + * This implementation of the error strategy customizes error messages that are extracted from the + * parsing exceptions + */ +@Slf4j +// for test +@NoArgsConstructor +public class BasicCobolErrorHandler extends DefaultErrorStrategy implements MessageServiceProvider { + private static final String REPORT_NO_VIABLE_ALTERNATIVE = + "ErrorStrategy.reportNoViableAlternative"; + private static final String REPORT_MISSING_TOKEN = "ErrorStrategy.reportMissingToken"; + + @Getter + @Setter + private MessageService messageService; + @Getter @Setter private ErrorMessageHelper errorMessageHelper; + + public BasicCobolErrorHandler(MessageService messageService) { + this.messageService = messageService; + this.errorMessageHelper = new ErrorMessageHelper(messageService); + } + + @Override + public void reportError(Parser recognizer, RecognitionException e) { + // if we've already reported an error and have not matched a token + // yet successfully, don't report any errors. + if (!inErrorRecoveryMode(recognizer)) { + beginErrorCondition(recognizer); + reportErrorByType(recognizer, e); + } + } + + private void reportErrorByType(Parser recognizer, RecognitionException e) { + if (e instanceof InputMismatchException) { + reportInputMismatch(recognizer, (InputMismatchException) e); + return; + } + if (e instanceof NoViableAltException) { + reportNoViableAlternative(recognizer, (NoViableAltException) e); + return; + } + if (e instanceof FailedPredicateException) { + reportFailedPredicate(recognizer, (FailedPredicateException) e); + return; + } + reportUnrecognizedException(recognizer, e); + } + + private void reportUnrecognizedException(Parser recognizer, RecognitionException e) { + LOG.error("unknown recognition error type: " + e.getClass().getName()); + recognizer.notifyErrorListeners(e.getOffendingToken(), e.getMessage(), e); + } + + @Override + protected void reportInputMismatch(Parser recognizer, InputMismatchException e) { + Token token = e.getOffendingToken(); + String msg = + errorMessageHelper.getInputMismatchMessage(recognizer, e, token, getOffendingToken(e)); + recognizer.notifyErrorListeners(token, msg, e); + } + + @Override + protected void reportNoViableAlternative(Parser recognizer, NoViableAltException e) { + String messageParams = errorMessageHelper.retrieveInputForNoViableException(recognizer, e); + String msg = messageService.getMessage(REPORT_NO_VIABLE_ALTERNATIVE, messageParams); + recognizer.notifyErrorListeners(e.getOffendingToken(), msg, e); + } + + @Override + protected void reportUnwantedToken(Parser recognizer) { + if (inErrorRecoveryMode(recognizer)) { + return; + } + beginErrorCondition(recognizer); + Token currentToken = recognizer.getCurrentToken(); + String msg = + errorMessageHelper.getUnwantedTokenMessage( + recognizer, currentToken, getTokenErrorDisplay(currentToken)); + recognizer.notifyErrorListeners(currentToken, msg, null); + } + + @Override + protected void reportMissingToken(Parser recognizer) { + if (inErrorRecoveryMode(recognizer)) { + return; + } + beginErrorCondition(recognizer); + String msg = + messageService.getMessage( + REPORT_MISSING_TOKEN, + errorMessageHelper.getExpectedText(recognizer), + ErrorMessageHelper.getRule(recognizer)); + recognizer.notifyErrorListeners(getPreviousToken(recognizer), msg, null); + } + + private Token getPreviousToken(Parser recognizer) { + if (recognizer.getCurrentToken().getText().trim().length() == 1) { + return recognizer.getCurrentToken(); + } + int index = recognizer.getCurrentToken().getTokenIndex(); + while (index > 0) { + index--; + Token token = recognizer.getTokenStream().get(index); + if (!token.getText().trim().isEmpty()) { + return token; + } + } + return recognizer.getCurrentToken(); + } + + private String getOffendingToken(InputMismatchException e) { + return getTokenErrorDisplay(e.getOffendingToken()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/CobolErrorStrategy.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/CobolErrorStrategy.java index 2551489b2f..e9778cf688 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/CobolErrorStrategy.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/CobolErrorStrategy.java @@ -14,125 +14,192 @@ */ package org.eclipse.lsp.cobol.core.strategy; -import lombok.Getter; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; import lombok.NoArgsConstructor; -import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.atn.ATNState; +import org.antlr.v4.runtime.misc.IntervalSet; import org.eclipse.lsp.cobol.common.message.MessageService; -import org.eclipse.lsp.cobol.common.message.MessageServiceProvider; +import org.eclipse.lsp.cobol.core.CobolLexer; +import org.eclipse.lsp.cobol.core.CobolParser; +import org.eclipse.lsp.cobol.core.MessageServiceParser; /** * This implementation of the error strategy customizes error messages that are extracted from the - * parsing exceptions + * parsing exceptions and changes the sync strategy adopted specific to the COBOL language */ @Slf4j // for test @NoArgsConstructor -public class CobolErrorStrategy extends DefaultErrorStrategy implements MessageServiceProvider { - private static final String REPORT_NO_VIABLE_ALTERNATIVE = - "ErrorStrategy.reportNoViableAlternative"; - private static final String REPORT_MISSING_TOKEN = "ErrorStrategy.reportMissingToken"; - - @Getter - @Setter - private MessageService messageService; - @Getter - @Setter - private ErrorMessageHelper errorMessageHelper; +public class CobolErrorStrategy extends BasicCobolErrorHandler { public CobolErrorStrategy(MessageService messageService) { - this.messageService = messageService; - this.errorMessageHelper = new ErrorMessageHelper(messageService); + super(messageService); } + /** + * This is a Cobol specific method adopted from {@link DefaultErrorStrategy#sync(Parser)} + * + *

The Cobol specific implementation of {@link ANTLRErrorStrategy#sync} makes sure that the + * current lookahead symbol is consistent with what were expecting at this point in the ATN. You + * can call this anytime but ANTLR only generates code to check before subrules/loops and each + * iteration. + * + *

Implements Jim Idle's magic sync mechanism in closures and optional subrules. E.g., + * + *

+   * a : sync ( stuff sync )* ;
+   * sync : {consume to what can follow sync} ;
+   * 
+ * + * At the start of a sub rule upon error, {@link #sync} performs single token deletion, if + * possible. If it can't do that, it bails on the current rule and uses the default error + * recovery, which consumes until the resynchronization set of the current rule. + * + *

If the sub rule is optional ({@code (...)?}, {@code (...)*}, or block with an empty + * alternative), then the expected set includes what follows the subrule. + * + *

During loop iteration, it consumes until it sees a token that can start a sub rule or what + * follows loop. Yes, that is pretty aggressive. We opt to stay in the loop as long as possible. + * + *

ORIGINS + * + *

Previous versions of ANTLR did a poor job of their recovery within loops. A single mismatch + * token or missing token would force the parser to bail out of the entire rules surrounding the + * loop. So, for rule + * + *

+   * classDef : 'class' ID '{' member* '}'
+   * 
+ * + * input with an extra token between members would force the parser to consume until it found the + * next class definition rather than the next member definition of the current class. + * + *

This functionality cost a little bit of effort because the parser has to compare token set + * at the start of the loop and at each iteration. If for some reason speed is suffering for you, + * you can turn off this functionality by simply overriding this method as a blank { }. + */ @Override - public void reportError(Parser recognizer, RecognitionException e) { - // if we've already reported an error and have not matched a token - // yet successfully, don't report any errors. - if (!inErrorRecoveryMode(recognizer)) { - beginErrorCondition(recognizer); - reportErrorByType(recognizer, e); + public void sync(Parser recognizer) throws RecognitionException { + ATNState s = recognizer.getInterpreter().atn.states.get(recognizer.getState()); + int stateType = s.getStateType(); + // System.err.println("sync @ "+s.stateNumber+"="+s.getClass().getSimpleName()); + // If already recovering, don't try to sync + if (inErrorRecoveryMode(recognizer)) { + return; } - } - private void reportErrorByType(Parser recognizer, RecognitionException e) { - if (e instanceof InputMismatchException) { - reportInputMismatch(recognizer, (InputMismatchException) e); + TokenStream tokens = recognizer.getInputStream(); + int la = tokens.LA(1); + Optional lastToken = Optional.ofNullable(tokens.LT(-1)).map(Token::getType); + + // try cheaper subset first; might get lucky. seems to shave a wee bit off + IntervalSet nextTokens = recognizer.getATN().nextTokens(s); + if (nextTokens.contains(la)) { + // We are sure the token matches + nextTokensContext = null; + nextTokensState = ATNState.INVALID_STATE_NUMBER; return; } - if (e instanceof NoViableAltException) { - reportNoViableAlternative(recognizer, (NoViableAltException) e); + + if (nextTokens.contains(Token.EPSILON)) { + if (nextTokensContext == null) { + // It's possible the next token won't match; information tracked + // by sync is restricted for performance. + // List skipToTokenList = + // CobolLexer.cobolVerbTokens.stream().filter(nextTokens::contains).distinct().collect(Collectors.toList()); + if (shouldSkipToSync(nextTokens, la, lastToken)) { + cobolSync(recognizer); + return; + } + nextTokensContext = recognizer.getContext(); + nextTokensState = recognizer.getState(); + } return; } - if (e instanceof FailedPredicateException) { - reportFailedPredicate(recognizer, (FailedPredicateException) e); - return; + + switch (stateType) { + case ATNState.BLOCK_START: + case ATNState.STAR_BLOCK_START: + case ATNState.PLUS_BLOCK_START: + case ATNState.STAR_LOOP_ENTRY: + // report error and recover if possible + if (singleTokenDeletion(recognizer) != null) { + return; + } + throw new InputMismatchException(recognizer); + + case ATNState.PLUS_LOOP_BACK: + case ATNState.STAR_LOOP_BACK: + // System.err.println("at loop back: "+s.getClass().getSimpleName()); + reportUnwantedToken(recognizer); + IntervalSet expecting = recognizer.getExpectedTokens(); + IntervalSet whatFollowsLoopIterationOrRule = expecting.or(getErrorRecoverySet(recognizer)); + consumeUntil(recognizer, whatFollowsLoopIterationOrRule); + break; + + default: + // do nothing if we can't identify the exact kind of ATN state + break; } - reportUnrecognizedException(recognizer, e); } - private void reportUnrecognizedException(Parser recognizer, RecognitionException e) { - LOG.error("unknown recognition error type: " + e.getClass().getName()); - recognizer.notifyErrorListeners(e.getOffendingToken(), e.getMessage(), e); + private void cobolSync(Parser recognizer) { + handleMissingDot(recognizer); + consumeUntilNext(recognizer, getSkipToTokenList()); } - @Override - protected void reportInputMismatch(Parser recognizer, InputMismatchException e) { - Token token = e.getOffendingToken(); - String msg = - errorMessageHelper.getInputMismatchMessage(recognizer, e, token, getOffendingToken(e)); - recognizer.notifyErrorListeners(token, msg, e); + private static List getSkipToTokenList() { + List skipToTokenList = new ArrayList<>(); + skipToTokenList.add(CobolLexer.DOT_FS); + skipToTokenList.add(CobolLexer.DOT_FS2); + skipToTokenList.addAll(CobolLexer.cobolVerbTokens); + return skipToTokenList; } - @Override - protected void reportNoViableAlternative(Parser recognizer, NoViableAltException e) { - String messageParams = errorMessageHelper.retrieveInputForNoViableException(recognizer, e); - String msg = messageService.getMessage(REPORT_NO_VIABLE_ALTERNATIVE, messageParams); - recognizer.notifyErrorListeners(e.getOffendingToken(), msg, e); - } - - @Override - protected void reportUnwantedToken(Parser recognizer) { - if (inErrorRecoveryMode(recognizer)) { - return; + private static void handleMissingDot(Parser recognizer) { + if (recognizer.getContext() instanceof CobolParser.Dot_fsContext + && recognizer instanceof CobolParser) { + ((CobolParser) recognizer) + .notifyError("missing.period", recognizer.getInputStream().LT(1).getText()); } - beginErrorCondition(recognizer); - Token currentToken = recognizer.getCurrentToken(); - String msg = errorMessageHelper.getUnwantedTokenMessage(recognizer, currentToken, getTokenErrorDisplay(currentToken)); - recognizer.notifyErrorListeners(currentToken, msg, null); } - @Override - protected void reportMissingToken(Parser recognizer) { - if (inErrorRecoveryMode(recognizer)) { - return; - } - beginErrorCondition(recognizer); - String msg = - messageService.getMessage( - REPORT_MISSING_TOKEN, - errorMessageHelper.getExpectedText(recognizer), - ErrorMessageHelper.getRule(recognizer)); - recognizer.notifyErrorListeners(getPreviousToken(recognizer), msg, null); + private static boolean shouldSkipToSync( + IntervalSet nextTokens, int la, Optional lastToken) { + return (nextTokens.contains(CobolLexer.DOT_FS) || nextTokens.contains(CobolLexer.DOT_FS2)) + && !nextTokens.contains(Token.EOF) + && la != Token.EOF + && (lastToken.isPresent() && !getSkipToTokenList().contains(lastToken.get())); } - private Token getPreviousToken(Parser recognizer) { - if (recognizer.getCurrentToken().getText().trim().length() == 1) { - return recognizer.getCurrentToken(); + protected void consumeUntilNext(Parser recognizer, List skipToTokenList) { + Token sToken = recognizer.getInputStream().LT(1); + int ttype = recognizer.getInputStream().LA(1); + int skipTokenCount = 0; + while (ttype != Token.EOF && !skipToTokenList.contains(ttype)) { + recognizer.consume(); + skipTokenCount++; + ttype = recognizer.getInputStream().LA(1); } - int index = recognizer.getCurrentToken().getTokenIndex(); - while (index > 0) { - index--; - Token token = recognizer.getTokenStream().get(index); - if (!token.getText().trim().isEmpty()) { - return token; - } + if (skipTokenCount > 0) { + MessageServiceParser cobolParser = (MessageServiceParser) recognizer; + ANTLRErrorListener errorListenerDispatch = cobolParser.getErrorListenerDispatch(); + CommonToken offendingToken = new CommonToken(sToken); + Token lastToken = recognizer.getInputStream().LT(-1); + offendingToken.setStopIndex(lastToken.getStopIndex()); + errorListenerDispatch.syntaxError( + recognizer, + offendingToken, + offendingToken.getLine(), + offendingToken.getCharPositionInLine(), + this.getMessageService().getMessage("input.mismatch.skipAnalysis"), + new InputMismatchException(recognizer)); } - return recognizer.getCurrentToken(); - } - - private String getOffendingToken(InputMismatchException e) { - return getTokenErrorDisplay(e.getOffendingToken()); + nextTokensContext = (ParserRuleContext) recognizer.getContext().parent; + nextTokensState = recognizer.getState(); } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/IdentifierReplacing.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/IdentifierReplacing.java index 705229b32b..d4900a027c 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/IdentifierReplacing.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/strategy/IdentifierReplacing.java @@ -15,22 +15,21 @@ package org.eclipse.lsp.cobol.core.strategy; +import static java.util.stream.Collectors.toMap; +import static java.util.stream.Collectors.toSet; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import lombok.experimental.UtilityClass; -import org.antlr.v4.runtime.Parser; -import org.antlr.v4.runtime.ParserRuleContext; -import org.eclipse.lsp.cobol.core.CobolParser; - import java.lang.reflect.Method; import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Set; import java.util.stream.Stream; - -import static java.util.stream.Collectors.toMap; -import static java.util.stream.Collectors.toSet; +import lombok.experimental.UtilityClass; +import org.antlr.v4.runtime.Parser; +import org.antlr.v4.runtime.ParserRuleContext; +import org.eclipse.lsp.cobol.core.CobolParser; /** * This class encapsulates the tokens of identifier rules that should be replaced in the error @@ -41,7 +40,7 @@ class IdentifierReplacing { private static final String KEYWORD_PATTERN = "[A-Z0-9_]+"; private static final Map, List>> - PARSER_IDENTIFIER_RULES = ImmutableMap.of(CobolParser.class, ImmutableList.of(CobolParser.CobolKeywordsContext.class)); + PARSER_IDENTIFIER_RULES = ImmutableMap.of(CobolParser.class, ImmutableList.of(CobolParser.AllowedCobolKeywordsContext.class)); /** * Retrieve all the tokens from the rules that represent identifiers diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolVisitor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolVisitor.java index 0eb93d592f..ba190a0761 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolVisitor.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolVisitor.java @@ -25,10 +25,12 @@ import static org.eclipse.lsp.cobol.core.visitor.VisitorHelper.*; import com.google.common.collect.ImmutableList; + import java.util.*; import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; + import lombok.Getter; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; @@ -64,9 +66,11 @@ import org.eclipse.lsp.cobol.core.CobolParser; import org.eclipse.lsp.cobol.core.CobolParserBaseVisitor; import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; +import org.eclipse.lsp.cobol.dialects.ibm.experimental.visitors.CobolDataDivisionVisitor; +import org.eclipse.lsp.cobol.dialects.ibm.experimental.visitors.CobolIdentificationDivisionVisitor; +import org.eclipse.lsp.cobol.dialects.ibm.experimental.visitors.CobolProcedureDivisionVisitor; import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; -import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; import org.eclipse.lsp4j.Location; import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; @@ -81,17 +85,17 @@ public class CobolVisitor extends CobolParserBaseVisitor> { @Getter - private final List errors = new ArrayList<>(); - private final CopybooksRepository copybooks; - private final CommonTokenStream tokenStream; - private final ExtendedDocument extendedDocument; - private final MessageService messageService; - private final SubroutineService subroutineService; - - private Map fileControls = null; + protected final List errors = new ArrayList<>(); + protected final CopybooksRepository copybooks; + protected final CommonTokenStream tokenStream; + protected final ExtendedDocument extendedDocument; + protected final MessageService messageService; + protected final SubroutineService subroutineService; + protected final CobolProgramLayout programLayout; + + protected Map fileControls = null; private final Map subroutineDefinitionMap = new HashMap<>(); - private final CachingConfigurationService cachingConfigurationService; - private final CodeLayoutStore codeLayoutStore; + protected final CachingConfigurationService cachingConfigurationService; public CobolVisitor( @NonNull CopybooksRepository copybooks, @@ -99,14 +103,14 @@ public CobolVisitor( @NonNull ExtendedDocument extendedDocument, MessageService messageService, SubroutineService subroutineService, - CachingConfigurationService cachingConfigurationService, CodeLayoutStore codeLayoutStore) { + CachingConfigurationService cachingConfigurationService, CobolProgramLayout programLayout) { this.copybooks = copybooks; this.tokenStream = tokenStream; this.extendedDocument = extendedDocument; this.messageService = messageService; this.subroutineService = subroutineService; this.cachingConfigurationService = cachingConfigurationService; - this.codeLayoutStore = codeLayoutStore; + this.programLayout = programLayout; } @Override @@ -297,12 +301,12 @@ public List visitXmlParseStatement(XmlParseStatementContext ctx) { .orElse(null); ProcedureName procName = parseProcedureName(Optional.ofNullable(ctx.xmlProcessinProcedure()) - .map(XmlProcessinProcedureContext::procedureName) - .orElse(null)); + .map(XmlProcessinProcedureContext::procedureName) + .orElse(null)); ProcedureName thru = parseProcedureName(Optional.ofNullable(ctx.through()) - .map(ThroughContext::procedureName) - .orElse(null)); + .map(ThroughContext::procedureName) + .orElse(null)); return addTreeNode( ctx, @@ -316,7 +320,7 @@ public List visitXmlParseStatement(XmlParseStatementContext ctx) { xmlNationalContext, procName, thru) - ); + ); } @Override @@ -332,10 +336,10 @@ public List visitNotOnExceptionClause(CobolParser.NotOnExceptionClauseCont @Override public List visitUseStatement(CobolParser.UseStatementContext ctx) { return ctx.useDebugClause() != null - ? - addTreeNode(ctx, l -> new UseForDebuggingNode(l, null)) - : - addTreeNode(ctx, UseNode::new); + ? + addTreeNode(ctx, l -> new UseForDebuggingNode(l, null)) + : + addTreeNode(ctx, UseNode::new); } /** @@ -383,6 +387,58 @@ locality, name, getIntervalText(ctx), def))) .orElseGet(() -> visitChildren(ctx)); } + @Override + public List visitXmlGenerate(XmlGenerateContext ctx) { + VariableNameAndLocality identifier1 = new VariableNameAndLocality( + ctx.xmlGenIdentifier1().getText(), retrieveLocality(ctx.xmlGenIdentifier1()).orElse(null)); + + VariableNameAndLocality identifier2 = new VariableNameAndLocality( + ctx.xmlGenIdentifier2().getText(), retrieveLocality(ctx.xmlGenIdentifier2()).orElse(null)); + + VariableNameAndLocality identifier3 = ofNullable(ctx.xmlGenIdentifier3()).map(iden3 -> new VariableNameAndLocality( + iden3.getText(), retrieveLocality(iden3).orElse(null))).orElse(null); + + VariableNameAndLocality identifier4 = ofNullable(ctx.xmlGenIdentifier4()).map(iden4 -> new VariableNameAndLocality( + iden4.getText(), retrieveLocality(iden4).orElse(null))).orElse(null); + + VariableNameAndLocality identifier5 = ofNullable(ctx.xmlGenIdentifier5()).map(iden5 -> new VariableNameAndLocality( + iden5.getText(), retrieveLocality(iden5).orElse(null))).orElse(null); + + List identifier6 = ctx.xmlGenIdentifier6().isEmpty() + ? null + : ctx.xmlGenIdentifier6().stream() + .map(iden6 -> new VariableNameAndLocality(iden6.getText(), retrieveLocality(iden6).orElse(null))) + .collect(Collectors.toList()); + + List identifier7 = ctx.xmlGenIdentifier7().isEmpty() + ? null + : ctx.xmlGenIdentifier7().stream() + .map(iden7 -> new VariableNameAndLocality(iden7.getText(), retrieveLocality(iden7).orElse(null))) + .collect(Collectors.toList()); + + List identifier8 = ctx.xmlGenIdentifier6().isEmpty() + ? null + : ctx.xmlGenIdentifier8().stream() + .map(iden8 -> new VariableNameAndLocality(iden8.getText(), retrieveLocality(iden8).orElse(null))) + .collect(Collectors.toList()); + + return addTreeNode( + ctx, + locality -> + new XmlGenerateNode( + locality, + identifier1, + identifier2, + identifier3, + identifier4, + identifier5, + identifier6, + identifier7, + identifier8 + )); + + } + @Override public List visitEndProgramStatement(EndProgramStatementContext ctx) { areaAWarning(ctx.getStart()); @@ -565,14 +621,12 @@ public List visitSectionName(SectionNameContext ctx) { @Override public List visitStatement(StatementContext ctx) { - if (!ParserUtils.isHwParserEnabled() || expectedInAriaA(ctx)) { - areaBWarning(ctx); - } + areaBWarning(ctx); throwWarning(ctx.getStart()); return visitChildren(ctx); } - private boolean expectedInAriaA(ParserRuleContext ctx) { + protected boolean expectedInAriaA(ParserRuleContext ctx) { // https://www.ibm.com/docs/en/cobol-zos/6.4?topic=format-area // Certain items must begin in Area A: // Division headers @@ -708,8 +762,8 @@ public List visitPerformInlineStatement(PerformInlineStatementContext ctx) public List visitPerformProcedureStatement(PerformProcedureStatementContext ctx) { final ProcedureName targetName = parseProcedureName(ctx.procedureName()); final ProcedureName thruName = parseProcedureName(Optional.ofNullable(ctx.through()) - .map(ThroughContext::procedureName) - .orElse(null)); + .map(ThroughContext::procedureName) + .orElse(null)); return addTreeNode(ctx, locality -> new PerformNode(locality, targetName, thruName)); } @@ -999,7 +1053,15 @@ public List visitParagraphs(ParagraphsContext ctx) { @Override public List visitProcedureDivisionBody(ProcedureDivisionBodyContext ctx) { - return addTreeNode(ctx, ProcedureDivisionBodyNode::new); + + ParserRuleContext context = new ParserRuleContext(); + context.start = ctx.getParent().start; + context.stop = ctx.stop; + + List children = visitChildren(ctx); + return retrieveLocality(context) + .map(constructNode(ProcedureDivisionBodyNode::new, children)) + .orElse(children); } @Override @@ -1055,6 +1117,20 @@ public List visitChildren(RuleNode node) { errors.addAll(cobolDataDivisionVisitor.getErrors()); return nodes; } + if (node.getClass().getEnclosingClass() == CobolProcedureDivisionParser.class) { + CobolProcedureDivisionVisitor cobolProcedureDivisionVisitor = new CobolProcedureDivisionVisitor( + copybooks, + tokenStream, + extendedDocument, + messageService, + subroutineService, + cachingConfigurationService, + programLayout + ); + List nodes = cobolProcedureDivisionVisitor.visit(node); + errors.addAll(cobolProcedureDivisionVisitor.getErrors()); + return nodes; + } return super.visitChildren(node); } @@ -1090,17 +1166,17 @@ public List visitSortStatement(CobolParser.SortStatementContext ctx) { String key; if (ctx.sortOnKeyClause() != null) { ascending = ctx.sortOnKeyClause().stream() - .map(s -> s.ASCENDING() != null) - .filter(b -> b) - .findAny() - .orElse(false); + .map(s -> s.ASCENDING() != null) + .filter(b -> b) + .findAny() + .orElse(false); key = ctx.sortOnKeyClause().stream() - .map(SortOnKeyClauseContext::KEY) - .filter(Objects::nonNull) - .map(ParseTree::getText) - .findFirst() - .orElse(""); + .map(SortOnKeyClauseContext::KEY) + .filter(Objects::nonNull) + .map(ParseTree::getText) + .findFirst() + .orElse(""); } else { ascending = false; key = ""; @@ -1115,17 +1191,17 @@ public List visitMergeStatement(CobolParser.MergeStatementContext ctx) { String key; if (ctx.mergeOnKeyClause() != null) { ascending = ctx.mergeOnKeyClause().stream() - .map(s -> s.ASCENDING() != null) - .filter(b -> b) - .findAny() - .orElse(false); + .map(s -> s.ASCENDING() != null) + .filter(b -> b) + .findAny() + .orElse(false); key = ctx.mergeOnKeyClause().stream() - .map(MergeOnKeyClauseContext::KEY) - .filter(Objects::nonNull) - .map(ParseTree::getText) - .findFirst() - .orElse(""); + .map(MergeOnKeyClauseContext::KEY) + .filter(Objects::nonNull) + .map(ParseTree::getText) + .findFirst() + .orElse(""); } else { ascending = false; key = ""; @@ -1138,8 +1214,8 @@ public List visitMergeStatement(CobolParser.MergeStatementContext ctx) { public List visitInputProcedurePhrase(CobolParser.InputProcedurePhraseContext ctx) { final ProcedureName procName = parseProcedureName(ctx.procedureName()); final ProcedureName thru = parseProcedureName(Optional.ofNullable(ctx.through()) - .map(ThroughContext::procedureName) - .orElse(null)); + .map(ThroughContext::procedureName) + .orElse(null)); Locality locality = retrieveLocality(ctx).orElse(null); InputNode node = new InputNode(locality); @@ -1154,8 +1230,8 @@ public List visitInputProcedurePhrase(CobolParser.InputProcedurePhraseCont public List visitOutputProcedurePhrase(CobolParser.OutputProcedurePhraseContext ctx) { final ProcedureName procName = parseProcedureName(ctx.procedureName()); final ProcedureName thru = parseProcedureName(Optional.ofNullable(ctx.through()) - .map(ThroughContext::procedureName) - .orElse(null)); + .map(ThroughContext::procedureName) + .orElse(null)); Locality locality = retrieveLocality(ctx).orElse(null); OutputNode node = new OutputNode(locality); @@ -1166,7 +1242,8 @@ public List visitOutputProcedurePhrase(CobolParser.OutputProcedurePhraseCo return ImmutableList.of(node); } - @Override public List visitAlterStatement(CobolParser.AlterStatementContext ctx) { + @Override + public List visitAlterStatement(CobolParser.AlterStatementContext ctx) { if (ctx.alterProceedTo() != null && ctx.alterProceedTo().size() > 0) { CobolParser.AlterProceedToContext alter = ctx.alterProceedTo().get(0); if (alter.procedureName() != null && alter.procedureName().size() == 2) { @@ -1175,14 +1252,14 @@ public List visitOutputProcedurePhrase(CobolParser.OutputProcedurePhraseCo String name = Optional.ofNullable(from.paragraphName()).map(RuleContext::getText).orElse(null); String inSection = Optional.ofNullable(from.inSection()) - .map(InSectionContext::sectionName) - .map(RuleContext::getText).orElse(null); + .map(InSectionContext::sectionName) + .map(RuleContext::getText).orElse(null); ProcedureName alterFrom = new ProcedureName(name, inSection); name = Optional.ofNullable(to.paragraphName()).map(RuleContext::getText).orElse(null); inSection = Optional.ofNullable(to.inSection()) - .map(InSectionContext::sectionName) - .map(RuleContext::getText).orElse(null); + .map(InSectionContext::sectionName) + .map(RuleContext::getText).orElse(null); ProcedureName alterTo = new ProcedureName(name, inSection); Locality locality = retrieveLocality(ctx).orElse(null); @@ -1239,7 +1316,7 @@ private void reportSubroutineNotDefined(String name, Locality locality) { errors.add(error); } - private void throwWarning(Token token) { + protected void throwWarning(Token token) { String tokenText = token.getText().toUpperCase(); if (MisspelledKeywordDistance.KEYWORDS.getSuggestions().contains(tokenText)) return; MisspelledKeywordDistance.calculateDistance(tokenText) @@ -1267,8 +1344,12 @@ private void areaAWarning(Token token) { if (token.getText().startsWith("EXEC")) { return; } + int areaBStartIndex = + programLayout.getSequenceLength() + + programLayout.getIndicatorLength() + + programLayout.getAreaALength() - 1; getLocality(token) - .filter(it -> it.getRange().getStart().getCharacter() > AREA_A_FINISH) + .filter(it -> it.getRange().getStart().getCharacter() > areaBStartIndex) .ifPresent( it -> throwException( @@ -1277,12 +1358,11 @@ private void areaAWarning(Token token) { messageService.getMessage("CobolVisitor.AreaAWarningMsg"))); } - private void areaBWarning(ParserRuleContext ctx) { + protected void areaBWarning(ParserRuleContext ctx) { final int start = ctx.getStart().getTokenIndex(); final int stop = ctx.getStop().getTokenIndex(); - areaBWarning( - start < stop ? tokenStream.getTokens(start, stop) : ImmutableList.of(ctx.getStart())); + areaBWarning(start < stop ? tokenStream.getTokens(start, stop) : ImmutableList.of(ctx.getStart())); } private void areaBWarning(@NonNull List tokenList) { @@ -1300,10 +1380,15 @@ private void areaBWarning(@NonNull List tokenList) { private Predicate startsInAreaA(Token token) { return it -> { - CobolProgramLayout codeLayout = codeLayoutStore.getCodeLayout(); + // TODO: UPdate this int charPosition = it.getRange().getStart().getCharacter(); - int areaBStartIndex = codeLayout.getSequenceLength() + codeLayout.getIndicatorLength() + codeLayout.getAreaALength(); - return charPosition > codeLayout.getSequenceLength() && charPosition < areaBStartIndex && token.getChannel() != HIDDEN; + int areaBStartIndex = + programLayout.getSequenceLength() + + programLayout.getIndicatorLength() + + programLayout.getAreaALength(); + return charPosition > programLayout.getSequenceLength() + && charPosition < areaBStartIndex + && token.getChannel() != HIDDEN; }; } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/KeywordSuggestions.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/KeywordSuggestions.java index f4ccc045ae..2b9bfa6a42 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/KeywordSuggestions.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/KeywordSuggestions.java @@ -26,7 +26,7 @@ /** This class provides keywords that are used for suggestions during the syntax check. */ @Slf4j -class KeywordSuggestions { +public class KeywordSuggestions { @Getter private Set suggestions; diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/MisspelledKeywordDistance.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/MisspelledKeywordDistance.java index 17230918b1..7316819e18 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/MisspelledKeywordDistance.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/MisspelledKeywordDistance.java @@ -27,7 +27,7 @@ * Levenshtein algorithm. */ @UtilityClass -class MisspelledKeywordDistance { +public class MisspelledKeywordDistance { public static final KeywordSuggestions KEYWORDS = new KeywordSuggestions(); private static final LevenshteinDistance DISTANCE = LevenshteinDistance.getDefaultInstance(); @@ -38,7 +38,7 @@ class MisspelledKeywordDistance { * @param wrongToken - potentially misspelled token to check * @return the closest keyword or null if nothing found */ - Optional calculateDistance(String wrongToken) { + public Optional calculateDistance(String wrongToken) { return KEYWORDS.getSuggestions().stream() .map(item -> new Object[] {item, DISTANCE.apply(wrongToken, item)}) .sorted(comparingInt(o -> (int) o[1])) diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/ParserListener.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/ParserListener.java index 780cdf712b..02f39d9f69 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/ParserListener.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/ParserListener.java @@ -29,7 +29,7 @@ import org.eclipse.lsp.cobol.common.error.SyntaxError; import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; import org.eclipse.lsp.cobol.common.model.Locality; -import org.eclipse.lsp.cobol.core.WarningRecognitionException; +import org.eclipse.lsp.cobol.parser.WarningRecognitionException; import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; import org.eclipse.lsp4j.Location; import org.eclipse.lsp4j.Position; diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/VisitorHelper.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/VisitorHelper.java index 976afc5584..52baae5ebf 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/VisitorHelper.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/VisitorHelper.java @@ -86,7 +86,7 @@ public static String getName(ParserRuleContext context) { * @param stop is end position * @return Locality with interval position */ - static Locality getIntervalPosition(Locality start, Locality stop) { + public static Locality getIntervalPosition(Locality start, Locality stop) { return Locality.builder() .uri(start.getUri()) .range(new Range(start.getRange().getStart(), stop.getRange().getEnd())) @@ -290,8 +290,8 @@ public static Range constructRange(ParserRuleContext ctx) { * @param children list of child nodes of the parser rule * @return a node for semantic analysis */ - static Function> constructNode( - Function nodeConstructor, List children) { + public static Function> constructNode( + Function nodeConstructor, List children) { return locality -> { Node node = nodeConstructor.apply(locality); children.forEach(node::addChild); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/TrueCobolDialect.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/TrueCobolDialect.java new file mode 100644 index 0000000000..42f69a2d18 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/TrueCobolDialect.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects; + +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; +import org.eclipse.lsp.cobol.common.pipeline.Pipeline; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; + +/** + * Cobol Dialect Interface + */ +public interface TrueCobolDialect { + /** + * Returns the pipeline for current dialect + * @return the pipeline for a dialect + */ + Pipeline getPipeline(); + + /** + * Returns the cleanup preprocessor for current dialect + * @return the cleanup preprocessor + */ + CleanerPreprocessor getPreprocessor(); +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/TrueDialectServiceImpl.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/TrueDialectServiceImpl.java new file mode 100644 index 0000000000..78c5d62af0 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/TrueDialectServiceImpl.java @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects; + +import com.google.inject.Inject; +import com.google.inject.Singleton; +import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; +import org.eclipse.lsp.cobol.common.SubroutineService; +import org.eclipse.lsp.cobol.common.copybook.CopybookService; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; +import org.eclipse.lsp.cobol.common.pipeline.Pipeline; +import org.eclipse.lsp.cobol.core.engine.processor.AstProcessor; +import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessor; +import org.eclipse.lsp.cobol.dialects.hp.HpTrueCobolDialect; +import org.eclipse.lsp.cobol.dialects.ibm.*; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.dialects.ibm.experimental.EnterpriseCobol64; +import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +/** + * Dialect Service provides available dialects pipeline for the given language od + */ +@Singleton +public class TrueDialectServiceImpl implements TrueDialectService { + + private final Map dialects; + + @Inject + public TrueDialectServiceImpl( + GrammarPreprocessor grammarPreprocessor, + MessageService messageService, + ParseTreeListener treeListener, + SubroutineService subroutineService, + CachingConfigurationService cachingConfigurationService, + DialectService dialectService, + AstProcessor astProcessor, + SymbolsRepository symbolsRepository, + CodeLayoutStore codeLayoutStore, + CopybookService copybookService) { + dialects = new HashMap<>(); + dialects.put(CobolLanguageId.COBOL, new IbmTrueCobolDialect(grammarPreprocessor, + messageService, treeListener, subroutineService, cachingConfigurationService, dialectService, + astProcessor, symbolsRepository, codeLayoutStore)); + + dialects.put(CobolLanguageId.EXPERIMENTAL_COBOL, new EnterpriseCobol64(grammarPreprocessor, + messageService, treeListener, subroutineService, cachingConfigurationService, dialectService, + astProcessor, symbolsRepository, codeLayoutStore)); + + dialects.put(CobolLanguageId.HP_COBOL, new HpTrueCobolDialect(grammarPreprocessor, + messageService, treeListener, subroutineService, cachingConfigurationService, dialectService, + astProcessor, symbolsRepository, codeLayoutStore, copybookService)); + } + + /** + * Returns the pipeline for a dialect based on a given language id + * @param languageId a language id of a dialect + * @return the pipeline for a dialect + */ + public Pipeline getPipeline(CobolLanguageId languageId) { + return Optional.ofNullable(dialects.get(languageId)) + .map(TrueCobolDialect::getPipeline) + .orElseThrow(() -> new RuntimeException("Dialect " + languageId.name() + "not found")); + } + + /** + * Returns the cleanup preprocessor for a dialect, based on a given language id + * @param languageId a language id of a dialect + * @return the cleanup preprocessor + */ + public CleanerPreprocessor getPreprocessor(CobolLanguageId languageId) { + return Optional.ofNullable(dialects.get(languageId)) + .map(TrueCobolDialect::getPreprocessor) + .orElseThrow(() -> new RuntimeException("Dialect " + languageId.name() + "not found")); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/CopybookDescriptor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/CopybookDescriptor.java new file mode 100644 index 0000000000..e3e5e62004 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/CopybookDescriptor.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.hp; + +import lombok.AllArgsConstructor; +import lombok.Data; +import org.eclipse.lsp4j.Range; + +/** + * HP Copybook descriptor + */ +@Data +@AllArgsConstructor +class CopybookDescriptor { + Range statementRange; + Range nameRange; + String name; + String variable; +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/CopybookParser.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/CopybookParser.java new file mode 100644 index 0000000000..e18c8aa858 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/CopybookParser.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.hp; + +import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; +import org.eclipse.lsp4j.Position; +import org.eclipse.lsp4j.Range; + +import java.util.LinkedList; +import java.util.List; + +/** + * HP Copybook parser + */ +class CopybookParser { + + public static List parseAndCleanup(ExtendedDocument extendedDocument) { + List result = new LinkedList<>(); + + String text = extendedDocument.getCurrentText().toString(); + String[] lines = text.split("\r?\n"); + for (int line = 0; line < lines.length; line++) { + String content = lines[line].toUpperCase(); + int index = content.indexOf("COPY"); + if (index > 0) { + Range statementRange = new Range(new Position(line, index), new Position(line, content.length())); + Range nameRange = findNameRange(content, line, index + "COPY".length()); + String name = "acopylib"; + String variable = "var"; + result.add(new CopybookDescriptor(statementRange, nameRange, name, variable)); + } + + for (int i = 0; i < content.length(); i++) { + if (content.charAt(i) == '$') { + extendedDocument.replace(new Range(new Position(line, i), new Position(line, i)), " "); + } + } + + } + return result; + } + + private static Range findNameRange(String text, int line, int start) { + int index = start; + while (text.charAt(index) == ' ') { + index++; + } + start = index; + while ((index < text.length()) && (text.charAt(index) != ' ')) { + index++; + } + int stop = index; + return new Range(new Position(line, start), new Position(line, stop)); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPCobolLineReader.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPCobolLineReader.java new file mode 100644 index 0000000000..729e0b46a0 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPCobolLineReader.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.hp; + +import static org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum.*; +import static org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum.NORMAL; + +import com.google.common.collect.ImmutableMap; +import java.util.*; +import java.util.regex.Pattern; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReader; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutUtil; + +/** + * Preprocessor, which converts strings with COBOL code into a specific entity based on HP tandem + * code layout; analyzes and processes line indicators. This implementation checks if the lines + * match the given format and raises an error if not. It also puts the entire compiler directive + * text (excluding the sequence area if present) to prevent possible cutting off the line beginning. + */ +@Slf4j +class HPCobolLineReader extends CobolLineReader { + private final CodeLayoutStore layoutStore; + + HPCobolLineReader(MessageService messageService, CodeLayoutStore layoutStore) { + super(messageService); + this.layoutStore = layoutStore; + } + + private static final Pattern COMPILER_DIRECTIVE_LINE = + Pattern.compile("(?i)(.{0,6} +|\\s*+)(?(CBL|PROCESS) .+)"); + + private static final Map INDICATORS = + new ImmutableMap.Builder() + .put("*", COMMENT) + .put("/", COMMENT) + .put("d", DEBUG) + .put("D", DEBUG) + .put("-", CONTINUATION) + .put("?", COMPILER_DIRECTIVE) + .put(" ", NORMAL) + .put("", NORMAL) + .build(); + + @Override + protected Pattern getCompilerDirectives() { + return COMPILER_DIRECTIVE_LINE; + } + + @Override + protected Map getIndicator() { + return INDICATORS; + } + + @Override + protected CobolProgramLayout getLayout() { + return layoutStore + .getCodeLayout() + .map(layout -> CodeLayoutUtil.mergeLayout(CobolLanguageId.HP_COBOL.getLayout(), layout)) + .orElse(CobolLanguageId.HP_COBOL.getLayout()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPCobolLineWriter.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPCobolLineWriter.java new file mode 100644 index 0000000000..85f1a82e81 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPCobolLineWriter.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.hp; + +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriter; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutUtil; + +/** + * {@link CobolLineWriter} for "hpcobol" + */ +class HPCobolLineWriter extends CobolLineWriter { + private final CodeLayoutStore layoutStore; + + HPCobolLineWriter(CodeLayoutStore layoutStore) { + this.layoutStore = layoutStore; + } + + @Override + protected CobolProgramLayout getLayout() { + return layoutStore + .getCodeLayout() + .map(layout -> CodeLayoutUtil.mergeLayout(CobolLanguageId.HP_COBOL.getLayout(), layout)) + .orElse(CobolLanguageId.HP_COBOL.getLayout()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPContinuationLineTransformation.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPContinuationLineTransformation.java new file mode 100644 index 0000000000..d2eb16818b --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HPContinuationLineTransformation.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.hp; + +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.ContinuationLineTransformation; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutUtil; + +/** + * {@link ContinuationLineTransformation} for "hpcobol" + */ +class HPContinuationLineTransformation extends ContinuationLineTransformation { + private final CodeLayoutStore layoutStore; + + HPContinuationLineTransformation( + MessageService messageService, CodeLayoutStore layoutStore) { + super(messageService); + this.layoutStore = layoutStore; + } + + @Override + public CobolProgramLayout getCodeLayout() { + return layoutStore + .getCodeLayout() + .map(layout -> CodeLayoutUtil.mergeLayout(CobolLanguageId.HP_COBOL.getLayout(), layout)) + .orElse(CobolLanguageId.HP_COBOL.getLayout()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCleanupStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCleanupStage.java new file mode 100644 index 0000000000..280d958346 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCleanupStage.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.hp; + +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; +import org.eclipse.lsp.cobol.common.ResultWithErrors; +import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; +import org.eclipse.lsp.cobol.common.mapping.ExtendedText; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.common.pipeline.Stage; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; + +/** + * Cleanup preprocessor pipeline stage + */ +class HpCleanupStage implements Stage { + + private final CleanerPreprocessor preprocessor; + + HpCleanupStage(CleanerPreprocessor preprocessor) { + this.preprocessor = preprocessor; + } + + @Override + public StageResult run(AnalysisContext context, StageResult prevStageResult) { + ResultWithErrors resultWithErrors = preprocessor.cleanUpCode( + context.getDocumentUri(), + context.getText()); + + context.getAccumulatedErrors().addAll(resultWithErrors.getErrors()); + context.setExtendedDocument(new ExtendedDocument(resultWithErrors.getResult(), context.getText())); + + return new StageResult<>(null); + } + + @Override + public String getName() { + return "Cleanup document processing"; + } + +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCobolLineIndicatorProcessor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCobolLineIndicatorProcessor.java new file mode 100644 index 0000000000..7ea9fbce13 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCobolLineIndicatorProcessor.java @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.hp; + +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.LineIndicatorProcessor; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutUtil; + +/** + * {@link LineIndicatorProcessor} for "hpcobol" languageId + */ +class HpCobolLineIndicatorProcessor extends LineIndicatorProcessor { + private final CodeLayoutStore layoutStore; + + HpCobolLineIndicatorProcessor(CodeLayoutStore layoutStore) { + this.layoutStore = layoutStore; + } + + @Override + protected CobolProgramLayout getLayout() { + return layoutStore + .getCodeLayout() + .map(layout -> CodeLayoutUtil.mergeLayout(CobolLanguageId.HP_COBOL.getLayout(), layout)) + .orElse(CobolLanguageId.HP_COBOL.getLayout()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCopybookProcessingStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCopybookProcessingStage.java new file mode 100644 index 0000000000..396b879850 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpCopybookProcessingStage.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.hp; + +import static org.eclipse.lsp.cobol.common.error.ErrorSeverity.ERROR; + +import com.google.common.collect.ImmutableList; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; +import java.util.Set; +import lombok.RequiredArgsConstructor; +import org.eclipse.lsp.cobol.common.copybook.CopybookModel; +import org.eclipse.lsp.cobol.common.copybook.CopybookName; +import org.eclipse.lsp.cobol.common.copybook.CopybookService; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.DialectOutcome; +import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.error.ErrorCodes; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; +import org.eclipse.lsp.cobol.common.mapping.ExtendedText; +import org.eclipse.lsp.cobol.common.mapping.MappedCharacter; +import org.eclipse.lsp.cobol.common.mapping.OriginalLocation; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.model.Locality; +import org.eclipse.lsp.cobol.common.model.tree.CopyNode; +import org.eclipse.lsp.cobol.common.pipeline.Stage; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp4j.Location; + +/** + * Resolving and inserting copybooks into the extended source stage + */ +@RequiredArgsConstructor +class HpCopybookProcessingStage implements Stage { + + private final MessageService messageService; + private final CopybookService copybookService; + + @Override + public StageResult run(AnalysisContext context, StageResult prevStageResult) { + List errors = new LinkedList<>(); + List cbs = CopybookParser.parseAndCleanup(context.getExtendedDocument()); + cbs.forEach( + cb -> { + List copybookNodes = + insertHpCopybook(context.getDocumentUri(), context.getExtendedDocument(), cb, errors); + context.getDialectNodes().addAll(copybookNodes); + }); + + DialectOutcome outcome = + new DialectOutcome( + Optional.ofNullable(context.getDialectNodes()).orElse(Collections.emptyList()), + DialectProcessingContext.builder() + .languageId(CobolLanguageId.HP_COBOL.getId()) + .config(context.getConfig()) + .programDocumentUri(context.getExtendedDocument().getUri()) + .extendedDocument(context.getExtendedDocument()) + .build()); + return new StageResult<>(outcome); + } + + @Override + public String getName() { + return "Copybook processing"; + } + + private List insertHpCopybook(String programUri, ExtendedDocument extendedDocument, CopybookDescriptor descriptor, List errors) { + CopybookName copybookName = new CopybookName(descriptor.getName()); + CopybookModel model = copybookService.resolve(copybookName.toCopybookId(extendedDocument.getUri()), + copybookName, programUri, + extendedDocument.getUri(), null) + .unwrap(errors::addAll); + + Location nameLocation = new Location(extendedDocument.getUri(), descriptor.getNameRange()); + if (model.getUri() == null) { + errors.add(SyntaxError.syntaxError() + .errorSource(ErrorSource.DIALECT) + .suggestion( + messageService.getMessage( + "GrammarPreprocessorListener.errorSuggestion", + copybookName.getQualifiedName())) + .severity(ERROR) + .errorCode(ErrorCodes.MISSING_COPYBOOK) + .location(new OriginalLocation(nameLocation, null)) + .build()); + return ImmutableList.of(); + } + + String text = model.getContent(); + ExtendedText copybook = new ExtendedText(text, model.getUri()); + Set unsupported = new HashSet<>(); + unsupported.add('?'); + copybook.perform( + (line) -> { + for (MappedCharacter character : line.getCharacters()) { + if (unsupported.contains(character.getCharacter())) { + character.setCharacter(' '); + } + } + } + ); + + extendedDocument.insertCopybook(descriptor.getStatementRange(), copybook); + + Locality statementLocality = Locality.builder() + .copybookId(copybookName.toCopybookId(programUri).toString()) + .range(descriptor.getStatementRange()) + .uri(extendedDocument.getUri()) + .build(); + + CopyNode copyNode = new CopyNode(statementLocality, nameLocation, descriptor.getName(), model.getUri()); + return ImmutableList.of(copyNode); + } + +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/TextPreprocessorImpl.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpTextPreprocessor.java similarity index 76% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/TextPreprocessorImpl.java rename to server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpTextPreprocessor.java index 19b6a8975d..157302b3a6 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/preprocessor/TextPreprocessorImpl.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpTextPreprocessor.java @@ -12,20 +12,21 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.preprocessor; +package org.eclipse.lsp.cobol.dialects.hp; -import com.google.inject.Inject; -import com.google.inject.Singleton; import lombok.extern.slf4j.Slf4j; import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.error.SyntaxError; import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; import org.eclipse.lsp.cobol.common.mapping.ExtendedText; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReader; import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineReWriter; import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.CobolLinesTransformation; import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriter; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import java.util.ArrayList; import java.util.List; @@ -36,23 +37,17 @@ * details. */ @Slf4j -@Singleton -public class TextPreprocessorImpl implements TextPreprocessor, CleanerPreprocessor { +class HpTextPreprocessor implements CleanerPreprocessor { private final CobolLineReader reader; private final CobolLineWriter writer; private final CobolLinesTransformation transformation; private final CobolLineReWriter indicatorProcessor; - @Inject - public TextPreprocessorImpl( - CobolLineReader reader, - CobolLineWriter writer, - CobolLinesTransformation transformation, - CobolLineReWriter indicatorProcessor) { - this.reader = reader; - this.writer = writer; - this.transformation = transformation; - this.indicatorProcessor = indicatorProcessor; + HpTextPreprocessor(MessageService messageService, CodeLayoutStore layoutStore) { + this.reader = new HPCobolLineReader(messageService, layoutStore); + this.writer = new HPCobolLineWriter(layoutStore); + this.transformation = new HPContinuationLineTransformation(messageService, layoutStore); + this.indicatorProcessor = new HpCobolLineIndicatorProcessor(layoutStore); } @Override diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpTrueCobolDialect.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpTrueCobolDialect.java new file mode 100644 index 0000000000..9621783357 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/hp/HpTrueCobolDialect.java @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.hp; + +import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; +import org.eclipse.lsp.cobol.common.SubroutineService; +import org.eclipse.lsp.cobol.common.copybook.CopybookService; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.pipeline.Pipeline; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; +import org.eclipse.lsp.cobol.core.engine.processor.AstProcessor; +import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessor; +import org.eclipse.lsp.cobol.dialects.TrueCobolDialect; +import org.eclipse.lsp.cobol.dialects.ibm.*; +import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; + +/** + * HP Cobol Dialect + */ +public class HpTrueCobolDialect implements TrueCobolDialect { + + private final CleanerPreprocessor preprocessor; + private final Pipeline pipeline; + + public HpTrueCobolDialect(GrammarPreprocessor grammarPreprocessor, + MessageService messageService, + ParseTreeListener treeListener, + SubroutineService subroutineService, + CachingConfigurationService cachingConfigurationService, + DialectService dialectService, + AstProcessor astProcessor, + SymbolsRepository symbolsRepository, + CodeLayoutStore codeLayoutStore, + CopybookService copybookService) { + preprocessor = new HpTextPreprocessor(messageService, codeLayoutStore); + + pipeline = new Pipeline<>(); + pipeline.add(new HpCleanupStage(preprocessor)); + pipeline.add(new DialectCompilerDirectiveStage(dialectService)); + pipeline.add(new CompilerDirectivesStage(messageService)); + pipeline.add(new HpCopybookProcessingStage(messageService, copybookService)); + pipeline.add(new PreprocessorStage(grammarPreprocessor, preprocessor)); + pipeline.add(new ImplicitDialectProcessingStage(dialectService)); + pipeline.add(new ParserStage(messageService, treeListener)); + pipeline.add( + new TransformTreeStage( + symbolsRepository, + messageService, + subroutineService, + cachingConfigurationService, + dialectService, + astProcessor, + codeLayoutStore)); + } + + @Override + public Pipeline getPipeline() { + return pipeline; + } + + @Override + public CleanerPreprocessor getPreprocessor() { + return preprocessor; + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/CompilerDirectivesStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/CompilerDirectivesStage.java similarity index 93% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/CompilerDirectivesStage.java rename to server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/CompilerDirectivesStage.java index 1902bfff7c..ec3406a3c5 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/CompilerDirectivesStage.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/CompilerDirectivesStage.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.engine.pipeline.stages; +package org.eclipse.lsp.cobol.dialects.ibm; import java.util.List; import java.util.regex.Matcher; @@ -27,8 +27,8 @@ import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; import org.eclipse.lsp.cobol.core.engine.directives.CompilerDirectivesErrorListener; import org.eclipse.lsp.cobol.core.engine.directives.CompilerDirectivesVisitor; -import org.eclipse.lsp.cobol.core.engine.pipeline.Stage; -import org.eclipse.lsp.cobol.core.engine.pipeline.StageResult; +import org.eclipse.lsp.cobol.common.pipeline.Stage; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; import org.eclipse.lsp.cobol.core.strategy.CobolErrorStrategy; import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; @@ -36,7 +36,7 @@ /** * Process compiler options statements in the source file and substitute them with empty lines. */ -public class CompilerDirectivesStage implements Stage> { +public class CompilerDirectivesStage implements Stage> { private static final Pattern COMPILER_DIRECTIVE_LINE = Pattern.compile("(?i)(\\d.{5}.*|\\s*+)\\*?(CBL|PROCESS)\\s+(?.+)"); private static final Pattern NEW_LINE_PATTERN = Pattern.compile("\n\r?"); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/DialectCompilerDirectiveStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/DialectCompilerDirectiveStage.java similarity index 88% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/DialectCompilerDirectiveStage.java rename to server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/DialectCompilerDirectiveStage.java index abaf7a9490..7ba21a5b9a 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/DialectCompilerDirectiveStage.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/DialectCompilerDirectiveStage.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.engine.pipeline.stages; +package org.eclipse.lsp.cobol.dialects.ibm; import java.util.ArrayList; import java.util.List; @@ -22,14 +22,14 @@ import org.eclipse.lsp.cobol.common.model.tree.CompilerDirectiveNode; import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; -import org.eclipse.lsp.cobol.core.engine.pipeline.Stage; -import org.eclipse.lsp.cobol.core.engine.pipeline.StageResult; +import org.eclipse.lsp.cobol.common.pipeline.Stage; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; /** * Stage to process dialect nodes */ @RequiredArgsConstructor -public class DialectCompilerDirectiveStage implements Stage, Void> { +public class DialectCompilerDirectiveStage implements Stage, Void> { private final DialectService dialectService; @Override diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/DialectProcessingStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/DialectProcessingStage.java similarity index 84% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/DialectProcessingStage.java rename to server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/DialectProcessingStage.java index 9dd06908af..83bd853e4c 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/DialectProcessingStage.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/DialectProcessingStage.java @@ -12,26 +12,28 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.engine.pipeline.stages; +package org.eclipse.lsp.cobol.dialects.ibm; import java.util.HashSet; import java.util.Set; import lombok.RequiredArgsConstructor; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.dialects.DialectOutcome; import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; import org.eclipse.lsp.cobol.common.error.SyntaxError; import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; -import org.eclipse.lsp.cobol.core.engine.pipeline.StageResult; -import org.eclipse.lsp.cobol.core.engine.pipeline.Stage; +import org.eclipse.lsp.cobol.common.pipeline.Stage; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; /** * Dialect Processing Stage */ @RequiredArgsConstructor -public class DialectProcessingStage implements Stage { +public class DialectProcessingStage implements Stage { private final DialectService dialectService; + private final CleanerPreprocessor preprocessor; @Override public StageResult run(AnalysisContext context, StageResult prevStageResult) { @@ -47,12 +49,13 @@ public String getName() { } private DialectOutcome processDialects(AnalysisContext ctx) { - dialectService.addDialectPredefinedCopybooks(ctx.getConfig()); + dialectService.addDialectPredefinedCopybooks(ctx.getConfig(), preprocessor); DialectProcessingContext dialectProcessingContext = DialectProcessingContext.builder() .config(ctx.getConfig()) .programDocumentUri(ctx.getExtendedDocument().getUri()) .extendedDocument(ctx.getExtendedDocument()) + .preprocessor(preprocessor) .build(); dialectProcessingContext.getExtendedDocument().commitTransformations(); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCleanupStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCleanupStage.java new file mode 100644 index 0000000000..5bc97876fb --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCleanupStage.java @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.ibm; + +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; +import org.eclipse.lsp.cobol.common.ResultWithErrors; +import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; +import org.eclipse.lsp.cobol.common.mapping.ExtendedText; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.common.pipeline.Stage; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; + +/** + * Cleanup preprocessor pipeline stage + */ +public class IbmCleanupStage implements Stage { + + private final CleanerPreprocessor preprocessor; + + public IbmCleanupStage(CleanerPreprocessor preprocessor) { + this.preprocessor = preprocessor; + } + + @Override + public StageResult run(AnalysisContext context, StageResult prevStageResult) { + ResultWithErrors resultWithErrors = preprocessor.cleanUpCode( + context.getDocumentUri(), + context.getText()); + + context.getAccumulatedErrors().addAll(resultWithErrors.getErrors()); + context.setExtendedDocument(new ExtendedDocument(resultWithErrors.getResult(), context.getText())); + + return new StageResult<>(null); + } + + @Override + public String getName() { + return "Cleanup document processing"; + } + +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolContinuationLineTransformation.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolContinuationLineTransformation.java new file mode 100644 index 0000000000..d75c1760dc --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolContinuationLineTransformation.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.ibm; + +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.ContinuationLineTransformation; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutUtil; + +/** {@link ContinuationLineTransformation} class for "cobol" languageId. */ +class IbmCobolContinuationLineTransformation extends ContinuationLineTransformation { + + IbmCobolContinuationLineTransformation( + MessageService messageService, CodeLayoutStore layoutStore) { + super(messageService); + this.layoutStore = layoutStore; + } + + private final CodeLayoutStore layoutStore; + + @Override + public CobolProgramLayout getCodeLayout() { + return layoutStore + .getCodeLayout() + .map(layout -> CodeLayoutUtil.mergeLayout(CobolLanguageId.COBOL.getLayout(), layout)) + .orElse(CobolLanguageId.COBOL.getLayout()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineIndicatorProcessor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineIndicatorProcessor.java new file mode 100644 index 0000000000..eaff0ae15b --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineIndicatorProcessor.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.ibm; + +import java.util.Optional; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.LineIndicatorProcessor; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutUtil; + +/** This class represents {@link LineIndicatorProcessor} for Cobol language */ +class IbmCobolLineIndicatorProcessor extends LineIndicatorProcessor { + private final CodeLayoutStore layoutStore; + + IbmCobolLineIndicatorProcessor(CodeLayoutStore layoutStore) { + this.layoutStore = layoutStore; + } + + @Override + protected CobolProgramLayout getLayout() { + return Optional.ofNullable(layoutStore) + .map( + store -> + store + .getCodeLayout() + .map( + layout -> + CodeLayoutUtil.mergeLayout(CobolLanguageId.COBOL.getLayout(), layout)) + .orElse(CobolLanguageId.COBOL.getLayout())) + .orElse(CobolLanguageId.COBOL.getLayout()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineReader.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineReader.java new file mode 100644 index 0000000000..6d21efdc46 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineReader.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2020 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.ibm; + +import static org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum.*; + +import com.google.common.collect.ImmutableMap; +import java.util.*; +import java.util.regex.Pattern; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.core.model.*; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReader; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutUtil; + +/** + * Preprocessor, which converts strings with COBOL code into a specific entity based on IBM cobol + * layout; analyzes and processes line indicators. This implementation checks if the lines match the + * given format and raises an error if not. It also puts the entire compiler directive text + * (excluding the sequence area if present) to prevent possible cutting off the line beginning. + */ +@Slf4j +class IbmCobolLineReader extends CobolLineReader { + private static final Pattern COMPILER_DIRECTIVE_LINE = + Pattern.compile("(?i)(.{0,6} +|\\s*+)(?(CBL|PROCESS) .+)"); + + private final CodeLayoutStore layoutStore; + + IbmCobolLineReader(MessageService messageService, CodeLayoutStore layoutStore) { + super(messageService); + this.layoutStore = layoutStore; + } + + private static final Map INDICATORS = + new ImmutableMap.Builder() + .put("*", COMMENT) + .put("/", COMMENT) + .put("d", DEBUG) + .put("D", DEBUG) + .put("-", CONTINUATION) + .put("$", COMPILER_DIRECTIVE) + .put(" ", NORMAL) + .put("", NORMAL) + .build(); + + @Override + protected Pattern getCompilerDirectives() { + return COMPILER_DIRECTIVE_LINE; + } + + @Override + protected Map getIndicator() { + return INDICATORS; + } + + @Override + protected CobolProgramLayout getLayout() { + return Optional.ofNullable(layoutStore) + .map( + store -> + store + .getCodeLayout() + .map(l -> CodeLayoutUtil.mergeLayout(CobolLanguageId.COBOL.getLayout(), l)) + .orElse(CobolLanguageId.COBOL.getLayout())) + .orElse(CobolLanguageId.COBOL.getLayout()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineWriter.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineWriter.java new file mode 100644 index 0000000000..0106736dbd --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmCobolLineWriter.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.ibm; + +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriter; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutUtil; + +/** + * {@link CobolLineWriter} for "cobol" languageId . This class serializes a list of COBOL lines into + * a String + */ +class IbmCobolLineWriter extends CobolLineWriter { + + private final CodeLayoutStore layoutStore; + + IbmCobolLineWriter(CodeLayoutStore layoutStore) { + this.layoutStore = layoutStore; + } + + @Override + protected CobolProgramLayout getLayout() { + return layoutStore + .getCodeLayout() + .map(layout -> CodeLayoutUtil.mergeLayout(CobolLanguageId.COBOL.getLayout(), layout)) + .orElse(CobolLanguageId.COBOL.getLayout()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmTextPreprocessor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmTextPreprocessor.java new file mode 100644 index 0000000000..a78147bbea --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmTextPreprocessor.java @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2020 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.ibm; + +import java.util.ArrayList; +import java.util.List; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; +import org.eclipse.lsp.cobol.common.ResultWithErrors; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; +import org.eclipse.lsp.cobol.common.mapping.ExtendedText; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReader; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineReWriter; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.CobolLinesTransformation; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriter; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; + +/** + * This class re-writes the content of the analyzing file to simplify the processing by the grammar, + * e.g. removes comments or cleans-up the comment and sequence areas. See the delegates for more + * details. + */ +@Slf4j +public class IbmTextPreprocessor implements CleanerPreprocessor { + private final CobolLineReader reader; + private final CobolLineWriter writer; + private final CobolLinesTransformation transformation; + private final CobolLineReWriter indicatorProcessor; + + public IbmTextPreprocessor(MessageService messageService, CodeLayoutStore layoutStore) { + this.reader = new IbmCobolLineReader(messageService, layoutStore); + this.writer = new IbmCobolLineWriter(layoutStore); + this.transformation = new IbmCobolContinuationLineTransformation(messageService, layoutStore); + this.indicatorProcessor = new IbmCobolLineIndicatorProcessor(layoutStore); + } + + @Override + public ResultWithErrors cleanUpCode(String documentUri, String cobolCode) { + List errors = new ArrayList<>(); + List lines = reader.processLines(documentUri, cobolCode).unwrap(errors::addAll); + List transformedLines = transformation.transformLines(documentUri, lines).unwrap(errors::addAll); + List rewrittenLines = indicatorProcessor.processLines(transformedLines); + + ExtendedDocument code = writer.serialize(rewrittenLines, documentUri); + return new ResultWithErrors<>(code.getCurrentText(), errors); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmTrueCobolDialect.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmTrueCobolDialect.java new file mode 100644 index 0000000000..08b48c86d3 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/IbmTrueCobolDialect.java @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.ibm; + +import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; +import org.eclipse.lsp.cobol.common.SubroutineService; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.pipeline.Pipeline; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; +import org.eclipse.lsp.cobol.core.engine.processor.AstProcessor; +import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessor; +import org.eclipse.lsp.cobol.dialects.TrueCobolDialect; +import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; + +/** + * HP Cobol Dialect + */ +public class IbmTrueCobolDialect implements TrueCobolDialect { + + private final CleanerPreprocessor preprocessor; + private final Pipeline pipeline; + + public IbmTrueCobolDialect(GrammarPreprocessor grammarPreprocessor, + MessageService messageService, + ParseTreeListener treeListener, + SubroutineService subroutineService, + CachingConfigurationService cachingConfigurationService, + DialectService dialectService, + AstProcessor astProcessor, + SymbolsRepository symbolsRepository, + CodeLayoutStore codeLayoutStore) { + preprocessor = new IbmTextPreprocessor(messageService, codeLayoutStore); + + pipeline = new Pipeline<>(); + pipeline.add(new IbmCleanupStage(preprocessor)); + pipeline.add(new DialectCompilerDirectiveStage(dialectService)); + pipeline.add(new CompilerDirectivesStage(messageService)); + pipeline.add(new DialectProcessingStage(dialectService, preprocessor)); + pipeline.add(new PreprocessorStage(grammarPreprocessor, preprocessor)); + pipeline.add(new ImplicitDialectProcessingStage(dialectService)); + pipeline.add(new ParserStage(messageService, treeListener)); + pipeline.add( + new TransformTreeStage( + symbolsRepository, + messageService, + subroutineService, + cachingConfigurationService, + dialectService, + astProcessor, + codeLayoutStore)); + } + + @Override + public Pipeline getPipeline() { + return pipeline; + } + + @Override + public CleanerPreprocessor getPreprocessor() { + return preprocessor; + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/ImplicitDialectProcessingStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/ImplicitDialectProcessingStage.java similarity index 95% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/ImplicitDialectProcessingStage.java rename to server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/ImplicitDialectProcessingStage.java index c2306e31fe..6554164405 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/ImplicitDialectProcessingStage.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/ImplicitDialectProcessingStage.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.engine.pipeline.stages; +package org.eclipse.lsp.cobol.dialects.ibm; import java.util.ArrayList; import java.util.HashSet; @@ -31,14 +31,14 @@ import org.eclipse.lsp.cobol.common.model.tree.Node; import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; -import org.eclipse.lsp.cobol.core.engine.pipeline.StageResult; -import org.eclipse.lsp.cobol.core.engine.pipeline.Stage; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; +import org.eclipse.lsp.cobol.common.pipeline.Stage; import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; import org.eclipse.lsp4j.Location; /** Implicit dialects processing stage */ @RequiredArgsConstructor -public class ImplicitDialectProcessingStage implements Stage { +public class ImplicitDialectProcessingStage implements Stage { private final DialectService dialectService; @Override diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/ParserStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/ParserStage.java similarity index 84% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/ParserStage.java rename to server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/ParserStage.java index e6f455e88a..f34d05a723 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/ParserStage.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/ParserStage.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.engine.pipeline.stages; +package org.eclipse.lsp.cobol.dialects.ibm; import com.google.common.collect.ImmutableList; import lombok.RequiredArgsConstructor; @@ -27,10 +27,12 @@ import org.eclipse.lsp.cobol.common.model.tree.Node; import org.eclipse.lsp.cobol.core.*; import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; -import org.eclipse.lsp.cobol.core.engine.pipeline.StageResult; -import org.eclipse.lsp.cobol.core.engine.pipeline.Stage; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; +import org.eclipse.lsp.cobol.common.pipeline.Stage; import org.eclipse.lsp.cobol.core.strategy.CobolErrorStrategy; import org.eclipse.lsp.cobol.core.visitor.ParserListener; +import org.eclipse.lsp.cobol.parser.AntlrCobolParser; +import org.eclipse.lsp.cobol.parser.AstBuilder; import org.eclipse.lsp4j.Location; import java.util.List; @@ -40,7 +42,7 @@ * Parser stage */ @RequiredArgsConstructor -public class ParserStage implements Stage { +public class ParserStage implements Stage { private final MessageService messageService; private final ParseTreeListener treeListener; @@ -54,10 +56,7 @@ public StageResult run(AnalysisContext context, StageResult { +public class PreprocessorStage implements Stage { private final GrammarPreprocessor grammarPreprocessor; + private final CleanerPreprocessor preprocessor; @Override public StageResult run(AnalysisContext context, StageResult prevStageResult) { @@ -67,9 +69,10 @@ private void applyDialectCopybooks(CopybooksRepository copybooksRepository, List private CopybooksRepository runPreprocessor(String programDocumentUri, AnalysisContext ctx) { List preprocessorErrors = new ArrayList<>(); ExtendedDocument extendedDocument = ctx.getExtendedDocument(); - CopybooksRepository copybooks = - grammarPreprocessor.preprocess(new PreprocessorContext(programDocumentUri, extendedDocument, - ctx.getConfig().getCopybookProcessingMode(), new CopybookHierarchy(), new CopybooksRepository())) + PreprocessorContext context = new PreprocessorContext(programDocumentUri, extendedDocument, + ctx.getConfig().getCopybookProcessingMode(), new CopybookHierarchy(), new CopybooksRepository()); + + CopybooksRepository copybooks = grammarPreprocessor.preprocess(context, preprocessor) .unwrap(preprocessorErrors::addAll); extendedDocument.commitTransformations(); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/ProcessingResult.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/ProcessingResult.java similarity index 92% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/ProcessingResult.java rename to server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/ProcessingResult.java index ad5e75f129..e87b0b624b 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/ProcessingResult.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/ProcessingResult.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.engine.pipeline.stages; +package org.eclipse.lsp.cobol.dialects.ibm; import lombok.Value; import org.eclipse.lsp.cobol.common.model.tree.Node; diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/TransformTreeStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/TransformTreeStage.java similarity index 86% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/TransformTreeStage.java rename to server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/TransformTreeStage.java index 04a8de05d1..483d142733 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/TransformTreeStage.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/TransformTreeStage.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.engine.pipeline.stages; +package org.eclipse.lsp.cobol.dialects.ibm; import java.util.ArrayList; import java.util.Arrays; @@ -35,8 +35,8 @@ import org.eclipse.lsp.cobol.core.CobolParser; import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; -import org.eclipse.lsp.cobol.core.engine.pipeline.Stage; -import org.eclipse.lsp.cobol.core.engine.pipeline.StageResult; +import org.eclipse.lsp.cobol.common.pipeline.Stage; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; import org.eclipse.lsp.cobol.core.engine.processor.AstProcessor; import org.eclipse.lsp.cobol.core.engine.processors.*; import org.eclipse.lsp.cobol.core.engine.processors.implicit.ImplicitVariablesProcessor; @@ -44,8 +44,11 @@ import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; import org.eclipse.lsp.cobol.core.visitor.CobolVisitor; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutUtil; import org.eclipse.lsp4j.Location; import org.eclipse.lsp4j.Range; @@ -53,15 +56,15 @@ * Transform Tree Stage */ @RequiredArgsConstructor -public class TransformTreeStage implements Stage { +public class TransformTreeStage implements Stage { - private final SymbolsRepository symbolsRepository; - private final MessageService messageService; - private final SubroutineService subroutineService; - private final CachingConfigurationService cachingConfigurationService; - private final DialectService dialectService; - private final AstProcessor astProcessor; - private final CodeLayoutStore codeLayoutStore; + protected final SymbolsRepository symbolsRepository; + protected final MessageService messageService; + protected final SubroutineService subroutineService; + protected final CachingConfigurationService cachingConfigurationService; + protected final DialectService dialectService; + protected final AstProcessor astProcessor; + protected final CodeLayoutStore layoutStore; @Override public StageResult run(AnalysisContext context, StageResult prevStageResult) { @@ -108,29 +111,20 @@ private void addCopyNodes(AnalysisContext context, Node rootNode) { } } - private List transformAST(AnalysisContext ctx, + protected List transformAST(AnalysisContext ctx, CopybooksRepository copybooksRepository, CommonTokenStream tokens, CobolParser.StartRuleContext tree) { + CobolProgramLayout cobolProgramLayout = layoutStore.getCodeLayout() + .map(lay -> CodeLayoutUtil.mergeLayout(ctx.getLanguageId().getLayout(), lay)) + .orElse(ctx.getLanguageId().getLayout()); CobolVisitor visitor = new CobolVisitor(copybooksRepository, tokens, ctx.getExtendedDocument(), - messageService, subroutineService, cachingConfigurationService, codeLayoutStore); + messageService, subroutineService, cachingConfigurationService, cobolProgramLayout); List syntaxTree = visitor.visit(tree); ctx.getAccumulatedErrors().addAll(visitor.getErrors()); return syntaxTree; } - private void addEmbeddedNodes(Node rootNode, List embeddedNodes) { - for (Node dialectNode : embeddedNodes) { - Optional nodeByPosition = - RangeUtils.findNodeByPosition( - rootNode, - dialectNode.getLocality().getUri(), - dialectNode.getLocality().getRange().getStart()); - - nodeByPosition.orElse(rootNode).addChild(dialectNode); - } - } - private Node processSyntaxTree(AnalysisConfig analysisConfig, SymbolAccumulatorService symbolAccumulatorService, AnalysisContext ctx, List syntaxTree) { Node rootNode = syntaxTree.get(0); addCopyNodes(ctx, rootNode); @@ -138,7 +132,7 @@ private Node processSyntaxTree(AnalysisConfig analysisConfig, SymbolAccumulatorS ProcessingContext processingContext = new ProcessingContext(new ArrayList<>(), symbolAccumulatorService, getCompilerDirectiveContext(analysisConfig), ctx.getConfig().getDialectsSettings()); - registerProcessors(analysisConfig, processingContext, symbolAccumulatorService); + registerProcessors(analysisConfig, processingContext, symbolAccumulatorService, ctx.getLanguageId()); ctx.getAccumulatedErrors().addAll(astProcessor.processSyntaxTree(processingContext, rootNode)); return rootNode; } @@ -159,7 +153,7 @@ private Optional getCompilerDirective(String compilerOp .findFirst(); } - private void registerProcessors(AnalysisConfig analysisConfig, ProcessingContext ctx, SymbolAccumulatorService symbolAccumulatorService) { + private void registerProcessors(AnalysisConfig analysisConfig, ProcessingContext ctx, SymbolAccumulatorService symbolAccumulatorService, CobolLanguageId languageId) { // Phase TRANSFORMATION ProcessingPhase t = ProcessingPhase.TRANSFORMATION; ctx.register(t, ProgramIdNode.class, new ProgramIdProcess()); @@ -192,7 +186,7 @@ private void registerProcessors(AnalysisConfig analysisConfig, ProcessingContext // Phase VALIDATION ProcessingPhase v = ProcessingPhase.VALIDATION; - ctx.register(v, VariableWithLevelNode.class, new VariableWithLevelCheck()); + ctx.register(v, VariableWithLevelNode.class, new VariableWithLevelCheck(CodeLayoutUtil.getProgramLayout(languageId, layoutStore))); ctx.register(v, StatementNode.class, new StatementValidate()); ctx.register(v, ElementaryNode.class, new ElementaryNodeCheck()); ctx.register(v, GroupItemNode.class, new GroupItemCheck()); @@ -203,6 +197,7 @@ private void registerProcessors(AnalysisConfig analysisConfig, ProcessingContext ctx.register(v, JsonGenerateNode.class, new JsonGenerateProcess(symbolAccumulatorService)); ctx.register(v, XMLParseNode.class, new XMLParseProcess(symbolAccumulatorService)); ctx.register(v, FileOperationStatementNode.class, new FileOperationProcess()); + ctx.register(v, XmlGenerateNode.class, new XmlGenerateProcess(symbolAccumulatorService)); // Implicit Dialects dialectService.getActiveImplicitDialects(analysisConfig) diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/EnterpriseCobol64.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/EnterpriseCobol64.java new file mode 100644 index 0000000000..9f75bf4da9 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/EnterpriseCobol64.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.ibm.experimental; + +import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; +import org.eclipse.lsp.cobol.common.SubroutineService; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.pipeline.Pipeline; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; +import org.eclipse.lsp.cobol.core.engine.processor.AstProcessor; +import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessor; +import org.eclipse.lsp.cobol.dialects.TrueCobolDialect; +import org.eclipse.lsp.cobol.dialects.ibm.*; +import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; + +/** + * HP Cobol Dialect + */ +public class EnterpriseCobol64 implements TrueCobolDialect { + + private final CleanerPreprocessor preprocessor; + private final Pipeline pipeline; + + public EnterpriseCobol64(GrammarPreprocessor grammarPreprocessor, + MessageService messageService, + ParseTreeListener treeListener, + SubroutineService subroutineService, + CachingConfigurationService cachingConfigurationService, + DialectService dialectService, + AstProcessor astProcessor, + SymbolsRepository symbolsRepository, + CodeLayoutStore codeLayoutStore) { + preprocessor = new IbmTextPreprocessor(messageService, codeLayoutStore); + + pipeline = new Pipeline<>(); + pipeline.add(new IbmCleanupStage(preprocessor)); + pipeline.add(new DialectCompilerDirectiveStage(dialectService)); + pipeline.add(new CompilerDirectivesStage(messageService)); + pipeline.add(new DialectProcessingStage(dialectService, preprocessor)); + pipeline.add(new PreprocessorStage(grammarPreprocessor, preprocessor)); + pipeline.add(new ImplicitDialectProcessingStage(dialectService)); + pipeline.add(new ExperimentalParserStage(messageService, treeListener)); + pipeline.add( + new TransformTreeStage( + symbolsRepository, + messageService, + subroutineService, + cachingConfigurationService, + dialectService, + astProcessor, + codeLayoutStore)); + } + + @Override + public Pipeline getPipeline() { + return pipeline; + } + + @Override + public CleanerPreprocessor getPreprocessor() { + return preprocessor; + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/ExperimentalParserStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/ExperimentalParserStage.java new file mode 100644 index 0000000000..938659235b --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/ExperimentalParserStage.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.ibm.experimental; + +import com.google.common.collect.ImmutableList; +import java.util.List; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.antlr.v4.runtime.CharStreams; +import org.antlr.v4.runtime.DefaultErrorStrategy; +import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.eclipse.lsp.cobol.common.dialects.DialectOutcome; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.common.mapping.OriginalLocation; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.model.tree.Node; +import org.eclipse.lsp.cobol.common.pipeline.Stage; +import org.eclipse.lsp.cobol.common.pipeline.StageResult; +import org.eclipse.lsp.cobol.core.*; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.core.strategy.BasicCobolErrorHandler; +import org.eclipse.lsp.cobol.core.visitor.ParserListener; +import org.eclipse.lsp.cobol.dialects.ibm.ParserStageResult; +import org.eclipse.lsp.cobol.parser.AstBuilder; +import org.eclipse.lsp.cobol.parser.SplitParser; +import org.eclipse.lsp4j.Location; + +/** + * Parser stage + */ +@RequiredArgsConstructor +class ExperimentalParserStage implements Stage { + private final MessageService messageService; + private final ParseTreeListener treeListener; + + @Override + public StageResult run(AnalysisContext context, StageResult prevStageResult) { + return context.getBenchmarkSession().measure("pipeline.parser", () -> { + // Run parser; + context.setDialectNodes(ImmutableList.builder() + .addAll(context.getDialectNodes()) + .addAll(prevStageResult.getData().getDialectNodes()) + .build()); + ParserListener listener = new ParserListener(context.getExtendedDocument(), context.getCopybooksRepository()); + DefaultErrorStrategy errorStrategy = new BasicCobolErrorHandler(messageService); + AstBuilder parser = new SplitParser(CharStreams.fromString(context.getExtendedDocument().toString()), + listener, errorStrategy, treeListener); + CobolParser.StartRuleContext tree = parser.runParser(); + context.getAccumulatedErrors().addAll(listener.getErrors()); + context.getAccumulatedErrors().addAll(getParsingError(context, parser)); + return new StageResult<>(new ParserStageResult(parser.getTokens(), tree)); + }); + } + + private List getParsingError(AnalysisContext context, AstBuilder parser) { + return parser.diagnostics().stream().map(diagnostic -> { + Location location = context.getExtendedDocument().mapLocation(diagnostic.getRange()); + String copybookId = context.getCopybooksRepository().getCopybookIdByUri(location.getUri()); + return SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(new OriginalLocation(location, copybookId)) + .suggestion(diagnostic.getMessage()) + .build(); + }).collect(Collectors.toList()); + } + + @Override + public String getName() { + return "Parsing stage (hw)"; + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/HwTransformTreeStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/HwTransformTreeStage.java new file mode 100644 index 0000000000..2a587d6b92 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/HwTransformTreeStage.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.ibm.experimental; + +import org.antlr.v4.runtime.CommonTokenStream; +import org.eclipse.lsp.cobol.common.SubroutineService; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.model.tree.*; +import org.eclipse.lsp.cobol.common.pipeline.Stage; +import org.eclipse.lsp.cobol.core.CobolParser; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; +import org.eclipse.lsp.cobol.core.engine.processor.AstProcessor; +import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; +import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; +import org.eclipse.lsp.cobol.dialects.ibm.experimental.visitors.HwCobolVisitor; +import org.eclipse.lsp.cobol.dialects.ibm.ParserStageResult; +import org.eclipse.lsp.cobol.dialects.ibm.ProcessingResult; +import org.eclipse.lsp.cobol.dialects.ibm.TransformTreeStage; +import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutUtil; + +import java.util.*; + +/** + * Transform Tree Stage + */ +public class HwTransformTreeStage extends TransformTreeStage implements Stage { + + public HwTransformTreeStage(SymbolsRepository symbolsRepository, MessageService messageService, SubroutineService subroutineService, CachingConfigurationService cachingConfigurationService, DialectService dialectService, AstProcessor astProcessor, CodeLayoutStore layoutStore) { + super(symbolsRepository, messageService, subroutineService, cachingConfigurationService, dialectService, astProcessor, layoutStore); + } + + @Override + protected List transformAST(AnalysisContext ctx, + CopybooksRepository copybooksRepository, CommonTokenStream tokens, + CobolParser.StartRuleContext tree) { + CobolProgramLayout cobolProgramLayout = layoutStore.getCodeLayout() + .map(lay -> CodeLayoutUtil.mergeLayout(ctx.getLanguageId().getLayout(), lay)) + .orElse(ctx.getLanguageId().getLayout()); + HwCobolVisitor visitor = + new HwCobolVisitor(copybooksRepository, tokens, ctx.getExtendedDocument(), + messageService, subroutineService, cachingConfigurationService, cobolProgramLayout); + List syntaxTree = visitor.visit(tree); + ctx.getAccumulatedErrors().addAll(visitor.getErrors()); + return syntaxTree; + } + +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolDataDivisionVisitor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/CobolDataDivisionVisitor.java similarity index 99% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolDataDivisionVisitor.java rename to server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/CobolDataDivisionVisitor.java index 1c3aa542bf..934fd4caba 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolDataDivisionVisitor.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/CobolDataDivisionVisitor.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.visitor; +package org.eclipse.lsp.cobol.dialects.ibm.experimental.visitors; import com.google.common.collect.ImmutableList; import lombok.Getter; @@ -39,6 +39,7 @@ import org.eclipse.lsp.cobol.core.CobolDataDivisionParserBaseVisitor; import org.eclipse.lsp.cobol.core.CobolParser; import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; +import org.eclipse.lsp.cobol.core.visitor.VisitorHelper; import org.eclipse.lsp4j.Location; import java.util.*; diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolIdentificationDivisionVisitor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/CobolIdentificationDivisionVisitor.java similarity index 98% rename from server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolIdentificationDivisionVisitor.java rename to server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/CobolIdentificationDivisionVisitor.java index f532b22e19..860e232be1 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/visitor/CobolIdentificationDivisionVisitor.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/CobolIdentificationDivisionVisitor.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.visitor; +package org.eclipse.lsp.cobol.dialects.ibm.experimental.visitors; import com.google.common.collect.ImmutableList; import lombok.Getter; diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/CobolProcedureDivisionVisitor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/CobolProcedureDivisionVisitor.java new file mode 100644 index 0000000000..11c0114c21 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/CobolProcedureDivisionVisitor.java @@ -0,0 +1,984 @@ +/* + * Copyright (c) 2020 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.dialects.ibm.experimental.visitors; + +import com.google.common.collect.ImmutableList; +import lombok.Getter; +import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; +import org.antlr.v4.runtime.CommonTokenStream; +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.RuleContext; +import org.antlr.v4.runtime.Token; +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.RuleNode; +import org.antlr.v4.runtime.tree.TerminalNode; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.eclipse.lsp.cobol.common.SubroutineService; +import org.eclipse.lsp.cobol.common.dialects.CobolDialect; +import org.eclipse.lsp.cobol.common.error.ErrorSeverity; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.model.*; +import org.eclipse.lsp.cobol.common.model.tree.*; +import org.eclipse.lsp.cobol.common.model.tree.statements.SetToBooleanStatement; +import org.eclipse.lsp.cobol.common.model.tree.statements.SetToOnOffStatement; +import org.eclipse.lsp.cobol.common.model.tree.statements.SetUpDownByStatement; +import org.eclipse.lsp.cobol.common.model.tree.variable.*; +import org.eclipse.lsp.cobol.common.model.variables.DivisionType; +import org.eclipse.lsp.cobol.common.utils.ImplicitCodeUtils; +import org.eclipse.lsp.cobol.common.utils.StringUtils; +import org.eclipse.lsp.cobol.core.*; +import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; +import org.eclipse.lsp.cobol.core.visitor.MisspelledKeywordDistance; +import org.eclipse.lsp.cobol.core.visitor.VisitorHelper; +import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp4j.Location; +import org.eclipse.lsp4j.Position; +import org.eclipse.lsp4j.Range; + +import java.util.*; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; + +import static java.util.Collections.emptyList; +import static java.util.Optional.ofNullable; +import static java.util.stream.Collectors.toList; +import static org.antlr.v4.runtime.Lexer.HIDDEN; +import static org.eclipse.lsp.cobol.common.VariableConstants.*; +import static org.eclipse.lsp.cobol.core.CobolProcedureDivisionParser.*; +import static org.eclipse.lsp.cobol.core.visitor.VisitorHelper.*; + +/** + * Visitor for Procedure Division ANTLR parser results + */ +@Slf4j +public class CobolProcedureDivisionVisitor extends CobolProcedureDivisionParserBaseVisitor> { + + @Getter + private final List errors = new ArrayList<>(); + private final CopybooksRepository copybooks; + private final CommonTokenStream tokenStream; + private final ExtendedDocument extendedDocument; + private final MessageService messageService; + private final SubroutineService subroutineService; + + private final Map subroutineDefinitionMap = new HashMap<>(); + private final CachingConfigurationService cachingConfigurationService; + private final CobolProgramLayout programLayout; + + public CobolProcedureDivisionVisitor( + @NonNull CopybooksRepository copybooks, + @NonNull CommonTokenStream tokenStream, + @NonNull ExtendedDocument extendedDocument, + MessageService messageService, + SubroutineService subroutineService, + CachingConfigurationService cachingConfigurationService, + CobolProgramLayout programLayout) { + + this.copybooks = copybooks; + this.tokenStream = tokenStream; + this.extendedDocument = extendedDocument; + this.messageService = messageService; + this.subroutineService = subroutineService; + this.cachingConfigurationService = cachingConfigurationService; + this.programLayout = programLayout; + } + + @Override + public List visitProcedureDivision(ProcedureDivisionContext ctx) { + areaAWarning(ctx.getStart()); + return addTreeNode( + ctx, location -> new DivisionNode(location, DivisionType.PROCEDURE_DIVISION)); + } + + @Override + public List visitProcedureSectionHeader(ProcedureSectionHeaderContext ctx) { + areaAWarning(ctx.getStart()); + return visitChildren(ctx); + } + + @Override + public List visitProcedureSection(ProcedureSectionContext ctx) { + throwWarning(ctx.getStart()); + + String name = ctx.getStart().getText().toUpperCase(); + return getLocality(ctx.getStart()) + .map( + def -> + addTreeNode( + ctx, + locality -> + new ProcedureSectionNode(locality, name, getIntervalText(ctx), def))) + .orElseGet(() -> visitChildren(ctx)); + } + + @Override + public List visitParagraph(ParagraphContext ctx) { + areaAWarning(ctx.getStart()); + + String name = ctx.paragraphDefinitionName().getText().toUpperCase(); + return getLocality(ctx.getStart()) + .map( + def -> + addTreeNode( + ctx, locality -> new ParagraphNode(locality, name, getIntervalText(ctx), def))) + .orElseGet(() -> visitChildren(ctx)); + } + + @Override + public List visitXmlParseStatement(XmlParseStatementContext ctx) { + VariableNameAndLocality identifier1 = new VariableNameAndLocality( + ctx.qualifiedDataName().getText(), retrieveLocality(ctx.qualifiedDataName()).orElse(null)); + + VariableNameAndLocality xmlValidatingContext = ofNullable(ctx.xmlValidating()) + .map(c -> new VariableNameAndLocality(c.getText(), retrieveLocality(c).orElse(null))) + .orElse(null); + + VariableNameAndLocality xmlNationalContext = ofNullable(ctx.xmlNational()) + .map(c -> new VariableNameAndLocality(c.getText(), retrieveLocality(c).orElse(null))) + .orElse(null); + + VariableNameAndLocality identifier2 = ofNullable(ctx.xmlValidating()) + .map(XmlValidatingContext::qualifiedDataName) + .map(qualCtx -> new VariableNameAndLocality(qualCtx.getText(), + retrieveLocality(qualCtx).orElse(null))) + .orElse(null); + + VariableNameAndLocality encodingLocality = ofNullable(ctx.xmlEncoding()).map(ctx2 -> + new VariableNameAndLocality(ctx2.integerLiteral().getText(), retrieveLocality(ctx2).orElse(null))) + .orElse(null); + + ProcedureName procName = parseProcedureName(Optional.ofNullable(ctx.xmlProcessinProcedure()) + .map(XmlProcessinProcedureContext::procedureName) + .orElse(null)); + + ProcedureName thru = parseProcedureName(Optional.ofNullable(ctx.through()) + .map(ThroughContext::procedureName) + .orElse(null)); + + return addTreeNode( + ctx, + locality -> + new XMLParseNode( + locality, + identifier1, + identifier2, + encodingLocality, + xmlValidatingContext, + xmlNationalContext, + procName, + thru) + ); + } + + @Override + public List visitOnExceptionClause(OnExceptionClauseContext ctx) { + return addTreeNode(ctx, OnExceptionNode::new); + } + + @Override + public List visitNotOnExceptionClause(NotOnExceptionClauseContext ctx) { + return addTreeNode(ctx, OnNotExceptionNode::new); + } + + @Override + public List visitUseStatement(UseStatementContext ctx) { + return ctx.useDebugClause() != null + ? + addTreeNode(ctx, l -> new UseForDebuggingNode(l, null)) + : + addTreeNode(ctx, UseNode::new); + } + + /** + * In this method, first condition is checking if there is any other element present on the same + * line as DECLARATIVES token and throws an error if the condition is true; In the PROCEDURE + * DIVISION, each of the keywords DECLARATIVES and END DECLARATIVES must begin in Area A and be + * followed immediately by a separator period; no other text can appear on the same line. After + * the keywords END DECLARATIVES, no text can appear before the following section header. + */ + @Override + public List visitProcedureDeclaratives(ProcedureDeclarativesContext ctx) { + Token firstDeclarative = ctx.getStart(); + int firstDeclLine = firstDeclarative.getLine(); + + if (!ctx.procedureDeclarative().isEmpty()) { + Token declarativeBody = ctx.procedureDeclarative(0).getStart(); + if (firstDeclLine == declarativeBody.getLine()) { + getLocality(declarativeBody) + .ifPresent( + locality -> + throwException( + declarativeBody.getText(), + locality, + messageService.getMessage("CobolVisitor.declarativeSameMsg"))); + } + } + + areaAWarning(firstDeclarative); + + ofNullable(ctx.END()).map(TerminalNode::getSymbol).ifPresent(this::areaAWarning); + return visitChildren(ctx); + } + + @Override + public List visitProcedureDeclarative(ProcedureDeclarativeContext ctx) { + String name = ctx.getStart().getText().toUpperCase(); + return getLocality(ctx.getStart()) + .map( + def -> + addTreeNode( + ctx, + locality -> + new DeclarativeProcedureSectionNode( + locality, name, getIntervalText(ctx), def))) + .orElseGet(() -> visitChildren(ctx)); + } + + @Override + public List visitJsonParse(JsonParseContext ctx) { + VariableNameAndLocality identifier1 = new VariableNameAndLocality( + ctx.jsonIdentifier1().getText(), retrieveLocality(ctx.jsonIdentifier1()).orElse(null)); + + VariableNameAndLocality identifier2 = new VariableNameAndLocality( + ctx.jsonIdentifier2().getText(), retrieveLocality(ctx.jsonIdentifier2()).orElse(null)); + + List identifier3 = ctx.jsonIdentifier3().isEmpty() + ? null + : ctx.jsonIdentifier3().stream() + .map(iden3 -> new VariableNameAndLocality(iden3.getText(), retrieveLocality(iden3).orElse(null))) + .collect(Collectors.toList()); + + List identifier4 = ctx.jsonIdentifier4().isEmpty() + ? null + : ctx.jsonIdentifier4().stream() + .map(iden4 -> new VariableNameAndLocality(iden4.getText(), retrieveLocality(iden4).orElse(null))) + .collect(Collectors.toList()); + + List identifier5 = + ctx.json_parse_phrase1().isEmpty() + ? null + : ctx.json_parse_phrase1().stream() + .map(Json_parse_phrase1Context::jsonIdentifier5) + .filter(Objects::nonNull) + .map(idctx -> new VariableNameAndLocality(idctx.getText(), retrieveLocality(idctx).orElse(null))) + .collect(Collectors.toList()); + + List conditionName = + ctx.json_parse_phrase1().isEmpty() + ? null + : ctx.json_parse_phrase1().get(0).callUsingPhrase1().isEmpty() + ? null + : ctx.json_parse_phrase1().get(0).callUsingPhrase1().jsonConditionName().stream() + .map( + context -> + new VariableNameAndLocality( + context.getText(), retrieveLocality(context).orElse(null))) + .collect(toList()); + + boolean isOmitted = Objects.nonNull(ctx.OMITTED()) && !ctx.OMITTED().isEmpty(); + + return addTreeNode( + ctx, + locality -> + new JsonParseNode( + locality, + identifier1, + identifier2, + identifier3, + identifier4, + identifier5, + conditionName, + isOmitted)); + } + + @Override + public List visitJsonGenerate(JsonGenerateContext ctx) { + VariableNameAndLocality identifier1 = new VariableNameAndLocality( + ctx.jsonGenIdentifier1().getText(), retrieveLocality(ctx.jsonGenIdentifier1()).orElse(null)); + + VariableNameAndLocality identifier2 = new VariableNameAndLocality( + ctx.jsonGenIdentifier2().getText(), retrieveLocality(ctx.jsonGenIdentifier2()).orElse(null)); + + VariableNameAndLocality identifier3 = Optional.ofNullable(ctx.jsonGenIdentifier3()) + .map(iden3 -> new VariableNameAndLocality(iden3.getText(), retrieveLocality(iden3).orElse(null))) + .orElse(null); + + List identifier4 = ctx.jsonGenIdentifier4().isEmpty() + ? null + : ctx.jsonGenIdentifier4().stream() + .map(iden4 -> new VariableNameAndLocality(iden4.getText(), retrieveLocality(iden4).orElse(null))) + .collect(Collectors.toList()); + + List identifier5 = ctx.jsonGenIdentifier5().isEmpty() + ? null + : ctx.jsonGenIdentifier5().stream() + .map(iden5 -> new VariableNameAndLocality(iden5.getText(), retrieveLocality(iden5).orElse(null))) + .collect(Collectors.toList()); + + List phases = ctx.json_gen_phrase1().isEmpty() + ? null + : ctx.json_gen_phrase1().stream() + .filter(idctx -> Objects.nonNull(idctx.jsonGenIdentifier6())) + .map(idctx -> new JsonGenerateNode.JsonGenPhase( + new VariableNameAndLocality(idctx.jsonGenIdentifier6().getText(), + retrieveLocality(idctx.jsonGenIdentifier6()).orElse(null)), + Objects.nonNull(idctx.jsonGenConditionName()) ? new VariableNameAndLocality(idctx.jsonGenConditionName().getText(), + retrieveLocality(idctx.jsonGenConditionName()).orElse(null)) : null + )) + .collect(Collectors.toList()); + + return addTreeNode( + ctx, + locality -> + new JsonGenerateNode( + locality, + identifier1, + identifier2, + identifier3, + identifier4, + identifier5, + phases)); + } + + @Override + public List visitSectionName(SectionNameContext ctx) { + return addTreeNode( + ctx, locality -> new SectionNameNode(locality, ctx.getText())); + } + + @Override + public List visitStatement(StatementContext ctx) { + areaBWarning(ctx); + throwWarning(ctx.getStart()); + return visitChildren(ctx); + } + + @Override + public List visitIfThen(IfThenContext ctx) { + throwWarning(ctx.getStart()); + return visitChildren(ctx); + } + + @Override + public List visitIfElse(IfElseContext ctx) { + throwWarning(ctx.getStart()); + return addTreeNode(ctx, IfElseNode::new); + } + + @Override + public List visitOpenInputStatement(OpenInputStatementContext ctx) { + List nodes = new ArrayList<>(); + for (OpenInputContext openInputContext : ctx.openInput()) { + VariableNameAndLocality fileNameLocality = + new VariableNameAndLocality(openInputContext.fileName().getText().toUpperCase(), + retrieveLocality(openInputContext.fileName()).orElse(null)); + nodes.addAll(addTreeNode(ctx, locality -> new OpenStatementNode(locality, fileNameLocality, FileOperationKind.INPUT))); + } + return nodes; + } + + @Override + public List visitOpenOutputStatement(OpenOutputStatementContext ctx) { + List nodes = new ArrayList<>(); + for (OpenOutputContext openOutputContext : ctx.openOutput()) { + VariableNameAndLocality fileNameLocality = + new VariableNameAndLocality(openOutputContext.fileName().getText().toUpperCase(), + retrieveLocality(openOutputContext.fileName()).orElse(null)); + nodes.addAll(addTreeNode(openOutputContext, + locality -> new OpenStatementNode(locality, fileNameLocality, FileOperationKind.OUTPUT))); + } + return nodes; + } + + @Override + public List visitOpenIOStatement(OpenIOStatementContext ctx) { + List nodes = new ArrayList<>(); + for (FileNameContext fileNameContext : ctx.fileName()) { + VariableNameAndLocality fileNameLocality = + new VariableNameAndLocality(fileNameContext.getText().toUpperCase(), + retrieveLocality(fileNameContext).orElse(null)); + nodes.addAll(addTreeNode(ctx, + locality -> new OpenStatementNode(locality, fileNameLocality, FileOperationKind.I_O))); + } + return nodes; + } + + @Override + public List visitOpenExtendStatement(OpenExtendStatementContext ctx) { + List nodes = new ArrayList<>(); + for (FileNameContext fileNameContext : ctx.fileName()) { + VariableNameAndLocality fileNameLocality = + new VariableNameAndLocality(fileNameContext.getText().toUpperCase(), + retrieveLocality(fileNameContext).orElse(null)); + nodes.addAll(addTreeNode(ctx, + locality -> new OpenStatementNode(locality, fileNameLocality, FileOperationKind.EXTEND))); + } + return nodes; + } + + @Override + public List visitReadStatement(ReadStatementContext ctx) { + VariableNameAndLocality fileNameLocality = + new VariableNameAndLocality(ctx.readFilenameClause().fileName().getText().toUpperCase(), + retrieveLocality(ctx.readFilenameClause().fileName()).orElse(null)); + return addTreeNode(ctx, locality -> new FileOperationStatementNode(locality, fileNameLocality, NodeType.READ_STATEMENT)); + } + + @Override + public List visitWriteStatement(WriteStatementContext ctx) { + VariableNameAndLocality fileNameLocality = + new VariableNameAndLocality(ctx.writeStatementClause().recordName().getText().toUpperCase(), + retrieveLocality(ctx.writeStatementClause().recordName()).orElse(null)); + return addTreeNode(ctx, locality -> new FileOperationStatementNode(locality, fileNameLocality, NodeType.WRITE_STATEMENT)); + } + + @Override + public List visitRewriteStatement(RewriteStatementContext ctx) { + VariableNameAndLocality fileNameLocality = + new VariableNameAndLocality(ctx.recordName().getText().toUpperCase(), + retrieveLocality(ctx.recordName()).orElse(null)); + return addTreeNode(ctx, locality -> new FileOperationStatementNode(locality, fileNameLocality, NodeType.REWRITE_STATEMENT)); + } + + @Override + public List visitDeleteStatement(DeleteStatementContext ctx) { + VariableNameAndLocality fileNameLocality = + new VariableNameAndLocality(ctx.deleteFilenameClause().fileName().getText().toUpperCase(), + retrieveLocality(ctx.deleteFilenameClause().fileName()).orElseGet(null)); + return addTreeNode(ctx, locality -> new FileOperationStatementNode(locality, fileNameLocality, NodeType.DELETE_STATEMENT)); + } + + @Override + public List visitStartStatement(StartStatementContext ctx) { + VariableNameAndLocality fileNameLocality = + new VariableNameAndLocality(ctx.fileName().getText().toUpperCase(), + retrieveLocality(ctx.fileName()).orElse(null)); + return addTreeNode(ctx, locality -> new FileOperationStatementNode(locality, fileNameLocality, NodeType.START_STATEMENT)); + } + + @Override + public List visitPerformInlineStatement(PerformInlineStatementContext ctx) { + return addTreeNode(ctx, PerformNode::new); + } + + @Override + public List visitPerformProcedureStatement(PerformProcedureStatementContext ctx) { + final ProcedureName targetName = parseProcedureName(ctx.procedureName()); + final ProcedureName thruName = parseProcedureName(Optional.ofNullable(ctx.through()) + .map(ThroughContext::procedureName) + .orElse(null)); + return addTreeNode(ctx, locality -> new PerformNode(locality, targetName, thruName)); + } + + @Override + public List visitSentence(SentenceContext ctx) { + throwWarning(ctx.getStart()); + return addTreeNode(ctx, SentenceNode::new); + } + + @Override + public List visitEvaluateWhenOther(EvaluateWhenOtherContext ctx) { + throwWarning(ctx.getStart()); + return addTreeNode(ctx, EvaluateWhenOtherNode::new); + } + + @Override + public List visitParagraphName(ParagraphNameContext ctx) { + return addTreeNode( + ctx, locality -> new CodeBlockUsageNode(locality, VisitorHelper.getName(ctx))); + } + + @Override + public List visitSetUpDownByStatement(SetUpDownByStatementContext ctx) { + List receivingField = + ctx.receivingField().stream().map(this::visit).flatMap(List::stream).collect(toList()); + List sendingField = + ofNullable(ctx.sendingField()).map(this::visit).orElseGet(ImmutableList::of); + List children = new ArrayList<>(); + children.addAll(receivingField); + children.addAll(sendingField); + if (sendingField.size() != 1) return children; + SetUpDownByStatement statement = + new SetUpDownByStatement( + retrieveLocality(ctx).orElse(null), + receivingField, + sendingField.get(0)); + return addTreeNode(statement, children); + } + + @Override + public List visitSetToOnOff(SetToOnOffContext ctx) { + List receivingField = + ctx.receivingField().stream().map(this::visit).flatMap(List::stream).collect(toList()); + SetToOnOffStatement statement = + new SetToOnOffStatement(retrieveLocality(ctx).orElse(null), receivingField); + return addTreeNode(statement, receivingField); + } + + @Override + public List visitSetToBoolean(SetToBooleanContext ctx) { + List receivingField = + ctx.receivingField().stream().map(this::visit).flatMap(List::stream).collect(toList()); + SetToBooleanStatement statement = + new SetToBooleanStatement( + retrieveLocality(ctx).orElse(null), receivingField); + return addTreeNode(statement, receivingField); + } + + @Override + public List visitLiteral(LiteralContext ctx) { + return addTreeNode(ctx, locality -> new LiteralNode(locality, ctx.getText())); + } + + @Override + public List visitQualifiedDataName(QualifiedDataNameContext ctx) { + return addTreeNode(ctx, QualifiedReferenceNode::new); + } + + @Override + public List visitVariableUsageName(VariableUsageNameContext ctx) { + return addTreeNode(ctx, locality -> new VariableUsageNode(getName(ctx), locality, isVariableDefinitionMandatory(ctx))); + } + + private boolean isVariableDefinitionMandatory(VariableUsageNameContext ctx) { + Boolean isDataRecordClause = ofNullable(ctx.getParent()) + .map(ParserRuleContext::getParent) + .map(CobolDataDivisionParser.DataRecordsClauseContext.class::isInstance) + .orElse(false); + return !isDataRecordClause; + } + + @Override + public List visitFileName(FileNameContext ctx) { + return addTreeNode( + ctx, + locality -> { + QualifiedReferenceNode reference = new QualifiedReferenceNode(locality); + VariableUsageNode usage = new VariableUsageNode(getName(ctx), locality); + reference.addChild(usage); + return reference; + }); + } + + @Override + public List visitCallStatement(CallStatementContext ctx) { + return addTreeNode(ctx, SubroutineNode::new); + } + + @Override + public List visitGoToStatement(GoToStatementContext ctx) { + return addTreeNode( + ctx, + locality -> + new GoToNode( + locality, + ctx.procedureName().stream() + .map(ProcedureNameContext::paragraphName) + .map(ParserRuleContext::getText) + .collect(toList()))); + } + + @Override + public List visitExitStatement(ExitStatementContext ctx) { + if (ctx.PROGRAM() != null) { + return addTreeNode(ctx, StopNode::new); + } + if (ctx.SECTION() != null) { + return addTreeNode(ctx, ExitSectionNode::new); + } + if (ctx.PARAGRAPH() != null) { + return addTreeNode(ctx, ExitParagraphNode::new); + } + return addTreeNode(ctx, ExitNode::new); + } + + @Override + public List visitGobackStatement(GobackStatementContext ctx) { + return addTreeNode(ctx, GoBackNode::new); + } + + @Override + public List visitStopStatement(StopStatementContext ctx) { + return addTreeNode(ctx, StopNode::new); + } + + @Override + public List visitEvaluateStatement(EvaluateStatementContext ctx) { + return addTreeNode(ctx, EvaluateNode::new); + } + + @Override + public List visitEvaluateWhen(EvaluateWhenContext ctx) { + return addTreeNode(ctx, EvaluateWhenNode::new); + } + + @Override + public List visitIfStatement(IfStatementContext ctx) { + return addTreeNode(ctx, IfNode::new); + } + + @Override + public List visitParagraphs(ParagraphsContext ctx) { + return addTreeNode(ctx, ParagraphsNode::new); + } + + @Override + public List visitProcedureDivisionBody(ProcedureDivisionBodyContext ctx) { + return addTreeNode(ctx, ProcedureDivisionBodyNode::new); + } + + @Override + public List visitParagraphDefinitionName(ParagraphDefinitionNameContext ctx) { + return addTreeNode(ctx, locality -> new ParagraphNameNode(locality, ctx.getText())); + } + + @Override + public List visitConstantName(ConstantNameContext ctx) { + String subroutineName = StringUtils.trimQuotes(ctx.getText()).toUpperCase(); + return getLocality(ctx.getStart()) + .map( + locality -> { + if (cachingConfigurationService.getSubroutineDirectories().size() > 0 + && !subroutineService.getUri(subroutineName).isPresent()) { + reportSubroutineNotDefined(subroutineName, locality); + } + subroutineDefinitionMap.putIfAbsent( + subroutineName, + new SubroutineDefinition( + getSubroutineLocation( + new ImmutablePair<>( + subroutineName, subroutineService.getUri(subroutineName))) + .stream() + .findFirst() + .orElseGet( + () -> + new Location( + ImplicitCodeUtils.createSubroutineLocation(), new Range())), + subroutineName)); + SubroutineNameNode usage = new SubroutineNameNode(locality, subroutineName); + SubroutineDefinition foundDefinition = subroutineDefinitionMap.get(subroutineName); + foundDefinition.addUsages(usage); + usage.setDefinition(foundDefinition); + return ImmutableList.of((Node) usage); + }) + .orElseGet(ImmutableList::of); + } + + @Override + public List visitChildren(RuleNode node) { + checkInterruption(); + return super.visitChildren(node); + } + + @Override + protected List defaultResult() { + return ImmutableList.of(); + } + + @Override + protected List aggregateResult(List aggregate, List nextResult) { + List result = new ArrayList<>(aggregate.size() + nextResult.size()); + result.addAll(aggregate); + result.addAll(nextResult); + return result; + } + + /** + * {@inheritDoc} + * + *

The default implementation returns the result of calling + * {@link #visitChildren} on {@code ctx}.

+ * + * @param ctx + */ + @Override + public List visitAtEndPhrase(AtEndPhraseContext ctx) { + return addTreeNode(ctx, AtEndNode::new); + } + + @Override + public List visitSortStatement(SortStatementContext ctx) { + boolean ascending; + String key; + if (ctx.sortOnKeyClause() != null) { + ascending = ctx.sortOnKeyClause().stream() + .map(s -> s.ASCENDING() != null) + .filter(b -> b) + .findAny() + .orElse(false); + + key = ctx.sortOnKeyClause().stream() + .map(SortOnKeyClauseContext::KEY) + .filter(Objects::nonNull) + .map(ParseTree::getText) + .findFirst() + .orElse(""); + } else { + ascending = false; + key = ""; + } + + return addTreeNode(ctx, locality -> new SortNode(locality, ascending, key)); + } + + @Override + public List visitMergeStatement(MergeStatementContext ctx) { + boolean ascending; + String key; + if (ctx.mergeOnKeyClause() != null) { + ascending = ctx.mergeOnKeyClause().stream() + .map(s -> s.ASCENDING() != null) + .filter(b -> b) + .findAny() + .orElse(false); + + key = ctx.mergeOnKeyClause().stream() + .map(MergeOnKeyClauseContext::KEY) + .filter(Objects::nonNull) + .map(ParseTree::getText) + .findFirst() + .orElse(""); + } else { + ascending = false; + key = ""; + } + + return addTreeNode(ctx, locality -> new MergeNode(locality, ascending, key)); + } + + @Override + public List visitInputProcedurePhrase(InputProcedurePhraseContext ctx) { + final ProcedureName procName = parseProcedureName(ctx.procedureName()); + final ProcedureName thru = parseProcedureName(Optional.ofNullable(ctx.through()) + .map(ThroughContext::procedureName) + .orElse(null)); + + Locality locality = retrieveLocality(ctx).orElse(null); + InputNode node = new InputNode(locality); + node.setTarget(procName); + node.setThru(thru); + + visitChildren(ctx).forEach(node::addChild); + return ImmutableList.of(node); + } + + @Override + public List visitOutputProcedurePhrase(OutputProcedurePhraseContext ctx) { + final ProcedureName procName = parseProcedureName(ctx.procedureName()); + final ProcedureName thru = parseProcedureName(Optional.ofNullable(ctx.through()) + .map(ThroughContext::procedureName) + .orElse(null)); + + Locality locality = retrieveLocality(ctx).orElse(null); + OutputNode node = new OutputNode(locality); + node.setTarget(procName); + node.setThru(thru); + + visitChildren(ctx).forEach(node::addChild); + return ImmutableList.of(node); + } + + @Override public List visitAlterStatement(AlterStatementContext ctx) { + if (ctx.alterProceedTo() != null && ctx.alterProceedTo().size() > 0) { + AlterProceedToContext alter = ctx.alterProceedTo().get(0); + if (alter.procedureName() != null && alter.procedureName().size() == 2) { + ProcedureNameContext from = alter.procedureName(0); + ProcedureNameContext to = alter.procedureName(1); + + String name = Optional.ofNullable(from.paragraphName()).map(RuleContext::getText).orElse(null); + String inSection = Optional.ofNullable(from.inSection()) + .map(InSectionContext::sectionName) + .map(RuleContext::getText).orElse(null); + ProcedureName alterFrom = new ProcedureName(name, inSection); + + name = Optional.ofNullable(to.paragraphName()).map(RuleContext::getText).orElse(null); + inSection = Optional.ofNullable(to.inSection()) + .map(InSectionContext::sectionName) + .map(RuleContext::getText).orElse(null); + ProcedureName alterTo = new ProcedureName(name, inSection); + + Locality locality = retrieveLocality(ctx).orElse(null); + AlterNode node = new AlterNode(locality, alterFrom, alterTo); + visitChildren(ctx).forEach(node::addChild); + + return ImmutableList.of(node); + } + } + return visitChildren(ctx); + } + + private ProcedureName parseProcedureName(ProcedureNameContext procedureNameContext) { + if (procedureNameContext == null) { + return null; + } + final String sectionName = + procedureNameContext.inSection() != null + ? procedureNameContext.inSection().sectionName().getText() + : null; + final String targetName = procedureNameContext.paragraphName().getText(); + return new ProcedureName(targetName, sectionName); + } + + private void throwException(String wrongToken, @NonNull Locality locality, String message) { + SyntaxError error = + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .location(locality.toOriginalLocation()) + .suggestion(message + wrongToken) + .severity(ErrorSeverity.WARNING) + .build(); + + LOG.debug("Syntax error by CobolVisitor#throwException: {}", error); + if (!errors.contains(error) && !wrongToken.equals(CobolDialect.FILLER)) { + errors.add(error); + } + } + + private Optional getLocality(Token childToken) { + Location location = extendedDocument.mapLocation(buildTokenRange(childToken)); + return ofNullable(locationToLocality(location)); + } + + private void reportSubroutineNotDefined(String name, Locality locality) { + SyntaxError error = + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .suggestion(messageService.getMessage("CobolVisitor.subroutineNotFound", name)) + .severity(ErrorSeverity.INFO) + .location(getIntervalPosition(locality, locality).toOriginalLocation()) + .build(); + LOG.debug("Syntax error by CobolVisitor#reportSubroutineNotDefined: {}", error); + errors.add(error); + } + + protected void throwWarning(Token token) { + String tokenText = token.getText().toUpperCase(); + if (MisspelledKeywordDistance.KEYWORDS.getSuggestions().contains(tokenText)) return; + MisspelledKeywordDistance.calculateDistance(tokenText) + .ifPresent( + correctWord -> + getLocality(token) + .ifPresent(locality -> reportMisspelledKeyword(correctWord, locality))); + } + + private void reportMisspelledKeyword(String suggestion, Locality locality) { + if (locality == null) return; + SyntaxError error = + SyntaxError.syntaxError() + .errorSource(ErrorSource.PARSING) + .suggestion(messageService.getMessage("CobolVisitor.misspelledWord", suggestion)) + .severity(ErrorSeverity.WARNING) + .location(locality.toOriginalLocation()) + .build(); + LOG.debug("Syntax error by CobolVisitor#reportMisspelledKeyword: {}", error); + errors.add(error); + } + + private void areaAWarning(Token token) { + // skip area A check for cics and sql block + if (token.getText().startsWith("EXEC")) { + return; + } + getLocality(token) + .filter(it -> it.getRange().getStart().getCharacter() > AREA_A_FINISH) + .ifPresent( + it -> + throwException( + token.getText(), + it, + messageService.getMessage("CobolVisitor.AreaAWarningMsg"))); + } + + private void areaBWarning(ParserRuleContext ctx) { + List tokens = ctx.getStart() != ctx.getStop() ? findTokens(ctx.getStart(), ctx.getStop()) : ImmutableList.of(ctx.getStart()); + tokens.forEach(token -> getLocality(token).filter(startsInAreaA(token)) + .ifPresent(locality -> throwException(token.getText(), locality, messageService.getMessage("CobolVisitor.AreaBWarningMsg")))); + } + + private List findTokens(Token startToken, Token stopToken) { + List result = new ArrayList<>(); + boolean start = false; + boolean stop = false; + for (int i = 0; i < tokenStream.size() && !stop; i++) { + Token t = tokenStream.get(i); + if (!start && t == startToken) { + start = true; + } + if (start) { + result.add(t); + } + if (t == stopToken) { + stop = true; + } + } + return result; + } + + private Predicate startsInAreaA(Token token) { + return it -> { + int charPosition = it.getRange().getStart().getCharacter(); + int areaBStartIndex = programLayout.getSequenceLength() + programLayout.getIndicatorLength() + programLayout.getAreaALength(); + return charPosition > programLayout.getSequenceLength() && charPosition < areaBStartIndex && token.getChannel() != HIDDEN; + }; + } + + private static Collection getSubroutineLocation( + ImmutablePair> subroutinePair) { + return subroutinePair + .getValue() + .map(it -> new Location(it, new Range(new Position(), new Position()))) + .map(Collections::singletonList) + .orElse(emptyList()); + } + + private List addTreeNode(ParserRuleContext ctx, Function nodeConstructor) { + List children = visitChildren(ctx); + return retrieveLocality(ctx) + .map(constructNode(nodeConstructor, children)) + .orElse(children); + } + + private List addTreeNode(Node node, List children) { + if (node.getLocality() == null) return children; + children.forEach(node::addChild); + return ImmutableList.of(node); + } + + private VariableNameAndLocality extractNameAndLocality(CobolWordContext context) { + return new VariableNameAndLocality( + getName(context), retrieveLocality(context).orElse(null)); + } + + private Optional retrieveLocality(ParserRuleContext ctx) { + return retrieveRangeLocality(ctx) + .map(extendedDocument::mapLocation) + .map(this::locationToLocality); + } + + private Locality locationToLocality(Location location) { + return Locality.builder() + .range(location.getRange()) + .uri(location.getUri()) + .copybookId(copybooks.getCopybookIdByUri(location.getUri())) + .build(); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/HwCobolProcedureDivisionVisitor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/HwCobolProcedureDivisionVisitor.java new file mode 100644 index 0000000000..f91ddffb14 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/HwCobolProcedureDivisionVisitor.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.dialects.ibm.experimental.visitors; + +import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; +import org.antlr.v4.runtime.CommonTokenStream; +import org.eclipse.lsp.cobol.common.SubroutineService; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.model.tree.*; +import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; +import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; + +import java.util.*; + +import static org.eclipse.lsp.cobol.core.CobolProcedureDivisionParser.*; + +/** + * Visitor for Procedure Division ANTLR parser results + */ +@Slf4j +public class HwCobolProcedureDivisionVisitor extends CobolProcedureDivisionVisitor { + public HwCobolProcedureDivisionVisitor(@NonNull CopybooksRepository copybooks, @NonNull CommonTokenStream tokenStream, @NonNull ExtendedDocument extendedDocument, MessageService messageService, SubroutineService subroutineService, CachingConfigurationService cachingConfigurationService, CobolProgramLayout programLayout) { + super(copybooks, tokenStream, extendedDocument, messageService, subroutineService, cachingConfigurationService, programLayout); + } + + @Override + public List visitStatement(StatementContext ctx) { + throwWarning(ctx.getStart()); + return visitChildren(ctx); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/HwCobolVisitor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/HwCobolVisitor.java new file mode 100644 index 0000000000..727f5166aa --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/visitors/HwCobolVisitor.java @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.dialects.ibm.experimental.visitors; + +import lombok.NonNull; +import lombok.extern.slf4j.Slf4j; +import org.antlr.v4.runtime.CommonTokenStream; +import org.antlr.v4.runtime.tree.RuleNode; +import org.eclipse.lsp.cobol.common.SubroutineService; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; +import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.model.tree.*; +import org.eclipse.lsp.cobol.core.*; +import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; +import org.eclipse.lsp.cobol.core.visitor.CobolVisitor; +import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; + +import java.util.*; +import static org.eclipse.lsp.cobol.core.CobolParser.*; +import static org.eclipse.lsp.cobol.core.visitor.VisitorHelper.checkInterruption; + +/** + * This extension of {@link CobolParserBaseVisitor} applies the semantic analysis based on the + * abstract syntax tree built by {@link CobolParser}. It requires a semantic context with defined + * elements to add the usages or throw a warning on an invalid definition. If there is a misspelled + * keyword, the visitor finds it and throws a warning. + */ +@Slf4j +public class HwCobolVisitor extends CobolVisitor { + + public HwCobolVisitor(@NonNull CopybooksRepository copybooks, @NonNull CommonTokenStream tokenStream, @NonNull ExtendedDocument extendedDocument, MessageService messageService, SubroutineService subroutineService, CachingConfigurationService cachingConfigurationService, CobolProgramLayout programLayout) { + super(copybooks, tokenStream, extendedDocument, messageService, subroutineService, cachingConfigurationService, programLayout); + } + + @Override + public List visitStatement(StatementContext ctx) { + + if (expectedInAriaA(ctx)) { + areaBWarning(ctx); + } + throwWarning(ctx.getStart()); + return visitChildren(ctx); + } + + @Override + public List visitChildren(RuleNode node) { + checkInterruption(); + if (node.getClass().getEnclosingClass() == CobolIdentificationDivisionParser.class) { + CobolIdentificationDivisionVisitor cobolIdentificationDivisionVisitor = new CobolIdentificationDivisionVisitor(extendedDocument, copybooks); + List nodes = cobolIdentificationDivisionVisitor.visit(node); + errors.addAll(cobolIdentificationDivisionVisitor.getErrors()); + return nodes; + } + if (node.getClass().getEnclosingClass() == CobolDataDivisionParser.class) { + CobolDataDivisionVisitor cobolDataDivisionVisitor = new CobolDataDivisionVisitor(extendedDocument, copybooks, messageService, fileControls); + List nodes = cobolDataDivisionVisitor.visit(node); + errors.addAll(cobolDataDivisionVisitor.getErrors()); + return nodes; + } + if (node.getClass().getEnclosingClass() == CobolProcedureDivisionParser.class) { + HwCobolProcedureDivisionVisitor cobolProcedureDivisionVisitor = new HwCobolProcedureDivisionVisitor( + copybooks, + tokenStream, + extendedDocument, + messageService, + subroutineService, + cachingConfigurationService, + programLayout + ); + List nodes = cobolProcedureDivisionVisitor.visit(node); + errors.addAll(cobolProcedureDivisionVisitor.getErrors()); + return nodes; + } + return super.visitChildren(node); + } + +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/domain/modules/EngineModule.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/domain/modules/EngineModule.java index 2c78e5ade3..9f0c05ec44 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/domain/modules/EngineModule.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/domain/modules/EngineModule.java @@ -22,27 +22,19 @@ import org.antlr.v4.runtime.tree.ParseTreeListener; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkService; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkServiceImpl; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.common.message.LocaleStore; import org.eclipse.lsp.cobol.common.message.MessageService; import org.eclipse.lsp.cobol.core.engine.CobolLanguageEngine; import org.eclipse.lsp.cobol.core.messages.LocaleStoreImpl; import org.eclipse.lsp.cobol.core.messages.PropertiesMessageService; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessorImpl; +import org.eclipse.lsp.cobol.dialects.TrueDialectServiceImpl; import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessor; import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessorImpl; import org.eclipse.lsp.cobol.core.preprocessor.delegates.copybooks.GrammarPreprocessorListenerFactory; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReader; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReaderImpl; import org.eclipse.lsp.cobol.core.preprocessor.delegates.replacement.ReplacePreprocessorFactory; import org.eclipse.lsp.cobol.core.preprocessor.delegates.replacement.ReplacingService; import org.eclipse.lsp.cobol.core.preprocessor.delegates.replacement.ReplacingServiceImpl; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineIndicatorProcessorImpl; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineReWriter; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.CobolLinesTransformation; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.ContinuationLineTransformation; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriter; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriterImpl; import org.eclipse.lsp.cobol.core.visitor.InterruptingTreeListener; import org.eclipse.lsp.cobol.lsp.CobolWorkspaceServiceImpl; import org.eclipse.lsp.cobol.lsp.LspEventConsumer; @@ -59,15 +51,13 @@ public class EngineModule extends AbstractModule { protected void configure() { bind(CobolLanguageEngine.class); bind(BenchmarkService.class).to(BenchmarkServiceImpl.class); - bind(TextPreprocessor.class).to(TextPreprocessorImpl.class); + bind(TrueDialectService.class).to(TrueDialectServiceImpl.class); + bind(GrammarPreprocessor.class).to(GrammarPreprocessorImpl.class); install(new FactoryModuleBuilder().build(GrammarPreprocessorListenerFactory.class)); install(new FactoryModuleBuilder().build(ReplacePreprocessorFactory.class)); bind(ReplacingService.class).to(ReplacingServiceImpl.class); - bind(CobolLineReader.class).to(CobolLineReaderImpl.class); - bind(CobolLineWriter.class).to(CobolLineWriterImpl.class); - bind(CobolLinesTransformation.class).to(ContinuationLineTransformation.class); - bind(CobolLineReWriter.class).to(CobolLineIndicatorProcessorImpl.class); + bind(MessageService.class).to(PropertiesMessageService.class); bind(LocaleStore.class).to(LocaleStoreImpl.class); bind(Communications.class).to(ServerCommunications.class); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlDialect.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlDialect.java index 6b472bc2d2..1f38f4a534 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlDialect.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlDialect.java @@ -108,7 +108,7 @@ public List getProcessors() { new ImplicitDb2VariablesProcessor()), new ProcessorDescription( Db2DataAndProcedureDivisionNode.class, - ProcessingPhase.POST_DEFINITION, + ProcessingPhase.VALIDATION, new Db2DataAndProcedureDivisionProcessor(messageService)), new ProcessorDescription( Db2DeclareVariableNode.class, diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitor.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitor.java index 90e3d7eb4b..563f31ff8a 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitor.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitor.java @@ -21,6 +21,8 @@ import java.util.LinkedList; import java.util.List; import java.util.function.Function; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Stream; import lombok.AllArgsConstructor; import lombok.Getter; @@ -57,6 +59,7 @@ class Db2SqlVisitor extends Db2SqlParserBaseVisitor> { private final DialectProcessingContext context; private final MessageService messageService; + private static final Pattern DOUBLE_DASH_SQL_COMMENT = Pattern.compile("--\\s[^\\r\\n]*", Pattern.MULTILINE); @Getter private final List errors = new LinkedList<>(); @@ -122,11 +125,43 @@ public Range constructRange(ParserRuleContext ctx) { @Override public List visitSqlCode(Db2SqlParser.SqlCodeContext ctx) { // String intervalText = VisitorHelper.getIntervalText(ctx); - List nodes = this.visitStartSqlRule(parseSQL(ctx)); + String sqlCode = preProcessSqlComment(ctx); + List nodes = this.visitStartSqlRule(parseSQL(sqlCode, ctx)); Db2SqlVisitorHelper.adjustNodeLocations(ctx, context, nodes); return nodes; } + private String preProcessSqlComment(Db2SqlParser.SqlCodeContext ctx) { + String sqlCode = VisitorHelper.getIntervalText(ctx); + Matcher matcher = DOUBLE_DASH_SQL_COMMENT.matcher(sqlCode); + while (matcher.find()) { + Position start = findPosition(sqlCode, matcher.start()); + Position end = findPosition(sqlCode, matcher.end() - 1); + String replace = StringUtils.repeat(CobolDialect.FILLER, matcher.end() - matcher.start() - 1); + start = Db2SqlVisitorHelper.getAdjustedStartPosition(ctx, start); + end = Db2SqlVisitorHelper.getAdjustedEndPosition(ctx, end); + context.getExtendedDocument().replace(new Range(start, end), replace); + } + sqlCode = matcher.replaceAll(""); + return sqlCode; + } + + private static Position findPosition(String text, int pos) { + int c = 1; + int line = 0; + int col = 1; + while (c <= pos) { + if (text.charAt(c) == '\n') { + ++line; + col = 1; + } else { + ++col; + } + c++; + } + return new Position(line, col); + } + @Override public List visitRulesAllowedInWorkingStorageAndLinkageSection(Db2SqlParser.RulesAllowedInWorkingStorageAndLinkageSectionContext ctx) { return addTreeNode(ctx, Db2WorkingAndLinkageSectionNode::new); @@ -152,8 +187,7 @@ public List visitRulesAllowedInDataDivisionAndProcedureDivision(Db2SqlPars return addTreeNode(ctx, Db2DataAndProcedureDivisionNode::new); } - private Db2SqlParser.StartSqlRuleContext parseSQL(Db2SqlParser.SqlCodeContext sqlCodeContext) { - String sqlCode = VisitorHelper.getIntervalText(sqlCodeContext); + private Db2SqlParser.StartSqlRuleContext parseSQL(String sqlCode, Db2SqlParser.SqlCodeContext sqlCodeContext) { Db2SqlLexer lexer = new Db2SqlLexer(CharStreams.fromString(sqlCode)); CommonTokenStream tokens = new CommonTokenStream(lexer); Db2SqlParser parser = new Db2SqlParser(tokens); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitorHelper.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitorHelper.java index 54e26a7ae3..d5eab3160f 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitorHelper.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/implicitDialects/sql/Db2SqlVisitorHelper.java @@ -72,8 +72,8 @@ public OriginalLocation adjustLocation( Location location = originalLocation.getLocation(); Range updatedRange = new Range( - getStartPosition(sqlCodeContext, location), - getEndPosition(sqlCodeContext, location)); + getAdjustedStartPosition(sqlCodeContext, location.getRange().getStart()), + getAdjustedEndPosition(sqlCodeContext, location.getRange().getEnd())); location.setRange(updatedRange); Location mapLocation = analysisContext.getExtendedDocument().mapLocation(updatedRange); return new OriginalLocation(mapLocation, originalLocation.getCopybookId()); @@ -109,44 +109,44 @@ public OriginalLocation adjustLocation( Location location = originalLocation.getLocation(); Range updatedRange = new Range( - getStartPosition(sqlCodeContext, location), - getEndPosition(sqlCodeContext, location)); + getAdjustedStartPosition(sqlCodeContext, location.getRange().getStart()), + getAdjustedEndPosition(sqlCodeContext, location.getRange().getEnd())); location.setRange(updatedRange); return new OriginalLocation(location, originalLocation.getCopybookId()); } - private static Position getStartPosition( - ParserRuleContext sqlCodeContext, Location nodeLocation) { + public static Position getAdjustedStartPosition( + ParserRuleContext sqlCodeContext, Position position) { Position start; - if (nodeLocation.getRange().getStart().getLine() == 0) { + if (position.getLine() == 0) { start = - new Position( - nodeLocation.getRange().getStart().getLine() + sqlCodeContext.start.getLine() - 1, - nodeLocation.getRange().getStart().getCharacter() - + sqlCodeContext.start.getCharPositionInLine()); + new Position( + position.getLine() + sqlCodeContext.start.getLine() - 1, + position.getCharacter() + + sqlCodeContext.start.getCharPositionInLine()); } else { start = - new Position( - nodeLocation.getRange().getStart().getLine() + sqlCodeContext.start.getLine() - 1, - nodeLocation.getRange().getStart().getCharacter()); + new Position( + position.getLine() + sqlCodeContext.start.getLine() - 1, + position.getCharacter()); } return start; } - private static Position getEndPosition( - ParserRuleContext sqlCodeContext, Location nodeLocation) { + public static Position getAdjustedEndPosition( + ParserRuleContext sqlCodeContext, Position position) { Position end; - if (nodeLocation.getRange().getEnd().getLine() == 0) { + if (position.getLine() == 0) { end = - new Position( - nodeLocation.getRange().getEnd().getLine() + sqlCodeContext.start.getLine() - 1, - nodeLocation.getRange().getEnd().getCharacter() - + sqlCodeContext.start.getCharPositionInLine()); + new Position( + position.getLine() + sqlCodeContext.start.getLine() - 1, + position.getCharacter() + + sqlCodeContext.start.getCharPositionInLine()); } else { end = - new Position( - nodeLocation.getRange().getEnd().getLine() + sqlCodeContext.start.getLine() - 1, - nodeLocation.getRange().getEnd().getCharacter()); + new Position( + position.getLine() + sqlCodeContext.start.getLine() - 1, + position.getCharacter()); } return end; } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/CobolLanguageServer.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/CobolLanguageServer.java index a922156f42..50be706375 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/CobolLanguageServer.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/CobolLanguageServer.java @@ -20,9 +20,11 @@ import javax.annotation.Nullable; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; +import org.eclipse.lsp.cobol.lsp.events.notifications.CancelProgressNotification; import org.eclipse.lsp.cobol.lsp.events.notifications.InitializedNotification; import org.eclipse.lsp.cobol.lsp.events.queries.InitializeQuery; import org.eclipse.lsp.cobol.lsp.events.queries.ShutdownQuery; +import org.eclipse.lsp.cobol.lsp.handlers.server.CancelProgressHandler; import org.eclipse.lsp.cobol.lsp.handlers.server.ExitHandler; import org.eclipse.lsp.cobol.lsp.handlers.server.InitializeHandler; import org.eclipse.lsp.cobol.lsp.handlers.server.InitializedHandler; @@ -48,6 +50,7 @@ public class CobolLanguageServer implements LanguageServer { private final ShutdownHandler shutdownHandler; private final InitializeHandler initializeHandler; private final InitializedHandler initializedHandler; + private final CancelProgressHandler cancelProgressHandler; @Inject @SuppressWarnings("squid:S107") @@ -59,7 +62,8 @@ public CobolLanguageServer( ShutdownHandler shutdownHandler, InitializeHandler initializeHandler, InitializedHandler initializedHandler, - LspEventConsumer lspEventConsumer) { + LspEventConsumer lspEventConsumer, + CancelProgressHandler cancelProgressHandler) { this.lspMessageBroker = lspMessageBroker; this.textService = textService; this.workspaceService = workspaceService; @@ -68,6 +72,7 @@ public CobolLanguageServer( this.initializeHandler = initializeHandler; this.initializedHandler = initializedHandler; this.lspEventConsumer = lspEventConsumer; + this.cancelProgressHandler = cancelProgressHandler; } @Override @@ -113,4 +118,9 @@ public void exit() { // Kill the server (loop should be already stopped at this time) exitHandler.exit(); } + + @Override + public void cancelProgress(WorkDoneProgressCancelParams params) { + lspMessageBroker.notify(new CancelProgressNotification(params.getToken().getLeft(), cancelProgressHandler)); + } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/CobolWorkspaceServiceImpl.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/CobolWorkspaceServiceImpl.java index 9e0dea76a5..75bb436b6c 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/CobolWorkspaceServiceImpl.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/CobolWorkspaceServiceImpl.java @@ -16,11 +16,17 @@ import com.google.inject.Inject; import com.google.inject.Singleton; +import java.net.URI; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.CompletableFuture; +import java.util.stream.Collectors; import lombok.NonNull; +import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.eclipse.lsp.cobol.lsp.analysis.AsyncAnalysisService; import org.eclipse.lsp.cobol.lsp.events.queries.ExecuteCommandQuery; @@ -46,11 +52,12 @@ public class CobolWorkspaceServiceImpl extends LspEventConsumer implements Works @Inject public CobolWorkspaceServiceImpl( - LspMessageBroker lspMessageBroker, - ExecuteCommandHandler executeCommandHandler, - SourceUnitGraph sourceUnitGraph, - DidChangeConfigurationHandler didChangeConfigurationHandler, - AsyncAnalysisService asyncAnalysisService, UriDecodeService uriDecodeService) { + LspMessageBroker lspMessageBroker, + ExecuteCommandHandler executeCommandHandler, + SourceUnitGraph sourceUnitGraph, + DidChangeConfigurationHandler didChangeConfigurationHandler, + AsyncAnalysisService asyncAnalysisService, + UriDecodeService uriDecodeService) { super(lspMessageBroker); this.executeCommandHandler = executeCommandHandler; this.sourceUnitGraph = sourceUnitGraph; @@ -97,15 +104,55 @@ public void didChangeWatchedFiles(@NonNull DidChangeWatchedFilesParams params) { Set changedFiles = new HashSet<>(params.getChanges()); changedFiles.forEach( file -> { - String uri = uriDecodeService.decode(file.getUri()); - sourceUnitGraph.updateContent(uri); - if (!sourceUnitGraph.isFileOpened(uri)) { - List uris = - sourceUnitGraph.getAllAssociatedFilesForACopybook(uriDecodeService.decode(uri)); - if (!uris.isEmpty()) - asyncAnalysisService.reanalyseCopybooksAssociatedPrograms( - uris, uri, sourceUnitGraph.getContent(uri), SourceUnitGraph.EventSource.FILE_SYSTEM); + URI uri = URI.create(file.getUri()); + if ("file".equals(uri.getScheme())) { + Path path = Paths.get(uri); + if (file.getType() == FileChangeType.Deleted) { + path = path.getParent(); + } + String uriString = uriDecodeService.decode(path.toUri().toString()); + if (sourceUnitGraph.isFileOpened(uriString)) { + // opened files are taken care by textChange events + return; + } + boolean isDirectory = Files.isDirectory(path); + if (!isDirectory) { + triggerAnalysisForChangedFile(uriString); + } else { + triggerAnalysisForFilesInDirectory(path); + } } }); } + + @SneakyThrows + private void triggerAnalysisForChangedFile(String uri) { + List uris = + sourceUnitGraph.getAllAssociatedFilesForACopybook(uriDecodeService.decode(uri)); + String fileContent = null; + if (uris.isEmpty()) { + asyncAnalysisService.reanalyseOpenedPrograms(); + return; + } + if (Files.exists(Paths.get(URI.create(uri)))) { + sourceUnitGraph.updateContent(uri); + fileContent = sourceUnitGraph.getContent(uri); + } + if (!sourceUnitGraph.isFileOpened(uri)) { + asyncAnalysisService.reanalyseCopybooksAssociatedPrograms( + uris, uri, fileContent, SourceUnitGraph.EventSource.FILE_SYSTEM); + } + } + + private void triggerAnalysisForFilesInDirectory(Path path) { + // Only care for deleted copybooks as they impact the diagnostics + Set affectedPrograms = + sourceUnitGraph.getCopybookUriInsideFolder(path.toUri().toString()).stream() + .flatMap( + copybookUri -> + sourceUnitGraph.getAllAssociatedFilesForACopybook(copybookUri).stream()) + .collect(Collectors.toSet()); + + affectedPrograms.forEach(this::triggerAnalysisForChangedFile); + } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/SourceUnitGraph.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/SourceUnitGraph.java index e46764d348..d6c876db99 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/SourceUnitGraph.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/SourceUnitGraph.java @@ -18,6 +18,11 @@ import com.google.common.collect.Sets; import com.google.inject.Inject; import com.google.inject.Singleton; +import java.io.IOException; +import java.net.URI; +import java.net.URL; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; @@ -125,9 +130,9 @@ private void updateGraphLink(CobolDocumentModel model, EventSource eventSource) }); objectRef.putIfAbsent(copyNode.getUri(), copyNodeV); references.add(copyNodeV); - - documentGraphIndexedByCopybook.putIfAbsent(copyNode.getUri(), new ArrayList<>()); - List strings = documentGraphIndexedByCopybook.get(copyNode.getUri()); + String decodedUri = uriDecodeService.decode(copyNode.getUri()); + documentGraphIndexedByCopybook.putIfAbsent(decodedUri, new ArrayList<>()); + List strings = documentGraphIndexedByCopybook.get(decodedUri); if (!strings.contains(parentUri)) { strings.add(parentUri); } @@ -173,7 +178,16 @@ private void invalidateCopybookIndexedCache(String referUri, String copybookUri) * @return true if copybook, false otherwise. */ public boolean isCopybook(String uri) { - return documentGraphIndexedByCopybook.containsKey(uri); + return documentGraphIndexedByCopybook.keySet().stream().anyMatch(copyUri -> { + try { + String decodeUri = uri.replace(" ", "%20"); + copyUri = copyUri.replace(" ", "%20"); + return new URL(decodeUri).sameFile(new URL(copyUri)); + } catch (IOException e) { + LOG.error("IOException encountered while comparing paths {} and {}", copyUri, uri); + return false; + } + }); } private void updateGraphNodes(CobolDocumentModel model, EventSource eventSource) { @@ -201,6 +215,7 @@ private void updateGraphNodes(CobolDocumentModel model, EventSource eventSource) /** * Get content for a passed uri + * * @param uri * @return content */ @@ -383,6 +398,23 @@ private static boolean isContainedInside(Position usage, NodeV nodeV) { return false; } + /** + * Gives a list of all the copybooks contained inside a parent dir. + * + * @param parentFolder parent directory + * @return List of copybooks contained inside a parent directory + */ + public List getCopybookUriInsideFolder(String parentFolder) { + List result = new ArrayList<>(); + Path parentPath = Paths.get(URI.create(parentFolder)); + Set allCopybooks = documentGraphIndexedByCopybook.keySet(); + for (String copybookUri : allCopybooks) { + Path copybookPath = Paths.get(URI.create(copybookUri)); + if (copybookPath.startsWith(parentPath)) result.add(copybookUri); + } + return result; + } + /** Nodes in the {@link SourceUnitGraph} representing document and their links in a workspace */ @AllArgsConstructor @EqualsAndHashCode(onlyExplicitlyIncluded = true) diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/analysis/AsyncAnalysisService.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/analysis/AsyncAnalysisService.java index 0471e5495d..121cb4ebaa 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/analysis/AsyncAnalysisService.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/analysis/AsyncAnalysisService.java @@ -22,13 +22,14 @@ import lombok.extern.slf4j.Slf4j; import org.eclipse.lsp.cobol.common.SubroutineService; import org.eclipse.lsp.cobol.common.copybook.CopybookService; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.lsp.LspEventCancelCondition; import org.eclipse.lsp.cobol.lsp.LspEventDependency; import org.eclipse.lsp.cobol.lsp.SourceUnitGraph; import org.eclipse.lsp.cobol.service.AnalysisService; import org.eclipse.lsp.cobol.service.CobolDocumentModel; import org.eclipse.lsp.cobol.service.DocumentModelService; -import org.eclipse.lsp.cobol.service.copybooks.CopybookServiceImpl; import org.eclipse.lsp.cobol.service.delegates.communications.Communications; /** @@ -38,6 +39,7 @@ @Singleton public class AsyncAnalysisService implements AnalysisStateNotifier { private static final ExecutorService SINGLE_THREAD_EXECUTOR = Executors.newSingleThreadExecutor(r -> new Thread(r, "LSP workspace service")); + private final TrueDialectService dialectService; private final DocumentModelService documentModelService; private final AnalysisService analysisService; private final CopybookService copybookService; @@ -60,11 +62,13 @@ public Thread newThread(Runnable r) { @Inject - public AsyncAnalysisService(DocumentModelService documentModelService, + public AsyncAnalysisService(TrueDialectService dialectService, + DocumentModelService documentModelService, AnalysisService analysisService, CopybookService copybookService, SubroutineService subroutineService, Communications communications) { + this.dialectService = dialectService; this.documentModelService = documentModelService; this.analysisService = analysisService; this.copybookService = copybookService; @@ -129,6 +133,7 @@ public synchronized CompletableFuture scheduleAnalysis(Strin notifyAllListeners(AnalysisState.STARTED, documentModelService.get(uri), eventSource); try { communications.notifyProgressBegin(uri); + documentModelService.get(uri).setOutlineResult(null); analysisService.analyzeDocument(uri, text, open); CobolDocumentModel documentModel = documentModelService.get(uri); analysisResults.remove(id).complete(documentModel); @@ -188,7 +193,7 @@ public void reanalyseOpenedPrograms() throws InterruptedException { subroutineService.invalidateCache(); LOG.info("Cache invalidated"); openDocuments - .forEach(doc -> scheduleAnalysis(doc.getUri(), doc.getText(), analysisResultsRevisions.get(doc.getUri()), false, true, SourceUnitGraph.EventSource.IDE)); + .forEach(doc -> scheduleAnalysis(doc.getUri(), doc.getText(), analysisResultsRevisions.getOrDefault(doc.getUri(), 0), false, true, SourceUnitGraph.EventSource.IDE)); } private void cancelRunningAnalysis(List openDocuments) { @@ -209,24 +214,32 @@ private void cancelRunningAnalysis(List openDocuments) { */ public void reanalyseCopybooksAssociatedPrograms(List uris, String copybookUri, String copybookContent, SourceUnitGraph.EventSource eventSource) { documentModelService.removeDocumentDiagnostics(copybookUri); - for (String uri : uris) { + Optional.ofNullable(documentModelService.get(copybookUri)).ifPresent(model -> model.update(copybookContent)); + List openedUris = + documentModelService.getAllOpened().stream() + .filter(model -> uris.contains(model.getUri())) + .filter(model -> !analysisService.isCopybook(model.getUri(), model.getText())) + .map(CobolDocumentModel::getUri) + .collect(Collectors.toList()); + for (String uri : openedUris) { + String languageId = documentModelService.get(uri).getLanguageId(); //TODO: update cache directly from workspace document graph - if (copybookService instanceof CopybookServiceImpl) { - CopybookServiceImpl copybookServiceImpl = (CopybookServiceImpl) copybookService; - copybookServiceImpl.getCopybookUsage(uri).stream() - .filter(model -> Objects.nonNull(model.getUri())) - .filter(model -> model.getUri().equals(copybookUri)) - .forEach( - copybookModel -> { - copybookServiceImpl.invalidateCache(copybookModel.getCopybookId()); - copybookModel.setContent(copybookContent); - copybookServiceImpl.store(copybookModel, true); - }); - } + copybookService.getCopybookUsage(uri).stream() + .filter(model -> Objects.nonNull(model.getUri())) + .filter(model -> model.getUri().equals(copybookUri)) + .forEach( + copybookModel -> { + copybookService.invalidateCache(copybookModel.getCopybookId()); + if (copybookContent != null) { + copybookModel.setContent(copybookContent); + copybookService.store(copybookModel, dialectService.getPreprocessor(CobolLanguageId.MAPPER.get(languageId))); + } + }); + subroutineService.invalidateCache(); LOG.info("Cache invalidated"); - CobolDocumentModel model = documentModelService.get(uri); - scheduleAnalysis(uri, model.getText(), analysisResultsRevisions.get(model.getUri()), false, true, eventSource); + CobolDocumentModel document = documentModelService.get(uri); + scheduleAnalysis(uri, document.getText(), analysisResultsRevisions.get(document.getUri()), false, true, eventSource); } } @@ -286,11 +299,12 @@ public LspEventCancelCondition createCancelConditionOnClose(String uri) { /** * Mark document as opened * - * @param uri of document - * @param text content od document. + * @param uri of document + * @param text content od document. + * @param languageId */ - public void openDocument(String uri, String text) { - documentModelService.openDocument(uri, text); + public void openDocument(String uri, String text, String languageId) { + documentModelService.openDocument(uri, text, languageId); } @Override diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/events/notifications/CancelProgressNotification.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/events/notifications/CancelProgressNotification.java new file mode 100644 index 0000000000..956b350a14 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/events/notifications/CancelProgressNotification.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.lsp.events.notifications; + +import lombok.SneakyThrows; +import org.eclipse.lsp.cobol.lsp.LspNotification; +import org.eclipse.lsp.cobol.lsp.handlers.server.CancelProgressHandler; + +/** `window/workDoneProgress/cancel` language server event */ +public class CancelProgressNotification implements LspNotification { + private final String uri; + private final CancelProgressHandler cancelProgressHandler; + + public CancelProgressNotification(String uri, CancelProgressHandler cancelProgressHandler) { + this.uri = uri; + this.cancelProgressHandler = cancelProgressHandler; + } + + @SneakyThrows + @Override + public void execute() { + this.cancelProgressHandler.cancel(uri); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/server/CancelProgressHandler.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/server/CancelProgressHandler.java new file mode 100644 index 0000000000..207784bc6f --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/server/CancelProgressHandler.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.lsp.handlers.server; + +import com.google.inject.Inject; +import org.eclipse.lsp.cobol.lsp.analysis.AsyncAnalysisService; + +/** LSP `window/workDoneProgress/cancel` Handler */ +public class CancelProgressHandler { + private final AsyncAnalysisService asyncAnalysisService; + + @Inject + public CancelProgressHandler(AsyncAnalysisService asyncAnalysisService) { + this.asyncAnalysisService = asyncAnalysisService; + } + + /** + * Cancel analysis for the passed uri + * @param uri + * @throws InterruptedException + */ + public void cancel(String uri) throws InterruptedException { + asyncAnalysisService.cancelAnalysis(uri); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/text/DidOpenHandler.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/text/DidOpenHandler.java index 40b014553c..b25b680e8f 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/text/DidOpenHandler.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/text/DidOpenHandler.java @@ -54,7 +54,7 @@ public void didOpen(DidOpenTextDocumentParams params, SourceUnitGraph.EventSourc return; } watcherService.addRuntimeWatchers(uri); - asyncAnalysisService.openDocument(uri, params.getTextDocument().getText()); + asyncAnalysisService.openDocument(uri, params.getTextDocument().getText(), params.getTextDocument().getLanguageId()); asyncAnalysisService.scheduleAnalysis(uri, params.getTextDocument().getText(), params.getTextDocument().getVersion(), true, eventSource); } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/text/FoldingRangeHandler.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/text/FoldingRangeHandler.java index 8116fc5d43..0c5c547130 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/text/FoldingRangeHandler.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/handlers/text/FoldingRangeHandler.java @@ -26,6 +26,7 @@ import org.eclipse.lsp.cobol.lsp.LspQuery; import org.eclipse.lsp.cobol.lsp.analysis.AsyncAnalysisService; import org.eclipse.lsp.cobol.lsp.events.queries.FoldingQuery; +import org.eclipse.lsp.cobol.service.AnalysisService; import org.eclipse.lsp.cobol.service.DocumentModelService; import org.eclipse.lsp.cobol.service.DocumentServiceHelper; import org.eclipse.lsp.cobol.service.UriDecodeService; @@ -41,12 +42,14 @@ public class FoldingRangeHandler { private final DocumentModelService documentService; private final AsyncAnalysisService asyncAnalysisService; private final UriDecodeService uriDecodeService; + private final AnalysisService analysisService; @Inject - public FoldingRangeHandler(DocumentModelService documentService, AsyncAnalysisService asyncAnalysisService, UriDecodeService uriDecodeService) { + public FoldingRangeHandler(DocumentModelService documentService, AsyncAnalysisService asyncAnalysisService, UriDecodeService uriDecodeService, AnalysisService analysisService) { this.documentService = documentService; this.asyncAnalysisService = asyncAnalysisService; this.uriDecodeService = uriDecodeService; + this.analysisService = analysisService; } /** @@ -82,7 +85,8 @@ public LspQuery> createEvent(FoldingRangeRequestParams params */ public List getDependencies(String uri) { return ImmutableList.of( - asyncAnalysisService.createDependencyOn(uri)); + asyncAnalysisService.createDependencyOn(uri), + () -> documentService.isDocumentSynced(uri)); } /** @@ -92,6 +96,7 @@ public List getDependencies(String uri) { */ public List getCancelConditions(String uri) { return ImmutableList.of( - asyncAnalysisService.createCancelConditionOnClose(uri)); + asyncAnalysisService.createCancelConditionOnClose(uri), + () -> analysisService.isCopybook(uri, documentService.get(uri).getText())); } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/jrpc/CobolLanguageClient.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/jrpc/CobolLanguageClient.java index 1eb9f194db..b85714d501 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/jrpc/CobolLanguageClient.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/lsp/jrpc/CobolLanguageClient.java @@ -56,7 +56,7 @@ default CompletableFuture resolveCopybook( * The copybook/download request is sent from the server to the client to * download remote copybook * - * @param cobolFilename the name of cobol program + * @param cobolFileUri Uri of the cobol program * @param copybookNames list of copybooks to download * @param dialectType the name of copybook dialect * @param quietMode the name of copybook dialect @@ -64,7 +64,7 @@ default CompletableFuture resolveCopybook( */ @JsonRequest("copybook/download") default CompletableFuture downloadCopybooks( - String cobolFilename, + String cobolFileUri, List copybookNames, String dialectType, boolean quietMode) { diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/AnalysisService.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/AnalysisService.java index f099b8b450..a8de678e61 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/AnalysisService.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/AnalysisService.java @@ -113,7 +113,7 @@ private void analyzeDocumentWithCopybooks(String uri, String text) { try { CopybookProcessingMode copybookProcessingMode = CopybookProcessingMode.getCopybookProcessingMode(uri, CopybookProcessingMode.ENABLED); AnalysisConfig config = configurationService.getConfig(uri, copybookProcessingMode); - AnalysisResult result = engine.analyze(uri, text, config); + AnalysisResult result = engine.analyze(uri, text, config, documentService.get(uri).getLanguageId()); documentService.processAnalysisResult(uri, result, text); ThreadInterruptionUtil.checkThreadInterrupted(); copybookService.sendCopybookDownloadRequest( diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/CobolDocumentModel.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/CobolDocumentModel.java index ddb35b8b5b..6ba3dfbb54 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/CobolDocumentModel.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/CobolDocumentModel.java @@ -14,33 +14,34 @@ */ package org.eclipse.lsp.cobol.service; -import lombok.*; -import org.eclipse.lsp.cobol.common.AnalysisResult; -import lombok.extern.slf4j.Slf4j; -import org.eclipse.lsp4j.DocumentSymbol; -import org.eclipse.lsp4j.Position; - import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; +import lombok.*; +import lombok.extern.slf4j.Slf4j; +import org.eclipse.lsp.cobol.common.AnalysisResult; +import org.eclipse.lsp4j.DocumentSymbol; +import org.eclipse.lsp4j.Position; /** * This class stores a COBOL program text to be processed. Provides a list of lines and text tokens * by position. */ +@Getter @RequiredArgsConstructor @Slf4j public class CobolDocumentModel { private static final String DELIMITER = "[ .\\[\\]()<>,*\"']+"; - @Getter private final List lines = new CopyOnWriteArrayList<>(); - @Getter private String text; - @Getter private final String uri; - @Getter @Setter private boolean opened = true; - @Getter private AnalysisResult analysisResult; - @Getter private AnalysisResult lastAnalysisResult; - @Getter @Setter private List outlineResult; + private final List lines = new CopyOnWriteArrayList<>(); + private String text; + private final String uri; + @Setter private volatile boolean opened = true; + @Setter private String languageId; + private volatile AnalysisResult analysisResult; + private volatile AnalysisResult lastAnalysisResult; + @Setter private volatile List outlineResult; public CobolDocumentModel(String uri, String text, AnalysisResult analysisResult) { this.uri = uri; @@ -60,7 +61,6 @@ public boolean isDocumentSynced() { return (analysisResult != null && outlineResult != null); } - Line getLine(int number) { return lines.stream().filter(line -> line.getNumber() == number).findFirst().orElse(null); } @@ -81,6 +81,7 @@ public String getTokenBeforePosition(Position position) { /** * Assign analysis result to the document. + * * @param analysisResult the analysis result. */ public void setAnalysisResult(AnalysisResult analysisResult) { @@ -93,6 +94,7 @@ public void setAnalysisResult(AnalysisResult analysisResult) { /** * Update CobolDocumentModel with a new text + * * @param text - the new document text */ public void update(String text) { @@ -173,5 +175,4 @@ public static class Line { this.text = text; } } - } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/DocumentModelService.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/DocumentModelService.java index 38982275f4..daaadf4f1a 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/DocumentModelService.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/DocumentModelService.java @@ -37,12 +37,15 @@ public class DocumentModelService { /** * Mark the document as opened and stores document text * - * @param uri - document uri - * @param text - document text + * @param uri - document uri + * @param text - document text + * @param languageId */ @Synchronized - public void openDocument(String uri, String text) { - docs.computeIfAbsent(uri, u -> new CobolDocumentModel(uri, text)).setOpened(true); + public void openDocument(String uri, String text, String languageId) { + CobolDocumentModel model = docs.computeIfAbsent(uri, u -> new CobolDocumentModel(uri, text)); + Optional.ofNullable(languageId).ifPresent(model::setLanguageId); + model.setOpened(true); } /** @@ -73,6 +76,7 @@ public void processAnalysisResult(String uri, AnalysisResult analysisResult, Str removeAllRelatedDiagnostics(document); updateDiagnosticRepo(uri, analysisResult.getDiagnostics()); CobolDocumentModel updatedModel = new CobolDocumentModel(uri, text, analysisResult); + updatedModel.setLanguageId(document.getLanguageId()); updatedModel.setOutlineResult(BuildOutlineTreeFromSyntaxTree.convert(analysisResult.getRootNode(), uri)); docs.put(uri, updatedModel); } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/copybooks/CopybookServiceImpl.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/copybooks/CopybookServiceImpl.java index acb773fc15..b6fe337b9c 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/copybooks/CopybookServiceImpl.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/copybooks/CopybookServiceImpl.java @@ -32,6 +32,7 @@ import java.util.concurrent.ExecutionException; import lombok.NonNull; import lombok.extern.slf4j.Slf4j; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.copybook.*; import org.eclipse.lsp.cobol.common.error.SyntaxError; @@ -40,9 +41,9 @@ import org.eclipse.lsp.cobol.common.mapping.OriginalLocation; import org.eclipse.lsp.cobol.common.utils.ImplicitCodeUtils; import org.eclipse.lsp.cobol.common.utils.ThreadInterruptionUtil; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; import org.eclipse.lsp.cobol.lsp.jrpc.CobolLanguageClient; +import org.eclipse.lsp.cobol.service.UriDecodeService; /** * This service processes copybook requests and returns content by its name. The service also caches @@ -56,8 +57,8 @@ public class CopybookServiceImpl implements CopybookService { private final Map> preprocessCopybookErrors = new ConcurrentHashMap<>(); private final Map> copybookUsage = new ConcurrentHashMap<>(); private final Provider clientProvider; + private final UriDecodeService uriDecodeService; private final FileSystemService files; - public final TextPreprocessor preprocessor; private static final String COBOL = "COBOL"; private final Map> copybooksForDownloading = @@ -68,12 +69,12 @@ public class CopybookServiceImpl implements CopybookService { @Inject public CopybookServiceImpl(Provider clientProvider, FileSystemService files, - TextPreprocessor preprocessor, - CopybookCache copybookCache) { + CopybookCache copybookCache, + UriDecodeService uriDecodeService) { this.files = files; this.clientProvider = clientProvider; - this.preprocessor = preprocessor; this.copybookCache = copybookCache; + this.uriDecodeService = uriDecodeService; } @Override @@ -88,7 +89,7 @@ public void invalidateCache() { /** * Removes cache for the passed {@link CopybookId} - * @param copybookId + * @param copybookId is a copybook identifier */ public void invalidateCache(CopybookId copybookId) { copybookCache.invalidate(copybookId); @@ -108,20 +109,19 @@ public void invalidateCache(CopybookId copybookId) { * @param copybookName - the name of the copybook to be retrieved * @param programDocumentUri - the currently processing program document * @param documentUri - the currently processing document that contains the copy statement - * @param preprocess - indicates if copybook needs to be preprocessed after resolving + * @param preprocessor - Cleanup preprocessor that will be used for new copybooks or null * @return a CopybookModel wrapped inside {@link ResultWithErrors} which contains copybook name, its URI and the content */ public ResultWithErrors resolve( - @NonNull CopybookId copybookId, - @NonNull CopybookName copybookName, - @NonNull String programDocumentUri, - @NonNull String documentUri, - boolean preprocess) { + @NonNull CopybookId copybookId, + @NonNull CopybookName copybookName, + @NonNull String programDocumentUri, + @NonNull String documentUri, + CleanerPreprocessor preprocessor) { try { ThreadInterruptionUtil.checkThreadInterrupted(); - CopybookModel copybookModel = getFromCache(programDocumentUri, copybookId, copybookName, - preprocess); + CopybookModel copybookModel = getFromCache(programDocumentUri, copybookId, copybookName, preprocessor); copybookUsage.computeIfAbsent(programDocumentUri, k -> new HashSet<>()).add(copybookModel); List errors = Optional.ofNullable(copybookModel.getUri()) @@ -136,11 +136,11 @@ public ResultWithErrors resolve( } private CopybookModel getFromCache(String programDocumentUri, CopybookId copybookId, - CopybookName copybookName, boolean preprocess) throws ExecutionException { + CopybookName copybookName, CleanerPreprocessor preprocessor) throws ExecutionException { return copybookCache.get(copybookId, () -> { CopybookModel copybookModel = resolveSync(copybookName, programDocumentUri); - if (preprocess && copybookModel.getUri() != null) { - ResultWithErrors copybookModelResultWithErrors = cleanupCopybook(copybookModel); + if (preprocessor != null && copybookModel.getUri() != null) { + ResultWithErrors copybookModelResultWithErrors = cleanupCopybook(copybookModel, preprocessor); copybookModel = copybookModelResultWithErrors.getResult(); preprocessCopybookErrors.put(copybookModel.getUri(), copybookModelResultWithErrors.getErrors()); } @@ -154,9 +154,9 @@ public void store(CopybookModel copybookModel) { } @Override - public void store(CopybookModel copybookModel, boolean doCleanUp) { - if (doCleanUp) { - ResultWithErrors processedCopybook = cleanupCopybook(copybookModel); + public void store(CopybookModel copybookModel, CleanerPreprocessor preprocessor) { + if (preprocessor != null) { + ResultWithErrors processedCopybook = cleanupCopybook(copybookModel, preprocessor); copybookModel = processedCopybook.getResult(); preprocessCopybookErrors.put(copybookModel.getUri(), processedCopybook.getErrors()); } @@ -190,7 +190,7 @@ private Optional tryResolvePredefinedCopybook(CopybookName copybo } } - private ResultWithErrors cleanupCopybook(CopybookModel dirtyCopybook) { + private ResultWithErrors cleanupCopybook(CopybookModel dirtyCopybook, CleanerPreprocessor preprocessor) { ResultWithErrors textTransformationsResultWithErrors = preprocessor.cleanUpCode(dirtyCopybook.getUri(), dirtyCopybook.getContent()); String cleanText = CharMatcher.whitespace().trimTrailingFrom(textTransformationsResultWithErrors.getResult().toString()); CopybookModel copybookModel = new CopybookModel(dirtyCopybook.getCopybookId(), dirtyCopybook.getCopybookName(), dirtyCopybook.getUri(), cleanText); @@ -223,7 +223,7 @@ private Optional tryResolveCopybookFromWorkspace( final Optional copybookModel = resolveCopybookFromWorkspace(copybookName, programUri) - .map(uri -> loadCopybook(uri, copybookName, programUri)); + .map(uri -> loadCopybook(uri, copybookName, programUri)); LOG.debug("Copybook from workspace: {}", copybookModel); return copybookModel; } @@ -260,9 +260,9 @@ private CopybookModel registerForDownloading(CopybookName copybookName, String p private CopybookModel loadCopybook(String uri, CopybookName copybookName, String programUri) { Path file = files.getPathFromURI(uri); - LOG.debug("Loading {} with URI {} for {} from path {}", copybookName, uri, files.getNameFromURI(programUri), file); + LOG.debug("Loading {} with URI {} for {} from path {}", copybookName, uriDecodeService.decode(uri), files.getNameFromURI(programUri), file); return files.fileExists(file) - ? new CopybookModel(copybookName.toCopybookId(programUri), copybookName, uri, files.getContentByPath(Objects.requireNonNull(file))) + ? new CopybookModel(copybookName.toCopybookId(programUri), copybookName, uriDecodeService.decode(uri), files.getContentByPath(Objects.requireNonNull(file))) : registerForDownloading(copybookName, programUri); } @@ -271,7 +271,6 @@ public void sendCopybookDownloadRequest(String documentUri, Collection c LOG.debug("Copybooks expecting downloading: {}", copybooksForDownloading); Set uris = new HashSet<>(copybookUris); uris.add(documentUri); - String document = files.getNameFromURI(documentUri); if (processingMode.download) { List copybooksToDownload = @@ -283,8 +282,7 @@ public void sendCopybookDownloadRequest(String documentUri, Collection c .collect(toList()); LOG.debug("Copybooks to download: {}", copybooksToDownload); if (!copybooksToDownload.isEmpty()) { - clientProvider.get().downloadCopybooks( - document, + clientProvider.get().downloadCopybooks(documentUri, copybooksToDownload.stream().map(CopybookName::getQualifiedName).collect(toList()), Optional.ofNullable(copybooksToDownload.stream().findFirst().get().getDialectType()).orElse(COBOL), //NOSONAR !processingMode.userInteraction); @@ -296,7 +294,7 @@ public void sendCopybookDownloadRequest(String documentUri, Collection c * Get the list of copybook used by a document * * @param documentUri current document uri. - * @return List of all the {@link CopybookModel} used by the passed document + * @return Set of all the {@link CopybookModel} used by the passed document */ public Set getCopybookUsage(String documentUri) { return Collections.unmodifiableSet(copybookUsage.getOrDefault(documentUri, ImmutableSet.of())); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/delegates/communications/ServerCommunications.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/delegates/communications/ServerCommunications.java index 2226ace14a..e36238b70c 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/delegates/communications/ServerCommunications.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/delegates/communications/ServerCommunications.java @@ -140,6 +140,7 @@ private void handleDanglingProgressNotifications(String uri) { private void notifyWorkProgress(String uri) { WorkDoneProgressReport workDoneProgressReport = new WorkDoneProgressReport(); + workDoneProgressReport.setCancellable(true); ProgressParams params = new ProgressParams(Either.forLeft(uri), Either.forLeft(workDoneProgressReport)); getClient().notifyProgress(params); } @@ -155,6 +156,7 @@ private void notifyWorkProgressBegin(String uri) { workDoneProgressBegin.setTitle(messageService.getMessage( "Communications.syntaxAnalysisInProgressTitle", files.getNameFromURI(uri))); + workDoneProgressBegin.setCancellable(true); params.setValue(Either.forLeft(workDoneProgressBegin)); getClient().notifyProgress(params); } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/delegates/validations/CobolLanguageEngineFacade.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/delegates/validations/CobolLanguageEngineFacade.java index 324cacdb5f..fa5ba2f519 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/delegates/validations/CobolLanguageEngineFacade.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/delegates/validations/CobolLanguageEngineFacade.java @@ -20,6 +20,7 @@ import org.eclipse.lsp.cobol.common.AnalysisResult; import org.eclipse.lsp.cobol.common.LanguageEngineFacade; import org.eclipse.lsp.cobol.core.engine.CobolLanguageEngine; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp4j.Diagnostic; /** @@ -50,6 +51,22 @@ public class CobolLanguageEngineFacade implements LanguageEngineFacade { */ @Override public AnalysisResult analyze(String uri, String text, AnalysisConfig analysisConfig) { - return engine.run(uri, text, analysisConfig); + return analyze(uri, text, analysisConfig, CobolLanguageId.COBOL.getId()); + } + + /** + * Analyze the document using the COBOL language engine for a specific cobol dialect (language id) + * and find syntax/semantic errors, variables, paragraphs etc. + * + * @param uri - URI of the processing document to define positions and errors properly + * @param text of document opened in the client editor + * @param analysisConfig contains analysis processing features info and copybook config with + * following information: target backend sql server, copybook processing mode which reflect + * the sync status of the document (DID_OPEN|DID_CHANGE) + * @return a model containing full analysis result, e.g. errors and semantic elements + */ + @Override + public AnalysisResult analyze(String uri, String text, AnalysisConfig analysisConfig, String languageId) { + return engine.run(uri, text, analysisConfig, CobolLanguageId.MAPPER.get(languageId)); } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout/CodeLayoutStore.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout/CodeLayoutStore.java index 7820d1c623..ed0c75647e 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout/CodeLayoutStore.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout/CodeLayoutStore.java @@ -23,7 +23,7 @@ import java.util.Optional; import java.util.function.Consumer; import lombok.extern.slf4j.Slf4j; -import org.eclipse.lsp.cobol.core.preprocessor.ProcessingConstants; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; /** Stores the Cobol Program layout */ @Slf4j @@ -50,8 +50,8 @@ public Consumer> updateCodeLayout() { * * @return a {@link CobolProgramLayout} instance */ - public CobolProgramLayout getCodeLayout() { - return Optional.ofNullable(layout).orElse(new CobolProgramLayout()); + public Optional getCodeLayout() { + return Optional.ofNullable(layout); } /** @@ -61,31 +61,27 @@ public CobolProgramLayout getCodeLayout() { * @return {@link CobolProgramLayout} */ private static CobolProgramLayout parseLayout(Object jsonElements) { + if (Objects.isNull(jsonElements)) return null; CobolProgramLayout.CobolProgramLayoutBuilder layoutBuilder = CobolProgramLayout.builder(); if (jsonElements instanceof JsonObject) { JsonObject element = (JsonObject) jsonElements; - layoutBuilder.sequenceLength( - Optional.ofNullable(element.get("sequence_length")) - .map(JsonElement::getAsInt) - .orElse(ProcessingConstants.SEQUENCE_LENGTH)); - layoutBuilder.indicatorLength( - Optional.ofNullable(element.get("indicator_length")) - .map(JsonElement::getAsInt) - .orElse(ProcessingConstants.INDICATOR_LENGTH)); - layoutBuilder.areaALength( - Optional.ofNullable(element.get("area_a_length")) - .map(JsonElement::getAsInt) - .orElse(ProcessingConstants.AREA_A_LENGTH)); - layoutBuilder.areaBLength( - Optional.ofNullable(element.get("area_b_length")) - .map(JsonElement::getAsInt) - .orElse(ProcessingConstants.AREA_B_LENGTH)); - layoutBuilder.commentAreaLength( - Optional.ofNullable(element.get("comment_area")) - .map(JsonElement::getAsInt) - .orElse(ProcessingConstants.COMMENT_AREA)); + Optional.ofNullable(element.get("sequence_length")) + .map(JsonElement::getAsInt) + .ifPresent(layoutBuilder::sequenceLength); + Optional.ofNullable(element.get("indicator_length")) + .map(JsonElement::getAsInt) + .ifPresent(layoutBuilder::indicatorLength); + Optional.ofNullable(element.get("area_a_length")) + .map(JsonElement::getAsInt) + .ifPresent(layoutBuilder::commentAreaLength); + Optional.ofNullable(element.get("area_b_length")) + .map(JsonElement::getAsInt) + .ifPresent(layoutBuilder::areaBLength); + Optional.ofNullable(element.get("comment_area")) + .map(JsonElement::getAsInt) + .ifPresent(layoutBuilder::commentAreaLength); return layoutBuilder.build(); } - return null; + return layoutBuilder.build(); } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout/CodeLayoutUtil.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout/CodeLayoutUtil.java new file mode 100644 index 0000000000..71ab002e04 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/service/settings/layout/CodeLayoutUtil.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.service.settings.layout; + +import java.util.Optional; +import lombok.experimental.UtilityClass; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; + +/** Utility class for code layout */ +@UtilityClass +public class CodeLayoutUtil { + /** + * Merge two layout and gives the resultant layout by combining the passed layouts + * + * @param defaultLayout default layout values + * @param proposedLayout proposed layout + * @return {@link CobolProgramLayout} + */ + public CobolProgramLayout mergeLayout( + CobolProgramLayout defaultLayout, CobolProgramLayout proposedLayout) { + Integer sequenceLength = + Optional.ofNullable(proposedLayout.getSequenceLength()) + .orElse(defaultLayout.getSequenceLength()); + Integer indicatorAreaLength = + Optional.ofNullable(proposedLayout.getIndicatorLength()) + .orElse(defaultLayout.getIndicatorLength()); + Integer areaALength = + Optional.ofNullable(proposedLayout.getAreaALength()).orElse(defaultLayout.getAreaALength()); + Integer areaBLength = + Optional.ofNullable(proposedLayout.getAreaBLength()).orElse(defaultLayout.getAreaBLength()); + Integer commentAreaLength = + Optional.ofNullable(proposedLayout.getCommentAreaLength()) + .orElse(defaultLayout.getCommentAreaLength()); + return new CobolProgramLayout( + sequenceLength, indicatorAreaLength, areaALength, areaBLength, commentAreaLength); + } + + /** + * Gives a merged {@link CobolProgramLayout} based on the user configuration and languageID + * @param defaultLangId language id send bt the LSP client + * @param layoutStore {@link CodeLayoutStore} + * @return {@link CobolProgramLayout} + */ + public CobolProgramLayout getProgramLayout( + CobolLanguageId defaultLangId, CodeLayoutStore layoutStore) { + CobolLanguageId cobolLanguageId = + CobolLanguageId.MAPPER.getOrDefault(defaultLangId, CobolLanguageId.COBOL); + return layoutStore + .getCodeLayout() + .map(lay -> mergeLayout(cobolLanguageId.getLayout(), lay)) + .orElse(cobolLanguageId.getLayout()); + } +} diff --git a/server/engine/src/main/resources/LanguageKeywords.txt b/server/engine/src/main/resources/LanguageKeywords.txt index b9fe7b22a4..48c341d7d6 100644 --- a/server/engine/src/main/resources/LanguageKeywords.txt +++ b/server/engine/src/main/resources/LanguageKeywords.txt @@ -207,6 +207,7 @@ BUT= BXNUMBER= BY= BYFUNCTION= +BYTEOFFSET= BYTITLE= CACHE= CADDRLENGTH= @@ -352,6 +353,7 @@ CONSTANT= CONSTRAINT= CONSTRAINTS= CONTAINER= +CONTAINERCNT= CONTAINS=The CONTAINS keyword is part of the BLOCK CONTAINS and RECORD CONTAINS parameters of the DATA DIVISION.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/ref/rlfde.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. CONTENT=The calling program passes only the contents of the literal or identifier.
[Read more](https://www.ibm.com/support/knowledgecenter/en/SS6SG3_6.2.0/com.ibm.cobol62.ent.doc/PGandLR/tasks/tpshr03.html)
\u00A9 Copyright IBM Corporation 1994, 2019.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. CONTENTS= @@ -1196,6 +1198,7 @@ MICROSECOND= MICROSECONDS= MIDNIGHT_SECONDS= MIG= +MILLISECS= MILLISECONDS= MIN= MINIMUM= diff --git a/server/engine/src/main/resources/resourceBundles/messages_en.properties b/server/engine/src/main/resources/resourceBundles/messages_en.properties index 5be7aeea40..cb5c64b47b 100644 --- a/server/engine/src/main/resources/resourceBundles/messages_en.properties +++ b/server/engine/src/main/resources/resourceBundles/messages_en.properties @@ -24,6 +24,8 @@ CompilerDirectivesTransformation.sequenceNumber=The first character of the seque ContinuationLineTransformation.compilerDirectiveContinued=Compiler directives cannot be continued on another line ContinuationLineTransformation.continuationLineContentAreaA=A continuation line cannot contain values in the Content Area A ContinuationLineTransformation.periodRequired=IGYDS1082-E A period was required. +missing.period=A period was assumed before "%s". +input.mismatch.skipAnalysis=Encountered invalid token. Analysis skipped to the next verb or period. inlineComment.missingBlank=Missing blank before inline comment db2SqlParser.currentQueryAcceleration=%s not valid. Must be of format %d%d%d%d.%d db2SqlParser.maxIntValue=%s not allowed. Allowed range is 1 to 32767 @@ -111,6 +113,7 @@ jsonGenProcess.identifier2.groupItemError=%s group item must have unique data-na jsonGenProcess.identifier3.dataType=%s must be an integer data item defined without the symbol P in its picture string. jsonGenProcess.identifier6.dataType=%s must be an elementary item with a PIC X clause. jsonGenProcess.condition.dataType=% must be a level-88 item directly subordinate to %s. +xmlGenProcess.identifier2.overlap=XML generate %s must not overlap %s xmlParse.identifier1.dataType=%s must be an elementary data item of category national, a national group, an elementary data item of category alphanumeric, or an alphanumeric group item xmlParse.identifier2.dataType=%s must be of category alphanumeric xmlParse.validating.phrase=Validating phrase can be specified only when XMLPARSE(XMLSS) compiler option is in effect diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/ClientServerTestModule.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/ClientServerTestModule.java index 1dfae58abe..03493f291e 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/ClientServerTestModule.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/ClientServerTestModule.java @@ -35,7 +35,6 @@ import org.eclipse.lsp.cobol.core.engine.dialects.DialectDiscoveryService; import org.eclipse.lsp.cobol.core.messages.LocaleStoreImpl; import org.eclipse.lsp.cobol.core.messages.PropertiesMessageService; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; import org.eclipse.lsp.cobol.lsp.CobolWorkspaceServiceImpl; import org.eclipse.lsp.cobol.lsp.DisposableLSPStateService; import org.eclipse.lsp.cobol.lsp.jrpc.CobolLanguageClient; @@ -62,7 +61,6 @@ import org.eclipse.lsp.cobol.service.delegates.references.Occurrences; import org.eclipse.lsp.cobol.service.mocks.MockLanguageClient; import org.eclipse.lsp.cobol.service.mocks.MockLanguageServer; -import org.eclipse.lsp.cobol.service.mocks.MockTextPreprocessor; import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; import org.eclipse.lsp.cobol.service.settings.ConfigurationService; import org.eclipse.lsp.cobol.service.settings.SettingsService; @@ -102,7 +100,6 @@ protected void configure() { bind(SubroutineService.class).to(SubroutineServiceImpl.class); bind(Occurrences.class).to(ElementOccurrences.class); bind(CFASTBuilder.class).to(CFASTBuilderImpl.class); - bind(TextPreprocessor.class).to(MockTextPreprocessor.class); bind(CopybookIdentificationService.class) .annotatedWith(Names.named("contentStrategy")) .to(CopybookIdentificationServiceBasedOnContent.class); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/cli/CliTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/cli/CliTest.java new file mode 100644 index 0000000000..a7b71a23f9 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/cli/CliTest.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.cli; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.junit.jupiter.MockitoExtension; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Test for {@link Cli} + */ +@ExtendWith(MockitoExtension.class) +class CliTest { + + @Test + void testCall_srcNull() { + Cli cli = new Cli(); + Integer actual; + try { + actual = cli.call(); + } catch (Exception e) { + throw new RuntimeException(e); + } + + assertEquals(1, actual); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/engine/CobolLanguageEngineTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/core/engine/CobolLanguageEngineTest.java index 0893713de0..8dcc904c92 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/engine/CobolLanguageEngineTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/core/engine/CobolLanguageEngineTest.java @@ -24,14 +24,13 @@ import com.google.common.collect.ImmutableList; import org.antlr.v4.runtime.tree.ParseTreeListener; -import org.eclipse.lsp.cobol.common.AnalysisConfig; -import org.eclipse.lsp.cobol.common.AnalysisResult; -import org.eclipse.lsp.cobol.common.ResultWithErrors; -import org.eclipse.lsp.cobol.common.SubroutineService; +import org.eclipse.lsp.cobol.common.*; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkService; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkSession; +import org.eclipse.lsp.cobol.common.copybook.CopybookService; import org.eclipse.lsp.cobol.common.dialects.DialectOutcome; import org.eclipse.lsp.cobol.common.dialects.DialectProcessingContext; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.common.error.SyntaxError; import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; @@ -40,16 +39,17 @@ import org.eclipse.lsp.cobol.common.model.Locality; import org.eclipse.lsp.cobol.common.model.NodeType; import org.eclipse.lsp.cobol.common.model.tree.Node; -import org.eclipse.lsp.cobol.core.ParserUtils; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; import org.eclipse.lsp.cobol.core.engine.errors.ErrorFinalizerService; import org.eclipse.lsp.cobol.core.engine.processor.AstProcessor; import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessor; import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; import org.eclipse.lsp.cobol.core.strategy.CobolErrorStrategy; import org.eclipse.lsp.cobol.core.strategy.ErrorMessageHelper; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.dialects.TrueDialectServiceImpl; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.eclipse.lsp.cobol.usecases.DialectConfigs; import org.eclipse.lsp4j.Position; @@ -60,7 +60,7 @@ /** * This test checks the logic of {@link CobolLanguageEngine}. It should first run {@link - * TextPreprocessor} to clean up the given COBOL text, then apply syntax and semantic analysis. If + * CleanerPreprocessor} to clean up the given COBOL text, then apply syntax and semantic analysis. If * the text doesn't have any semantic elements, it should return an empty {@link Node} */ class CobolLanguageEngineTest { @@ -68,7 +68,6 @@ class CobolLanguageEngineTest { private static final String TEXT = " IDENTIFICATION DIVISION."; private static final String URI = "document.cbl"; - private final TextPreprocessor preprocessor = mock(TextPreprocessor.class); private final GrammarPreprocessor grammarPreprocessor = mock(GrammarPreprocessor.class); private final MessageService mockMessageService = mock(MessageService.class); private final ErrorMessageHelper mockErrUtil = mock(ErrorMessageHelper.class); @@ -77,6 +76,9 @@ class CobolLanguageEngineTest { private final DialectService dialectService = mock(DialectService.class); private final AstProcessor astProcessor = mock(AstProcessor.class); private final SymbolsRepository symbolsRepository = mock(SymbolsRepository.class); + private final CleanerPreprocessor preprocessor = mock(CleanerPreprocessor.class); + private final CodeLayoutStore store = mock(CodeLayoutStore.class); + private final CopybookService copybookService = mock(CopybookService.class); @Test void testLanguageEngineRun() { @@ -84,15 +86,18 @@ void testLanguageEngineRun() { cobolErrorStrategy.setErrorMessageHelper(mockErrUtil); AstProcessor astProcessor = mock(AstProcessor.class); SymbolsRepository symbolsRepository = mock(SymbolsRepository.class); - CodeLayoutStore codeLayoutStore = mock(CodeLayoutStore.class); BenchmarkService benchmarkService = mock(BenchmarkService.class); when(benchmarkService.startSession()).thenReturn(new BenchmarkSession()); + + TrueDialectService trueDialectService = new TrueDialectServiceImpl(grammarPreprocessor, mockMessageService, treeListener, mock(SubroutineService.class), + null, + dialectService, astProcessor, symbolsRepository, store, copybookService); CobolLanguageEngine engine = - new CobolLanguageEngine( - preprocessor, grammarPreprocessor, mockMessageService, treeListener, mock(SubroutineService.class), null, - dialectService, astProcessor, symbolsRepository, mock(ErrorFinalizerService.class), - benchmarkService, codeLayoutStore); + new CobolLanguageEngine(trueDialectService, + mockMessageService, + mock(ErrorFinalizerService.class), + benchmarkService); when(mockMessageService.getMessage(anyString(), anyString(), anyString())).thenReturn(""); Locality locality = Locality.builder() @@ -129,28 +134,22 @@ dialectService, astProcessor, symbolsRepository, mock(ErrorFinalizerService.clas when(preprocessor.cleanUpCode(URI, TEXT)) .thenReturn(new ResultWithErrors<>(new ExtendedText(TEXT, URI), ImmutableList.of())); - when(grammarPreprocessor.preprocess(any())).thenReturn(new ResultWithErrors<>(new CopybooksRepository(), ImmutableList.of())); - - Range sourceRange = ParserUtils.isHwParserEnabled() - ? new Range(new Position(0, 0), new Position(0, 32)) - : new Range(new Position(0, 7), new Position(0, 31)); - Range programRange = ParserUtils.isHwParserEnabled() - ? new Range(new Position(0, 7), new Position(0, 32)) - : new Range(new Position(0, 7), new Position(0, 31)); - Range divisionRange = ParserUtils.isHwParserEnabled() - ? new Range(new Position(0, 7), new Position(0, 31)) - : new Range(new Position(0, 7), new Position(0, 31)); - AnalysisResult actual = engine.run(URI, TEXT, AnalysisConfig.defaultConfig(ENABLED)); + when(grammarPreprocessor.preprocess(any(), any())).thenReturn(new ResultWithErrors<>(new CopybooksRepository(), ImmutableList.of())); + + Range sourceRange = new Range(new Position(0, 7), new Position(0, 31)); + Range programRange = new Range(new Position(0, 7), new Position(0, 31)); + Range divisionRange = new Range(new Position(0, 7), new Position(0, 31)); + AnalysisResult actual = engine.run(URI, TEXT, AnalysisConfig.defaultConfig(ENABLED), CobolLanguageId.COBOL); Node root = actual.getRootNode(); Node program = root.getChildren().get(0); Node division = program.getChildren().get(0); assertEquals(NodeType.ROOT, root.getNodeType()); - assertEquals(sourceRange, root.getLocality().getRange()); + assertEquals(programRange, root.getLocality().getRange()); assertEquals(NodeType.PROGRAM, program.getNodeType()); assertEquals(programRange, program.getLocality().getRange()); assertEquals(NodeType.DIVISION, division.getNodeType()); - assertEquals(divisionRange, division.getLocality().getRange()); + assertEquals(programRange, division.getLocality().getRange()); assertEquals(0, division.getChildren().size()); } @@ -160,16 +159,19 @@ void testLanguageEngineRunWhenNativeServerWithDialects() { cobolErrorStrategy.setErrorMessageHelper(mockErrUtil); when(mockMessageService.getMessage("workspaceError.ServerType")).thenReturn(ERROR_MSG); System.setProperty("serverType", "NATIVE"); - CodeLayoutStore codeLayoutStore = mock(CodeLayoutStore.class); BenchmarkService benchmarkService = mock(BenchmarkService.class); when(benchmarkService.startSession()).thenReturn(mock(BenchmarkSession.class)); + + TrueDialectService trueDialectService = new TrueDialectServiceImpl(grammarPreprocessor, mockMessageService, treeListener, mock(SubroutineService.class), + null, + dialectService, astProcessor, symbolsRepository, store, copybookService); CobolLanguageEngine engine = - new CobolLanguageEngine( - preprocessor, grammarPreprocessor, mockMessageService, treeListener, mock(SubroutineService.class), null, - dialectService, astProcessor, symbolsRepository, - mock(ErrorFinalizerService.class), benchmarkService, codeLayoutStore); + new CobolLanguageEngine(trueDialectService, + mockMessageService, + mock(ErrorFinalizerService.class), + benchmarkService); - AnalysisResult actual = engine.run(URI, TEXT, DialectConfigs.getDaCoAnalysisConfig()); + AnalysisResult actual = engine.run(URI, TEXT, DialectConfigs.getDaCoAnalysisConfig(), CobolLanguageId.COBOL); Assertions.assertEquals(1, actual.getDiagnostics().size()); Assertions.assertEquals(ERROR_MSG, actual.getDiagnostics().get(URI).get(0).getMessage()); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/CompilerDirectivesStageTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/CompilerDirectivesStageTest.java index 425d7122f0..892aa7da5d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/CompilerDirectivesStageTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/core/engine/pipeline/stages/CompilerDirectivesStageTest.java @@ -19,6 +19,7 @@ import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; import org.eclipse.lsp.cobol.common.message.MessageService; import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.dialects.ibm.CompilerDirectivesStage; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/messages/CobolLSPropertiesResourceBundleTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/core/messages/CobolLSPropertiesResourceBundleTest.java index 05d47286aa..8cdf281326 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/messages/CobolLSPropertiesResourceBundleTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/core/messages/CobolLSPropertiesResourceBundleTest.java @@ -18,9 +18,12 @@ import com.google.common.collect.ImmutableList; import org.eclipse.lsp.cobol.common.DialectRegistryItem; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; import java.io.IOException; +import java.net.MalformedURLException; import java.net.URI; import java.net.URL; import java.nio.charset.StandardCharsets; @@ -31,7 +34,23 @@ import static org.mockito.Mockito.*; /** Tests @{@link CobolLSPropertiesResourceBundle} */ +@TestInstance(TestInstance.Lifecycle.PER_CLASS) class CobolLSPropertiesResourceBundleTest { + private URI uri; + @BeforeAll + void init() { + uri = mock(URI.class); + mockConstruction(JarFile.class); + JarFile jarFileSpy = mock(JarFile.class); + URL url = mock(URL.class); + try { + when(uri.toURL()).thenReturn(url); + } catch (MalformedURLException e) { + throw new RuntimeException(e); + } + when(url.getFile()).thenReturn("file://uri"); + when(jarFileSpy.getJarEntry("resourceBundles/test")).thenReturn(null); + } @Test void updateMessageResourceBundle() throws IOException { @@ -62,19 +81,60 @@ void updateMessageResourceBundle() throws IOException { @Test void updateMessageResourceBundleWhenResourcesNotFound() throws IOException { - URI uri = mock(URI.class); DialectRegistryItem dialectRegistryItem = new DialectRegistryItem("dummyDialect", uri, "dummy dialect", "dummyDialect"); CobolLSPropertiesResourceBundle bundle = new CobolLSPropertiesResourceBundle( "resourceBundles/test", Locale.FRENCH); + bundle.updateMessageResourceBundle(dialectRegistryItem); - mockConstruction(JarFile.class); - JarFile jarFileSpy = mock(JarFile.class); - URL url = mock(URL.class); - when(uri.toURL()).thenReturn(url); - when(url.getFile()).thenReturn("file://uri"); - when(jarFileSpy.getJarEntry("resourceBundles/test")).thenReturn(null); + Assertions.assertEquals(bundle.handleGetObject("test.test"), "test.test"); + Assertions.assertEquals(bundle.handleGetObject("1"), "French test selected."); + } + + @Test + void updateMessageResourceBundleNoLocale() throws IOException { + DialectRegistryItem dialectRegistryItem = new DialectRegistryItem("dummyDialect", uri, "dummy dialect", "dummyDialect"); + CobolLSPropertiesResourceBundle bundle = + new CobolLSPropertiesResourceBundle( + "resourceBundles/test", new Locale("")); + bundle.updateMessageResourceBundle(dialectRegistryItem); + + Assertions.assertEquals(bundle.handleGetObject("test.test"), "test.test"); + Assertions.assertEquals(bundle.handleGetObject("1"), "This is a test."); + } + + @Test + void updateMessageResourceBundleLocaleWithScript() throws IOException { + DialectRegistryItem dialectRegistryItem = new DialectRegistryItem("dummyDialect", uri, "dummy dialect", "dummyDialect"); + Locale locale = new Locale.Builder().setLanguage("fr").setRegion("FR").setScript("Latn").build(); + CobolLSPropertiesResourceBundle bundle = + new CobolLSPropertiesResourceBundle( + "resourceBundles/test", locale); + bundle.updateMessageResourceBundle(dialectRegistryItem); + + Assertions.assertEquals(bundle.handleGetObject("test.test"), "test.test"); + Assertions.assertEquals(bundle.handleGetObject("1"), "French test selected."); + } + @Test + void updateMessageResourceBundleLocaleWithVariant() throws IOException { + DialectRegistryItem dialectRegistryItem = new DialectRegistryItem("dummyDialect", uri, "dummy dialect", "dummyDialect"); + Locale locale = new Locale.Builder().setLanguage("fr").setRegion("FR").setVariant("variant").build(); + CobolLSPropertiesResourceBundle bundle = + new CobolLSPropertiesResourceBundle( + "resourceBundles/test", locale); + bundle.updateMessageResourceBundle(dialectRegistryItem); + Assertions.assertEquals(bundle.handleGetObject("test.test"), "test.test"); + Assertions.assertEquals(bundle.handleGetObject("1"), "French test selected."); + } + + @Test + void updateMessageResourceBundleLocaleWithScriptVariant() throws IOException { + DialectRegistryItem dialectRegistryItem = new DialectRegistryItem("dummyDialect", uri, "dummy dialect", "dummyDialect"); + Locale locale = new Locale.Builder().setLanguage("fr").setRegion("FR").setScript("Latn").setVariant("variant").build(); + CobolLSPropertiesResourceBundle bundle = + new CobolLSPropertiesResourceBundle( + "resourceBundles/test", locale); bundle.updateMessageResourceBundle(dialectRegistryItem); Assertions.assertEquals(bundle.handleGetObject("test.test"), "test.test"); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/util/CobolLineUtilsTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/util/CobolLineUtilsTest.java index c42a243ffa..e0226571c5 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/util/CobolLineUtilsTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/util/CobolLineUtilsTest.java @@ -19,7 +19,8 @@ import org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum; import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; import org.junit.jupiter.api.Test; /** This class is a unit test for {@link CobolLineUtils} and checks its utility methods. */ @@ -50,7 +51,7 @@ void copyCobolLineWithContentArea() { expected.setType(CobolLineTypeEnum.COMMENT); CobolLine actual = - CobolLineUtils.copyCobolLineWithContentArea("", line, new CobolProgramLayout()); + CobolLineUtils.copyCobolLineWithContentArea("", line, CobolLanguageId.COBOL.getLayout()); assertEquals(expected, actual); } @@ -99,7 +100,8 @@ void copyCobolLineWithContentAreaLineIsSplitBetweenAreas() { expected.setContentAreaB("56"); CobolLine actual = - CobolLineUtils.copyCobolLineWithContentArea("123456", line, new CobolProgramLayout()); + CobolLineUtils.copyCobolLineWithContentArea( + "123456", line, CobolLanguageId.COBOL.getLayout()); assertEquals(expected, actual); } @@ -120,7 +122,7 @@ void copyCobolLineWithIndicatorAndContentArea() { CobolLine actual = CobolLineUtils.copyCobolLineWithIndicatorAndContentArea( - "-", "123456", line, new CobolProgramLayout()); + "-", "123456", line, CobolLanguageId.COBOL.getLayout()); assertEquals(expected, actual); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/visitor/CobolDataDivisionVisitorTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/core/visitor/CobolDataDivisionVisitorTest.java index 900469bd91..fba16b2537 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/visitor/CobolDataDivisionVisitorTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/core/visitor/CobolDataDivisionVisitorTest.java @@ -25,6 +25,7 @@ import org.eclipse.lsp.cobol.core.CobolDataDivisionParser.*; import org.eclipse.lsp.cobol.core.CobolParser; import org.eclipse.lsp.cobol.core.semantics.CopybooksRepository; +import org.eclipse.lsp.cobol.dialects.ibm.experimental.visitors.CobolDataDivisionVisitor; import org.eclipse.lsp4j.Location; import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/AbstractCobolLinePreprocessorTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/AbstractCobolLinePreprocessorTest.java similarity index 73% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/core/AbstractCobolLinePreprocessorTest.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/AbstractCobolLinePreprocessorTest.java index 632662293f..48553a9a3e 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/AbstractCobolLinePreprocessorTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/AbstractCobolLinePreprocessorTest.java @@ -12,43 +12,39 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core; +package org.eclipse.lsp.cobol.dialects.ibm; -import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.matches; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.util.List; +import java.util.Optional; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.message.MessageService; import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReader; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReaderImpl; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; +import org.eclipse.lsp.cobol.common.dialects.CobolProgramLayout; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; public abstract class AbstractCobolLinePreprocessorTest { protected ResultWithErrors> processText(String text) { MessageService mockMessageService = mock(MessageService.class); - CodeLayoutStore layoutStore = mock(CodeLayoutStore.class); - when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout()); - - CobolLineReader reader = new CobolLineReaderImpl(mockMessageService, layoutStore); + CobolLineReader reader = new IbmCobolLineReader(mockMessageService, null); when(mockMessageService.getMessage(matches("CobolLineReaderImpl.incorrectLineFormat"))) .thenReturn("Unexpected indicator area content"); - when(mockMessageService.getMessage(matches("CobolLineReaderImpl.longLineMsg"), any())) + when(mockMessageService.getMessage(matches("CobolLineReaderImpl.longLineMsg"), anyInt())) .thenReturn("Source text cannot go past column 80"); return reader.processLines("", text); } protected ResultWithErrors> processTextWithNoSequenceArea(String text) { MessageService mockMessageService = mock(MessageService.class); - CodeLayoutStore layoutStore = mock(CodeLayoutStore.class); - when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout(0, 1, 4, 61, 8)); - - CobolLineReader reader = new CobolLineReaderImpl(mockMessageService, layoutStore); + CodeLayoutStore store = mock(CodeLayoutStore.class); + when(store.getCodeLayout()).thenReturn(Optional.of(new CobolProgramLayout(0, 1, 4, 61, 8))); + CobolLineReader reader = new IbmCobolLineReader(mockMessageService, store); when(mockMessageService.getMessage(matches("CobolLineReaderImpl.incorrectLineFormat"))) .thenReturn("Unexpected indicator area content"); when(mockMessageService.getMessage(matches("CobolLineReaderImpl.longLineMsg"))) diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/rewriter/impl/CobolLineIndicatorProcessorImplTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/CobolLineIndicatorProcessorImplTest.java similarity index 86% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/rewriter/impl/CobolLineIndicatorProcessorImplTest.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/CobolLineIndicatorProcessorImplTest.java index 0520468d1b..bd6f868db1 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/rewriter/impl/CobolLineIndicatorProcessorImplTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/CobolLineIndicatorProcessorImplTest.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.impl; +package org.eclipse.lsp.cobol.dialects.ibm; import static org.eclipse.lsp.cobol.core.model.CobolLineTypeEnum.*; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -21,18 +21,25 @@ import com.google.common.collect.ImmutableList; import java.util.List; +import java.util.Optional; import lombok.val; import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; import org.eclipse.lsp.cobol.core.preprocessor.ProcessingConstants; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineIndicatorProcessorImpl; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.LineIndicatorProcessor; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; /** Testing that the cobol lines formatted correctly before being used for token analysis */ class CobolLineIndicatorProcessorImplTest { private static final String EMPTY_STRING = ""; + private final CodeLayoutStore store = mock(CodeLayoutStore.class); + + @BeforeEach + void setup() { + when(store.getCodeLayout()).thenReturn(Optional.empty()); + } /** Testing Debug lines preformatting for Token analysis */ @Test @@ -43,8 +50,7 @@ void debugLineTest() { debugLine.setContentAreaA(" "); debugLine.setContentAreaB(" DEBUG LINE HERE "); - CodeLayoutStore layoutStore = getMockLayoutStore(); - CobolLineIndicatorProcessorImpl processor = new CobolLineIndicatorProcessorImpl(layoutStore); + LineIndicatorProcessor processor = new IbmCobolLineIndicatorProcessor(store); List outcome = processor.processLines(ImmutableList.of(debugLine)); CobolLine actual = outcome.get(0); @@ -53,11 +59,6 @@ void debugLineTest() { actual.getIndicatorArea() + actual.getContentArea()); } - private CodeLayoutStore getMockLayoutStore() { - CodeLayoutStore layoutStore = mock(CodeLayoutStore.class); - when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout()); - return layoutStore; - } /** Testing normal lines pre-formatting for Token analysis */ @Test @@ -68,8 +69,8 @@ void normalLineTest() { normalLine.setContentAreaA(" "); normalLine.setContentAreaB(" RANDOM TEXT , "); - CobolLineIndicatorProcessorImpl processor = - new CobolLineIndicatorProcessorImpl(getMockLayoutStore()); + LineIndicatorProcessor processor = + new IbmCobolLineIndicatorProcessor(store); List outcome = processor.processLines(ImmutableList.of(normalLine)); CobolLine actual = outcome.get(0); @@ -86,9 +87,7 @@ void normalLineTest_whenCodeLayoutIsDifferent_thenProcessingHappensAsPerLayout() normalLine.setIndicatorArea(ProcessingConstants.WS); normalLine.setContentAreaA(" "); normalLine.setContentAreaB(" RANDOM TEXT , "); - CodeLayoutStore layoutStore = mock(CodeLayoutStore.class); - when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout(3, 1, 3, 40, 0)); - CobolLineIndicatorProcessorImpl processor = new CobolLineIndicatorProcessorImpl(layoutStore); + LineIndicatorProcessor processor = new IbmCobolLineIndicatorProcessor(store); List outcome = processor.processLines(ImmutableList.of(normalLine)); CobolLine actual = outcome.get(0); @@ -107,8 +106,8 @@ void compilerDirectiveTest() { compilerDirectiveLine.setContentAreaA(" "); compilerDirectiveLine.setContentAreaB("DEFINE"); - CobolLineIndicatorProcessorImpl processor = - new CobolLineIndicatorProcessorImpl(getMockLayoutStore()); + LineIndicatorProcessor processor = + new IbmCobolLineIndicatorProcessor(store); List outcome = processor.processLines(ImmutableList.of(compilerDirectiveLine)); CobolLine actual = outcome.get(0); @@ -125,8 +124,8 @@ void commentLineTest() { commentLine.setContentAreaA(" "); commentLine.setContentAreaB("THIS IS A COMMENT "); - CobolLineIndicatorProcessorImpl processor = - new CobolLineIndicatorProcessorImpl(getMockLayoutStore()); + LineIndicatorProcessor processor = + new IbmCobolLineIndicatorProcessor(null); List outcome = processor.processLines(ImmutableList.of(commentLine)); CobolLine actual = outcome.get(0); @@ -144,8 +143,8 @@ void floatingCommentLineTest() { commentLine.setContentAreaA("PROGRAM-ID. comments *> Floating"); commentLine.setContentAreaB(" comment"); - CobolLineIndicatorProcessorImpl processor = - new CobolLineIndicatorProcessorImpl(getMockLayoutStore()); + LineIndicatorProcessor processor = + new IbmCobolLineIndicatorProcessor(null); List outcome = processor.processLines(ImmutableList.of(commentLine)); CobolLine actual = outcome.get(0); @@ -181,8 +180,8 @@ void continuationLineTest() { List listOfLines = ImmutableList.of(startContinuationLine, middleContinuationLine, lastContinuationLine); - CobolLineIndicatorProcessorImpl processor = - new CobolLineIndicatorProcessorImpl(getMockLayoutStore()); + LineIndicatorProcessor processor = + new IbmCobolLineIndicatorProcessor(null); List outcomeList = processor.processLines(listOfLines); assertEquals( @@ -210,8 +209,8 @@ void emptyContinuationLine() { continuationLine.setSuccessor(emptyContinuationLine); final List listOfLines = ImmutableList.of(continuationLine, emptyContinuationLine); - CobolLineIndicatorProcessorImpl processor = - new CobolLineIndicatorProcessorImpl(getMockLayoutStore()); + LineIndicatorProcessor processor = + new IbmCobolLineIndicatorProcessor(null); List outcomeList = processor.processLines(listOfLines); assertEquals( @@ -242,8 +241,8 @@ void trailingCommaContinuationLineTest() { List listOfLines = ImmutableList.of(startContinuationLine, trailingCommaContinuationLine); - CobolLineIndicatorProcessorImpl processor = - new CobolLineIndicatorProcessorImpl(getMockLayoutStore()); + LineIndicatorProcessor processor = + new IbmCobolLineIndicatorProcessor(null); List outcomeList = processor.processLines(listOfLines); assertEquals( @@ -280,8 +279,8 @@ void continuationLineWithoutBeginningQuotes() { startContinuationLine.setSuccessor(quoteContinuationLine); quoteContinuationLine.setSuccessor(lastContinuationLine); - CobolLineIndicatorProcessorImpl processor = - new CobolLineIndicatorProcessorImpl(getMockLayoutStore()); + LineIndicatorProcessor processor = + new IbmCobolLineIndicatorProcessor(null); List outcome = processor.processLines(ImmutableList.of(lastContinuationLine)); CobolLine actual = outcome.get(0); @@ -317,8 +316,8 @@ void continuationLineWithOuterQuotes() { startContinuationLine.setSuccessor(quoteContinuationLine); quoteContinuationLine.setSuccessor(lastContinuationLine); - CobolLineIndicatorProcessorImpl processor = - new CobolLineIndicatorProcessorImpl(getMockLayoutStore()); + LineIndicatorProcessor processor = + new IbmCobolLineIndicatorProcessor(null); List outcome = processor.processLines(ImmutableList.of(lastContinuationLine)); val actual = outcome.get(0); @@ -340,8 +339,8 @@ void noExceptionOnNotFormattedLine() { notFormattedLine.setSequenceArea(" P-ADD"); notFormattedLine.setType(CONTINUATION); - CobolLineIndicatorProcessorImpl processor = - new CobolLineIndicatorProcessorImpl(getMockLayoutStore()); + LineIndicatorProcessor processor = + new IbmCobolLineIndicatorProcessor(null); List outcome = processor.processLines(ImmutableList.of(notFormattedLine)); val actual = outcome.get(0); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/reader/impl/CobolLineReaderImplTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/CobolLineReaderImplTest.java similarity index 98% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/reader/impl/CobolLineReaderImplTest.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/CobolLineReaderImplTest.java index a140747c77..787405e4bd 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/reader/impl/CobolLineReaderImplTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/CobolLineReaderImplTest.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.impl; +package org.eclipse.lsp.cobol.dialects.ibm; import static java.util.stream.IntStream.range; import static org.hamcrest.CoreMatchers.is; @@ -25,7 +25,6 @@ import java.util.List; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.error.SyntaxError; -import org.eclipse.lsp.cobol.core.AbstractCobolLinePreprocessorTest; import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.Range; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/writer/impl/CobolLineWriterImplTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/CobolLineWriterImplTest.java similarity index 82% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/writer/impl/CobolLineWriterImplTest.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/CobolLineWriterImplTest.java index 19ef54f047..c7d7573122 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/writer/impl/CobolLineWriterImplTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/CobolLineWriterImplTest.java @@ -12,19 +12,17 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.impl; +package org.eclipse.lsp.cobol.dialects.ibm; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.util.List; +import java.util.Optional; import org.eclipse.lsp.cobol.common.ResultWithErrors; -import org.eclipse.lsp.cobol.core.AbstractCobolLinePreprocessorTest; import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriter; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriterImpl; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.junit.jupiter.api.Test; @@ -53,9 +51,9 @@ class CobolLineWriterImplTest extends AbstractCobolLinePreprocessorTest { @Test void test() { ResultWithErrors> result = super.processText(TEXT_TO_TEST); - CodeLayoutStore layoutStore = mock(CodeLayoutStore.class); - when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout()); - CobolLineWriter writer = new CobolLineWriterImpl(layoutStore); + CodeLayoutStore store = mock(CodeLayoutStore.class); + when(store.getCodeLayout()).thenReturn(Optional.empty()); + CobolLineWriter writer = new IbmCobolLineWriter(store); assertEquals(EXPECTED, writer.serialize(result.getResult(), "").toString()); assertEquals(0, result.getErrors().size()); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/transformer/ContinuationLineTransformationTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/ContinuationLineTransformationTest.java similarity index 88% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/transformer/ContinuationLineTransformationTest.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/ContinuationLineTransformationTest.java index 5cf5eaca83..b6dc6220be 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/delegates/transformer/ContinuationLineTransformationTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/ContinuationLineTransformationTest.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer; +package org.eclipse.lsp.cobol.dialects.ibm; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.mock; @@ -20,11 +20,11 @@ import java.util.ArrayList; import java.util.List; +import java.util.Optional; import org.eclipse.lsp.cobol.common.error.SyntaxError; import org.eclipse.lsp.cobol.common.message.MessageService; -import org.eclipse.lsp.cobol.core.AbstractCobolLinePreprocessorTest; import org.eclipse.lsp.cobol.core.preprocessor.CobolLine; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.ContinuationLineTransformation; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.junit.jupiter.api.Test; @@ -107,16 +107,12 @@ void testQuotesInsideStringNotCauseError() { private List runTransformation(String text) { List lines = convertToCobolLines(text); MessageService mockMessageService = mock(MessageService.class); - ContinuationLineTransformation transformation = new ContinuationLineTransformation(mockMessageService, getMockLayoutStore()); + CodeLayoutStore store = mock(CodeLayoutStore.class); + when(store.getCodeLayout()).thenReturn(Optional.empty()); + ContinuationLineTransformation transformation = new IbmCobolContinuationLineTransformation(mockMessageService, store); return transformation.transformLines("", lines).getErrors(); } - private CodeLayoutStore getMockLayoutStore() { - CodeLayoutStore layoutStore = mock(CodeLayoutStore.class); - when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout()); - return layoutStore; - } - private List convertToCobolLines(String text) { return super.processText(text).getResult(); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/TestCommentLines.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/TestCommentLines.java similarity index 60% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/TestCommentLines.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/TestCommentLines.java index 78358c3107..3ede96111f 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/TestCommentLines.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/TestCommentLines.java @@ -13,28 +13,22 @@ * */ -package org.eclipse.lsp.cobol.core.preprocessor; +package org.eclipse.lsp.cobol.dialects.ibm; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import java.util.ArrayList; import java.util.List; +import java.util.Optional; + +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.error.SyntaxError; import org.eclipse.lsp.cobol.common.message.MessageService; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReader; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReaderImpl; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineIndicatorProcessorImpl; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineReWriter; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.CobolLinesTransformation; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.ContinuationLineTransformation; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriter; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriterImpl; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.junit.jupiter.api.Test; -import org.mockito.Mockito; /** This test checks multiple comment entries are parsed and cleaned up correctly */ class TestCommentLines { @@ -63,15 +57,11 @@ class TestCommentLines { void test() { List accumulatedErrors = new ArrayList<>(); MessageService messageService = mock(MessageService.class); - CodeLayoutStore layoutStore = mock(CodeLayoutStore.class); - Mockito.when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout()); - CobolLineReader reader = new CobolLineReaderImpl(messageService, layoutStore); - CobolLineWriter writer = new CobolLineWriterImpl(layoutStore); - CobolLinesTransformation transformation = new ContinuationLineTransformation(messageService, layoutStore); - CobolLineReWriter indicatorProcessor = new CobolLineIndicatorProcessorImpl(layoutStore); + CodeLayoutStore store = mock(CodeLayoutStore.class); + when(store.getCodeLayout()).thenReturn(Optional.empty()); - TextPreprocessor textPreprocessor = - new TextPreprocessorImpl(reader, writer, transformation, indicatorProcessor); + CleanerPreprocessor textPreprocessor = + new IbmTextPreprocessor(messageService, store); String actual = textPreprocessor.cleanUpCode(DOCUMENT_URI, TEXT).unwrap(accumulatedErrors::addAll).toString(); assertEquals(EXPECTED, actual); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/TestLinesConcatenation.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/TestLinesConcatenation.java similarity index 66% rename from server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/TestLinesConcatenation.java rename to server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/TestLinesConcatenation.java index df1d10398a..0e4872b159 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/core/preprocessor/TestLinesConcatenation.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/dialects/ibm/TestLinesConcatenation.java @@ -13,7 +13,7 @@ * */ -package org.eclipse.lsp.cobol.core.preprocessor; +package org.eclipse.lsp.cobol.dialects.ibm; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -21,18 +21,12 @@ import java.util.ArrayList; import java.util.List; +import java.util.Optional; + +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.error.SyntaxError; import org.eclipse.lsp.cobol.common.mapping.ExtendedText; import org.eclipse.lsp.cobol.common.message.MessageService; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReader; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReaderImpl; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineIndicatorProcessorImpl; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineReWriter; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.CobolLinesTransformation; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.ContinuationLineTransformation; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriter; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriterImpl; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.junit.jupiter.api.Test; @@ -67,16 +61,10 @@ class TestLinesConcatenation { void test() { List accumulatedErrors = new ArrayList<>(); MessageService messageService = mock(MessageService.class); - CodeLayoutStore layoutStore = mock(CodeLayoutStore.class); - when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout()); - when(layoutStore.updateCodeLayout()).thenReturn(l -> {}); - - CobolLineReader reader = new CobolLineReaderImpl(messageService, layoutStore); - CobolLineWriter writer = new CobolLineWriterImpl(layoutStore); - CobolLinesTransformation transformation = new ContinuationLineTransformation(messageService, layoutStore); - CobolLineReWriter indicatorProcessor = new CobolLineIndicatorProcessorImpl(layoutStore); + CodeLayoutStore store = mock(CodeLayoutStore.class); + when(store.getCodeLayout()).thenReturn(Optional.empty()); - TextPreprocessor textPreprocessor = new TextPreprocessorImpl(reader, writer, transformation, indicatorProcessor); + CleanerPreprocessor textPreprocessor = new IbmTextPreprocessor(messageService, store); ExtendedText extendedText = textPreprocessor.cleanUpCode(DOCUMENT_URI, TEXT).unwrap(accumulatedErrors::addAll); assertEquals(EXPECTED, extendedText.toString()); assertTrue(accumulatedErrors.isEmpty()); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/SourceUnitGraphTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/SourceUnitGraphTest.java index 294848e1c6..1eefa48181 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/SourceUnitGraphTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/SourceUnitGraphTest.java @@ -43,7 +43,7 @@ class SourceUnitGraphTest { public static final String URI = "file://document.cbl"; @Mock private WorkspaceFileService fileService; @Mock private AsyncAnalysisService asyncAnalysisService; - @Mock private UriDecodeService uriDecodeService; + private final UriDecodeService uriDecodeService = new UriDecodeService(); @Test void testNotifyState() { diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/analysis/AsyncAnalysisServiceTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/analysis/AsyncAnalysisServiceTest.java index a0008c7ba9..bdc0081e36 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/analysis/AsyncAnalysisServiceTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/analysis/AsyncAnalysisServiceTest.java @@ -14,7 +14,15 @@ */ package org.eclipse.lsp.cobol.lsp.analysis; +import static org.mockito.Mockito.*; + +import com.google.common.collect.ImmutableList; +import java.lang.reflect.Field; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.eclipse.lsp.cobol.common.SubroutineService; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.lsp.SourceUnitGraph; import org.eclipse.lsp.cobol.service.AnalysisService; import org.eclipse.lsp.cobol.service.CobolDocumentModel; @@ -27,13 +35,6 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import java.lang.reflect.Field; -import java.util.*; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import static org.mockito.Mockito.*; - /** * Test {@link AsyncAnalysisService} */ @@ -54,8 +55,8 @@ class AsyncAnalysisServiceTest { @BeforeEach void setUp() { - asyncAnalysisService = new AsyncAnalysisService(documentModelService, analysisService, copybookService, - subroutineService, communication); + asyncAnalysisService = new AsyncAnalysisService(mock(TrueDialectService.class), + documentModelService, analysisService, copybookService, subroutineService, communication); } @Test @@ -83,7 +84,11 @@ void testReanalyseCopybooksAssociatedPrograms() { List uris = Stream.of("URI1", "URI2").collect(Collectors.toList()); SourceUnitGraph.EventSource eventSource = mock(SourceUnitGraph.EventSource.class); CobolDocumentModel cobolDocumentModel = mock(CobolDocumentModel.class); + when(cobolDocumentModel.getUri()).thenReturn("URI1"); + when(cobolDocumentModel.getText()).thenReturn("code"); + when(documentModelService.getAllOpened()).thenReturn(ImmutableList.of(cobolDocumentModel)); when(documentModelService.get(any())).thenReturn(cobolDocumentModel); + when(analysisService.isCopybook(anyString(), anyString())).thenReturn(false); when(analysisResultsRevisionsMock.get(cobolDocumentModel.getUri())).thenReturn(1); asyncAnalysisService.reanalyseCopybooksAssociatedPrograms(uris, "copybookUri", "copybookContent", eventSource); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/events/notifications/CancelProgressNotificationTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/events/notifications/CancelProgressNotificationTest.java new file mode 100644 index 0000000000..fb28691e1e --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/events/notifications/CancelProgressNotificationTest.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.lsp.events.notifications; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import org.eclipse.lsp.cobol.lsp.handlers.server.CancelProgressHandler; +import org.junit.jupiter.api.Test; + +/** Test {@link CancelProgressNotification} */ +class CancelProgressNotificationTest { + @Test + void test() throws InterruptedException { + CancelProgressHandler handler = mock(CancelProgressHandler.class); + CancelProgressNotification notification = new CancelProgressNotification("uri", handler); + notification.execute(); + verify(handler).cancel("uri"); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/server/CancelProgressHandlerTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/server/CancelProgressHandlerTest.java new file mode 100644 index 0000000000..97aab9ba87 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/server/CancelProgressHandlerTest.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.lsp.handlers.server; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import org.eclipse.lsp.cobol.lsp.analysis.AsyncAnalysisService; +import org.junit.jupiter.api.Test; + +/** Test {@link CancelProgressHandler} */ +class CancelProgressHandlerTest { + + @Test + void whenCancelIsCalled_properMethodIsInvoked() throws InterruptedException { + AsyncAnalysisService asyncAnalysisService = mock(AsyncAnalysisService.class); + CancelProgressHandler handler = new CancelProgressHandler(asyncAnalysisService); + handler.cancel("test-uri"); + verify(asyncAnalysisService).cancelAnalysis("test-uri"); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/server/InitializedHandlerTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/server/InitializedHandlerTest.java index 6c7d2f4252..ef6ce53f1d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/server/InitializedHandlerTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/server/InitializedHandlerTest.java @@ -24,16 +24,17 @@ import com.google.common.collect.ImmutableList; import com.google.gson.JsonArray; import com.google.gson.JsonPrimitive; +import java.util.Optional; import org.eclipse.lsp.cobol.common.message.LocaleStore; import org.eclipse.lsp.cobol.common.message.MessageService; import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.service.AnalysisService; import org.eclipse.lsp.cobol.service.WatcherService; import org.eclipse.lsp.cobol.service.copybooks.CopybookNameService; import org.eclipse.lsp.cobol.service.delegates.completions.Keywords; import org.eclipse.lsp.cobol.service.settings.SettingsService; import org.eclipse.lsp.cobol.service.settings.SettingsServiceImpl; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.eclipse.lsp4j.InitializedParams; import org.junit.jupiter.api.Test; @@ -57,7 +58,7 @@ void test() { prepareSettingsService(settingsService, localeStore); CodeLayoutStore codeLayoutStore = mock(CodeLayoutStore.class); - when(codeLayoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout()); + when(codeLayoutStore.getCodeLayout()).thenReturn(Optional.of(CobolLanguageId.COBOL.getLayout())); when(codeLayoutStore.updateCodeLayout()).thenReturn(mock -> {}); InitializedHandler initializedHandler = @@ -96,6 +97,6 @@ private void prepareSettingsService(SettingsService settingsService, LocaleStore when(settingsService.fetchConfiguration("dialect")) .thenReturn(completedFuture(singletonList(arr))); when(settingsService.fetchConfiguration(COBOL_PROGRAM_LAYOUT.label)) - .thenReturn(completedFuture(ImmutableList.of(new CobolProgramLayout()))); + .thenReturn(completedFuture(ImmutableList.of(Optional.of(CobolLanguageId.COBOL.getLayout())))); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/workspace/DidChangeConfigurationHandlerTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/workspace/DidChangeConfigurationHandlerTest.java index 3837813acd..a26c6d41ca 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/workspace/DidChangeConfigurationHandlerTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/lsp/handlers/workspace/DidChangeConfigurationHandlerTest.java @@ -26,7 +26,10 @@ import com.google.gson.JsonArray; import com.google.gson.JsonPrimitive; import java.util.List; +import java.util.Optional; import java.util.concurrent.CompletableFuture; + +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.message.LocaleStore; import org.eclipse.lsp.cobol.common.message.MessageService; import org.eclipse.lsp.cobol.lsp.*; @@ -37,7 +40,6 @@ import org.eclipse.lsp.cobol.service.delegates.completions.Keywords; import org.eclipse.lsp.cobol.service.settings.SettingsService; import org.eclipse.lsp.cobol.service.settings.SettingsServiceImpl; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.eclipse.lsp4j.DidChangeConfigurationParams; import org.junit.jupiter.api.Test; @@ -78,7 +80,7 @@ void testChangeConfigurationNoPathToRegister() throws InterruptedException { when(settingsService.fetchConfiguration(LOGGING_LEVEL.label)) .thenReturn(completedFuture(singletonList("INFO"))); when(settingsService.fetchConfiguration(COBOL_PROGRAM_LAYOUT.label)) - .thenReturn(completedFuture(ImmutableList.of(new CobolProgramLayout()))); + .thenReturn(completedFuture(ImmutableList.of(CobolLanguageId.COBOL.getLayout()))); when(watchingService.getWatchingFolders()).thenReturn(emptyList()); when(localeStore.notifyLocaleStore()).thenReturn(e -> {}); @@ -121,7 +123,7 @@ void testChangeConfigurationNoChangesInPaths() throws InterruptedException { when(settingsService.fetchConfiguration(LOGGING_LEVEL.label)) .thenReturn(completedFuture(singletonList("INFO"))); when(settingsService.fetchConfiguration(COBOL_PROGRAM_LAYOUT.label)) - .thenReturn(completedFuture(ImmutableList.of(new CobolProgramLayout()))); + .thenReturn(completedFuture(ImmutableList.of(CobolLanguageId.COBOL.getLayout()))); when(watchingService.getWatchingFolders()).thenReturn(singletonList(path)); when(localeStore.notifyLocaleStore()).thenReturn(e -> {}); @@ -166,7 +168,7 @@ void testChangeConfigurationNewPath() throws InterruptedException { when(settingsService.fetchConfiguration(LOGGING_LEVEL.label)) .thenReturn(completedFuture(singletonList("INFO"))); when(settingsService.fetchConfiguration(COBOL_PROGRAM_LAYOUT.label)) - .thenReturn(completedFuture(ImmutableList.of(new CobolProgramLayout()))); + .thenReturn(completedFuture(ImmutableList.of(CobolLanguageId.COBOL.getLayout()))); when(watchingService.getWatchingFolders()).thenReturn(emptyList()); when(localeStore.notifyLocaleStore()).thenReturn(e -> {}); @@ -217,7 +219,7 @@ void testChangeConfigurationPathRemoved() throws InterruptedException { when(watchingService.getWatchingFolders()).thenReturn(singletonList(path)); when(localeStore.notifyLocaleStore()).thenReturn(e -> {}); when(settingsService.fetchConfiguration(COBOL_PROGRAM_LAYOUT.label)) - .thenReturn(completedFuture(ImmutableList.of(new CobolProgramLayout()))); + .thenReturn(completedFuture(ImmutableList.of(CobolLanguageId.COBOL.getLayout()))); didChangeConfigurationHandler.didChangeConfiguration(new DidChangeConfigurationParams(localeStore)); verify(watchingService).addWatchers(emptyList()); @@ -228,7 +230,7 @@ void testChangeConfigurationPathRemoved() throws InterruptedException { private CodeLayoutStore getMockLayoutStore() { CodeLayoutStore layoutStore = mock(CodeLayoutStore.class); - when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout()); + when(layoutStore.getCodeLayout()).thenReturn(Optional.ofNullable(CobolLanguageId.COBOL.getLayout())); when(layoutStore.updateCodeLayout()).thenReturn(mock -> {}); return layoutStore; } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/positive/PositiveTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/positive/PositiveTest.java index 42ea17387d..7d0bf99f47 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/positive/PositiveTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/positive/PositiveTest.java @@ -14,21 +14,44 @@ */ package org.eclipse.lsp.cobol.positive; +import static java.lang.System.getProperty; +import static java.util.Collections.emptyList; +import static java.util.Optional.ofNullable; +import static java.util.stream.Collectors.toList; import static org.eclipse.lsp.cobol.common.copybook.CopybookProcessingMode.ENABLED; +import static org.eclipse.lsp.cobol.positive.CobolTextRegistry.DEFAULT_LISTING_PATH; +import static org.eclipse.lsp.cobol.positive.CobolTextRegistry.PATH_TO_LISTING_SNAP; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.parallel.ExecutionMode.CONCURRENT; -import java.util.List; -import java.util.Map; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.gson.Gson; import lombok.extern.slf4j.Slf4j; +import org.eclipse.lsp.cobol.ConfigurableTest; import org.eclipse.lsp.cobol.common.AnalysisConfig; import org.eclipse.lsp.cobol.common.AnalysisResult; +import org.eclipse.lsp.cobol.common.copybook.SQLBackend; import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCase; import org.eclipse.lsp.cobol.test.engine.UseCaseUtils; +import org.eclipse.lsp.cobol.usecases.DialectConfigs; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.parallel.Execution; import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.junit.jupiter.params.provider.NullSource; /** * This class provides capability to run the server for actual cobol files that are provided using @@ -36,44 +59,204 @@ * regressions. The complete error description with the file name logged. */ @Slf4j -class PositiveTest extends FileBasedTest { +@Execution(CONCURRENT) +class PositiveTest extends ConfigurableTest { private CobolTextRegistry cobolTextRegistry; - @ParameterizedTest - @MethodSource("getSourceFolder") + @ParameterizedTest(name = "[{index}] run {1} in {2}") + @MethodSource("getTestFiles") @DisplayName("Parameterized - positive tests") - @NullSource - void test(String testFolder) { - LOG.info("-- {} under test --", testFolder); - cobolTextRegistry = retrieveTextsRegistry(testFolder); - List textsToTest = getTextsToTest(cobolTextRegistry); - for (CobolText text : textsToTest) { - if (text == null) { - return; - } - String fileName = text.getFileName(); - Map> dataNameRefs = - getDataNameRefs(fileName, cobolTextRegistry); - LOG.debug("Processing: " + fileName); - AnalysisConfig analysisConfig = getAnalysisConfiguration(cobolTextRegistry.getDialect()); - UseCase useCase = - UseCase.builder() - .documentUri(fileName) - .text(text.getFullText()) - .copybooks(getFileSpecificCopybooks(cobolTextRegistry, fileName)) - .copybookProcessingMode(ENABLED) - .dialects(analysisConfig.getDialects()) - .dialectsSettings(analysisConfig.getDialectsSettings()) - .build(); - AnalysisResult analyze = UseCaseUtils.analyze(useCase); - PositiveTestUtility.assetDefinitionsNReferencesFromSnap(analyze.getSymbolTableMap(), dataNameRefs, analyze.getRootNode(), fileName); - assertNoError(fileName, analyze); - } + void test(CobolTextRegistry cobolTextRegistry, CobolText text, String folderName) { + LOG.info("-- {} under test --", text.getFileName()); + this.cobolTextRegistry = cobolTextRegistry; + String fileName = text.getFileName(); + Map> dataNameRefs = + getDataNameRefs(fileName, cobolTextRegistry); + LOG.debug("Processing: " + fileName); + AnalysisConfig analysisConfig = getAnalysisConfiguration(cobolTextRegistry.getDialect()); + UseCase useCase = + UseCase.builder() + .documentUri(fileName) + .text(text.getFullText()) + .copybooks(getTestFileSpecificCopybooks(cobolTextRegistry, fileName)) + .copybookProcessingMode(ENABLED) + .dialects(analysisConfig.getDialects()) + .dialectsSettings(analysisConfig.getDialectsSettings()) + .build(); + AnalysisResult analyze = UseCaseUtils.analyze(useCase); + PositiveTestUtility.assetDefinitionsNReferencesFromSnap(analyze.getSymbolTableMap(), dataNameRefs, analyze.getRootNode(), fileName); + assertNoError(fileName, analyze); } @AfterEach void check() { updateSnaps(cobolTextRegistry); } + + static Stream getTestFiles() { + String path = ofNullable(getProperty(PATH_TO_TEST_RESOURCES)).orElse("../../tests/test_files"); + return searchFolderToTest(ImmutableList.of(Paths.get(path).toFile())).stream().map(p -> p.toAbsolutePath().toString()) + .flatMap(folder -> { + CobolTextRegistry cobolTextRegistry = retrieveTextsRegistry(folder); + List textsToTest = getTextsToTest(cobolTextRegistry); + return textsToTest.stream().map(file -> Arguments.of(cobolTextRegistry, file, new File(folder).getName())); + }); + } + + private static List searchFolderToTest(List files) { + List paths = new ArrayList<>(); + for (File file : files) { + if (file.isHidden()) continue; + if (file.isDirectory()) { + if (isValidTestFolder(file)) { + paths.add(file.toPath()); + } + paths.addAll(searchFolderToTest(listFiles(file))); + } + } + return paths; + } + + private static List listFiles(File file) { + return Optional.ofNullable(file.listFiles()) + .map(Arrays::stream) + .orElse(Stream.empty()) + .collect(Collectors.toList()); + } + + private static boolean isValidTestFolder(File file) { + return Optional.ofNullable(file.listFiles()) + .map(Arrays::stream) + .orElse(Stream.empty()) + .anyMatch(f -> f.getName().equals("positive")); + } + + + /** + * Get the files to be analyzed by Language Server from {@link CobolTextRegistry} using file-based + * implementation. + * + * @return the list of objects that would be passed to the constructor one by one + */ + protected static List getTextsToTest(CobolTextRegistry textRegistry) { + return textRegistry.getPositives(); + } + + /** + * Get the copybooks to be passed to the Language Server while analyzing from {@link + * CobolTextRegistry} using file-based implementation. + * + * @return the list of all defined copybooks + */ + protected static List getCopybooks(CobolTextRegistry textRegistry) { + return textRegistry.getCopybooks(); + } + + /** + * Get the copybooks to be passed to the Language Server while analyzing from {@link + * CobolTextRegistry} using file-based implementation. + * + * @return the list of all defined copybooks + */ + protected static List getCopybooks(CobolTextRegistry textRegistry, String filename) { + return textRegistry.getCopybooks(filename); + } + + protected static Map> getDataNameRefs( + String filename, CobolTextRegistry textRegistry) { + return textRegistry.getSnapForFile(filename); + } + + /** + * Check that there were no errors found. + * + * @param diagnostics list of diagnostic from the analysis result + * @param fileName name of the file that has been tested + */ + protected void assertNoSyntaxErrorsFound(List diagnostics, String fileName) { + assertEquals(0, diagnostics.size(), createErrorMessage(diagnostics, fileName)); + } + + private String createErrorMessage(List diagnostics, String fileName) { + StringBuilder result = new StringBuilder(fileName); + result.append(" contains syntax errors:\r\n"); + diagnostics.forEach( + it -> { + result.append(it.getRange().getStart().getLine() + 1); + result.append(":"); + result.append(it.getRange().getStart().getCharacter()); + result.append(" - "); + result.append(it.getRange().getEnd().getLine() + 1); + result.append(":"); + result.append(it.getRange().getEnd().getCharacter()); + result.append(" : "); + result.append(it.getMessage()); + result.append("\r\n"); + }); + return result.toString(); + } + + void updateSnaps(CobolTextRegistry cobolTextRegistry) { + String listingSnap = ofNullable(getProperty(PATH_TO_LISTING_SNAP)).orElse(DEFAULT_LISTING_PATH); + String updateFlag = ofNullable(getProperty("UpdateSnapListing")).orElse("false"); + if (Files.exists(Paths.get(listingSnap)) && !updateFlag.equals("false")) { + FolderTextRegistry textRegistry = (FolderTextRegistry) cobolTextRegistry; + textRegistry.createListingSnap(textRegistry.getSnaps(), textRegistry.getTestResourcePath()); + } + } + + void assertNoError(String fileName, AnalysisResult analyze) { + List diagnostic = + ofNullable(analyze.getDiagnostics().get(fileName)) + .map( + diagnostics -> + diagnostics.stream() + .filter(it -> it.getSeverity() == DiagnosticSeverity.Error) + .collect(toList())) + .orElse(emptyList()); + assertNoSyntaxErrorsFound(diagnostic, fileName); + } + + /** + * Get the copybooks specific to a cobol file, to be passed to the Language Server while analyzing + * from {@link CobolTextRegistry} using file-based implementation. + * + * @param cobolTextRegistry {@link CobolTextRegistry} + * @param fileName file to be analysed + * @return List of copybooks + */ + protected List getTestFileSpecificCopybooks( + CobolTextRegistry cobolTextRegistry, String fileName) { + Stream cobolTextStream = + getCopybooks(cobolTextRegistry).stream() + .filter( + book -> + getCopybooks(cobolTextRegistry, fileName.split("\\.")[0]).stream() + .noneMatch(b1 -> b1.getFileName().equals(book.getFileName()))); + return Stream.concat( + cobolTextStream, getCopybooks(cobolTextRegistry, fileName.split("\\.")[0]).stream()) + .collect(toList()); + } + + /** + * Returns a {@link AnalysisConfig} based on passed system variables + * + * @return {@link AnalysisConfig} + */ + protected AnalysisConfig getAnalysisConfiguration(String testDialectsLists) { + if (testDialectsLists.contains("DaCo")) { + return DialectConfigs.getDaCoAnalysisConfig(); + } + + if (testDialectsLists.contains("IDMS")) { + return new AnalysisConfig( + ENABLED, + ImmutableList.of("IDMS"), + true, + ImmutableList.of(), + ImmutableMap.of("target-sql-backend", new Gson().toJsonTree(SQLBackend.DB2_SERVER))); + } + return AnalysisConfig.defaultConfig(ENABLED); + } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/positive/PositiveTestOld.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/positive/PositiveTestOld.java new file mode 100644 index 0000000000..25ed3fd9d3 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/positive/PositiveTestOld.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.positive; + +import lombok.extern.slf4j.Slf4j; +import org.eclipse.lsp.cobol.common.AnalysisConfig; +import org.eclipse.lsp.cobol.common.AnalysisResult; +import org.eclipse.lsp.cobol.test.CobolText; +import org.eclipse.lsp.cobol.test.engine.UseCase; +import org.eclipse.lsp.cobol.test.engine.UseCaseUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.NullSource; + +import java.util.List; +import java.util.Map; + +import static org.eclipse.lsp.cobol.common.copybook.CopybookProcessingMode.ENABLED; + +/** + * This class provides capability to run the server for actual cobol files that are provided using + * {@link CobolTextRegistry}. The positive test should always pass. If not, then there are some + * regressions. The complete error description with the file name logged. + */ +@Slf4j +@Disabled("To be removed if PositiveTest are good enough.") +class PositiveTestOld extends FileBasedTest { + + private CobolTextRegistry cobolTextRegistry; + + @ParameterizedTest + @MethodSource("getSourceFolder") + @DisplayName("Parameterized - positive tests") + @NullSource + void test(String testFolder) { + LOG.info("-- {} under test --", testFolder); + cobolTextRegistry = retrieveTextsRegistry(testFolder); + List textsToTest = getTextsToTest(cobolTextRegistry); + for (CobolText text : textsToTest) { + if (text == null) { + return; + } + String fileName = text.getFileName(); + Map> dataNameRefs = + getDataNameRefs(fileName, cobolTextRegistry); + LOG.debug("Processing: " + fileName); + AnalysisConfig analysisConfig = getAnalysisConfiguration(cobolTextRegistry.getDialect()); + UseCase useCase = + UseCase.builder() + .documentUri(fileName) + .text(text.getFullText()) + .copybooks(getFileSpecificCopybooks(cobolTextRegistry, fileName)) + .copybookProcessingMode(ENABLED) + .dialects(analysisConfig.getDialects()) + .dialectsSettings(analysisConfig.getDialectsSettings()) + .build(); + AnalysisResult analyze = UseCaseUtils.analyze(useCase); + PositiveTestUtility.assetDefinitionsNReferencesFromSnap(analyze.getSymbolTableMap(), dataNameRefs, analyze.getRootNode(), fileName); + assertNoError(fileName, analyze); + } + } + + @AfterEach + void check() { + updateSnaps(cobolTextRegistry); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/positive/TypingTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/positive/TypingTest.java index 14892e3b5d..4da53a2fb7 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/positive/TypingTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/positive/TypingTest.java @@ -20,22 +20,20 @@ import com.google.common.util.concurrent.SimpleTimeLimiter; import java.util.List; +import java.util.Optional; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicInteger; import java.util.stream.Collectors; import java.util.stream.IntStream; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.time.DurationFormatUtils; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.error.SyntaxError; import org.eclipse.lsp.cobol.common.mapping.ExtendedText; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessorImpl; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.reader.CobolLineReaderImpl; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.rewriter.CobolLineIndicatorProcessorImpl; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.transformer.ContinuationLineTransformation; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.writer.CobolLineWriterImpl; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.dialects.ibm.IbmTextPreprocessor; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCase; @@ -57,7 +55,7 @@ class TypingTest extends FileBasedTest { @ParameterizedTest @MethodSource("getSourceFolder") - void typingTest(String testFolder) { + void typingTest(String testFolder) throws InterruptedException { cobolTextRegistry = retrieveTextsRegistry(testFolder); if (!Boolean.TRUE.toString().equals(TEST_MODE)) return; List textsToTest = getTextsToTest(cobolTextRegistry); @@ -80,20 +78,21 @@ void typingTest(String testFolder) { private String getCleanText(CobolText cobolText) { CodeLayoutStore layoutStore = mock(CodeLayoutStore.class); - when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout()); - TextPreprocessor preprocessor = - new TextPreprocessorImpl( - new CobolLineReaderImpl(null, layoutStore), - new CobolLineWriterImpl(layoutStore), - new ContinuationLineTransformation(null, layoutStore), - new CobolLineIndicatorProcessorImpl(layoutStore)); + when(layoutStore.getCodeLayout()).thenReturn(Optional.of(CobolLanguageId.COBOL.getLayout())); + + MessageService messageService = mock(MessageService.class); + + CleanerPreprocessor preprocessor = + new IbmTextPreprocessor( + messageService, + layoutStore); ResultWithErrors cleanTextResult = preprocessor.cleanUpCode(cobolText.getFileName(), cobolText.getFullText()); for (SyntaxError error : cleanTextResult.getErrors()) LOG.error(error.toString()); return cleanTextResult.getResult().toString(); } - private void analyze(String name, String fullText) { + private void analyze(String name, String fullText) throws InterruptedException { AtomicInteger position = new AtomicInteger(); ScheduledExecutorService scheduled = Executors.newScheduledThreadPool(1); int textSize = fullText.length(); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/AnalysisServiceTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/AnalysisServiceTest.java index d0577cd0ca..c1df268ac8 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/AnalysisServiceTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/AnalysisServiceTest.java @@ -102,11 +102,13 @@ void testAnalyzeDocument_program() { String uri = UUID.randomUUID().toString(); String text = UUID.randomUUID().toString(); when(copybookIdentificationService.isCopybook(any(), any(), any())).thenReturn(false); - when(engine.analyze(any(), any(), any())).thenReturn(result); - + when(engine.analyze(any(), any(), any(), anyString())).thenReturn(result); + CobolDocumentModel mockDocModel = mock(CobolDocumentModel.class); + when(mockDocModel.getLanguageId()).thenReturn("cobol"); + when(documentService.get(uri)).thenReturn(mockDocModel); service.analyzeDocument(uri, text, true); verify(documentService, times(1)).processAnalysisResult(eq(uri), any(), anyString()); - verify(engine, times(1)).analyze(any(), any(), any()); + verify(engine, times(1)).analyze(any(), any(), any(), anyString()); } @Test @@ -124,10 +126,13 @@ void testReanalyzeDocument_program() { String uri = UUID.randomUUID().toString(); String text = UUID.randomUUID().toString(); when(copybookIdentificationService.isCopybook(any(), any(), any())).thenReturn(false); - when(engine.analyze(any(), any(), any())).thenReturn(prepareAnalysisResult()); + when(engine.analyze(any(), any(), any(), anyString())).thenReturn(prepareAnalysisResult()); + CobolDocumentModel mockDocModel = mock(CobolDocumentModel.class); + when(mockDocModel.getLanguageId()).thenReturn("cobol"); + when(documentService.get(uri)).thenReturn(mockDocModel); service.analyzeDocument(uri, text, false); - verify(engine, times(1)).analyze(any(), any(), any()); + verify(engine, times(1)).analyze(any(), any(), any(), anyString()); } private AnalysisResult prepareAnalysisResult() { diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/ClientServerIntegrationTestImpl.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/ClientServerIntegrationTestImpl.java index 9f5faf8423..0c49f035bc 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/ClientServerIntegrationTestImpl.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/ClientServerIntegrationTestImpl.java @@ -17,10 +17,10 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.AnalysisConfig; -import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.common.AnalysisResult; import org.eclipse.lsp.cobol.common.LanguageEngineFacade; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; @@ -32,6 +32,11 @@ public class ClientServerIntegrationTestImpl implements LanguageEngineFacade { @Override public AnalysisResult analyze(String uri, String text, AnalysisConfig analysisConfig) { + return analyze(uri, text, analysisConfig, "cobol"); + } + + @Override + public AnalysisResult analyze(String uri, String text, AnalysisConfig analysisConfig, String languageId) { final String copybook1 = " {_COPY {~CPYBK1}.|1_}"; final String copybook2 = " {_COPY {~CPYBK2}.|2_}"; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/CobolLanguageServerTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/CobolLanguageServerTest.java index cbf1c5e97e..0b7406705f 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/CobolLanguageServerTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/CobolLanguageServerTest.java @@ -27,10 +27,12 @@ import com.google.gson.JsonArray; import com.google.gson.JsonPrimitive; import java.util.List; +import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorCodes; import org.eclipse.lsp.cobol.common.message.LocaleStore; import org.eclipse.lsp.cobol.common.message.MessageService; @@ -38,10 +40,7 @@ import org.eclipse.lsp.cobol.lsp.*; import org.eclipse.lsp.cobol.lsp.analysis.AsyncAnalysisService; import org.eclipse.lsp.cobol.lsp.events.queries.CodeActionQuery; -import org.eclipse.lsp.cobol.lsp.handlers.server.ExitHandler; -import org.eclipse.lsp.cobol.lsp.handlers.server.InitializeHandler; -import org.eclipse.lsp.cobol.lsp.handlers.server.InitializedHandler; -import org.eclipse.lsp.cobol.lsp.handlers.server.ShutdownHandler; +import org.eclipse.lsp.cobol.lsp.handlers.server.*; import org.eclipse.lsp.cobol.lsp.handlers.text.CodeActionHandler; import org.eclipse.lsp.cobol.lsp.handlers.workspace.DidChangeConfigurationHandler; import org.eclipse.lsp.cobol.lsp.handlers.workspace.ExecuteCommandHandler; @@ -49,7 +48,6 @@ import org.eclipse.lsp.cobol.service.delegates.completions.Keywords; import org.eclipse.lsp.cobol.service.settings.SettingsService; import org.eclipse.lsp.cobol.service.settings.SettingsServiceImpl; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.eclipse.lsp4j.ClientCapabilities; import org.eclipse.lsp4j.ClientInfo; @@ -85,6 +83,7 @@ class CobolLanguageServerTest { private DisposableLSPStateService stateService; private final UriDecodeService uriDecodeService = mock(UriDecodeService.class); + private final CancelProgressHandler cancelProgressHandler = mock(CancelProgressHandler.class); @BeforeEach void getStateService() { @@ -98,7 +97,6 @@ void getStateService() { @Test void initialized() throws InterruptedException { SettingsService settingsService = mock(SettingsServiceImpl.class); -// WatcherService watchingService = mock(WatcherService.class); LocaleStore localeStore = mock(LocaleStore.class); CopybookNameService copybookNameService = mock(CopybookNameService.class); MessageService messageService = mock(MessageService.class); @@ -129,7 +127,8 @@ void initialized() throws InterruptedException { new ShutdownHandler(stateService, lspMessageBroker), mock(InitializeHandler.class), initializedHandler, - lspEventConsumer); + lspEventConsumer, + cancelProgressHandler); server.initialized(new InitializedParams()); @@ -166,7 +165,7 @@ private void prepareSettingsService(SettingsService settingsService, LocaleStore when(settingsService.fetchConfiguration("dialect")) .thenReturn(completedFuture(singletonList(arr))); when(settingsService.fetchConfiguration(COBOL_PROGRAM_LAYOUT.label)) - .thenReturn(completedFuture(ImmutableList.of(new CobolProgramLayout()))); + .thenReturn(completedFuture(ImmutableList.of(CobolLanguageId.COBOL.getLayout()))); } @Test @@ -194,7 +193,7 @@ void initializedConfig() throws InterruptedException { LspMessageBroker lspMessageBroker = new LspMessageBroker(); CobolWorkspaceServiceImpl lspEventConsumer = new CobolWorkspaceServiceImpl(lspMessageBroker, executeCommandHandler, sourceUnitGraph, didChangeConfigurationHandler, asyncAnalysisService, uriDecodeService); - when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout()); + when(layoutStore.getCodeLayout()).thenReturn(Optional.of(CobolLanguageId.COBOL.getLayout())); when(layoutStore.updateCodeLayout()).thenReturn(mock -> {}); lspEventConsumer.startConsumer(); @@ -207,7 +206,8 @@ void initializedConfig() throws InterruptedException { new ShutdownHandler(stateService, lspMessageBroker), new InitializeHandler(watchingService), new InitializedHandler(watchingService, copybookNameService, keywords, settingsService, localeStore, analysisService, messageService, layoutStore), - lspEventConsumer); + lspEventConsumer, + cancelProgressHandler); server.initialized(new InitializedParams()); waitingQuery(lspMessageBroker).join(); @@ -252,7 +252,8 @@ private void testServerInitialization(InitializeParams initializeParams) { new ShutdownHandler(stateService, lspMessageBroker), new InitializeHandler(mock(WatcherServiceImpl.class)), new InitializedHandler(mock(WatcherServiceImpl.class), null, null, null, null, null, null, null), - lspEventConsumer); + lspEventConsumer, + cancelProgressHandler); try { InitializeResult result = server.initialize(initializeParams).get(); @@ -313,7 +314,8 @@ void shutdown() { new ShutdownHandler(stateService, lspMessageBroker), new InitializeHandler(null), new InitializedHandler(null, null, null, null, null, null, null, null), - lspEventConsumer); + lspEventConsumer, + cancelProgressHandler); assertEquals(1, stateService.getExitCode()); server.shutdown(); try { diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/CobolTextDocumentServiceTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/CobolTextDocumentServiceTest.java index 1c003d32dd..dfff845c35 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/CobolTextDocumentServiceTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/CobolTextDocumentServiceTest.java @@ -22,6 +22,7 @@ import org.eclipse.lsp.cobol.cfg.CFASTBuilder; import org.eclipse.lsp.cobol.common.SubroutineService; import org.eclipse.lsp.cobol.common.copybook.CopybookService; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.lsp.*; import org.eclipse.lsp.cobol.lsp.analysis.AsyncAnalysisService; import org.eclipse.lsp.cobol.lsp.events.notifications.DidChangeNotification; @@ -96,7 +97,7 @@ void setupService() { DisposableLSPStateService disposableLSPStateService = new CobolLSPServerStateService(); CopybookService copybookService = mock(CopybookService.class); SubroutineService subroutineService = mock(SubroutineService.class); - AsyncAnalysisService asyncAnalysisService = new AsyncAnalysisService(documentModelService, analysisService, copybookService, subroutineService, communications); + AsyncAnalysisService asyncAnalysisService = new AsyncAnalysisService(mock(TrueDialectService.class), documentModelService, analysisService, copybookService, subroutineService, communications); CompletionHandler completionHandler = new CompletionHandler(asyncAnalysisService, completions, documentModelService, uriDecodeService); FormattingHandler formattingHandler = new FormattingHandler(documentModelService, formations, asyncAnalysisService, uriDecodeService); @@ -112,7 +113,7 @@ void setupService() { DocumentHighlightHandler documentHighlightHandler = new DocumentHighlightHandler(asyncAnalysisService, occurrences, documentModelService, uriDecodeService); ReferencesHandler referencesHandler = new ReferencesHandler(asyncAnalysisService, occurrences, documentModelService, uriDecodeService); HoverHandler hoverHandler = new HoverHandler(asyncAnalysisService, hoverProvider, documentModelService, documentGraph, uriDecodeService); - FoldingRangeHandler foldingRangeHandler = new FoldingRangeHandler(documentModelService, asyncAnalysisService, uriDecodeService); + FoldingRangeHandler foldingRangeHandler = new FoldingRangeHandler(documentModelService, asyncAnalysisService, uriDecodeService, analysisService); service = new CobolTextDocumentService( lspMessageBroker, diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/DocumentModelServiceTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/DocumentModelServiceTest.java index 6b0f27b15b..000221e9e2 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/DocumentModelServiceTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/DocumentModelServiceTest.java @@ -32,6 +32,7 @@ */ class DocumentModelServiceTest { private DocumentModelService service; + private String languageId = "cobol"; @BeforeEach void init() { @@ -42,7 +43,7 @@ void init() { void testOpenDocument() { String uri = UUID.randomUUID().toString(); String text = UUID.randomUUID().toString(); - service.openDocument(uri, text); + service.openDocument(uri, text, "cobol"); assertTrue(service.get(uri).isOpened()); } @@ -59,8 +60,8 @@ private AnalysisResult createAnalysisResult(String uri) { void testGetAllOpened() { String uri1 = UUID.randomUUID().toString(); String uri2 = UUID.randomUUID().toString(); - service.openDocument(uri1, UUID.randomUUID().toString()); - service.openDocument(uri2, UUID.randomUUID().toString()); + service.openDocument(uri1, UUID.randomUUID().toString(), languageId); + service.openDocument(uri2, UUID.randomUUID().toString(), languageId); service.closeDocument(uri1); assertEquals(uri2, service.getAllOpened().get(0).getUri()); @@ -69,7 +70,7 @@ void testGetAllOpened() { @Test void testIsDocumentSynced() { String uri = UUID.randomUUID().toString(); - service.openDocument(uri, UUID.randomUUID().toString()); + service.openDocument(uri, UUID.randomUUID().toString(), languageId); assertFalse(service.isDocumentSynced(uri)); service.processAnalysisResult(uri, AnalysisResult.builder().build(), "text"); @@ -80,10 +81,10 @@ void testIsDocumentSynced() { void testGetOpenedDiagnostic() { String uri1 = UUID.randomUUID().toString(); String uri2 = UUID.randomUUID().toString(); - service.openDocument(uri1, UUID.randomUUID().toString()); + service.openDocument(uri1, UUID.randomUUID().toString(), languageId); service.processAnalysisResult(uri1, createAnalysisResult(uri1), "text"); - service.openDocument(uri2, UUID.randomUUID().toString()); + service.openDocument(uri2, UUID.randomUUID().toString(), languageId); service.processAnalysisResult(uri2, createAnalysisResult(uri2), "text"); service.closeDocument(uri1); @@ -97,7 +98,7 @@ void testGetOpenedDiagnostic() { @Test void testInvalidate() { String uri = UUID.randomUUID().toString(); - service.openDocument(uri, UUID.randomUUID().toString()); + service.openDocument(uri, UUID.randomUUID().toString(), languageId); service.processAnalysisResult(uri, createAnalysisResult(uri), "text"); Map> diagnostics = service.getOpenedDiagnostic(); @@ -118,7 +119,7 @@ void testInvalidate() { void testProcessAnalysis() { String uri = UUID.randomUUID().toString(); String text = UUID.randomUUID().toString(); - service.openDocument(uri, text); + service.openDocument(uri, text, languageId); service.processAnalysisResult(uri, createAnalysisResult(uri), text); assertTrue(service.isDocumentSynced(uri)); @@ -129,7 +130,7 @@ void testRemove() { String uri = UUID.randomUUID().toString(); String text = UUID.randomUUID().toString(); - service.openDocument(uri, text); + service.openDocument(uri, text, languageId); assertNotNull(service.get(uri)); service.removeDocumentDiagnostics(uri); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/WorkspaceServiceTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/WorkspaceServiceTest.java index c35948e1a3..e889a27bc7 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/WorkspaceServiceTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/WorkspaceServiceTest.java @@ -23,6 +23,7 @@ import com.google.common.collect.ImmutableList; import com.google.gson.JsonPrimitive; import java.util.List; +import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ExecutionException; import lombok.extern.slf4j.Slf4j; @@ -37,7 +38,6 @@ import org.eclipse.lsp.cobol.lsp.handlers.workspace.DidChangeConfigurationHandler; import org.eclipse.lsp.cobol.lsp.handlers.workspace.ExecuteCommandHandler; import org.eclipse.lsp.cobol.service.copybooks.CopybookNameService; -import org.eclipse.lsp.cobol.service.settings.layout.CobolProgramLayout; import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import org.eclipse.lsp.cobol.test.engine.UseCaseUtils; import org.eclipse.lsp4j.*; @@ -176,6 +176,7 @@ void testChangeConfigurationDelegatesRequestToHandler() throws InterruptedExcept didChangeConfigurationHandler, asyncAnalysisService, uriDecodeService); ((LspEventConsumer) workspaceService).startConsumer(); + doNothing().when(didChangeConfigurationHandler).didChangeConfiguration(any(DidChangeConfigurationParams.class)); DidChangeConfigurationParams didChangeConfigurationParams = new DidChangeConfigurationParams(new Object()); workspaceService.didChangeConfiguration(didChangeConfigurationParams); waitingQuery(lspMessageBroker).join(); @@ -252,7 +253,7 @@ private void checkWatchers(FileEvent event) throws InterruptedException { private CodeLayoutStore getMockLayoutStore() { CodeLayoutStore layoutStore = mock(CodeLayoutStore.class); - when(layoutStore.getCodeLayout()).thenReturn(new CobolProgramLayout()); + when(layoutStore.getCodeLayout()).thenReturn(Optional.empty()); return layoutStore; } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/copybooks/CopybookServiceTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/copybooks/CopybookServiceTest.java index d340005102..750fa41424 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/copybooks/CopybookServiceTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/copybooks/CopybookServiceTest.java @@ -29,6 +29,8 @@ import java.net.URI; import java.nio.file.Path; import java.util.Collections; + +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.copybook.*; import org.eclipse.lsp.cobol.common.error.ErrorSeverity; @@ -37,8 +39,8 @@ import org.eclipse.lsp.cobol.common.mapping.ExtendedText; import org.eclipse.lsp.cobol.common.mapping.OriginalLocation; import org.eclipse.lsp.cobol.common.utils.PredefinedCopybooks; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; import org.eclipse.lsp.cobol.lsp.jrpc.CobolLanguageClient; +import org.eclipse.lsp.cobol.service.UriDecodeService; import org.eclipse.lsp.cobol.service.providers.ClientProvider; import org.eclipse.lsp4j.services.LanguageClient; import org.junit.jupiter.api.BeforeEach; @@ -65,9 +67,11 @@ class CopybookServiceTest { private static final String COPYBOOK_3_NAME = "SQLCA_DB2"; private final CobolLanguageClient client = mock(CobolLanguageClient.class); private final FileSystemService files = mock(FileSystemService.class); - private final TextPreprocessor preprocessor = mock(TextPreprocessor.class); + private final CleanerPreprocessor preprocessor = mock(CleanerPreprocessor.class); private final Path cpyPath = mock(Path.class); private final Path parentPath = mock(Path.class); + private final UriDecodeService uriDecodeService = new UriDecodeService(); + private final String languageId = "cobol"; @BeforeEach void setupMocks() throws IOException { @@ -104,7 +108,7 @@ void testRequestWhileCopybookAnalysisActiveProcessed() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); assertEquals( @@ -132,7 +136,7 @@ void testResponseIfFileNotExists() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); assertEquals( @@ -157,7 +161,7 @@ void testRequestWhenUriNotFoundProcessed() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); assertEquals( @@ -181,7 +185,7 @@ void testNoNewClientCallsOnDidChange() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); CopybookModel copybookModelSkipped = copybookService @@ -190,7 +194,7 @@ void testNoNewClientCallsOnDidChange() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); verify(files, times(1)).getContentByPath(cpyPath); @@ -223,7 +227,7 @@ void testCacheInvalidation() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); assertEquals( new CopybookModel( @@ -239,7 +243,7 @@ void testCacheInvalidation() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); assertEquals( new CopybookModel( @@ -267,7 +271,7 @@ void testServiceRespondsIfClientSendsInvalidResult() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); assertEquals( @@ -299,7 +303,7 @@ void testServiceSendsDownloadingRequestForAnalysisFinishedEvent() { copybookInvalid, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); CopybookName copybookValid = createCopybook(VALID_CPY_NAME); CopybookModel validCpy = @@ -309,7 +313,7 @@ void testServiceSendsDownloadingRequestForAnalysisFinishedEvent() { copybookValid, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); // Second document parsed CopybookName copybookInvalid2 = createCopybook(INVALID_2_CPY_NAME); @@ -320,7 +324,7 @@ void testServiceSendsDownloadingRequestForAnalysisFinishedEvent() { copybookInvalid2, DOCUMENT_2_URI, DOCUMENT_2_URI, - false) + null) .getResult(); // Check that all copybook models are correct @@ -339,18 +343,18 @@ void testServiceSendsDownloadingRequestForAnalysisFinishedEvent() { // First document parsing done copybookService.sendCopybookDownloadRequest(DOCUMENT_URI, emptyList(), ENABLED); verify(client, times(1)) - .downloadCopybooks("document", ImmutableList.of(INVALID_CPY_NAME), "COBOL", true); + .downloadCopybooks(DOCUMENT_URI, ImmutableList.of(INVALID_CPY_NAME), "COBOL", true); // Others parsing done events for first document are not trigger settingsService copybookService.sendCopybookDownloadRequest(DOCUMENT_URI, emptyList(), ENABLED); verify(client, times(1)) - .downloadCopybooks("document", ImmutableList.of(INVALID_CPY_NAME), "COBOL", true); + .downloadCopybooks(DOCUMENT_URI, ImmutableList.of(INVALID_CPY_NAME), "COBOL", true); // Second document parsing done copybookService.sendCopybookDownloadRequest(DOCUMENT_2_URI, emptyList(), ENABLED); verify(client, times(1)) - .downloadCopybooks("document2", ImmutableList.of(INVALID_2_CPY_NAME), "COBOL", true); + .downloadCopybooks(DOCUMENT_2_URI, ImmutableList.of(INVALID_2_CPY_NAME), "COBOL", true); } /** Test that the service resolves the SQLDA predefined copybook */ @@ -368,13 +372,13 @@ void testSqldaCopybookResolutionDoesNotRelyOnBackend() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - false), + null), copybookService.resolve( CopybookId.fromString(copybookName.getDisplayName()), copybookName, DOCUMENT_URI, DOCUMENT_URI, - false)); + null)); } /** @@ -403,7 +407,7 @@ void testServiceSendsDownloadingRequestForAllNotResolvedCopybooks() { copybookInvalid, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); CopybookName copybookParent = createCopybook(PARENT_CPY_NAME); CopybookModel parentCpy = @@ -413,7 +417,7 @@ void testServiceSendsDownloadingRequestForAllNotResolvedCopybooks() { copybookParent, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); // Nested copybook declaration CopybookName copybookNested = createCopybook(NESTED_CPY_NAME); @@ -424,7 +428,7 @@ void testServiceSendsDownloadingRequestForAllNotResolvedCopybooks() { copybookNested, DOCUMENT_URI, PARENT_CPY_URI, - false) + null) .getResult(); // Check that all copybook models are correct @@ -447,7 +451,7 @@ void testServiceSendsDownloadingRequestForAllNotResolvedCopybooks() { copybookService.sendCopybookDownloadRequest( DOCUMENT_URI, asList(PARENT_CPY_URI, DOCUMENT_URI), ENABLED); verify(client, times(1)) - .downloadCopybooks("document", asList(INVALID_CPY_NAME, NESTED_CPY_NAME), "COBOL", true); + .downloadCopybooks(DOCUMENT_URI, asList(INVALID_CPY_NAME, NESTED_CPY_NAME), "COBOL", true); } @Test @@ -470,7 +474,7 @@ void testPredefinedCopybooksResolvedInsteadOfStaticOnes() { new CopybookName(copybookName), DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); // Assert the copybook was resolved from the workspace @@ -486,7 +490,7 @@ private CopybookServiceImpl createCopybookService() { ClientProvider provider = new ClientProvider(); provider.setClient(client); return new CopybookServiceImpl( - provider, files, preprocessor, new CopybookCache(3, 3, "HOURS")); + provider, files, new CopybookCache(3, 3, "HOURS"), uriDecodeService); } private CopybookName createCopybook(String displayName) { @@ -504,7 +508,7 @@ void store() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); CopybookModel resolve; resolve = @@ -514,10 +518,10 @@ void store() { copybookName, DOCUMENT_2_URI, DOCUMENT_2_URI, - false) + null) .getResult(); assertNull(resolve.getContent()); - copybookService.store(copybookModel, false); + copybookService.store(copybookModel, null); resolve = copybookService .resolve( @@ -525,7 +529,7 @@ void store() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - false) + null) .getResult(); assertEquals(CONTENT, resolve.getContent()); } @@ -553,7 +557,7 @@ void whenErrorInPreprocessOfCopybook_thenResolveReturnsPreprocessErrors() { copybookName, DOCUMENT_URI, DOCUMENT_URI, - true); + preprocessor); CopybookModel copybookModel = resolvedCopybook.getResult(); assertEquals(copybookModel.getContent(), copybookContent); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/communications/ServerCommunicationsTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/communications/ServerCommunicationsTest.java index 9704d011d1..79ccdea6cd 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/communications/ServerCommunicationsTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/communications/ServerCommunicationsTest.java @@ -126,11 +126,14 @@ void testNotifyProgressBegin() throws NoSuchFieldException { expectedNotifyBeginParams.setToken(uri); WorkDoneProgressBegin workDoneProgressBegin = new WorkDoneProgressBegin(); workDoneProgressBegin.setTitle("TITLE"); + workDoneProgressBegin.setCancellable(true); expectedNotifyBeginParams.setValue(Either.forLeft(workDoneProgressBegin)); communications.notifyProgressBegin(uri); verify(client).notifyProgress(expectedNotifyBeginParams); - verify(client).notifyProgress(new ProgressParams(Either.forLeft(uri), Either.forLeft(new WorkDoneProgressReport()))); + WorkDoneProgressReport expectedProgressReport = new WorkDoneProgressReport(); + expectedProgressReport.setCancellable(true); + verify(client).notifyProgress(new ProgressParams(Either.forLeft(uri), Either.forLeft(expectedProgressReport))); } @Test diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/completions/KeywordCompletionTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/completions/KeywordCompletionTest.java index bf6eafe7a6..ecba47e618 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/completions/KeywordCompletionTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/completions/KeywordCompletionTest.java @@ -15,8 +15,17 @@ package org.eclipse.lsp.cobol.service.delegates.completions; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import java.util.List; +import java.util.Optional; import org.eclipse.lsp.cobol.common.AnalysisResult; import org.eclipse.lsp.cobol.common.dialects.CobolDialect; import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; @@ -28,16 +37,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.util.List; -import java.util.Optional; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - /** * This test {@link KeywordCompletion} asserts that filtration and preparing the keyword completion * suggestions works correctly @@ -85,16 +84,16 @@ void testGetStreamDataMap() { Keywords keywords = new Keywords(mock(SettingsService.class), dialectService); List dialectType = ImmutableList.of(); - assertEquals(2344, keywords.getDataMap(dialectType).size()); + assertEquals(2347, keywords.getDataMap(dialectType).size()); dialectType = ImmutableList.of("IDMS"); - assertEquals(2345, keywords.getDataMap(dialectType).size()); + assertEquals(2348, keywords.getDataMap(dialectType).size()); dialectType = ImmutableList.of("DaCo"); - assertEquals(2346, keywords.getDataMap(dialectType).size()); + assertEquals(2349, keywords.getDataMap(dialectType).size()); dialectType = ImmutableList.of("DaCo", "IDMS"); - assertEquals(2347, keywords.getDataMap(dialectType).size()); + assertEquals(2350, keywords.getDataMap(dialectType).size()); } @Test diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/completions/VariableCompletionTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/completions/VariableCompletionTest.java index 760d4164c7..7cc0777eb5 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/completions/VariableCompletionTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/completions/VariableCompletionTest.java @@ -14,8 +14,14 @@ */ package org.eclipse.lsp.cobol.service.delegates.completions; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.is; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import java.util.List; import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; import org.eclipse.lsp.cobol.service.CobolDocumentModel; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; @@ -23,13 +29,6 @@ import org.eclipse.lsp4j.CompletionItemKind; import org.junit.jupiter.api.Test; -import java.util.List; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.empty; -import static org.hamcrest.Matchers.is; -import static org.junit.jupiter.api.Assertions.assertEquals; - /** * This test {@link VariableCompletion} asserts that filtration and preparing the variable * completion suggestions works correctly @@ -38,7 +37,7 @@ class VariableCompletionTest { private static final String HEADER = " Identification Division.\n" - + " Program-id. TEST.\n" + + " Program-id. TEST1.\n" + " Data Division.\n" + " Working-Storage Section.\n"; diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/hover/VariableHoverTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/hover/VariableHoverTest.java index b439ad4bca..d8792df1b8 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/hover/VariableHoverTest.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/delegates/hover/VariableHoverTest.java @@ -44,13 +44,13 @@ void setUp() { private static final String HEADER = " Identification Division.\n" - + " Program-id. TEST.\n" + + " Program-id. TEST1.\n" + " Data Division.\n" + " Working-Storage Section.\n"; private static final String FULL_TEXT = HEADER - + " 01 {$*TEST} PIC 9.\n" - + " 01 {$*TOP}.\n" + + " 01 {$*TEST2} PIC 9.\n" + + " 01 {$*TOP2}.\n" + " 05 {$*MIDDLE-1}.\n" + " 10 {$*LEAF-1} PIC 9.\n" + " 05 {$*MIDDLE-2}.\n" @@ -81,13 +81,13 @@ void getHoverForOneVariable() { assertNotNull(hover); MarkedString markedString = hover.getContents().getLeft().get(0).getRight(); assertEquals("cobol", markedString.getLanguage()); - assertEquals("01 TEST PIC 9.", markedString.getValue()); + assertEquals("01 TEST2 PIC 9.", markedString.getValue()); } @Test void getHoverForStructure() { String result = - "01 TOP.\n" + "01 TOP2.\n" + " 05 MIDDLE-2.\n" + " 10 LEAF-2 PIC 9.\n" + " 88 COND-ITEM1 VALUE 0.\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/mocks/MockTextPreprocessor.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/mocks/MockTextPreprocessor.java index db9b128d25..4688604df1 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/mocks/MockTextPreprocessor.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/mocks/MockTextPreprocessor.java @@ -15,14 +15,14 @@ package org.eclipse.lsp.cobol.service.mocks; import com.google.common.collect.ImmutableList; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; import org.eclipse.lsp.cobol.common.mapping.ExtendedText; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; /** * Mock Text Processor class */ -public class MockTextPreprocessor implements TextPreprocessor { +public class MockTextPreprocessor implements CleanerPreprocessor { @Override public ResultWithErrors cleanUpCode(String documentUri, String cobolCode) { return new ResultWithErrors<>(new ExtendedText(cobolCode, documentUri), ImmutableList.of()); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/service/settings/SettingsServiceImplTest.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/settings/SettingsServiceImplTest.java new file mode 100644 index 0000000000..fcd2b95980 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/service/settings/SettingsServiceImplTest.java @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.service.settings; + +import com.google.inject.Provider; +import org.eclipse.lsp.cobol.lsp.jrpc.CobolLanguageClient; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +import static org.eclipse.lsp.cobol.service.settings.SettingsParametersEnum.COBOL_PROGRAM_LAYOUT; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.*; + +/** + * Test for {@link SettingsServiceImpl} + */ +@ExtendWith(MockitoExtension.class) +class SettingsServiceImplTest { + @Mock + private Provider clientProvider; + private SettingsServiceImpl settingsService; + + @BeforeEach + void setUp() { + settingsService = new SettingsServiceImpl(clientProvider); + } + @Test + void testFetchConfiguration() { + when(clientProvider.get()).thenReturn(mock(CobolLanguageClient.class)); + when(clientProvider.get().configuration(any())).thenReturn(CompletableFuture.completedFuture(Arrays.asList(Object.class, Object.class))); + CompletableFuture> future = settingsService.fetchConfiguration("param1", "param2"); + List result = future.join(); + assertNotNull(result); + assertEquals(2, result.size()); + } + + @Test + void testFetchTextConfiguration() { + when(clientProvider.get()).thenReturn(mock(CobolLanguageClient.class)); + when(clientProvider.get().configuration(any())).thenReturn(CompletableFuture.completedFuture(Arrays.asList(Object.class, Object.class))); + CompletableFuture> future = settingsService.fetchTextConfiguration(COBOL_PROGRAM_LAYOUT.label); + List result = future.join(); + assertNotNull(result); + verify(clientProvider.get(), times(1)).configuration(any()); + } + + @Test + void testFetchTextConfigurationWithScope() { + when(clientProvider.get()).thenReturn(mock(CobolLanguageClient.class)); + when(clientProvider.get().configuration(any())).thenReturn(CompletableFuture.completedFuture(Arrays.asList(Object.class, Object.class))); + CompletableFuture> future = settingsService.fetchTextConfigurationWithScope("scopeUri", "section"); + List result = future.join(); + assertNotNull(result); + verify(clientProvider.get(), times(1)).configuration(any()); + } + + @Test + void testFetchTextConfigurationWithScope_dialect() { + when(clientProvider.get()).thenReturn(mock(CobolLanguageClient.class)); + when(clientProvider.get().configuration(any())).thenReturn(CompletableFuture.completedFuture(Arrays.asList(Object.class, Object.class))); + CompletableFuture> future = settingsService.fetchTextConfigurationWithScope("scopeUri", "section", "dialect"); + List result = future.join(); + assertNotNull(result); + verify(clientProvider.get(), times(1)).configuration(any()); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/Test88ThruHover.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/Test88ThruHover.java index 1c2d336785..17ce6b5345 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/Test88ThruHover.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/Test88ThruHover.java @@ -40,7 +40,7 @@ class Test88ThruHover { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" + " 01 {$*EIGHT-BITS} PIC X.\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestAllocateStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestAllocateStatement.java index 85ffbd81ce..7f95c4bae8 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestAllocateStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestAllocateStatement.java @@ -43,5 +43,6 @@ public class TestAllocateStatement { @Test void test() { UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); + } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestAsteriskBeforeCopyDoesntBreakAnalysis.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestAsteriskBeforeCopyDoesntBreakAnalysis.java index b4f334badc..2367a17230 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestAsteriskBeforeCopyDoesntBreakAnalysis.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestAsteriskBeforeCopyDoesntBreakAnalysis.java @@ -17,17 +17,18 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** - * This test checks that the an asterisk out of indicator area before the COPY statement doesn't + * This test checks that the asterisk out of indicator area before the COPY statement doesn't * break syntax analysis */ class TestAsteriskBeforeCopyDoesntBreakAnalysis { @@ -53,12 +54,26 @@ void test() { ImmutableMap.of( "1", new Diagnostic( - new Range(), - ParserUtils.isHwParserEnabled() - ? "Extraneous input '*'" - : - "Syntax error on '*'", + new Range(), "Syntax error on '*'", DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } + + @Test + @Disabled("Experimental parser") + void testEx() { + + UseCaseEngine.runTest( + TEXT, + ImmutableList.of(new CobolText(CPY_NAME, CPY)), + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), "Extraneous input '*'", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), + CobolLanguageId.EXPERIMENTAL_COBOL); + } + } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCOUNTVariableNameAllowed.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCOUNTVariableNameAllowed.java index 2fff87bc7e..ec2c2fa532 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCOUNTVariableNameAllowed.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCOUNTVariableNameAllowed.java @@ -18,11 +18,32 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** This test checks that COUNT variable name is allowed. */ class TestCOUNTVariableNameAllowed { + // SYSPRINT OUTPUT + // 0 000001 IDENTIFICATION DIVISION. + // 000002 PROGRAM-ID. TEST1. + // 000003 DATA DIVISION. + // 000004 WORKING-STORAGE SECTION. + // 000005 01 COUNT PIC 9. + // 000000000 1C + // + // ==000005==> IGYDS1089-S "COUNT" was invalid. Scanning was resumed at the next area "A" item, + // level-number, or the start of the next clause. + // + // 000006 PROCEDURE DIVISION. + // 000007 COUNT. + // + // ==000007==> IGYPS0009-E "COUNT" should not begin in area "A". It was processed as if found in + // area "B". + // + // ==000007==> IGYPS2072-S "COUNT" was invalid. Skipped to the next verb, period or + // procedure-name + // definition. private static final String TEXT = " IDENTIFICATION DIVISION.\n" + " PROGRAM-ID. TEST1.\n" @@ -34,6 +55,8 @@ class TestCOUNTVariableNameAllowed { + " END PROGRAM TEST1."; @Test + @Disabled( + "Issue https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/issues/646 is not valid. Check sysprint attached along with this class") void test() { UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCommaSeparatorAllowed.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCommaSeparatorAllowed.java index b5529490df..6cb558c826 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCommaSeparatorAllowed.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestCommaSeparatorAllowed.java @@ -24,7 +24,7 @@ public class TestCommaSeparatorAllowed { private static final String TEXT = " identification division.\n" - + " program-id. test.\n" + + " program-id. test1.\n" + " AUTHOR. \n" + " INSTALLATION\n" + " DATE-WRITTEN 02/02/02\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestContinuationLine.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestContinuationLine.java index 45084673c1..b050f8c844 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestContinuationLine.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestContinuationLine.java @@ -14,8 +14,12 @@ */ package org.eclipse.lsp.cobol.usecases; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import java.util.Optional; import org.eclipse.lsp.cobol.common.AnalysisResult; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.common.model.Locality; @@ -28,11 +32,6 @@ import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; -import java.util.Optional; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; - /** The test for various cases with the continuation line */ class TestContinuationLine { private static final String TEXT = @@ -146,7 +145,7 @@ void testWhenContinuousLineStartsWithTwoQuotes_thenTwoLiteralsAreIdentified() { assertTrue(node.isPresent()); assertEquals(Locality.builder() - .uri("file:///c:/workspace/document.cbl") + .uri("file:c:/workspace/document.cbl") .range(new Range(new Position(8, 7), new Position(13, 44))) .build(), node.get().getLocality()); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestDeclarativesSection.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestDeclarativesSection.java index 0d0a7d6dda..fdff2d92c6 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestDeclarativesSection.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestDeclarativesSection.java @@ -29,7 +29,7 @@ class TestDeclarativesSection { " Identification Division.\n" + " Program-id. HELLO-WORLD.\n" + " Procedure Division.\n" - + " DECLARATIVES{|1}"; + + " DECLARATIVES{|1|2}"; @Test void test() { @@ -42,6 +42,12 @@ void test() { new Range(), "Unexpected end of file", DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "2", + new Diagnostic( + new Range(), + "A period was assumed before \"\".", + DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestEmptyOptionalParagraphs.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestEmptyOptionalParagraphs.java index dc7eedb32c..a3e52fe165 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestEmptyOptionalParagraphs.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestEmptyOptionalParagraphs.java @@ -25,7 +25,7 @@ class TestEmptyOptionalParagraphs { private static final String TEXT = " identification division.\n" - + " program-id. test.\n" + + " program-id. test1.\n" + " AUTHOR. \n" + " INSTALLATION\n" + " DATE-WRITTEN 02/02/02\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestEndIfDoesNotProduceError.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestEndIfDoesNotProduceError.java index 15f1ec1f20..c4609a78ff 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestEndIfDoesNotProduceError.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestEndIfDoesNotProduceError.java @@ -17,25 +17,17 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; import org.eclipse.lsp4j.Range; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assumptions.assumeFalse; - /** Typing END-IF should not produce any exceptions */ class TestEndIfDoesNotProduceError { - @BeforeAll - public static void beforeMethod() { - assumeFalse(ParserUtils.isHwParserEnabled()); - } - private static final String TEXT = " IDENTIFICATION DIVISION.\n" + " PROGRAM-ID. TEST1.\n" @@ -67,6 +59,7 @@ void test() { new Range(), "Unexpected end of file", DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestErrorOnReadyTraceOutsideProcedureDivision.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestErrorOnReadyTraceOutsideProcedureDivision.java index 5bfa2beb7f..85923f0066 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestErrorOnReadyTraceOutsideProcedureDivision.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestErrorOnReadyTraceOutsideProcedureDivision.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; @@ -46,11 +46,24 @@ void test() { ImmutableMap.of( "1", new Diagnostic( - new Range(), - ParserUtils.isHwParserEnabled() - ? "Extraneous input 'READY'" - : "Syntax error on 'READY'", + new Range(), "Syntax error on 'READY'", DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } + + @Test + void testHw() { + UseCaseEngine.runTest( + TEXT, + ImmutableList.of(), + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), "Extraneous input 'READY'", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), + CobolLanguageId.EXPERIMENTAL_COBOL); + } + } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestErrorsInDifferentFiles.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestErrorsInDifferentFiles.java index 398b5e6440..768c406bbd 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestErrorsInDifferentFiles.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestErrorsInDifferentFiles.java @@ -15,6 +15,9 @@ package org.eclipse.lsp.cobol.usecases; +import static org.eclipse.lsp4j.DiagnosticSeverity.Error; +import static org.eclipse.lsp4j.DiagnosticSeverity.Warning; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; @@ -24,9 +27,6 @@ import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; -import static org.eclipse.lsp4j.DiagnosticSeverity.Error; -import static org.eclipse.lsp4j.DiagnosticSeverity.Warning; - /** * Test syntax errors found in a copybook displayed in the according file. Here, variable definition * in the copybook pasted to procedure division that is an error. @@ -41,11 +41,14 @@ class TestErrorsInDifferentFiles { + "4 Procedure Division.\n" + "5 {#*000-Main-Logic}.\n" + "6 {_COPY {~ASDASD}.|error_} \n" - + "7 DISPLAY {CHILD1|invalid}.\n" + + "7 DISPLAY CHILD1.\n" + "8 End program ProgramId."; +// private static final String ASDASD = +// " {@*03|areaA11} {@*CHILD1|child11|areaA22} {PIC|pic1|dot} 9 VALUE IS '0'."; + private static final String ASDASD = - " {@*03|areaA11} {@*CHILD1|child11|areaA22} {PIC|pic1} 9 VALUE IS '0'."; + " {#*03|areaA11} {CHILD1|child11|areaA22} {PIC|pic1|dot} 9 VALUE IS '0'."; private static final String ASDASD_NAME = "ASDASD"; @@ -55,37 +58,26 @@ void test() { TEXT, ImmutableList.of(new CobolText(ASDASD_NAME, ASDASD)), new ImmutableMap.Builder() - .put( - "invalid", - new Diagnostic( - new Range(), - "Variable CHILD1 is not defined", - Error, - ErrorSource.PARSING.getText())) .put( "pic", new Diagnostic( - new Range(), - "Syntax error on 'PIC'", - Error, - ErrorSource.COPYBOOK.getText())).put( + new Range(), "Syntax error on 'PIC'", Error, ErrorSource.COPYBOOK.getText())) + .put( "pic1", new Diagnostic( - new Range(), - "Syntax error on 'PIC'", - Error, - ErrorSource.PARSING.getText())) + new Range(), "Syntax error on 'PIC'", Error, ErrorSource.PARSING.getText())) .put( "child1", new Diagnostic( new Range(), - "Syntax error on 'CHILD1'", + "A period was assumed before \"CHILD1\".", Error, - ErrorSource.COPYBOOK.getText())).put( + ErrorSource.COPYBOOK.getText())) + .put( "child11", new Diagnostic( new Range(), - "Syntax error on 'CHILD1'", + "A period was assumed before \"CHILD1\".", Error, ErrorSource.PARSING.getText())) .put( @@ -94,7 +86,8 @@ void test() { new Range(), "The following token must start in Area A: 03", Warning, - ErrorSource.COPYBOOK.getText())) .put( + ErrorSource.COPYBOOK.getText())) + .put( "areaA11", new Diagnostic( new Range(), @@ -108,12 +101,19 @@ void test() { "Errors inside the copybook", Error, ErrorSource.COPYBOOK.getText())) - .put( + .put( "areaA22", new Diagnostic( new Range(), - "The following token must start in Area A: CHILD1", - Warning, + "Encountered invalid token. Analysis skipped to the next verb or period.", + Error, + ErrorSource.PARSING.getText())) + .put( + "dot", + new Diagnostic( + new Range(), + "A period was assumed before \"PIC\".", + Error, ErrorSource.PARSING.getText())) .build()); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecVarDoesNotProduceNPE.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecVarDoesNotProduceNPE.java index 75366742ba..cdb5b2a9d8 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecVarDoesNotProduceNPE.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestExecVarDoesNotProduceNPE.java @@ -49,7 +49,7 @@ void test() { "2", new Diagnostic( new Range(), - "Unexpected end of file", + "A period was assumed before \"\".", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestFDRecordContainsClause.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestFDRecordContainsClause.java index 307e6d664f..404fd80302 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestFDRecordContainsClause.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestFDRecordContainsClause.java @@ -17,12 +17,15 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; /** - * Tests record contains clause2 for file description entry - * ref- * division-data-file-description-entries */ @@ -62,6 +65,14 @@ public class TestFDRecordContainsClause { + "002800 DATA RECORD IS {$AAAAAAAAAA}. 00002800\n" + " 01 {$*AAAAAAAAAA} PIC 9(2).\n"; + public static final String TEXT5 = + BASE + + " record contains 0 CHARACTERS.\n" + + " {BLOCK|1} CONTAINS 0 RECORDS\n" + + " LABEL RECORDS are OMITTED.\n" + + " 01 CARD_ABC_FIELD.\n" + + " 05 A-FIELD pic x(9)."; + @Test void test() { UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); @@ -81,4 +92,18 @@ void test3() { void test4() { UseCaseEngine.runTest(TEXT4, ImmutableList.of(), ImmutableMap.of()); } + + @Test + void testDotAreNotAllowedBetweenFDEntryClauses() { + UseCaseEngine.runTest( + TEXT5, + ImmutableList.of(), + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), + "Syntax error on 'BLOCK'", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestHalfTypedVariableDefinition.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestHalfTypedVariableDefinition.java index fb7e66a061..49add1cc14 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestHalfTypedVariableDefinition.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestHalfTypedVariableDefinition.java @@ -30,7 +30,7 @@ class TestHalfTypedVariableDefinition { + " Program-id. HELLO-WORLD.\n" + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" - + " 01 {$*COD-RETOUR} PIC X{(|1}{66|2}{|3}"; + + " 01 {$*COD-RETOUR} PIC X{(|1|2}66"; @Test void test() { @@ -41,19 +41,13 @@ void test() { "1", new Diagnostic( new Range(), - "Extraneous input '('", + "A period was assumed before \"(\".", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()), "2", new Diagnostic( new Range(), - "No data definition entry found for rename", - DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()), - "3", - new Diagnostic( - new Range(), - "Unexpected end of file", + "Syntax error on '('", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestHwUnexpectedTextInIdentificationDivision.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestHwUnexpectedTextInIdentificationDivision.java new file mode 100644 index 0000000000..ca758e4a63 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestHwUnexpectedTextInIdentificationDivision.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ + +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Test; + +/** This test checks that unexpected text in ID DIVISION is flagged */ +class TestHwUnexpectedTextInIdentificationDivision { + + private static final String TEXT = + " identification division.\n" + + " program-id. test.\n" + + " {DISPLAY|1} \"HELLO\".\n" + + " data division.\n" + + " working-storage section.\n" + + " 01 {$*VARNAME} PIC X(3) VALUE \"ABC\".\n" + + " procedure division.\n" + + " DISPLAY {$VARNAME}."; + + @Test + void test() { + UseCaseEngine.runTest( + TEXT, + ImmutableList.of(), + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), + "Syntax error on 'DISPLAY'", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), + CobolLanguageId.EXPERIMENTAL_COBOL); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIdentificationDivOptionalParagraphs.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIdentificationDivOptionalParagraphs.java index b1358bda49..f1dd57f391 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIdentificationDivOptionalParagraphs.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIdentificationDivOptionalParagraphs.java @@ -20,7 +20,7 @@ import org.junit.jupiter.api.Test; /** Test optional paragraphs in the Identification division. */ -public class TestIdentificationDivOptionalParagraphs { +class TestIdentificationDivOptionalParagraphs { private static final String TEXT = " IDENTIFICATION DIVISION. \n" + " PROGRAM-ID. \n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIdentificationDivisionInCopybookWithError.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIdentificationDivisionInCopybookWithError.java index d7ae0bda03..2cde957c6a 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIdentificationDivisionInCopybookWithError.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIdentificationDivisionInCopybookWithError.java @@ -17,17 +17,15 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.Range; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import static org.eclipse.lsp4j.DiagnosticSeverity.Error; -import static org.junit.jupiter.api.Assumptions.assumeFalse; /** * This test checks the insertion of IDENTIFICATION DIVISION statement that contains a syntax error @@ -53,11 +51,6 @@ class TestIdentificationDivisionInCopybookWithError { private static final String MESSAGE = "Syntax error on 'DIVISIONs'"; - @BeforeAll - public static void beforeMethod() { - assumeFalse(ParserUtils.isHwParserEnabled()); - } - @Test void test() { UseCaseEngine.runTest( @@ -67,6 +60,7 @@ void test() { "1", new Diagnostic(new Range(), "Errors inside the copybook", Error, ErrorSource.COPYBOOK.getText()), "2", - new Diagnostic(new Range(), MESSAGE, Error, ErrorSource.PARSING.getText()))); + new Diagnostic(new Range(), MESSAGE, Error, ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIndicatorAreaError.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIndicatorAreaError.java index 128b4bac9f..46e0fe581a 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIndicatorAreaError.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestIndicatorAreaError.java @@ -16,8 +16,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; @@ -30,9 +30,9 @@ class TestIndicatorAreaError { private static final String TEXT = "qwerty{u|1}{iop|2}"; private static final String MESSAGE_1 = "Unexpected indicator area content"; - private static final String MESSAGE_2 = ParserUtils.isHwParserEnabled() - ? "Unknown input: 'iop'" - : "Syntax error on 'iop'"; + private static final String MESSAGE_2 = "Syntax error on 'iop'"; + + private static final String MESSAGE_2_HW = "Unknown input: 'iop'"; @Test void test() { @@ -45,6 +45,23 @@ void test() { new Range(), MESSAGE_1, DiagnosticSeverity.Error, ErrorSource.PREPROCESSING.getText()), "2", new Diagnostic( - new Range(), MESSAGE_2, DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); + new Range(), MESSAGE_2, DiagnosticSeverity.Error, ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); + } + + @Test + void testHw() { + UseCaseEngine.runTest( + TEXT, + ImmutableList.of(), + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), MESSAGE_1, DiagnosticSeverity.Error, ErrorSource.PREPROCESSING.getText()), + "2", + new Diagnostic( + new Range(), MESSAGE_2_HW, DiagnosticSeverity.Error, ErrorSource.PARSING.getText())), + CobolLanguageId.EXPERIMENTAL_COBOL); } + } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestKeywordInProgramId.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestKeywordInProgramId.java index f09d4f5f54..dedddca695 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestKeywordInProgramId.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestKeywordInProgramId.java @@ -26,11 +26,11 @@ class TestKeywordInProgramId { + " PROGRAM-ID. AND.\n" + " END PROGRAM AND.\n" + " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" - + " END PROGRAM TEST.\n" + + " PROGRAM-ID. TEST1.\n" + + " END PROGRAM TEST1.\n" + " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. ADDRESS.\n" - + " END PROGRAM ADDRESS.\n"; + + " PROGRAM-ID. ADDRES1.\n" + + " END PROGRAM ADDRES1.\n"; @Test void test() { diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMappingMultilineVariable.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMappingMultilineVariable.java index 527decaa39..a1238bc473 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMappingMultilineVariable.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMappingMultilineVariable.java @@ -14,18 +14,18 @@ */ package org.eclipse.lsp.cobol.usecases; +import static org.eclipse.lsp4j.DiagnosticSeverity.Error; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.AnalysisConfig; import org.eclipse.lsp.cobol.common.copybook.CopybookProcessingMode; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.common.AnalysisConfig; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; -import static org.eclipse.lsp4j.DiagnosticSeverity.Error; - /** Test for multiline variable definition **/ class TestMappingMultilineVariable { private static final String TEXT = "000100 IDENTIFICATION DIVISION. NC2054.2\n" @@ -39,7 +39,7 @@ class TestMappingMultilineVariable { + "006600 NC2054.2\n" + "006700 X(10) VALUENC2054.2\n" + "006900 \"ABCDE12345\". NC2054.2\n" - + "007100 77 {$*SPACING-RECEIVE|1} {PICTUREQ|2} NC2054.2\n"; + + "007100 77 {$*SPACING-RECEIVE|1} {PICTUREQ|2}{|3} NC2054.2\n"; @Test void test() { @@ -52,14 +52,19 @@ void test() { new Range(), "A \"PICTURE\" or \"USAGE INDEX\" clause was not found for elementary item SPACING-RECEIVE", Error, - ErrorSource.PARSING.getText()), + ErrorSource.PARSING.getText()), "2", new Diagnostic( new Range(), - "Syntax error on 'PICTUREQ'", + "Encountered invalid token. Analysis skipped to the next verb or period.", + Error, + ErrorSource.PARSING.getText()), + "3", + new Diagnostic( + new Range(), + "A period was assumed before \"\".", Error, - ErrorSource.PARSING.getText()) - ), + ErrorSource.PARSING.getText())), ImmutableList.of(), AnalysisConfig.defaultConfig(CopybookProcessingMode.DISABLED)); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMarginAB.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMarginAB.java index 3e05534f03..9125da46a1 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMarginAB.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMarginAB.java @@ -15,65 +15,64 @@ package org.eclipse.lsp.cobol.usecases; +import static org.junit.jupiter.api.Assertions.assertEquals; + import org.eclipse.lsp.cobol.common.AnalysisResult; -import org.eclipse.lsp.cobol.core.ParserUtils; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.test.engine.UseCase; import org.eclipse.lsp.cobol.test.engine.UseCaseUtils; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assumptions.assumeFalse; - /** This test verifies if the margins respected and warnings thrown */ class TestMarginAB { /** * In TEXT_DIVISION_WRONG_PLACE string there are several DIVISIONS that are not in the right place */ private static final String TEXT_AREA_A = - "000000 IDENTIFICATION DIVISION.\n" // starting area B instead of A - + "000000 PROGRAM-ID. FILETOTEST.\n" - + "000000 AUTHOR. SERGIU ILIE.\n" + " IDENTIFICATION DIVISION.\n" // starting area B instead of A + + " PROGRAM-ID. FILETOTEST.\n" + + " AUTHOR. SERGIU ILIE.\n" + " ENVIRONMENT DIVISION.\n" + " INPUT-OUTPUT SECTION.\n" + " FILE-CONTROL.\n" - + " SELECT TRANS-FILE-IN ASSIGN TO TEST \n" + + " SELECT TRANS-FILE-IN ASSIGN TO TEST1 \n" + " ORGANIZATION IS LINE SEQUENTIAL \n" + " ACCESS MODE IS SEQUENTIAL. \n" - + "000000 DATA DIVISION.\n" // starting area B instead of A - + "000000 FILE SECTION.\n" - + "000000 FD TRANS-FILE-IN\n" // FD starting in area B instead of A - + "000000 LABEL RECORDS ARE STANDARD\n" - + "000000 RECORDING MODE IS F\n" - + "000000 BLOCK CONTAINS 0 RECORDS\n" - + "000000 RECORD CONTAINS 113 CHARACTERS\n" - + "000000 DATA RECORD IS BILL-LADING-RECORD.\n" - + "000000 01 BILL-LADING-RECORD PIC 9(2).\n" - + "000000 WORKING-STORAGE SECTION.\n" - + "000000 01 TAPARM1 PIC 9.\n" - + "000000 01 TAPARM2 PIC 99 VALUE 2.\n" - + "000000 01 ATCDEM3 PIC X(7) VALUE 'ATCDEM3'.\n" - + "000000 01 P1PARM1 PIC 99 VALUE 0.\n" - + "000000 01 TASTRUCT.\n" - + "000000 05 LOC-ID.\n" - + "000000 10 STATE PIC X(2).\n" - + "000000 10 CITY PIC X(3).\n" - + "000000 05 OP-SYS PIC X(3).\n" - + "000000 PROCEDURE DIVISION.\n" // starting area B instead of A - + "000000 MOVE 'ILCHIMVS' TO TASTRUCT.\n" - + "000000 MOVE 'ILSPR' TO LOC-ID.\n" - + "000000 MOVE 'AIX' TO OP-SYS.\n" - + "000000 PROGA.\n" - + "000000 PERFORM WITH TEST BEFORE UNTIL TAPARM1 = 0\n" - + "000000 SUBTRACT 1 FROM TAPARM1\n" - + "000000 CALL ATCDEM3\n" - + "000000 END-PERFORM\n" - + "000000 IF TAPARM2 = 0\n" - + "000000 PERFORM PROCA\n" - + "000000 END-IF\n" - + "000000 PERFORM WITH TEST BEFORE UNTIL TAPARM2 = 0\n" - + "000000 SUBTRACT 1 FROM TAPARM2\n" - + "000000 END-PERFORM.\n" - + "000000 END PROGRAM FILETOTEST."; + + " DATA DIVISION.\n" // starting area B instead of A + + " FILE SECTION.\n" + + " FD TRANS-FILE-IN\n" // FD starting in area B instead of A + + " LABEL RECORDS ARE STANDARD\n" + + " RECORDING MODE IS F\n" + + " BLOCK CONTAINS 0 RECORDS\n" + + " RECORD CONTAINS 113 CHARACTERS\n" + + " DATA RECORD IS BILL-LADING-RECORD.\n" + + " 01 BILL-LADING-RECORD PIC 9(2).\n" + + " WORKING-STORAGE SECTION.\n" + + " 01 TAPARM1 PIC 9.\n" + + " 01 TAPARM2 PIC 99 VALUE 2.\n" + + " 01 ATCDEM3 PIC X(7) VALUE 'ATCDEM3'.\n" + + " 01 P1PARM1 PIC 99 VALUE 0.\n" + + " 01 TASTRUCT.\n" + + " 05 LOC-ID.\n" + + " 10 STATE PIC X(2).\n" + + " 10 CITY PIC X(3).\n" + + " 05 OP-SYS PIC X(3).\n" + + " PROCEDURE DIVISION.\n" // starting area B instead of A + + " MOVE 'ILCHIMVS' TO TASTRUCT.\n" + + " MOVE 'ILSPR' TO LOC-ID.\n" + + " MOVE 'AIX' TO OP-SYS.\n" + + " PROGA.\n" + + " PERFORM WITH TEST BEFORE UNTIL TAPARM1 = 0\n" + + " SUBTRACT 1 FROM TAPARM1\n" + + " CALL ATCDEM3\n" + + " END-PERFORM\n" + + " IF TAPARM2 = 0\n" + + " PERFORM PROCA\n" + + " END-IF\n" + + " PERFORM WITH TEST BEFORE UNTIL TAPARM2 = 0\n" + + " SUBTRACT 1 FROM TAPARM2\n" + + " END-PERFORM.\n" + + " END PROGRAM FILETOTEST."; /** In TEXT_AREA_B there are several statements starting on the wrong position */ private static final String TEXT_AREA_B = @@ -129,30 +128,30 @@ class TestMarginAB { /** In TEXT_DECLARATIVES the mistake is on the DECLARATIVE line */ private static final String TEXT_DECLARATIVES = - "000000 IDENTIFICATION DIVISION.\n" - + "000000 PROGRAM-ID. FILETOTEST.\n" - + "000000 AUTHOR. SERGIU ILIE.\n" - + "000000 DATA DIVISION.\n" - + "000000 WORKING-STORAGE SECTION.\n" - + "000000 01 TASTRUCT.\n" - + "000000 05 LOC-ID.\n" - + "000000 10 STATE PIC X(2).\n" - + "000000 10 CITY PIC X(3).\n" - + "000000 05 OP-SYS PIC X(3).\n" - + "000000 88 READY-TRACE VALUE 0.\n" - + "000000 PROCEDURE DIVISION.\n" - + "000000 DECLARATIVES. MAMA\n" // after DECLARATIVES keyword no other token is allowed - + "000000 COBOL-DEBUG SECTION.\n" - + "000000 USE FOR DEBUGGING ON ALL PROCEDURES.\n" - + "000000 COBOL-DEBUG-PARA.\n" - + "000000 IF READY-TRACE THEN\n" - + "000000 DISPLAY DEBUG-NAME\n" - + "000000 END-IF.\n" - + "000000 END DECLARATIVES.\n" - + "000000 MOVE 'ILCHIMVS' TO TASTRUCT.\n" - + "000000 MOVE 'ILSPR' TO LOC-ID.\n" - + "000000 MOVE 'AIX' TO OP-SYS.\n" - + "000000 END PROGRAM FILETOTEST."; + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. FILETOTEST.\n" + + " AUTHOR. SERGIU ILIE.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " 01 TASTRUCT.\n" + + " 05 LOC-ID.\n" + + " 10 STATE PIC X(2).\n" + + " 10 CITY PIC X(3).\n" + + " 05 OP-SYS PIC X(3).\n" + + " 88 READY-TRACE VALUE 0.\n" + + " PROCEDURE DIVISION.\n" + + " DECLARATIVES. MAMA\n" // after DECLARATIVES keyword no other token is allowed + + " COBOL-DEBUG SECTION.\n" + + " USE FOR DEBUGGING ON ALL PROCEDURES.\n" + + " COBOL-DEBUG-PARA.\n" + + " IF READY-TRACE THEN\n" + + " DISPLAY DEBUG-NAME\n" + + " END-IF.\n" + + " END DECLARATIVES.\n" + + " MOVE 'ILCHIMVS' TO TASTRUCT.\n" + + " MOVE 'ILSPR' TO LOC-ID.\n" + + " MOVE 'AIX' TO OP-SYS.\n" + + " END PROGRAM FILETOTEST."; @Test void checkForAreaA() { @@ -162,8 +161,7 @@ void checkForAreaA() { @Test void checkForAreaB() { - assumeFalse(ParserUtils.isHwParserEnabled()); - AnalysisResult result = UseCaseUtils.analyze(UseCase.builder().text(TEXT_AREA_B).build()); + AnalysisResult result = UseCaseUtils.analyze(UseCase.builder().text(TEXT_AREA_B).build(), CobolLanguageId.COBOL); assertEquals(5, result.getDiagnostics().get(UseCaseUtils.DOCUMENT_URI).size()); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMissedDialect.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMissedDialect.java index fe7ce26b0b..3c52d26c85 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMissedDialect.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMissedDialect.java @@ -44,7 +44,7 @@ void test() { ImmutableList.of(), ImmutableMap.of( "1", - new Diagnostic(new Range(), "TESTDIALECT dialect is missing (required for file:///c:/workspace/document.cbl)", DiagnosticSeverity.Error, ErrorSource.DIALECT.getText())), + new Diagnostic(new Range(), "TESTDIALECT dialect is missing (required for file:c:/workspace/document.cbl)", DiagnosticSeverity.Error, ErrorSource.DIALECT.getText())), ImmutableList.of(), new AnalysisConfig(CopybookProcessingMode.ENABLED, ImmutableList.of("TESTDIALECT"), false, ImmutableList.of(), ImmutableMap.of())); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMisspelledKeywordWarningInCorrectPosition.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMisspelledKeywordWarningInCorrectPosition.java index 291a113f2d..7e2402db8d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMisspelledKeywordWarningInCorrectPosition.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMisspelledKeywordWarningInCorrectPosition.java @@ -15,6 +15,9 @@ package org.eclipse.lsp.cobol.usecases; +import static org.eclipse.lsp4j.DiagnosticSeverity.Error; +import static org.eclipse.lsp4j.DiagnosticSeverity.Warning; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; @@ -24,9 +27,6 @@ import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; -import static org.eclipse.lsp4j.DiagnosticSeverity.Error; -import static org.eclipse.lsp4j.DiagnosticSeverity.Warning; - /** This test checks that a misspelled keyword after a copybook usage is in the correct position */ class TestMisspelledKeywordWarningInCorrectPosition { @@ -38,7 +38,8 @@ class TestMisspelledKeywordWarningInCorrectPosition { + "4 COPY {~STRUC1}. \n" + "5 Procedure Division.\n" + "6 {#*000-Main-Logic}.\n" - + "7 {@*DISPLA|misspelled|area} {\"hello\"|hello}.\n" + // + "7 {@*DISPLA|area} {\"hello\"|hello|dot}.\n" + + "7 {#*DISPLA|area} {\"hello\"|hello|dot}.\n" + "8 DISPLAY {$CHILD1} OF {$PARENT1}.\n" + "9 End program ProgramId."; @@ -56,12 +57,6 @@ void test() { TEXT, ImmutableList.of(new CobolText(STRUC1_NAME, STRUC1)), ImmutableMap.of( - "misspelled", - new Diagnostic( - new Range(), - "A misspelled word, maybe you want to put DISPLAY", - Warning, - ErrorSource.PARSING.getText()), "area", new Diagnostic( new Range(), @@ -70,6 +65,12 @@ void test() { ErrorSource.PARSING.getText()), "hello", new Diagnostic( - new Range(), "Syntax error on '\"hello\"'", Error, ErrorSource.PARSING.getText()))); + new Range(), "Encountered invalid token. Analysis skipped to the next verb or period.", Error, ErrorSource.PARSING.getText()), + "dot", + new Diagnostic( + new Range(), + "A period was assumed before \"\"hello\"\".", + Error, + ErrorSource.PARSING.getText()))); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMultilineCommentEntries.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMultilineCommentEntries.java index b260a57127..949e53b5b6 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMultilineCommentEntries.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestMultilineCommentEntries.java @@ -25,7 +25,7 @@ class TestMultilineCommentEntries { private static final String TEXT = " identification division.\n" - + " program-id. test.\n" + + " program-id. test1.\n" + " AUTHOR. asdfasdf1\n" + " adfasdf2. \n" + " adfasdf2. \n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestNoExceptionOnEmptyUsage.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestNoExceptionOnEmptyUsage.java index fc581183bb..9d51dae9fb 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestNoExceptionOnEmptyUsage.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestNoExceptionOnEmptyUsage.java @@ -32,7 +32,7 @@ class TestNoExceptionOnEmptyUsage { + " PROGRAM-ID. SETINDEX.\n" + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" - + " 01 {$*MRB|1} USAGE{|2}\n"; + + " 01 {$*MRB|1} USAGE{|2|3}\n"; @Test void test() { @@ -51,6 +51,12 @@ void test() { new Range(), "Unexpected end of file", DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "3", + new Diagnostic( + new Range(), + "A period was assumed before \"\".", + DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestNoNullPointerExpForIncompleteReplaceStatement.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestNoNullPointerExpForIncompleteReplaceStatement.java index a809ebc056..e342342e35 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestNoNullPointerExpForIncompleteReplaceStatement.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestNoNullPointerExpForIncompleteReplaceStatement.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; @@ -55,12 +55,24 @@ void testWhenTypingEndsAtDoubleEqualChar() { ImmutableMap.of( "1", new Diagnostic( - new Range(), - ParserUtils.isHwParserEnabled() - ? "Extraneous input 'copy'" - : "Syntax error on 'copy'", + new Range(), "Syntax error on 'copy'", DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); + } + + @Test + void testHwWhenTypingEndsAtDoubleEqualChar() { + UseCaseEngine.runTest( + TEXT, + ImmutableList.of(), + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), "Extraneous input 'copy'", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), + CobolLanguageId.EXPERIMENTAL_COBOL); } @Test @@ -71,11 +83,24 @@ void testWhenTypingEndsAtSingleEqualChar() { ImmutableMap.of( "1", new Diagnostic( - new Range(), - ParserUtils.isHwParserEnabled() - ? "Extraneous input 'copy'" - : "Syntax error on 'copy'", + new Range(), "Syntax error on 'copy'", DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } + + @Test + void testHwWhenTypingEndsAtSingleEqualChar() { + UseCaseEngine.runTest( + TEXT2, + ImmutableList.of(), + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), "Extraneous input 'copy'", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), + CobolLanguageId.EXPERIMENTAL_COBOL); + } + } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestOccursToDoesNotProduceExceptions.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestOccursToDoesNotProduceExceptions.java index 35c5d1199e..d30b747155 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestOccursToDoesNotProduceExceptions.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestOccursToDoesNotProduceExceptions.java @@ -31,7 +31,7 @@ class TestOccursToDoesNotProduceExceptions { + " PROGRAM-ID. MNEM.\n" + " DATA DIVISION.\n" + " working-storage section.\n" - + " 01 {$*ABCD} OCCURS 5 TO{|1}"; + + " 01 {$*ABCD} OCCURS 5 TO{|1|2}"; @Test void test() { @@ -41,6 +41,15 @@ void test() { ImmutableMap.of( "1", new Diagnostic( - new Range(), "Unexpected end of file", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); + new Range(), + "Unexpected end of file", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "2", + new Diagnostic( + new Range(), + "A period was assumed before \"\".", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestPICVariableStructure.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestPICVariableStructure.java index b2667a4faa..5628065419 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestPICVariableStructure.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestPICVariableStructure.java @@ -47,7 +47,7 @@ class TestPICVariableStructure { + " DATA DIVISION. \n" + " WORKING-STORAGE SECTION. \n" + " 77 {$*DATA-J} PICTURE IS {W|1}WWWW. \n" - + " 77 {$*DATA-S} PICTURE X(20) VALUE \"OFFSET \n" + + " {77|2} {$*DATA-S} PICTURE X(20) VALUE \"OFFSET \n" + " - \"CONTINUATION \". "; @Test @@ -66,6 +66,12 @@ void testSyntaxErrorWhenPICClausePassesWithWrongSyntax() { new Range(), "Syntax error on 'W'", DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "2", + new Diagnostic( + new Range(), + "A period was assumed before \"77\".", + DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestPerformClose.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestPerformClose.java index c254e17db8..4845d71bc9 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestPerformClose.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestPerformClose.java @@ -14,6 +14,8 @@ */ package org.eclipse.lsp.cobol.usecases; +import static org.junit.jupiter.api.Assertions.assertEquals; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.AnalysisResult; @@ -22,8 +24,6 @@ import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.assertEquals; - /** * Paragraph name can be "CLOSE" */ @@ -31,8 +31,8 @@ class TestPerformClose { private static final String TEXT = " IDENTIFICATION DIVISION.\n" + " PROGRAM-ID. CLOSEPAR.\n" + " PROCEDURE DIVISION.\n" - + " PERFORM {#CLOSE}.\n" - + " {#*CLOSE}.\n" + + " PERFORM {#CLOSE1}.\n" + + " {#*CLOSE1}.\n" + " DISPLAY 'CLOSE'.\n"; private static final String TEXT_THRU = " IDENTIFICATION DIVISION.\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestProgramContexts.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestProgramContexts.java index c274821732..32e49d784c 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestProgramContexts.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestProgramContexts.java @@ -31,13 +31,13 @@ class TestProgramContexts { private static final String TEXT_SEQUENTIAL_PROGRAMS = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. FIRST.\n" + + " PROGRAM-ID. FIRST1.\n" + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" + " 01 {$*VARNAME} PIC X(2).\n" + " Procedure Division.\n" + " move 1 to {$VARNAME}.\n" - + " End program FIRST.\n" + + " End program FIRST1.\n" + " IDENTIFICATION DIVISION.\n" + " PROGRAM-ID. SECOND.\n" + " DATA DIVISION.\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSameCopybookStatementsInDifferentPlacesTreatedAsDifferentEntries.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSameCopybookStatementsInDifferentPlacesTreatedAsDifferentEntries.java index 03eb516a18..b216a2c38b 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSameCopybookStatementsInDifferentPlacesTreatedAsDifferentEntries.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSameCopybookStatementsInDifferentPlacesTreatedAsDifferentEntries.java @@ -17,8 +17,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; @@ -26,8 +26,6 @@ import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assumptions.assumeFalse; - /** * Test several copy statements treated as different entries, so if one of them contains a syntax * errors, it will be shown only on the copy statement that produces the error. Here: duplicated @@ -44,7 +42,6 @@ class TestSameCopybookStatementsInDifferentPlacesTreatedAsDifferentEntries { @Test void test() { - assumeFalse(ParserUtils.isHwParserEnabled()); UseCaseEngine.runTest( TEXT, ImmutableList.of(new CobolText(REPL_NAME, REPL)), @@ -59,12 +56,10 @@ void test() { "2", new Diagnostic( new Range(), - ParserUtils.isHwParserEnabled() - ? "Unknown input: 'DATA'" - : "Syntax error on 'DATA'", DiagnosticSeverity.Error, ErrorSource.PARSING.getText(), - null))); + null)), + CobolLanguageId.COBOL); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSemicolonNotAllowedInIdentificationDivision.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSemicolonNotAllowedInIdentificationDivision.java index c93dfa53fa..08d06395f2 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSemicolonNotAllowedInIdentificationDivision.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSemicolonNotAllowedInIdentificationDivision.java @@ -17,33 +17,25 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; import org.eclipse.lsp4j.Range; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assumptions.assumeFalse; - /** This test checks that the semicolons are not allowed outside the PROCEDURE DIVISION. */ class TestSemicolonNotAllowedInIdentificationDivision { private static final String TEXT = " IDENTIFICATION DIVISION;\n" - + " {PROGRAM-ID|1}{.|2} TEST1.\n" + + " {PROGRAM-ID|1}. TEST1.\n" + " DATA DIVISION.\n" + " working-storage section.\n" + " 01 {$*LINE-SPACING} PIC 9.\n" + " procedure division.\n" + " MOVE 2 TO {$LINE-SPACING}.\n"; - @BeforeAll - public static void beforeMethod() { - assumeFalse(ParserUtils.isHwParserEnabled()); - } - @Test void test() { UseCaseEngine.runTest( @@ -53,14 +45,9 @@ void test() { "1", new Diagnostic( new Range(), - "Extraneous input 'PROGRAM-ID'", - DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()), - "2", - new Diagnostic( - new Range(), - "Missing token PROGRAM-ID at programIdParagraph", + "A period was assumed before \"PROGRAM-ID\".", DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotDefinedCorrectly.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotDefinedCorrectly.java index 6cec52a086..ae6b9e971d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotDefinedCorrectly.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSqlIncludeStatementNotDefinedCorrectly.java @@ -19,8 +19,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.Range; @@ -44,9 +44,24 @@ void test() { ImmutableMap.of( "1", new Diagnostic( - new Range(), - ParserUtils.isHwParserEnabled() ? "Extraneous input 'EXEC'" : "Syntax error on 'EXEC'", + new Range(), "Syntax error on 'EXEC'", Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } + + @Test + void testHw() { + UseCaseEngine.runTest( + TEXT, + ImmutableList.of(), + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), "Extraneous input 'EXEC'", + Error, + ErrorSource.PARSING.getText())), + CobolLanguageId.EXPERIMENTAL_COBOL); + } + } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSyntaxError.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSyntaxError.java index 91c3843998..dc7f21d9e6 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSyntaxError.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSyntaxError.java @@ -16,17 +16,14 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; import org.eclipse.lsp4j.Range; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assumptions.assumeFalse; - /** * This test checks if the parser recognizes typo on the "DIVISIONs" token. The correct is * "DIVISION". @@ -43,11 +40,6 @@ class TestSyntaxError { private static final String DIVISION = "Syntax error on 'DIVISIONs'"; private static final String NAME = "There is an issue with PROGRAM-ID paragraph"; - @BeforeAll - public static void beforeMethod() { - assumeFalse(ParserUtils.isHwParserEnabled()); - } - @Test void test() { UseCaseEngine.runTest( @@ -57,6 +49,7 @@ void test() { "typo", new Diagnostic(new Range(), DIVISION, DiagnosticSeverity.Error, ErrorSource.PARSING.getText()), "name", - new Diagnostic(new Range(), NAME, DiagnosticSeverity.Warning, ErrorSource.PARSING.getText()))); + new Diagnostic(new Range(), NAME, DiagnosticSeverity.Warning, ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSyntaxErrorTraversedThroughHierarchy.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSyntaxErrorTraversedThroughHierarchy.java index 20a3518ac2..631ef3e79d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSyntaxErrorTraversedThroughHierarchy.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestSyntaxErrorTraversedThroughHierarchy.java @@ -15,6 +15,8 @@ package org.eclipse.lsp.cobol.usecases; +import static org.eclipse.lsp4j.DiagnosticSeverity.Error; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; @@ -24,8 +26,6 @@ import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; -import static org.eclipse.lsp4j.DiagnosticSeverity.Error; - /** * Test the errors from the bottom of the hierarchy shown at the original document even if there are * several intermediate document levels. Here: REPL is nested to CONT, and is nested to the @@ -41,13 +41,15 @@ class TestSyntaxErrorTraversedThroughHierarchy { + " WORKING-STORAGE SECTION.\n" + " PROCEDURE DIVISION.\n" + " {_COPY {~CONT}.|1_}\n" - + " {#*MAINLINE}. \n" + // + " {#*MAINLINE}. \n" + + " MAINLINE. \n" + " GOBACK. "; private static final String CONT = " {_COPY {~REPL}.|1_}"; private static final String CONT_NAME = "CONT"; - private static final String REPL = " {@*05} {@*TAG-ID|3} {PIC|4} 9.\n"; + // private static final String REPL = " {@*05} {@*TAG-ID|3} {PIC|4|5} 9.\n"; + private static final String REPL = " {#*05} {TAG-ID|3|skip} {PIC|4|5} 9.\n"; private static final String REPL_NAME = "REPL"; @Test @@ -66,16 +68,26 @@ void test() { "3", new Diagnostic( new Range(), - "Syntax error on 'TAG-ID'", + "A period was assumed before \"TAG-ID\".", Error, ErrorSource.PARSING.getText(), null), "4", + new Diagnostic( + new Range(), "Syntax error on 'PIC'", Error, ErrorSource.PARSING.getText(), null), + "5", new Diagnostic( new Range(), - "Syntax error on 'PIC'", + "A period was assumed before \"PIC\".", Error, ErrorSource.PARSING.getText(), - null))); + null), + "skip", + new Diagnostic( + new Range(), + "Encountered invalid token. Analysis skipped to the next verb or period.", + Error, + ErrorSource.PARSING.getText(), + null))); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTolerationForMissingDot.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTolerationForMissingDot.java new file mode 100644 index 0000000000..03dc662517 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTolerationForMissingDot.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableList; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.Test; + +/** + * Tests the toleration of missing DOT_FS + */ +public class TestTolerationForMissingDot { + public static final String TEXT = + " IDENTIFICATION DIVISION\n" + + " {PROGRAM-ID|1}. testabd.\n" + + " ENVIRONMENT DIVISION\n" + + " {CONFIGURATION|2} SECTION\n" + + " {SPECIAL-NAMES|3}.\n" + + " SOURCE-COMPUTER {IBM-PC|4} \n" + + " {OBJECT-COMPUTER|5} .IBM-PC CHARACTER SET.\n" + + " {INPUT-OUTPUT|6} SECTION\n" + + " {FILE-CONTROL|7}\n" + + " {DATA|8} DIVISION\n" + + " {FILE|9} SECTION\n" + + " {WORKING-STORAGE|10} SECTION\n" + + " {01|11} {$*test1}.\n" + + " 05 {$*testa} pic x\n" + + " {LINKAGE|12} SECTION\n" + + " {PROCEDURE|13} DIVISION\n" + + " {_{@*MAIN-PROCESSING}|14_} SECTION.\n" + + " {#*MAINLINE-PARAGRAPH}.\n" + + " display {$TESTA}\n" + + " STOP RUN.\n" + + " {#*ABC}\n" + + " {display|15} \"under abc\"."; + + @Test + void test() { + UseCaseEngine.runTest(TEXT, ImmutableList.of(), getExpectedDiagnostics()); + } + + private Stream getExpectedErrorMessages() { + return Stream.of( + "A period was assumed before \"PROGRAM-ID\".", + "A period was assumed before \"CONFIGURATION\".", + "A period was assumed before \"SPECIAL-NAMES\".", + "A period was assumed before \"IBM-PC\".", + "A period was assumed before \"OBJECT-COMPUTER\".", + "A period was assumed before \"INPUT-OUTPUT\".", + "A period was assumed before \"FILE-CONTROL\".", + "A period was assumed before \"DATA\".", + "A period was assumed before \"FILE\".", + "A period was assumed before \"WORKING-STORAGE\".", + "A period was assumed before \"01\".", + "A period was assumed before \"LINKAGE\".", + "A period was assumed before \"PROCEDURE\".", + "A period was assumed before \"MAIN-PROCESSING\".", + "A period was assumed before \"display\"."); + } + + private Map getExpectedDiagnostics() { + AtomicInteger i = new AtomicInteger(1); + return getExpectedErrorMessages() + .collect( + Collectors.toMap( + str -> String.valueOf(i.getAndIncrement()), + str -> + new Diagnostic( + new Range(), + str, + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTopAsIdentifier.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTopAsIdentifier.java index 0f2f566d6a..d2aaf3d515 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTopAsIdentifier.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTopAsIdentifier.java @@ -18,6 +18,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** TOP is allowed as a name for variables, paragraphs, etc. */ @@ -31,8 +32,35 @@ class TestTopAsIdentifier { + " procedure division.\n" + " {#*TOP}.\n" + " MOVE 0 TO {$TOP}."; - +// ----------- SYSPRINT ---------------- +// LineID PL SL ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6----+----7-|--+----8 Map and Cross Reference +//0 000001 IDENTIFICATION DIVISION. +// 000002 PROGRAM-ID. TEST1. +// 000003 DATA DIVISION. +// 000004 working-storage section. +// 000005 01 TOP PIC 9. 000000000 1C +// +// ==000005==> IGYDS1089-S "TOP" was invalid. Scanning was resumed at the next area "A" item, +// level-number, or the start of the next clause. +// +// 000006 procedure division. +// 000007 TOP. +// +// ==000007==> IGYPS0009-E "TOP" should not begin in area "A". It was processed as if found in area +// "B". +// +// ==000007==> IGYPS2072-S "TOP" was invalid. Skipped to the next verb, period or procedure-name +// definition. +// +// ==000007==> IGYPS0009-E ". " should not begin in area "A". It was processed as if found in area +// "B". +// +// 000008 MOVE 0 TO TOP. +// +// ==000008==> IGYPS2000-S Expected a data-name, but found "TOP". The "MOVE" statement was +// discarded. @Test + @Disabled(" Issue https://github.com/eclipse-che4z/che-che4z-lsp-for-cobol/issues/1004, is not valid. Check sysprint attached along with this class") void test() { UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTypingExecDoesNotProduceException.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTypingExecDoesNotProduceException.java index 1d397e076c..dd607b615d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTypingExecDoesNotProduceException.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTypingExecDoesNotProduceException.java @@ -32,7 +32,7 @@ class TestTypingExecDoesNotProduceException { + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" + " PROCEDURE DIVISION.\n" - + " {@*EXEC}{|1} "; + + " {#*EXEC}{|1} "; @Test void test() { @@ -43,7 +43,7 @@ void test() { "1", new Diagnostic( new Range(), - "Unexpected end of file", + "A period was assumed before \"\".", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTypingOccursDoesNotProduceNumberFormatException.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTypingOccursDoesNotProduceNumberFormatException.java index bd96e235a1..4a3e87f0fb 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTypingOccursDoesNotProduceNumberFormatException.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTypingOccursDoesNotProduceNumberFormatException.java @@ -32,7 +32,7 @@ class TestTypingOccursDoesNotProduceNumberFormatException { + " PROGRAM-ID. TEST1.\n" + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" - + " 01 {$*A1|1} OCCURS{|2}\n"; + + " 01 {$*A1|1} OCCURS{|2|3}\n"; @Test void test() { @@ -51,6 +51,12 @@ void test() { new Range(), "Unexpected end of file", DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "3", + new Diagnostic( + new Range(), + "A period was assumed before \"\".", + DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTyposOnCompilerDirectives.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTyposOnCompilerDirectives.java index 0ac5b7d2fc..d04440b677 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTyposOnCompilerDirectives.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestTyposOnCompilerDirectives.java @@ -16,17 +16,14 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; import org.eclipse.lsp4j.Range; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assumptions.assumeFalse; - /** This test checks that the compiler directives that contain typos processed as usual lines */ class TestTyposOnCompilerDirectives { private static final String PROCESS_WITHOUT_NUMBER_TYPO = @@ -50,11 +47,6 @@ class TestTyposOnCompilerDirectives { private static final String DATA_ERROR_MESSAGE = "Syntax error on 'DDATA'"; - @BeforeAll - public static void beforeMethod() { - assumeFalse(ParserUtils.isHwParserEnabled()); - } - @Test void testProcessWithoutNumbersWithTypo() { UseCaseEngine.runTest( @@ -66,7 +58,8 @@ void testProcessWithoutNumbersWithTypo() { new Range(), "Syntax error on 'DATA'", DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } @Test @@ -80,7 +73,8 @@ void testProcessWithNumbersWithTypo() { new Range(), "Syntax error on 'PROESS'", DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } @Test @@ -94,7 +88,8 @@ void testProcessWithTypoOnData() { new Range(), DATA_ERROR_MESSAGE, DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } @Test @@ -108,6 +103,7 @@ void testProcessWithoutNumberWithTypoOnData() { new Range(), DATA_ERROR_MESSAGE, DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnexpectedCharErrorShown.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnexpectedCharErrorShown.java index 18707088c6..7c3e5c946b 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnexpectedCharErrorShown.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnexpectedCharErrorShown.java @@ -16,33 +16,25 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; import org.eclipse.lsp4j.Range; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assumptions.assumeFalse; - /** This test checks if the parser recognizes an unexpected symbol and shows it as an error. */ class TestUnexpectedCharErrorShown { private static final String TEXT = - " IDENTIFICATION DIVISION{?|typo}.\r\n" + " IDENTIFICATION DIVISION{?|typo|dot}.\r\n" + " PROGRAM-ID. test1.\r\n" + " DATA DIVISION.\r\n" + " PROCEDURE DIVISION.\r\n" - + " END PROGRAM test1."; - - private static final String MESSAGE = "Extraneous input '?'"; + + " END PROGRAM {test1|1}."; - @BeforeAll - public static void beforeMethod() { - assumeFalse(ParserUtils.isHwParserEnabled()); - } + private static final String MESSAGE = "Syntax error on '?'"; @Test void test() { @@ -51,6 +43,20 @@ void test() { ImmutableList.of(), ImmutableMap.of( "typo", - new Diagnostic(new Range(), MESSAGE, DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); + new Diagnostic( + new Range(), MESSAGE, DiagnosticSeverity.Error, ErrorSource.PARSING.getText()), + "dot", + new Diagnostic( + new Range(), + "A period was assumed before \"?\".", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "1", + new Diagnostic( + new Range(), + "There is an issue with PROGRAM-ID paragraph", + DiagnosticSeverity.Warning, + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnexpectedTextInIdentificationDivision.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnexpectedTextInIdentificationDivision.java index 70c632dedb..1ea875e5f9 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnexpectedTextInIdentificationDivision.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnexpectedTextInIdentificationDivision.java @@ -18,7 +18,6 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; @@ -30,17 +29,13 @@ class TestUnexpectedTextInIdentificationDivision { private static final String TEXT = " identification division.\n" - + " program-id. test.\n" + + " program-id. test1.\n" + " {DISPLAY|1} \"HELLO\".\n" + " data division.\n" + " working-storage section.\n" - + (ParserUtils.isHwParserEnabled() - ? " 01 {$*VARNAME} PIC X(3) VALUE \"ABC\".\n" - : " 01 VARNAME PIC X(3) VALUE \"ABC\".\n") + + " 01 VARNAME PIC X(3) VALUE \"ABC\".\n" + " procedure division.\n" - + (ParserUtils.isHwParserEnabled() - ? " DISPLAY {$VARNAME}." - : " DISPLAY VARNAME."); + + " DISPLAY VARNAME."; @Test void test() { diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnknownVariableDefinition.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnknownVariableDefinition.java index 524976cf9c..623f14b511 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnknownVariableDefinition.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestUnknownVariableDefinition.java @@ -33,7 +33,7 @@ class TestUnknownVariableDefinition { + " PROGRAM-ID. THIS.\n" + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" - + " {_01 BLANK|1_}{|2}"; + + " {_01 BLANK|1_}{|2|3}"; @Test void test() { @@ -52,6 +52,12 @@ void test() { new Range(), "Unexpected end of file", DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "3", + new Diagnostic( + new Range(), + "A period was assumed before \"\".", + DiagnosticSeverity.Error, ErrorSource.PARSING.getText()))); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableEndDoesNotProduceNPE.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableEndDoesNotProduceNPE.java index 358a24a113..0b0e8bb6e4 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableEndDoesNotProduceNPE.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableEndDoesNotProduceNPE.java @@ -17,17 +17,14 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; -import org.eclipse.lsp.cobol.core.ParserUtils; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; import org.eclipse.lsp4j.Range; -import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assumptions.assumeFalse; - /** Variable with name "END" should not produce any exceptions */ class TestVariableEndDoesNotProduceNPE { @@ -38,11 +35,6 @@ class TestVariableEndDoesNotProduceNPE { + " WORKING-STORAGE SECTION.\n" + " {01|1} {END|2|3}{|4}"; - @BeforeAll - public static void beforeMethod() { - assumeFalse(ParserUtils.isHwParserEnabled()); - } - @Test void test() { UseCaseEngine.runTest( @@ -58,7 +50,7 @@ void test() { "2", new Diagnostic( new Range(), - "Syntax error on 'END'", + "A period was assumed before \"END\".", DiagnosticSeverity.Error, ErrorSource.PARSING.getText()), "3", @@ -72,6 +64,7 @@ void test() { new Range(), "Unexpected end of file", DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); } } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableInFileControl.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableInFileControl.java index a2256fc261..b45a78e173 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableInFileControl.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableInFileControl.java @@ -27,7 +27,7 @@ class TestVariableInFileControl { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " INPUT-OUTPUT SECTION.\n" + " FILE-CONTROL.\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableRedefineSameGroup.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableRedefineSameGroup.java index aa38970b3d..29fde4de2d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableRedefineSameGroup.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestVariableRedefineSameGroup.java @@ -117,7 +117,7 @@ class TestVariableRedefineSameGroup { + " 03 {$*SEGX-OVERDUE-IND} PIC X(1).\n" + " 03 {$*SEGX-CUSTOMER-STATUS} PIC X(10).\n" + " 66 {$*SED} RENAMES {$SEGX-CUSTOMER-STATUS}.\n" - + " 01 {$*test} REDEFINES {$'XXX'-BALANCE-DUE^NEW-BALANCE-DUE} PIC x(120)."; + + " 01 {$*test1} REDEFINES {$'XXX'-BALANCE-DUE^NEW-BALANCE-DUE} PIC x(120)."; private static final String HOWDY_NAME = "HOWDY"; @Test diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestXMLGenerateStatements.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestXMLGenerateStatements.java new file mode 100644 index 0000000000..0403029c7b --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/TestXMLGenerateStatements.java @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2023 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ + +package org.eclipse.lsp.cobol.usecases; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.error.ErrorSource; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.stream.Stream; + +/** + * Tests XML Generate statements. Ref: + * https://www.ibm.com/docs/en/cobol-zos/6.3?topic=statements-xml-generate-statement + */ +public class TestXMLGenerateStatements { + public static final String TEXT1 = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID TEST3.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " \n" + + " 01 {$*WS-MIS-VARIABLES}. \n" + + " 05 {$*TOTAL-CHAR} PIC 9(05) VALUE 0. \n" + + " 05 {$*XML-OUTPUT} PIC X(1000) VALUE QUOTES. \n" + + "\n" + + " 01 {$*XML-INPUT}. \n" + + " 05 {$*NAME} PIC X(10) VALUE 'JOHN'. \n" + + " 05 {$*AGE} PIC X(02) VALUE 33.\n" + + " PROCEDURE DIVISION.\n" + + " {#*1000-MAINLINE}.\n" + + " XML GENERATE {$XML-OUTPUT} \n" + + " FROM {$XML-INPUT} \n" + + " COUNT IN {$TOTAL-CHAR}\n" + + " WITH ENCODING 1208\n" + + " ON EXCEPTION DISPLAY \"ERROR-XML-CODE = \" {$XML-CODE}. \n" + + "\n" + + " DISPLAY {$XML-OUTPUT}(1:{$TOTAL-CHAR}).\n" + + " STOP RUN."; + + public static final String TEXT2 = + " Identification division.\n" + + " Program-id. XGFX.\n" + + " Data division.\n" + + " Working-storage section.\n" + + " 01 {$*numItems} pic 99 global.\n" + + " 01 {$*purchaseOrder} global.\n" + + " 05 {$*orderDate} pic x(10).\n" + + " 01 {$*numChars} comp pic 999.\n" + + " 01 {$*xmlPO} pic x(999).\n" + + " Procedure division.\n" + + " m.\n" + + " Move space to {$*xmlPO}\n" + + " Xml generate {$*xmlPO} from {$*purchaseOrder} count in {$*numChars} \n" + + " with xml-declaration with attributes \n" + + " namespace 'http://www.example.com' namespace-prefix 'po'\n" + + " Call 'pretty' using {$*xmlPO} value {$numChars}\n" + + " Goback\n" + + " .\n" + + "\n" + + " End program XGFX."; + + public static final String TEXT3 = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID TEST3.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " 01 {$*XML-INPUT}.\n" + + " 05 {$*NAME} PIC X(10) VALUE \"JANE\".\n" + + " \n" + + " PROCEDURE DIVISION.\n" + + " XML GENERATE {XML-OUT|1} FROM {$XML-INPUT} WITH ATTRIBUTES ."; + + public static final String TEXT4 = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. XML5.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " 01 {$*REQUEST}.\n" + + " 06 {$*ROUTE}.\n" + + " 11 {$*NAME} PIC X(030).\n" + + " 11 {$*VERSION} PIC 9(004).\n" + + " 06 {$*QUESTION}.\n" + + " 11 {$*IDENT} PIC 9(009).\n" + + " 11 {$*XMLFILENAME} PIC X(006).\n" + + " 11 {$*XMLFILEINH} PIC X(5000).\n" + + " 01 {$*XML-DOC} PIC X(5000).\n" + + " 01 {$*XML-IDX} PIC S9(9) BINARY.\n" + + " 01 {$*XML-CHAR-CNT} PIC S9(9) BINARY.\n" + + " PROCEDURE DIVISION.\n" + + " XML GENERATE {$XML-DOC} FROM {$REQUEST} COUNT IN {$XML-CHAR-CNT}\n" + + " PERFORM VARYING {$XML-IDX} FROM 1 BY 80\n" + + " UNTIL {$XML-IDX} > {$XML-CHAR-CNT}\n" + + " DISPLAY {$XML-DOC} ({$XML-IDX} : 80)\n" + + " END-PERFORM."; + + public static final String TEXT5 = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. XML5.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " 01 {$*REQUEST}.\n" + + " 06 {$*ROUTE}.\n" + + " 11 {$*NAME} PIC X(030).\n" + + " 11 {$*VERSION} PIC 9(004).\n" + + " 06 {$*QUESTION}.\n" + + " 11 {$*IDENT} PIC 9(009).\n" + + " 11 {$*XMLFILENAME} PIC X(006).\n" + + " 11 {$*XMLFILEINH} PIC X(5000).\n" + + " 01 {$*XML-DOC} PIC X(5000).\n" + + " 01 {$*XML-IDX} PIC S9(9) BINARY.\n" + + " 01 {$*XML-CHAR-CNT} PIC S9(9) BINARY.\n" + + " PROCEDURE DIVISION.\n" + + " XML GENERATE {$XML-DOC} FROM {$REQUEST} COUNT IN {$XML-CHAR-CNT}\n" + + " SUPPRESS EVERY NONNUMERIC ELEMENT WHEN SPACES\n" + + " ON EXCEPTION\n" + + " DISPLAY 'GENERATE XML Error-Header'\n" + + " NOT ON EXCEPTION\n" + + " CONTINUE\n" + + " END-XML."; + + public static final String TEST_TEXT = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. HELLO-WORLD.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + "\n" + + " 77 {$*TestXmlTag} PIC X(20) VALUE \"test\". \n" + + " 77 {$*OutputXml} PIC X(100).\n" + + "\n" + + " PROCEDURE DIVISION.\n" + + " \n" + + " XML GENERATE OutputXml FROM TestXmlTag \n" + + " END-XML\n" + + " \n" + + " DISPLAY \"TestXmlTag: \" {$TestXmlTag}\n" + + " DISPLAY \"OutputXml: \" {$OutputXml}\n" + + "\n" + + " STOP RUN."; + + @ParameterizedTest + @MethodSource("textsToTest") + @DisplayName("Parameterized - testing positive XML generate statements") + void positiveXMLGenerateTest() { + UseCaseEngine.runTest(TEXT1, ImmutableList.of(), ImmutableMap.of()); + } + + private static Stream textsToTest() { + return Stream.of(TEXT1, TEXT2, TEXT4, TEXT5, TEST_TEXT); + } + + @Test + void test3() { + UseCaseEngine.runTest( + TEXT3, + ImmutableList.of(), + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), + "Variable XML-OUT is not defined", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()))); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/engine/UseCaseInitializerService.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/engine/UseCaseInitializerService.java index 9ee3cc8628..4606f4ed78 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/engine/UseCaseInitializerService.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/engine/UseCaseInitializerService.java @@ -27,17 +27,16 @@ import com.google.inject.multibindings.Multibinder; import com.google.inject.name.Names; import java.util.concurrent.CompletableFuture; -import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.LanguageEngineFacade; import org.eclipse.lsp.cobol.common.SubroutineService; import org.eclipse.lsp.cobol.common.action.CodeActionProvider; import org.eclipse.lsp.cobol.common.copybook.CopybookService; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.common.file.FileSystemService; import org.eclipse.lsp.cobol.common.file.WorkspaceFileService; import org.eclipse.lsp.cobol.core.engine.dialects.DialectDiscoveryFolderService; import org.eclipse.lsp.cobol.core.engine.dialects.DialectDiscoveryService; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessor; -import org.eclipse.lsp.cobol.core.preprocessor.TextPreprocessorImpl; +import org.eclipse.lsp.cobol.dialects.TrueDialectServiceImpl; import org.eclipse.lsp.cobol.domain.modules.DatabusModule; import org.eclipse.lsp.cobol.domain.modules.EngineModule; import org.eclipse.lsp.cobol.lsp.DisposableLSPStateService; @@ -78,14 +77,13 @@ public Injector createInjector() { new AbstractModule() { @Override protected void configure() { + bind(TrueDialectService.class).to(TrueDialectServiceImpl.class); bind(LanguageEngineFacade.class).to(CobolLanguageEngineFacade.class); bind(CopybookService.class).to(CopybookServiceImpl.class); bind(SettingsService.class).toInstance(mockSettingsService); bind(FileSystemService.class).toInstance(new WorkspaceFileService()); bind(CobolLanguageClient.class).toInstance(languageClient); bind(SubroutineService.class).to(SubroutineServiceImpl.class); - bind(TextPreprocessor.class).to(TextPreprocessorImpl.class); - bind(CleanerPreprocessor.class).to(TextPreprocessorImpl.class); bind(WatcherService.class).to(WatcherServiceImpl.class); bind(DialectDiscoveryService.class).to(DialectDiscoveryFolderService.class); bind(CodeActions.class); diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestParametrised.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestParametrised.java index bc957a1754..799b3faf25 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestParametrised.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestParametrised.java @@ -16,6 +16,8 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import java.util.stream.Stream; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; @@ -25,8 +27,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; -import java.util.stream.Stream; - /** UseCase test example with variants */ class TestParametrised { private static final String TEXT_START = @@ -47,6 +47,23 @@ private static Stream textsGetter() { @MethodSource("textsGetter") @DisplayName("Parameterized - different ends") void test(String text) { + UseCaseEngine.runTest( + text, + ImmutableList.of(), + ImmutableMap.of( + "eof", + new Diagnostic( + new Range(), + "A period was assumed before \"\".", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); + } + + @ParameterizedTest + @MethodSource("textsGetter") + @DisplayName("Parameterized - different ends") + void testHw(String text) { UseCaseEngine.runTest( text, ImmutableList.of(), @@ -56,6 +73,8 @@ void test(String text) { new Range(), "Unexpected end of file", DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.EXPERIMENTAL_COBOL); } + } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestPositiveCase.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestPositiveCase.java index 415ba3d954..fa2eb62a64 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestPositiveCase.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestPositiveCase.java @@ -23,7 +23,7 @@ class TestPositiveCase { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestReplacing.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestReplacing.java index 6d0aaffc90..e4fe84d68d 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestReplacing.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestReplacing.java @@ -24,7 +24,7 @@ class TestReplacing { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST1.\n" + " ENVIRONMENT DIVISION.\n" + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestWithCopybook.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestWithCopybook.java index ef130ba2ed..81f66afa84 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestWithCopybook.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestWithCopybook.java @@ -24,7 +24,7 @@ class TestWithCopybook { private static final String TEXT = " IDENTIFICATION DIVISION.\n" - + " PROGRAM-ID. TEST.\n" + + " PROGRAM-ID. TEST12.\n" + " ENVIRONMENT DIVISION.\n" + " DATA DIVISION.\n" + " WORKING-STORAGE SECTION.\n" diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestWithErrorCheck.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestWithErrorCheck.java index 36ac16e115..b13d592875 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestWithErrorCheck.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/example/TestWithErrorCheck.java @@ -16,6 +16,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; import org.eclipse.lsp4j.Diagnostic; @@ -35,6 +36,21 @@ class TestWithErrorCheck { @Test void test() { + UseCaseEngine.runTest( + TEXT, + ImmutableList.of(), + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), + "A period was assumed before \"\".", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())), + CobolLanguageId.COBOL); + } + + @Test + void testHw() { UseCaseEngine.runTest( TEXT, ImmutableList.of(), @@ -44,6 +60,8 @@ void test() { new Range(), "Unexpected end of file", DiagnosticSeverity.Error, - ErrorSource.PARSING.getText()))); + ErrorSource.PARSING.getText())), + CobolLanguageId.EXPERIMENTAL_COBOL); } + } diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/hpcobol/TestHPCobol.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/hpcobol/TestHPCobol.java new file mode 100644 index 0000000000..9ef4aac5b4 --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/hpcobol/TestHPCobol.java @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases.hpcobol; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.junit.jupiter.api.Test; + +/** Sample test for HP Cobol language id. */ +public class TestHPCobol { + public static final String TEXT = + "?SAVE ALL\n" + + "?SAVEABEND\n" + + "?SYMBOLS\n" + + "?HEADING \"DUMMY MODULE TO SHOW USE of DOLLAR ZERO\"\n" + + "\n" + + " IDENTIFICATION DIVISION.\n" + + "*************************\n" + + "\n" + + " PROGRAM-ID. AAABCD001.\n" + + "\n" + + "********************************************************************************\n" + + "* *\n" + + "* This is a dummy program for testing *\n" + + "* *\n" + + "********************************************************************************\n" + + "\n" + + "********************************************************************************\n" + + "* PROGRAM HISTORY *\n" + + "* *\n" + + "* DEV/CR DATE INITS DESCRIPTION CIS Release *\n" + + "* 030423 CT Initial version. 1.0 *\n" + + "* 180523 CT Comment added for test 1.0 *\n" + + "********************************************************************************\n" + + "/\n" + + " ENVIRONMENT DIVISION.\n" + + "**********************\n" + + "\n" + + " CONFIGURATION SECTION.\n" + + "\n" + + " SOURCE-COMPUTER. TANDEM.\n" + + " OBJECT-COMPUTER. TANDEM.\n" + + "\n" + + "\n" + + "/\n" + + " DATA DIVISION.\n" + + "***************\n" + + "\n" + + "\n" + + " WORKING-STORAGE SECTION.\n" + + "\n" + + "/\n" + + "*LOCAL WORKING STORAGE\n" + + "**********************\n" + + "\n" + + " 01 {$*W-RECEIVE-COUNT} PIC 9(04).\n" + + " 01 {$*W-DOLLAR-ZERO-BUFFER-LENGTH} PIC 9(04) COMP.\n" + + "\n" + + "*MODULE LINKAGES.\n" + + "*****************\n" + + "\n" + + " LINKAGE SECTION.\n" + + "\n" + + " PROCEDURE DIVISION.\n" + + "********************\n" + + "\n" + + "\n" + + " {@*MAIN-CONTROL} SECTION.\n" + + " {#*MAIN-0}.\n" + + "********************************************************************************\n" + + "* *\n" + + "* This section controls the overall processing within the module. *\n" + + "* *\n" + + "********************************************************************************\n" + + "\n" + + " PERFORM {@A-COMMON-INITIALISATION}\n" + + "\n" + + " PERFORM {@B-SPECIFIC-INITIALISATION}\n" + + "\n" + + " PERFORM {@C-PROCESS-REQUEST}\n" + + " .\n" + + " {#*MAIN-EXIT}.\n" + + " EXIT PROGRAM.\n" + + "/\n" + + " {@*A-COMMON-INITIALISATION} SECTION.\n" + + " {#*A-0}.\n" + + "********************************************************************************\n" + + "* *\n" + + "* This section initialises standard control and event data. *\n" + + "* *\n" + + "********************************************************************************\n" + + "\n" + + " MOVE \"ABCDEFGHIJKLMNOQPRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX\" TO {$W-DOLLAR-ZERO-BUFFER-LENGTH}\n" + + " .\n" + + "\n" + + " {#*A-EXIT}.\n" + + " EXIT.\n" + + "/\n" + + " {@*B-SPECIFIC-INITIALISATION} SECTION.\n" + + " {#*B-0}.\n" + + "********************************************************************************\n" + + "* *\n" + + "* This section is used to perform specific initialisation. *\n" + + "* *\n" + + "********************************************************************************\n" + + "\n" + + " CONTINUE\n" + + " .\n" + + " {#*B-EXIT}.\n" + + " EXIT.\n" + + "/\n" + + " {@*C-PROCESS-REQUEST} SECTION.\n" + + " {#*C-0}.\n" + + "********************************************************************************\n" + + "* *\n" + + "* This section controls the processing of the request message received. *\n" + + "* *\n" + + "********************************************************************************\n" + + "\n" + + " CONTINUE\n" + + " .\n" + + " {#*C-EXIT}.\n" + + " EXIT.\n" + + "/\n" + + "\n" + + "********************************************************************************\n" + + "* E N D O F P R O G R A M *\n" + + "********************************************************************************"; + + @Test + void test() { + UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of(), CobolLanguageId.HP_COBOL); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlComment.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlComment.java new file mode 100644 index 0000000000..2b788d737b --- /dev/null +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/sql/TestSqlComment.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.usecases.sql; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.junit.jupiter.api.Test; + +/** Test DB2 SQL comments */ +public class TestSqlComment { + public static final String TEXT = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. test12.\n" + + " ENVIRONMENT DIVISION.\n" + + " CONFIGURATION SECTION.\n" + + " SPECIAL-NAMES.\n" + + " INPUT-OUTPUT SECTION.\n" + + " FILE-CONTROL.\n" + + " DATA DIVISION.\n" + + " FILE SECTION.\n" + + " WORKING-STORAGE SECTION.\n" + + " LINKAGE SECTION.\n" + + " PROCEDURE DIVISION.\n" + + " EXEC SQL \n" + + " open a\n" + + " * select a from table a = b \n" + + " select a from table -- random where stuffss ss sdjsd \n" + + " END-EXEC."; + + @Test + void test() { + UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); + } +} diff --git a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/variables/TestSymbolVariableName.java b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/variables/TestSymbolVariableName.java index 728fde3a18..eb66fa9bd9 100644 --- a/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/variables/TestSymbolVariableName.java +++ b/server/engine/src/test/java/org/eclipse/lsp/cobol/usecases/variables/TestSymbolVariableName.java @@ -16,12 +16,20 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import java.util.stream.Stream; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; +import org.eclipse.lsp.cobol.common.error.ErrorSource; import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.DiagnosticSeverity; +import org.eclipse.lsp4j.Range; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; -/** - * Symbol variable name should not cause an error. - */ +/** Symbol variable name should not cause an error. */ public class TestSymbolVariableName { private static final String TEXT = @@ -31,10 +39,105 @@ public class TestSymbolVariableName { + " WORKING-STORAGE SECTION.\n" + " 01 {$*SYMBOL} PIC X(10).\n" + " PROCEDURE DIVISION.\n" - + " DISPLAY {$SYMBOL}.\n"; + + " DISPLAY {$SYMBOL}.\n" + + " call {%'subrtn'} using {$SYMBOL}\n" + + " exit.\n" + + " GOBACK.\n"; + + private static final String CODE_TEMPLATE = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. test232.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " {01|1} {%s|2|3} pic x(9).\n" + + " PROCEDURE DIVISION.\n" + + " DISPLAY \"testing in progress\".\n" + + "\n"; + + private static final String CODE_TEMPLATE_SINGLE_ERROR = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. test232.\n" + + " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " 01 {%s|1} pic x(9).\n" + + " PROCEDURE DIVISION.\n" + + " DISPLAY \"testing in progress\".\n" + + "\n"; - @Test - void test() { - UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); + private static Stream> getOptions() { + return Stream.of( + ImmutablePair.of("address", ""), + ImmutablePair.of("bottom", ""), + ImmutablePair.of("close", ""), + ImmutablePair.of("count", ""), + ImmutablePair.of("currency", ""), + ImmutablePair.of("data", ""), + ImmutablePair.of("date", ""), + ImmutablePair.of("day", ""), + ImmutablePair.of("dbcs", ""), + ImmutablePair.of("exit", ""), + ImmutablePair.of("extend", ""), + ImmutablePair.of("first", ""), + ImmutablePair.of("initial", ""), +// ImmutablePair.of("national", ""), TODO: The "PICTURE" clause in the data definition was not compatible with the specified "USAGE NATIONAL" + ImmutablePair.of("object", "Missing token REFERENCE at usageFormat"), + ImmutablePair.of("off", ""), + ImmutablePair.of("quote", ""), + ImmutablePair.of("separate", ""), + ImmutablePair.of("sequence", ""), + ImmutablePair.of("service", ""), + ImmutablePair.of("standard", ""), + ImmutablePair.of("suppress", ""), + ImmutablePair.of( + "terminal", "Encountered invalid token. Analysis skipped to the next verb or period."), + ImmutablePair.of("test", ""), + ImmutablePair.of("time", ""), + ImmutablePair.of("top", "")); + } + + @ParameterizedTest(name = "{arguments} not allowed as variable") + @MethodSource("getOptions") + void testOption(Pair keyword) { + String code = String.format(CODE_TEMPLATE, keyword.getLeft()); + ImmutableMap expectedDiagnostics; + if (!StringUtils.isEmpty(keyword.getRight())) { + code = String.format(CODE_TEMPLATE_SINGLE_ERROR, keyword.getLeft()); + expectedDiagnostics = + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), + keyword.getRight(), + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); + } else { + expectedDiagnostics = + ImmutableMap.of( + "1", + new Diagnostic( + new Range(), + "A \"PICTURE\" or \"USAGE INDEX\" clause was not found for elementary item FILLER", + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "2", + new Diagnostic( + new Range(), + String.format("A period was assumed before \"%s\".", keyword.getLeft()), + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText()), + "3", + new Diagnostic( + new Range(), + String.format("Syntax error on '%s'", keyword.getLeft()), + DiagnosticSeverity.Error, + ErrorSource.PARSING.getText())); } + + UseCaseEngine.runTest(code, ImmutableList.of(), expectedDiagnostics); + } + + @Test + void test() { + UseCaseEngine.runTest(TEXT, ImmutableList.of(), ImmutableMap.of()); + } } diff --git a/server/engine/src/test/resources/cfast/case_execCicsHandleAbend.cbl b/server/engine/src/test/resources/cfast/case_execCicsHandleAbend.cbl index 718582df5a..9d883cec9d 100644 --- a/server/engine/src/test/resources/cfast/case_execCicsHandleAbend.cbl +++ b/server/engine/src/test/resources/cfast/case_execCicsHandleAbend.cbl @@ -15,4 +15,3 @@ PROCEDURE DIVISION. EXEC CICS HANDLE ABEND END-EXEC. -. diff --git a/server/parser/pom.xml b/server/parser/pom.xml index 25eb6373e7..286eefd113 100644 --- a/server/parser/pom.xml +++ b/server/parser/pom.xml @@ -40,7 +40,6 @@ 3.0.2 4.7 3.7.0 - 2.7 3.1.1 0.8.11 UTF-8 @@ -240,20 +239,4 @@ - - - - org.codehaus.mojo - cobertura-maven-plugin - ${maven.cobertura.plugin.version} - - - - cobertura - - - - - - diff --git a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolDataDivisionParser.g4 b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolDataDivisionParser.g4 index a1cd1e30c4..fc4e622abe 100644 --- a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolDataDivisionParser.g4 +++ b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolDataDivisionParser.g4 @@ -37,7 +37,7 @@ fileDescriptionEntry ; fileDescriptionEntryClauses - : (FD | SD) cobolWord (DOT_FS? fileDescriptionEntryClause)* DOT_FS + : (FD | SD) cobolWord fileDescriptionEntryClause* DOT_FS ; fileDescriptionEntryClause @@ -533,5 +533,5 @@ cobolWord ; dialectNodeFiller - : ZERO_WIDTH_SPACE+ + : ZERO_WIDTH_SPACE+ DOT_FS? EOF? ; diff --git a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolIdentificationDivisionParser.g4 b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolIdentificationDivisionParser.g4 index 904239d964..83a1c8d3f1 100644 --- a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolIdentificationDivisionParser.g4 +++ b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolIdentificationDivisionParser.g4 @@ -202,5 +202,5 @@ cobolWord ; dialectNodeFiller - : ZERO_WIDTH_SPACE+ + : ZERO_WIDTH_SPACE+ DOT_FS? EOF? ; diff --git a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolLexer.g4 b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolLexer.g4 index cd9291f221..700565df06 100644 --- a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolLexer.g4 +++ b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolLexer.g4 @@ -14,9 +14,15 @@ lexer grammar CobolLexer; +@header { + import java.util.List; + import java.util.ArrayList; +} + channels{COMMENTS, TECHNICAL} @lexer::members { boolean enableCobolSpecialSeparators = true; + public static List cobolVerbTokens = new ArrayList(); } EJECT: E J E C T DOT_FS? -> channel(HIDDEN); SKIP1 : S K I P '1' DOT_FS? -> channel(HIDDEN); @@ -25,439 +31,443 @@ SKIP3 : S K I P '3' DOT_FS? -> channel(HIDDEN); // keywords ABORT: A B O R T; -ACCEPT : A C C E P T; -ACCESS : A C C E S S; -ADD : A D D; -ALLOCATE: A L L O C A T E; -SYSEIB : S Y S E I B; -ADDRESS : A D D R E S S; -ADVANCING : A D V A N C I N G; -AFTER : A F T E R; -ALL : A L L; -ALPHABET : A L P H A B E T; -ALPHABETIC : A L P H A B E T I C; -ALPHABETIC_LOWER : A L P H A B E T I C MINUSCHAR L O W E R; -ALPHABETIC_UPPER : A L P H A B E T I C MINUSCHAR U P P E R; -ALPHANUMERIC : A L P H A N U M E R I C; -ALPHANUMERIC_EDITED : A L P H A N U M E R I C MINUSCHAR E D I T E D; -ALSO : A L S O; -ALTER : A L T E R; -ALTERNATE : A L T E R N A T E; -AND : A N D; -ANY : A N Y; -APPLY : A P P L Y; -ARE : A R E; -AREA : A R E A; -AREAS : A R E A S; -ASCENDING : A S C E N D I N G; +ACCEPT : A C C E P T {cobolVerbTokens.add(ACCEPT);}; +ACCESS: A C C E S S {cobolVerbTokens.add(ACCESS);}; +ADD: A D D {cobolVerbTokens.add(ADD);}; +ADDRESS: A D D R E S S {cobolVerbTokens.add(ADDRESS);}; +ADVANCING : A D V A N C I N G {cobolVerbTokens.add(ADVANCING);}; +AFTER : A F T E R {cobolVerbTokens.add(AFTER);}; +ALL : A L L {cobolVerbTokens.add(ALL);}; +ALLOCATE : A L L O C A T E {cobolVerbTokens.add(ALLOCATE);}; +ALPHABET : A L P H A B E T {cobolVerbTokens.add(ALPHABET);}; +ALPHABETIC : A L P H A B E T I C {cobolVerbTokens.add(ALPHABETIC);}; +ALPHABETIC_LOWER : A L P H A B E T I C MINUSCHAR L O W E R {cobolVerbTokens.add(ALPHABETIC_LOWER);}; +ALPHABETIC_UPPER : A L P H A B E T I C MINUSCHAR U P P E R {cobolVerbTokens.add(ALPHABETIC_UPPER);}; +ALPHANUMERIC : A L P H A N U M E R I C {cobolVerbTokens.add(ALPHANUMERIC);}; +ALPHANUMERIC_EDITED : A L P H A N U M E R I C MINUSCHAR E D I T E D {cobolVerbTokens.add(ALPHANUMERIC_EDITED);}; +ALSO : A L S O {cobolVerbTokens.add(ALSO);}; +ALTER : A L T E R {cobolVerbTokens.add(ALTER);}; +ALTERNATE : A L T E R N A T E {cobolVerbTokens.add(ALTERNATE);}; +AND : A N D {cobolVerbTokens.add(AND);}; +ANY : A N Y {cobolVerbTokens.add(ANY);}; +APPLY : A P P L Y {cobolVerbTokens.add(APPLY);}; +ARE : A R E {cobolVerbTokens.add(ARE);}; +AREA : A R E A {cobolVerbTokens.add(AREA);}; +AREAS : A R E A S {cobolVerbTokens.add(AREAS);}; +ASCENDING : A S C E N D I N G {cobolVerbTokens.add(ASCENDING);}; ASCII : A S C I I; -ASSIGN : A S S I G N; +ASSIGN : A S S I G N {cobolVerbTokens.add(ASSIGN);}; ASSOCIATED_DATA : A S S O C I A T E D UNDERSCORECHAR D A T A; ASSOCIATED_DATA_LENGTH : A S S O C I A T E D UNDERSCORECHAR D A T A UNDERSCORECHAR L E N G T H; -AT : A T; -AUTHOR : A U T H O R; -BEFORE : B E F O R E; -BINARY : B I N A R Y; -BLANK : B L A N K; -BLOCK : B L O C K; +ATTRIBUTE : A T T R I B U T E; +ATTRIBUTES: A T T R I B U T E S; +AT : A T {cobolVerbTokens.add(AT);}; +AUTHOR : A U T H O R {cobolVerbTokens.add(AUTHOR);}; +BEFORE : B E F O R E {cobolVerbTokens.add(BEFORE);}; +BINARY : B I N A R Y {cobolVerbTokens.add(BINARY);}; +BLANK : B L A N K {cobolVerbTokens.add(BLANK);}; +BLOCK : B L O C K {cobolVerbTokens.add(BLOCK);}; BOOL : B O O L; BOOLEAN : B O O L E A N; -BOTTOM : B O T T O M; -BY : B Y; +BOTTOM : B O T T O M {cobolVerbTokens.add(BOTTOM);}; +BY : B Y {cobolVerbTokens.add(BY);}; BYFUNCTION : B Y F U N C T I O N; BYTITLE : B Y T I T L E; -CALL : C A L L; -CANCEL : C A N C E L; +CALL : C A L L {cobolVerbTokens.add(CALL);}; +CANCEL : C A N C E L {cobolVerbTokens.add(CANCEL);}; CAPABLE : C A P A B L E; -CBL : C B L; +CBL : C B L {cobolVerbTokens.add(CBL);}; CCSVERSION : C C S V E R S I O N; CHAINING : C H A I N I N G; CHANGED : C H A N G E D; CHANNEL : C H A N N E L; -CHARACTER : C H A R A C T E R; -CHARACTERS : C H A R A C T E R S; -CLASS : C L A S S; +CHARACTER : C H A R A C T E R {cobolVerbTokens.add(CHARACTER);}; +CHARACTERS : C H A R A C T E R S {cobolVerbTokens.add(CHARACTERS);}; +CLASS : C L A S S {cobolVerbTokens.add(CLASS);}; CLOCK_UNITS : C L O C K MINUSCHAR U N I T S; -CLOSE : C L O S E; +CLOSE : C L O S E {cobolVerbTokens.add(CLOSE);}; CLOSE_DISPOSITION : C L O S E MINUSCHAR D I S P O S I T I O N; -CODE_SET : C O D E MINUSCHAR S E T; -COLLATING : C O L L A T I N G; -COMMA : C O M M A; +CODE_SET : C O D E MINUSCHAR S E T {cobolVerbTokens.add(CODE_SET);}; +COLLATING : C O L L A T I N G {cobolVerbTokens.add(COLLATING);}; +COMMA : C O M M A {cobolVerbTokens.add(COMMA);}; COMMITMENT : C O M M I T M E N T; -COMMON : C O M M O N; -COMP : C O M P; -COMPUTATIONAL : C O M P U T A T I O N A L; -COMPUTATIONAL_1 : C O M P U T A T I O N A L MINUSCHAR '1'; -COMPUTATIONAL_2 : C O M P U T A T I O N A L MINUSCHAR '2'; -COMPUTATIONAL_3 : C O M P U T A T I O N A L MINUSCHAR '3'; -COMPUTATIONAL_4 : C O M P U T A T I O N A L MINUSCHAR '4'; -COMPUTATIONAL_5 : C O M P U T A T I O N A L MINUSCHAR '5'; -COMPUTE : C O M P U T E; -COMP_1 : C O M P MINUSCHAR '1'; -COMP_2 : C O M P MINUSCHAR '2'; -COMP_3 : C O M P MINUSCHAR '3'; -COMP_4 : C O M P MINUSCHAR '4'; -COMP_5 : C O M P MINUSCHAR '5'; -CONFIGURATION : C O N F I G U R A T I O N; -CONTAINS : C O N T A I N S; -CONTENT : C O N T E N T; -CONTINUE : C O N T I N U E; +COMMON : C O M M O N {cobolVerbTokens.add(COMMON);}; +COMP : C O M P {cobolVerbTokens.add(COMP);}; +COMP_1 : C O M P MINUSCHAR '1' {cobolVerbTokens.add(COMP_1);}; +COMP_2 : C O M P MINUSCHAR '2' {cobolVerbTokens.add(COMP_2);}; +COMP_3 : C O M P MINUSCHAR '3' {cobolVerbTokens.add(COMP_3);}; +COMP_4 : C O M P MINUSCHAR '4' {cobolVerbTokens.add(COMP_4);}; +COMP_5 : C O M P MINUSCHAR '5' {cobolVerbTokens.add(COMP_5);}; +COMPUTATIONAL : C O M P U T A T I O N A L {cobolVerbTokens.add(COMPUTATIONAL);}; +COMPUTATIONAL_1 : C O M P U T A T I O N A L MINUSCHAR '1' {cobolVerbTokens.add(COMPUTATIONAL_1);}; +COMPUTATIONAL_2 : C O M P U T A T I O N A L MINUSCHAR '2' {cobolVerbTokens.add(COMPUTATIONAL_2);}; +COMPUTATIONAL_3 : C O M P U T A T I O N A L MINUSCHAR '3' {cobolVerbTokens.add(COMPUTATIONAL_3);}; +COMPUTATIONAL_4 : C O M P U T A T I O N A L MINUSCHAR '4' {cobolVerbTokens.add(COMPUTATIONAL_4);}; +COMPUTATIONAL_5 : C O M P U T A T I O N A L MINUSCHAR '5' {cobolVerbTokens.add(COMPUTATIONAL_5);}; +COMPUTE : C O M P U T E {cobolVerbTokens.add(COMPUTE);}; +CONFIGURATION : C O N F I G U R A T I O N {cobolVerbTokens.add(CONFIGURATION);}; +CONTAINS : C O N T A I N S {cobolVerbTokens.add(CONTAINS);}; +CONTENT : C O N T E N T {cobolVerbTokens.add(CONTENT);}; +CONTINUE : C O N T I N U E {cobolVerbTokens.add(CONTINUE);}; CONTROL : C O N T R O L; -CONVERTING : C O N V E R T I N G; +CONVERTING : C O N V E R T I N G {cobolVerbTokens.add(CONVERTING);}; COPYENTRY : (' *>CPYENTER' .*? '') -> channel(TECHNICAL); COPYEXIT : '*>CPYEXIT' + NEWLINE -> channel(TECHNICAL); -CORR : C O R R; -CORRESPONDING : C O R R E S P O N D I N G; -COUNT : C O U N T; +CORR : C O R R {cobolVerbTokens.add(CORR);}; +CORRESPONDING : C O R R E S P O N D I N G {cobolVerbTokens.add(CORRESPONDING);}; +COUNT : C O U N T {cobolVerbTokens.add(COUNT);}; CR : C R; CRUNCH : C R U N C H; -CURRENCY : C U R R E N C Y; +CURRENCY : C U R R E N C Y {cobolVerbTokens.add(CURRENCY);}; CYCLE : C Y C L E; DACO_CONTROL : D A C O MINUSCHAR C O N T R O L; -DATA : D A T A; -DATE : D A T E; -DATE_COMPILED : D A T E MINUSCHAR C O M P I L E D; -DATE_WRITTEN : D A T E MINUSCHAR W R I T T E N; -DAY : D A Y; -DAY_OF_WEEK : D A Y MINUSCHAR O F MINUSCHAR W E E K; -DBCS : D B C S; -DEBUGGING : D E B U G G I N G; -DECIMAL_POINT : D E C I M A L MINUSCHAR P O I N T; -DECLARATIVES : D E C L A R A T I V E S; -DEFAULT : D E F A U L T; +DATA : D A T A {cobolVerbTokens.add(DATA);}; +DATE : D A T E {cobolVerbTokens.add(DATE);}; +DATE_COMPILED : D A T E MINUSCHAR C O M P I L E D {cobolVerbTokens.add(DATE_COMPILED);}; +DATE_WRITTEN : D A T E MINUSCHAR W R I T T E N {cobolVerbTokens.add(DATE_WRITTEN);}; +DAY : D A Y {cobolVerbTokens.add(DAY);}; +DAY_OF_WEEK : D A Y MINUSCHAR O F MINUSCHAR W E E K {cobolVerbTokens.add(DAY_OF_WEEK);}; +DBCS : D B C S {cobolVerbTokens.add(DBCS);}; +DEBUGGING : D E B U G G I N G {cobolVerbTokens.add(DEBUGGING);}; +DECIMAL_POINT : D E C I M A L MINUSCHAR P O I N T {cobolVerbTokens.add(DECIMAL_POINT);}; +DECLARATIVES : D E C L A R A T I V E S {cobolVerbTokens.add(DECLARATIVES);}; +DEFAULT : D E F A U L T {cobolVerbTokens.add(DEFAULT);}; DEFAULT_DISPLAY : D E F A U L T MINUSCHAR D I S P L A Y; DEFINITION : D E F I N I T I O N; -DELETE : D E L E T E; -DELIMITED : D E L I M I T E D; -DELIMITER : D E L I M I T E R; -DEPENDING : D E P E N D I N G; -DESCENDING : D E S C E N D I N G; +DELETE : D E L E T E {cobolVerbTokens.add(DELETE);}; +DELIMITED : D E L I M I T E D {cobolVerbTokens.add(DELIMITED);}; +DELIMITER : D E L I M I T E R {cobolVerbTokens.add(DELIMITER);}; +DEPENDING : D E P E N D I N G {cobolVerbTokens.add(DEPENDING);}; +DESCENDING : D E S C E N D I N G {cobolVerbTokens.add(DESCENDING);}; DETAIL: D E T A I L; DISABLE : D I S A B L E; DISK : D I S K; -DISPLAY : D I S P L A Y; -DISPLAY_1 : D I S P L A Y MINUSCHAR '1'; -DIVIDE : D I V I D E; -DIVISION : D I V I S I O N; -DOWN : D O W N; -DUPLICATES : D U P L I C A T E S; -DYNAMIC : D Y N A M I C; +DISPLAY : D I S P L A Y {cobolVerbTokens.add(DISPLAY);}; +DISPLAY_1 : D I S P L A Y MINUSCHAR '1' {cobolVerbTokens.add(DISPLAY_1);}; +DIVIDE : D I V I D E {cobolVerbTokens.add(DIVIDE);}; +DIVISION : D I V I S I O N {cobolVerbTokens.add(DIVISION);}; +DOWN : D O W N {cobolVerbTokens.add(DOWN);}; +DUPLICATES : D U P L I C A T E S {cobolVerbTokens.add(DUPLICATES);}; +DYNAMIC : D Y N A M I C {cobolVerbTokens.add(DYNAMIC);}; EBCDIC : E B C D I C; -EGCS : E G C S; +EGCS : E G C S {cobolVerbTokens.add(EGCS);}; EGI : E G I; -ELSE : E L S E; +ELSE : E L S E {cobolVerbTokens.add(ELSE);}; +ELEMENT : E L E M E N T; EMI : E M I; ENABLE : E N A B L E; ENCODING: E N C O D I N G; -END : E N D; +END : E N D {cobolVerbTokens.add(END);}; END_ACCEPT : E N D MINUSCHAR A C C E P T; -END_ADD : E N D MINUSCHAR A D D; -END_CALL : E N D MINUSCHAR C A L L; -END_COMPUTE : E N D MINUSCHAR C O M P U T E; -END_DELETE : E N D MINUSCHAR D E L E T E; -END_DIVIDE : E N D MINUSCHAR D I V I D E; -END_EVALUATE : E N D MINUSCHAR E V A L U A T E; -END_IF : E N D MINUSCHAR I F; -END_JSON: E N D MINUSCHAR J S O N; -END_MULTIPLY : E N D MINUSCHAR M U L T I P L Y; -END_OF_PAGE : E N D MINUSCHAR O F MINUSCHAR P A G E; -END_PERFORM : E N D MINUSCHAR P E R F O R M; -END_READ : E N D MINUSCHAR R E A D; +END_ADD : E N D MINUSCHAR A D D {cobolVerbTokens.add(END_ADD);}; +END_CALL : E N D MINUSCHAR C A L L {cobolVerbTokens.add(END_CALL);}; +END_COMPUTE : E N D MINUSCHAR C O M P U T E {cobolVerbTokens.add(END_COMPUTE);}; +END_DELETE : E N D MINUSCHAR D E L E T E {cobolVerbTokens.add(END_DELETE);}; +END_DIVIDE : E N D MINUSCHAR D I V I D E {cobolVerbTokens.add(END_DIVIDE);}; +END_EVALUATE : E N D MINUSCHAR E V A L U A T E {cobolVerbTokens.add(END_EVALUATE);}; +END_IF : E N D MINUSCHAR I F {cobolVerbTokens.add(END_IF);}; +END_JSON : E N D MINUSCHAR J S O N {cobolVerbTokens.add(END_JSON);}; +END_MULTIPLY : E N D MINUSCHAR M U L T I P L Y {cobolVerbTokens.add(END_MULTIPLY);}; +END_OF_PAGE : E N D MINUSCHAR O F MINUSCHAR P A G E {cobolVerbTokens.add(END_OF_PAGE);}; +END_PERFORM : E N D MINUSCHAR P E R F O R M {cobolVerbTokens.add(END_PERFORM);}; +END_READ : E N D MINUSCHAR R E A D {cobolVerbTokens.add(END_READ);}; END_RECEIVE : E N D MINUSCHAR R E C E I V E; -END_RETURN : E N D MINUSCHAR R E T U R N; -END_REWRITE : E N D MINUSCHAR R E W R I T E; -END_SEARCH : E N D MINUSCHAR S E A R C H; -END_START : E N D MINUSCHAR S T A R T; -END_STRING : E N D MINUSCHAR S T R I N G; -END_SUBTRACT : E N D MINUSCHAR S U B T R A C T; -END_UNSTRING : E N D MINUSCHAR U N S T R I N G; -END_WRITE : E N D MINUSCHAR W R I T E; -END_XML : E N D MINUSCHAR X M L; -ENTRY : E N T R Y; -ENVIRONMENT : E N V I R O N M E N T; -EOP : E O P; -EQUAL : E Q U A L; -ERROR : E R R O R; +END_RETURN : E N D MINUSCHAR R E T U R N {cobolVerbTokens.add(END_RETURN);}; +END_REWRITE : E N D MINUSCHAR R E W R I T E {cobolVerbTokens.add(END_REWRITE);}; +END_SEARCH : E N D MINUSCHAR S E A R C H {cobolVerbTokens.add(END_SEARCH);}; +END_START : E N D MINUSCHAR S T A R T {cobolVerbTokens.add(END_START);}; +END_STRING : E N D MINUSCHAR S T R I N G {cobolVerbTokens.add(END_STRING);}; +END_SUBTRACT : E N D MINUSCHAR S U B T R A C T {cobolVerbTokens.add(END_SUBTRACT);}; +END_UNSTRING : E N D MINUSCHAR U N S T R I N G {cobolVerbTokens.add(END_UNSTRING);}; +END_WRITE : E N D MINUSCHAR W R I T E {cobolVerbTokens.add(END_WRITE);}; +END_XML : E N D MINUSCHAR X M L {cobolVerbTokens.add(END_XML);}; +ENTRY : E N T R Y {cobolVerbTokens.add(ENTRY);}; +ENVIRONMENT : E N V I R O N M E N T {cobolVerbTokens.add(ENVIRONMENT);}; +EOP : E O P {cobolVerbTokens.add(EOP);}; +EQUAL : E Q U A L {cobolVerbTokens.add(EQUAL);}; +ERROR : E R R O R {cobolVerbTokens.add(ERROR);}; ESCAPE : E S C A P E; ESI : E S I; -EVALUATE : E V A L U A T E; -EVERY : E V E R Y; -EXCEPTION : E X C E P T I O N; +EVALUATE : E V A L U A T E {cobolVerbTokens.add(EVALUATE);}; +EVERY : E V E R Y {cobolVerbTokens.add(EVERY);}; +EXCEPTION : E X C E P T I O N {cobolVerbTokens.add(EXCEPTION);}; EXCLUSIVE : E X C L U S I V E; EXHIBIT : E X H I B I T; -EXIT : E X I T; -EXTEND : E X T E N D; -EXTERNAL : E X T E R N A L; -FALSE : F A L S E; -FD : F D; +EXIT : E X I T {cobolVerbTokens.add(EXIT);}; +EXTEND : E X T E N D {cobolVerbTokens.add(EXTEND);}; +EXTERNAL : E X T E R N A L {cobolVerbTokens.add(EXTERNAL);}; +FALSE : F A L S E {cobolVerbTokens.add(FALSE);}; +FD : F D {cobolVerbTokens.add(FD);}; FIELD : F I E L D; -FILE : F I L E; -FILE_CONTROL : F I L E MINUSCHAR C O N T R O L; -FILLER : F I L L E R; -FIRST : F I R S T; -FOOTING : F O O T I N G; -FOR : F O R; -FREE: F R E E; -FROM : F R O M; -FUNCTION : F U N C T I O N; -FUNCTION_POINTER : F U N C T I O N MINUSCHAR P O I N T E R; -GENERATE : G E N E R A T E; -GIVING : G I V I N G; -GLOBAL : G L O B A L; -GO : G O; -GOBACK : G O B A C K; -GREATER : G R E A T E R; -GROUP_USAGE : G R O U P MINUSCHAR U S A G E; -HIGH_VALUE : H I G H MINUSCHAR V A L U E; -HIGH_VALUES : H I G H MINUSCHAR V A L U E S; -ID : I D; -IDENTIFICATION : I D E N T I F I C A T I O N {enableCobolSpecialSeparators = true;}; -IF : I F; +FILE : F I L E {cobolVerbTokens.add(FILE);}; +FILE_CONTROL : F I L E MINUSCHAR C O N T R O L {cobolVerbTokens.add(FILE_CONTROL);}; +FILLER : F I L L E R {cobolVerbTokens.add(FILLER);}; +FIRST : F I R S T {cobolVerbTokens.add(FIRST);}; +FOOTING : F O O T I N G {cobolVerbTokens.add(FOOTING);}; +FOR : F O R {cobolVerbTokens.add(FOR);}; +FREE : F R E E {cobolVerbTokens.add(FREE);}; +FROM : F R O M {cobolVerbTokens.add(FROM);}; +FUNCTION : F U N C T I O N {cobolVerbTokens.add(FUNCTION);}; +FUNCTION_POINTER : F U N C T I O N MINUSCHAR P O I N T E R {cobolVerbTokens.add(FUNCTION_POINTER);}; +GENERATE : G E N E R A T E {cobolVerbTokens.add(GENERATE);}; +GIVING : G I V I N G {cobolVerbTokens.add(GIVING);}; +GLOBAL : G L O B A L {cobolVerbTokens.add(GLOBAL);}; +GO : G O {cobolVerbTokens.add(GO);}; +GOBACK : G O B A C K {cobolVerbTokens.add(GOBACK);}; +GREATER : G R E A T E R {cobolVerbTokens.add(GREATER);}; +GROUP_USAGE : G R O U P MINUSCHAR U S A G E {cobolVerbTokens.add(GROUP_USAGE);}; +HIGH_VALUE : H I G H MINUSCHAR V A L U E {cobolVerbTokens.add(HIGH_VALUE);}; +HIGH_VALUES : H I G H MINUSCHAR V A L U E S {cobolVerbTokens.add(HIGH_VALUES);}; +I_O : I MINUSCHAR O {cobolVerbTokens.add(I_O);}; +I_O_CONTROL : I MINUSCHAR O MINUSCHAR C O N T R O L {cobolVerbTokens.add(I_O_CONTROL);}; +ID : I D {cobolVerbTokens.add(ID);}; +IDENTIFICATION : I D E N T I F I C A T I O N {cobolVerbTokens.add(IDENTIFICATION); enableCobolSpecialSeparators = true;}; +IF : I F {cobolVerbTokens.add(IF);}; IMPLICIT : I M P L I C I T; -IN : I N; -INDEX : I N D E X; -INDEXED : I N D E X E D; -INITIAL : I N I T I A L; -INITIALIZE : I N I T I A L I Z E; +IN : I N {cobolVerbTokens.add(IN);}; +INDEX : I N D E X {cobolVerbTokens.add(INDEX);}; +INDEXED : I N D E X E D {cobolVerbTokens.add(INDEXED);}; +INITIAL : I N I T I A L {cobolVerbTokens.add(INITIAL);}; +INITIALIZE : I N I T I A L I Z E {cobolVerbTokens.add(INITIALIZE);}; INITIALIZED: I N I T I A L I Z E D; INITIATE : I N I T I A T E; -INPUT : I N P U T; -INPUT_OUTPUT : I N P U T MINUSCHAR O U T P U T; -INSPECT : I N S P E C T; -INSTALLATION : I N S T A L L A T I O N; -INTRINSIC : I N T R I N S I C; +INPUT : I N P U T {cobolVerbTokens.add(INPUT);}; +INPUT_OUTPUT : I N P U T MINUSCHAR O U T P U T {cobolVerbTokens.add(INPUT_OUTPUT);}; +INSPECT : I N S P E C T {cobolVerbTokens.add(INSPECT);}; +INSTALLATION : I N S T A L L A T I O N {cobolVerbTokens.add(INSTALLATION);}; INTEGER : I N T E G E R; -INTO : I N T O; -INVALID : I N V A L I D; +INTO : I N T O {cobolVerbTokens.add(INTO);}; +INTRINSIC : I N T R I N S I C; +INVALID : I N V A L I D {cobolVerbTokens.add(INVALID);}; INVD : I N V D; INVDATA : I N V D A T A; -IS : I S; -I_O : I MINUSCHAR O; -I_O_CONTROL : I MINUSCHAR O MINUSCHAR C O N T R O L; -JSON: J S O N; -JUST : J U S T; -JUSTIFIED : J U S T I F I E D; -KANJI : K A N J I; +IS : I S {cobolVerbTokens.add(IS);}; +JSON : J S O N {cobolVerbTokens.add(JSON);}; +JUST : J U S T {cobolVerbTokens.add(JUST);}; +JUSTIFIED : J U S T I F I E D {cobolVerbTokens.add(JUSTIFIED);}; +KANJI : K A N J I {cobolVerbTokens.add(KANJI);}; KEPT : K E P T; -KEY : K E Y; +KEY : K E Y {cobolVerbTokens.add(KEY);}; KEYBOARD : K E Y B O A R D; -LABEL : L A B E L; +LABEL : L A B E L {cobolVerbTokens.add(LABEL);}; LAST : L A S T; -LEADING : L E A D I N G; -LEFT : L E F T; -LENGTH : L E N G T H; -LESS : L E S S; +LEADING : L E A D I N G {cobolVerbTokens.add(LEADING);}; +LEFT : L E F T {cobolVerbTokens.add(LEFT);}; +LENGTH : L E N G T H {cobolVerbTokens.add(LENGTH);}; +LESS : L E S S {cobolVerbTokens.add(LESS);}; LIBRARY : L I B R A R Y; -LIMIT : L I M I T; -LINAGE : L I N A G E; -LINAGE_COUNTER : L I N A G E MINUSCHAR C O U N T E R; -LINE : L I N E; -LINES : L I N E S; -LINKAGE : L I N K A G E; +LIMIT : L I M I T {cobolVerbTokens.add(LIMIT);}; +LINAGE : L I N A G E {cobolVerbTokens.add(LINAGE);}; +LINAGE_COUNTER : L I N A G E MINUSCHAR C O U N T E R {cobolVerbTokens.add(LINAGE_COUNTER);}; +LINE : L I N E {cobolVerbTokens.add(LINE);}; +LINES : L I N E S {cobolVerbTokens.add(LINES);}; +LINKAGE : L I N K A G E {cobolVerbTokens.add(LINKAGE);}; LIST : L I S T; LOC: L O C; LOCAL : L O C A L; -LOCAL_STORAGE : L O C A L MINUSCHAR S T O R A G E; -LOCK : L O C K; -LOW_VALUE : L O W MINUSCHAR V A L U E; -LOW_VALUES : L O W MINUSCHAR V A L U E S; +LOCAL_STORAGE : L O C A L MINUSCHAR S T O R A G E {cobolVerbTokens.add(LOCAL_STORAGE);}; +LOCK : L O C K {cobolVerbTokens.add(LOCK);}; +LOW_VALUE : L O W MINUSCHAR V A L U E; +LOW_VALUES : L O W MINUSCHAR V A L U E S {cobolVerbTokens.add(LOW_VALUES);}; MAX : M A X; -MEMORY : M E M O R Y; -MERGE : M E R G E; +MEMORY : M E M O R Y {cobolVerbTokens.add(MEMORY);}; +MERGE : M E R G E {cobolVerbTokens.add(MERGE);}; MESSAGE : M E S S A G E; -METHOD: M E T H O D; +METHOD : M E T H O D {cobolVerbTokens.add(METHOD);}; MMDDYYYY : M M D D Y Y Y Y; -MODE : M O D E; -MODULES : M O D U L E S; -MOVE : M O V E; -MULTIPLE : M U L T I P L E; -MULTIPLY : M U L T I P L Y; +MODE : M O D E {cobolVerbTokens.add(MODE);}; +MODULES : M O D U L E S {cobolVerbTokens.add(MODULES);}; +MOVE : M O V E {cobolVerbTokens.add(MOVE);}; +MULTIPLE : M U L T I P L E {cobolVerbTokens.add(MULTIPLE);}; +MULTIPLY : M U L T I P L Y {cobolVerbTokens.add(MULTIPLY);}; NAME : N A M E; NAMED : N A M E D; -NATIONAL : N A T I O N A L; -NATIONAL_EDITED : N A T I O N A L MINUSCHAR E D I T E D; -NATIVE : N A T I V E; -NEGATIVE : N E G A T I V E; +NAMESPACE : N A M E S P A C E; +NAMESPACE_PREFIX : NAMESPACE MINUSCHAR P R E F I X; +NATIONAL : N A T I O N A L {cobolVerbTokens.add(NATIONAL);}; +NATIONAL_EDITED : N A T I O N A L MINUSCHAR E D I T E D {cobolVerbTokens.add(NATIONAL_EDITED);}; +NATIVE : N A T I V E {cobolVerbTokens.add(NATIVE);}; +NEGATIVE : N E G A T I V E {cobolVerbTokens.add(NEGATIVE);}; NETWORK : N E T W O R K; -NEXT : N E X T; -NO : N O; +NEXT : N E X T {cobolVerbTokens.add(NEXT);}; +NO : N O {cobolVerbTokens.add(NO);}; NONNUMERIC : N O N N U M E R I C; -NOT : N O T; -NULL : N U L L; -NULLS : N U L L S; -NUMERIC : N U M E R I C; -NUMERIC_EDITED : N U M E R I C MINUSCHAR E D I T E D; -OBJECT : O B J E C T; -OBJECT_COMPUTER : O B J E C T MINUSCHAR C O M P U T E R; -OCCURS : O C C U R S; +NOT : N O T {cobolVerbTokens.add(NOT);}; +NULL : N U L L {cobolVerbTokens.add(NULL);}; +NULLS : N U L L S {cobolVerbTokens.add(NULLS);}; +NUMERIC : N U M E R I C {cobolVerbTokens.add(NUMERIC);}; +NUMERIC_EDITED : N U M E R I C MINUSCHAR E D I T E D {cobolVerbTokens.add(NUMERIC_EDITED);}; +OBJECT : O B J E C T {cobolVerbTokens.add(OBJECT);}; +OBJECT_COMPUTER : O B J E C T MINUSCHAR C O M P U T E R {cobolVerbTokens.add(OBJECT_COMPUTER);}; +OCCURS : O C C U R S {cobolVerbTokens.add(OCCURS);}; ODT : O D T; -OF : O F; -OFF : O F F; -OMITTED : O M I T T E D; -ON : O N; -OPEN : O P E N; -OPTIONAL : O P T I O N A L; -OR : O R; -ORDER : O R D E R; +OF : O F {cobolVerbTokens.add(OF);}; +OFF : O F F {cobolVerbTokens.add(OFF);}; +OMITTED : O M I T T E D {cobolVerbTokens.add(OMITTED);}; +ON : O N {cobolVerbTokens.add(ON);}; +OPEN : O P E N {cobolVerbTokens.add(OPEN);}; +OPTIONAL : O P T I O N A L {cobolVerbTokens.add(OPTIONAL);}; +OR : O R {cobolVerbTokens.add(OR);}; +ORDER : O R D E R {cobolVerbTokens.add(ORDER);}; ORDERLY : O R D E R L Y; -ORGANIZATION : O R G A N I Z A T I O N; -OTHER : O T H E R; -OUTPUT : O U T P U T; -OVERFLOW : O V E R F L O W; -PACKED_DECIMAL : P A C K E D MINUSCHAR D E C I M A L; -PADDING : P A D D I N G; -PAGE : P A G E; +ORGANIZATION : O R G A N I Z A T I O N {cobolVerbTokens.add(ORGANIZATION);}; +OTHER : O T H E R {cobolVerbTokens.add(OTHER);}; +OUTPUT : O U T P U T {cobolVerbTokens.add(OUTPUT);}; +OVERFLOW : O V E R F L O W {cobolVerbTokens.add(OVERFLOW);}; +PACKED_DECIMAL : P A C K E D MINUSCHAR D E C I M A L {cobolVerbTokens.add(PACKED_DECIMAL);}; +PADDING : P A D D I N G {cobolVerbTokens.add(PADDING);}; +PAGE : P A G E {cobolVerbTokens.add(PAGE);}; PARAGRAPH: P A R A G R A P H; PARSE: P A R S E; -// PARTNFAIL : P A R T N F A I L; -PASSWORD : P A S S W O R D; -PERFORM : P E R F O R M; -PIC : P I C -> pushMode(PICTURECLAUSE); -PICTURE : P I C T U R E -> pushMode(PICTURECLAUSE); -POINTER : P O I N T E R; -POINTER_32 : P O I N T E R MINUSCHAR '3' '2'; +PASSWORD : P A S S W O R D {cobolVerbTokens.add(PASSWORD);}; +PERFORM : P E R F O R M {cobolVerbTokens.add(PERFORM);}; +PIC : P I C {cobolVerbTokens.add(PIC);} -> pushMode(PICTURECLAUSE) ; +PICTURE : P I C T U R E {cobolVerbTokens.add(PICTURE);} -> pushMode(PICTURECLAUSE) ; +POINTER : P O I N T E R {cobolVerbTokens.add(POINTER);}; PORT : P O R T; -POSITION : P O S I T I O N; -POSITIVE : P O S I T I V E; +POSITION : P O S I T I O N {cobolVerbTokens.add(POSITION);}; +POSITIVE : P O S I T I V E {cobolVerbTokens.add(POSITIVE);}; PRINTER : P R I N T E R; -PROCEDURE : P R O C E D U R E; -PROCEDURES : P R O C E D U R E S; -PROCEDURE_POINTER : P R O C E D U R E MINUSCHAR P O I N T E R; -PROCEED : P R O C E E D; -PROCESS : P R O C E S S {enableCobolSpecialSeparators = false;}; -PROCESSING: P R O C E S S I N G; -PROGRAM : P R O G R A M; -PROGRAM_ID : P R O G R A M MINUSCHAR I D; +PROCEDURE : P R O C E D U R E {cobolVerbTokens.add(PROCEDURE);}; +PROCEDURE_POINTER : P R O C E D U R E MINUSCHAR P O I N T E R {cobolVerbTokens.add(PROCEDURE_POINTER);}; +PROCEDURES : P R O C E D U R E S {cobolVerbTokens.add(PROCEDURES);}; +PROCEED : P R O C E E D {cobolVerbTokens.add(PROCEED);}; +PROCESSING : P R O C E S S I N G {cobolVerbTokens.add(PROCESSING); enableCobolSpecialSeparators = false;}; +PROGRAM : P R O G R A M {cobolVerbTokens.add(PROGRAM);}; +PROGRAM_ID : P R O G R A M MINUSCHAR I D {cobolVerbTokens.add(PROGRAM_ID);}; PURGE : P U R G E; -QUOTE : Q U O T E; -QUOTES : Q U O T E S; -RANDOM : R A N D O M; -READ : R E A D; +QUOTE : Q U O T E {cobolVerbTokens.add(QUOTE);}; +QUOTES : Q U O T E S {cobolVerbTokens.add(QUOTES);}; +RANDOM : R A N D O M {cobolVerbTokens.add(RANDOM);}; +READ : R E A D {cobolVerbTokens.add(READ);}; READER : R E A D E R; -READY : R E A D Y; +READY : R E A D Y {cobolVerbTokens.add(READY);}; RECEIVE : R E C E I V E; -RECORD : R E C O R D; -RECORDING : R E C O R D I N G; -RECORDS : R E C O R D S; -RECURSIVE : R E C U R S I V E; -REDEFINES : R E D E F I N E S; -REEL : R E E L; -REFERENCE : R E F E R E N C E; -REFERENCES : R E F E R E N C E S; -RELATIVE : R E L A T I V E; -RELEASE : R E L E A S E; -RELOAD: R E L O A D; -REMAINDER : R E M A I N D E R; +RECORD : R E C O R D {cobolVerbTokens.add(RECORD);}; +RECORDING : R E C O R D I N G {cobolVerbTokens.add(RECORDING);}; +RECORDS : R E C O R D S {cobolVerbTokens.add(RECORDS);}; +RECURSIVE : R E C U R S I V E {cobolVerbTokens.add(RECURSIVE);}; +REDEFINES : R E D E F I N E S {cobolVerbTokens.add(REDEFINES);}; +REEL : R E E L {cobolVerbTokens.add(REEL);}; +REFERENCE : R E F E R E N C E {cobolVerbTokens.add(REFERENCE);}; +REFERENCES : R E F E R E N C E S {cobolVerbTokens.add(REFERENCES);}; +RELATIVE : R E L A T I V E {cobolVerbTokens.add(RELATIVE);}; +RELEASE : R E L E A S E {cobolVerbTokens.add(RELEASE);}; +RELOAD : R E L O A D {cobolVerbTokens.add(RELOAD);}; +REMAINDER : R E M A I N D E R {cobolVerbTokens.add(REMAINDER);}; REMARKS : R E M A R K S; REMOTE : R E M O T E; -REMOVAL : R E M O V A L; +REMOVAL : R E M O V A L {cobolVerbTokens.add(REMOVAL);}; REMOVE : R E M O V E; -RENAMES : R E N A M E S; -REPLACING : R E P L A C I N G; +RENAMES : R E N A M E S {cobolVerbTokens.add(RENAMES);}; +REPLACING : R E P L A C I N G {cobolVerbTokens.add(REPLACING);}; REPORT : R E P O R T; REPORTS : R E P O R T S; -REPOSITORY : R E P O S I T O R Y; -RERUN : R E R U N; -RESERVE : R E S E R V E; -RESET : R E S E T; +REPOSITORY : R E P O S I T O R Y {cobolVerbTokens.add(REPOSITORY);}; +RERUN : R E R U N {cobolVerbTokens.add(RERUN);}; +RESERVE : R E S E R V E {cobolVerbTokens.add(RESERVE);}; +RESET : R E S E T {cobolVerbTokens.add(RESET);}; RESUME : R E S U M E; -RETURN : R E T U R N; -RETURNING: R E T U R N I N G; -REVERSED : R E V E R S E D; -REWIND : R E W I N D; -REWRITE : R E W R I T E; -RIGHT : R I G H T; -ROUNDED : R O U N D E D; -RUN : R U N; -SAME : S A M E; +RETURN : R E T U R N {cobolVerbTokens.add(RETURN);}; +RETURNING : R E T U R N I N G {cobolVerbTokens.add(RETURNING);}; +REVERSED : R E V E R S E D {cobolVerbTokens.add(REVERSED);}; +REWIND : R E W I N D {cobolVerbTokens.add(REWIND);}; +REWRITE : R E W R I T E {cobolVerbTokens.add(REWRITE);}; +RIGHT : R I G H T {cobolVerbTokens.add(RIGHT);}; +ROUNDED : R O U N D E D {cobolVerbTokens.add(ROUNDED);}; +RUN : R U N {cobolVerbTokens.add(RUN);}; +SAME : S A M E {cobolVerbTokens.add(SAME);}; SAVE : S A V E; -SD : S D; -SEARCH : S E A R C H; -SECTION : S E C T I O N; -SECURITY : S E C U R I T Y; +SD : S D {cobolVerbTokens.add(SD);}; +SEARCH : S E A R C H {cobolVerbTokens.add(SEARCH);}; +SECTION : S E C T I O N {cobolVerbTokens.add(SECTION);}; +SECURITY : S E C U R I T Y {cobolVerbTokens.add(SECURITY);}; SEGMENT : S E G M E N T; -SEGMENT_LIMIT : S E G M E N T MINUSCHAR L I M I T; -SELECT : S E L E C T; +SEGMENT_LIMIT : S E G M E N T MINUSCHAR L I M I T {cobolVerbTokens.add(SEGMENT_LIMIT);}; +SELECT : S E L E C T {cobolVerbTokens.add(SELECT);}; SEND : S E N D; -SENTENCE : S E N T E N C E; -SEPARATE : S E P A R A T E; -SEQUENCE : S E Q U E N C E; -SEQUENTIAL : S E Q U E N T I A L; -SERVICE : S E R V I C E; -SET : S E T; -SIGN : S I G N; -SIZE : S I Z E; -SORT : S O R T; -SORT_MERGE : S O R T MINUSCHAR M E R G E; -SOURCE_COMPUTER : S O U R C E MINUSCHAR C O M P U T E R; -SPACE : S P A C E; -SPACES : S P A C E S; -SPECIAL_NAMES : S P E C I A L MINUSCHAR N A M E S; -STANDARD : S T A N D A R D; -STANDARD_1 : S T A N D A R D MINUSCHAR '1'; -STANDARD_2 : S T A N D A R D MINUSCHAR '2'; -START : S T A R T; -STATUS : S T A T U S; -STOP : S T O P; -STRING : S T R I N G; -SUBTRACT : S U B T R A C T; +SENTENCE : S E N T E N C E {cobolVerbTokens.add(SENTENCE);}; +SEPARATE : S E P A R A T E {cobolVerbTokens.add(SEPARATE);}; +SEQUENCE : S E Q U E N C E {cobolVerbTokens.add(SEQUENCE);}; +SEQUENTIAL : S E Q U E N T I A L {cobolVerbTokens.add(SEQUENTIAL);}; +SERVICE : S E R V I C E {cobolVerbTokens.add(SERVICE);}; +SET : S E T {cobolVerbTokens.add(SET);}; +SIGN : S I G N {cobolVerbTokens.add(SIGN);}; +SIZE : S I Z E {cobolVerbTokens.add(SIZE);}; +SORT : S O R T {cobolVerbTokens.add(SORT);}; +SORT_MERGE : S O R T MINUSCHAR M E R G E {cobolVerbTokens.add(SORT_MERGE);}; +SOURCE_COMPUTER : S O U R C E MINUSCHAR C O M P U T E R {cobolVerbTokens.add(SOURCE_COMPUTER);}; +SPACE : S P A C E {cobolVerbTokens.add(SPACE);}; +SPACES : S P A C E S {cobolVerbTokens.add(SPACES);}; +SPECIAL_NAMES : S P E C I A L MINUSCHAR N A M E S {cobolVerbTokens.add(SPECIAL_NAMES);}; +STANDARD : S T A N D A R D {cobolVerbTokens.add(STANDARD);}; +STANDARD_1 : S T A N D A R D MINUSCHAR '1' {cobolVerbTokens.add(STANDARD_1);}; +STANDARD_2 : S T A N D A R D MINUSCHAR '2' {cobolVerbTokens.add(STANDARD_2);}; +START : S T A R T {cobolVerbTokens.add(START);}; +STATUS : S T A T U S {cobolVerbTokens.add(STATUS);}; +STOP : S T O P {cobolVerbTokens.add(STOP);}; +STRING : S T R I N G {cobolVerbTokens.add(STRING);}; +SUBTRACT : S U B T R A C T {cobolVerbTokens.add(SUBTRACT);}; SUM : S U M; -SUPPRESS : S U P P R E S S; +SUPPRESS : S U P P R E S S {cobolVerbTokens.add(SUPPRESS);}; SYMBOL : S Y M B O L; -SYMBOLIC : S Y M B O L I C; -SYNC : S Y N C; -SYNCHRONIZED : S Y N C H R O N I Z E D; -TALLYING : T A L L Y I N G; -TAPE : T A P E; +SYMBOLIC : S Y M B O L I C {cobolVerbTokens.add(SYMBOLIC);}; +SYNC : S Y N C {cobolVerbTokens.add(SYNC);}; +SYNCHRONIZED : S Y N C H R O N I Z E D {cobolVerbTokens.add(SYNCHRONIZED);}; +SYSEIB : S Y S E I B; +TALLYING : T A L L Y I N G {cobolVerbTokens.add(TALLYING);}; +TAPE : T A P E {cobolVerbTokens.add(TAPE);}; TERMINAL : T E R M I N A L; TERMINATE : T E R M I N A T E; -TEST : T E S T; -THAN : T H A N; -THEN : T H E N; +TEST : T E S T {cobolVerbTokens.add(TEST);}; +THAN : T H A N {cobolVerbTokens.add(THAN);}; +THEN : T H E N {cobolVerbTokens.add(THEN);}; THREAD : T H R E A D; -THROUGH : T H R O U G H; -THRU : T H R U; -TIME : T I M E; +THROUGH : T H R O U G H {cobolVerbTokens.add(THROUGH);}; +THRU : T H R U {cobolVerbTokens.add(THRU);}; +TIME : T I M E {cobolVerbTokens.add(TIME);}; TIMER: T I M E R; -TIMES : T I M E S; -TO : T O; +TIMES : T I M E S {cobolVerbTokens.add(TIMES);}; +TO : T O {cobolVerbTokens.add(TO);}; TODAYS_DATE : T O D A Y S MINUSCHAR D A T E; TODAYS_NAME : T O D A Y S MINUSCHAR N A M E; -TOP : T O P; -TRACE : T R A C E; -TRAILING : T R A I L I N G; -TRUE : T R U E; +TOP : T O P {cobolVerbTokens.add(TOP);}; +TRACE : T R A C E {cobolVerbTokens.add(TRACE);}; +TRAILING : T R A I L I N G {cobolVerbTokens.add(TRAILING);}; +TRUE : T R U E {cobolVerbTokens.add(TRUE);}; +TYPE: T Y P E; UNBOUNDED: U N B O U N D E D; -UNIT : U N I T; -UNSTRING : U N S T R I N G; -UNTIL : U N T I L; -UP : U P; -UPON : U P O N; -USAGE : U S A G E; -USE : U S E; -USING : U S I N G; -UTF_8 : U T F MINUSCHAR '8'; +UNIT : U N I T {cobolVerbTokens.add(UNIT);}; +UNSTRING : U N S T R I N G {cobolVerbTokens.add(UNSTRING);}; +UNTIL : U N T I L {cobolVerbTokens.add(UNTIL);}; +UP : U P {cobolVerbTokens.add(UP);}; +UPON : U P O N {cobolVerbTokens.add(UPON);}; +USAGE : U S A G E {cobolVerbTokens.add(USAGE);}; +USE : U S E {cobolVerbTokens.add(USE);}; +USING : U S I N G {cobolVerbTokens.add(USING);}; +UTF_8 : U T F MINUSCHAR '8' {cobolVerbTokens.add(UTF_8);}; VALIDATING: V A L I D A T I N G; -VALUE : V A L U E; -VALUES : V A L U E S; -VARYING : V A R Y I N G; +VALUE : V A L U E {cobolVerbTokens.add(VALUE);}; +VALUES : V A L U E S {cobolVerbTokens.add(VALUES);}; +VARYING : V A R Y I N G {cobolVerbTokens.add(VARYING);}; VIRTUAL : V I R T U A L; -VOLATILE : V O L A T I L E; +VOLATILE : V O L A T I L E {cobolVerbTokens.add(VOLATILE);}; WAIT : W A I T; -WHEN : W H E N; -WHEN_COMPILED : W H E N MINUSCHAR C O M P I L E D; -WITH : W I T H; -WORDS : W O R D S; -WORKING_STORAGE : W O R K I N G MINUSCHAR S T O R A G E; -WRITE : W R I T E; -WRITE_ONLY : W R I T E MINUSCHAR O N L Y; -XML : X M L; +WHEN : W H E N {cobolVerbTokens.add(WHEN);}; +WHEN_COMPILED : W H E N MINUSCHAR C O M P I L E D {cobolVerbTokens.add(WHEN_COMPILED);}; +WITH : W I T H {cobolVerbTokens.add(WITH);}; +WORDS : W O R D S {cobolVerbTokens.add(WORDS);}; +WORKING_STORAGE : W O R K I N G MINUSCHAR S T O R A G E {cobolVerbTokens.add(WORKING_STORAGE);}; +WRITE : W R I T E {cobolVerbTokens.add(WRITE);}; +WRITE_ONLY : W R I T E MINUSCHAR O N L Y {cobolVerbTokens.add(WRITE_ONLY);}; +XML : X M L {cobolVerbTokens.add(XML);}; +XML_DECLARATION : XML MINUSCHAR D E C L A R A T I O N; YEAR : Y E A R; YYYYDDD : Y Y Y Y D D D; YYYYMMDD : Y Y Y Y M M D D; -ZERO : Z E R O; -ZEROES : Z E R O E S; -ZEROS : Z E R O S; +ZERO : Z E R O {cobolVerbTokens.add(ZERO);}; +ZEROES : Z E R O E S {cobolVerbTokens.add(ZEROES);}; +ZEROS : Z E R O S {cobolVerbTokens.add(ZEROS);}; INTEGERLITERAL_WITH_K: INTEGERLITERAL ('K' | 'k'); CURRENCY_SYMBOL : [\p{Sc}]; diff --git a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolParser.g4 b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolParser.g4 index 29a817baf2..ed27ea86e1 100644 --- a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolParser.g4 +++ b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolParser.g4 @@ -28,7 +28,7 @@ commaSeparator: COMMACHAR | COMMASEPARATOR; // --- identification division -------------------------------------------------------------------- identificationDivision - : (IDENTIFICATION | ID) DIVISION DOT_FS programIdParagraph identificationDivisionBody* + : (IDENTIFICATION | ID) DIVISION dot_fs programIdParagraph identificationDivisionBody* ; identificationDivisionBody @@ -86,7 +86,7 @@ optionalParagraphTermination // --- environment division -------------------------------------------------------------------- environmentDivision - : ENVIRONMENT DIVISION DOT_FS environmentDivisionBody* + : ENVIRONMENT DIVISION dot_fs environmentDivisionBody* ; environmentDivisionBody @@ -96,7 +96,7 @@ environmentDivisionBody // -- configuration section ---------------------------------- configurationSection - : CONFIGURATION SECTION DOT_FS configurationSectionParagraph* + : CONFIGURATION SECTION dot_fs configurationSectionParagraph* ; // - configuration section paragraph ---------------------------------- @@ -127,13 +127,13 @@ intrinsicClause // - source computer paragraph ---------------------------------- sourceComputerParagraph - : SOURCE_COMPUTER DOT_FS (computerName (WITH? DEBUGGING MODE)? DOT_FS)? + : SOURCE_COMPUTER dot_fs (computerName (WITH? DEBUGGING MODE)? dot_fs)? ; // - object computer paragraph ---------------------------------- objectComputerParagraph - : OBJECT_COMPUTER DOT_FS (computerName objectComputerClause* DOT_FS)? + : OBJECT_COMPUTER dot_fs (computerName objectComputerClause* dot_fs)? ; objectComputerClause @@ -165,13 +165,12 @@ segmentLimitClause ; characterSetClause - : CHARACTER SET DOT_FS - ; + : CHARACTER SET dot_fs ; // - special names paragraph ---------------------------------- specialNamesParagraph - : SPECIAL_NAMES DOT_FS (specialNameClause+ DOT_FS)? + : SPECIAL_NAMES dot_fs (specialNameClause+ dot_fs)? ; specialNameClause @@ -264,7 +263,7 @@ symbolicCharacters // -- input output section ---------------------------------- inputOutputSection - : INPUT_OUTPUT SECTION DOT_FS inputOutputSectionParagraph* + : INPUT_OUTPUT SECTION dot_fs inputOutputSectionParagraph* ; // - input output section paragraph ---------------------------------- @@ -276,12 +275,11 @@ inputOutputSectionParagraph // - file control paragraph ---------------------------------- fileControlParagraph - : FILE_CONTROL DOT_FS fileControlEntry* + : FILE_CONTROL dot_fs fileControlEntry* ; fileControlEntry - : selectClause fileControlClauses DOT_FS - ; + : selectClause fileControlClauses dot_fs ; fileControlClauses : fileControlClause* @@ -346,7 +344,7 @@ relativeKeyClause // - io control paragraph ---------------------------------- ioControlParagraph - : I_O_CONTROL DOT_FS (fileName DOT_FS)? (ioControlClause+ DOT_FS)? + : I_O_CONTROL dot_fs (fileName dot_fs)? (ioControlClause+ dot_fs)? ; ioControlClause @@ -396,7 +394,7 @@ endClause // --- data division -------------------------------------------------------------------- dataDivision - : DATA DIVISION DOT_FS dataDivisionSection* + : DATA DIVISION dot_fs dataDivisionSection* ; dataDivisionSection @@ -411,7 +409,7 @@ dialectSection // -- file section ---------------------------------- fileSection - : FILE SECTION DOT_FS fileDescriptionEntry* + : FILE SECTION dot_fs fileDescriptionEntry* ; fileDescriptionEntry @@ -419,8 +417,7 @@ fileDescriptionEntry ; fileDescriptionEntryClauses - : (FD | SD) cobolWord (DOT_FS? fileDescriptionEntryClause)* DOT_FS - ; + : (FD | SD) cobolWord fileDescriptionEntryClause* dot_fs ; fileDescriptionEntryClause : externalClause | globalClause | blockContainsClause | recordContainsClause | labelRecordsClause | valueOfClause | dataRecordsClause | linageClause | codeSetClause | reportClause | recordingModeClause @@ -517,18 +514,18 @@ reportClause // -- working storage section ---------------------------------- workingStorageSection - : WORKING_STORAGE SECTION DOT_FS dataDescriptionEntryForWorkingStorageSection* + : WORKING_STORAGE SECTION dot_fs dataDescriptionEntryForWorkingStorageSection* ; // -- linkage section ---------------------------------- linkageSection - : LINKAGE SECTION DOT_FS dataDescriptionEntryForWorkingStorageAndLinkageSection* + : LINKAGE SECTION dot_fs dataDescriptionEntryForWorkingStorageAndLinkageSection* ; // -- local storage section ---------------------------------- localStorageSection - : LOCAL_STORAGE SECTION DOT_FS dataDescriptionEntryForLocalStorageSection* + : LOCAL_STORAGE SECTION dot_fs dataDescriptionEntryForLocalStorageSection* ; dataDescriptionEntryForLocalStorageSection @@ -556,8 +553,7 @@ dataDescriptionEntryFormat1 | dataGlobalClause | dataPictureClause | dataUsageClause | dataValueClause | dataOccursClause | dataSignClause | dataSynchronizedClause | dataJustifiedClause | dataBlankWhenZeroClause | dataDynamicLengthClause | dataVolatileClause)* - DOT_FS - ; + dot_fs ; levelNumber : LEVEL_NUMBER @@ -565,21 +561,18 @@ levelNumber dataDescriptionEntryFormat2 - : LEVEL_NUMBER_66 entryName? dataRenamesClause DOT_FS - ; + : LEVEL_NUMBER_66 entryName? dataRenamesClause dot_fs ; dataDescriptionEntryFormat1Level77 : LEVEL_NUMBER_77 entryName? (dataGroupUsageClause | dataRedefinesClause | dataExternalClause | dataGlobalClause | dataPictureClause | dataUsageClause | dataValueClause | dataOccursClause | dataSignClause | dataSynchronizedClause | dataJustifiedClause | dataBlankWhenZeroClause | dataDynamicLengthClause | dataVolatileClause)* - DOT_FS - ; + dot_fs ; dataDescriptionEntryFormat3 - : LEVEL_NUMBER_88 entryName? dataValueClause DOT_FS - ; + : LEVEL_NUMBER_88 entryName? dataValueClause dot_fs ; dialectDescriptionEntry : dialectNodeFiller @@ -731,7 +724,7 @@ thruToken // --- procedure division -------------------------------------------------------------------- procedureDivision - : PROCEDURE DIVISION procedureDivisionUsingClause? procedureDivisionGivingClause? DOT_FS procedureDeclaratives? procedureDivisionBody + : PROCEDURE DIVISION procedureDivisionUsingClause? procedureDivisionGivingClause? dot_fs procedureDeclaratives? procedureDivisionBody ; procedureDivisionUsingClause @@ -747,11 +740,10 @@ procedureDivisionUsingParameter ; procedureDeclaratives - : DECLARATIVES DOT_FS procedureDeclarative+ END DECLARATIVES DOT_FS - ; + : DECLARATIVES dot_fs procedureDeclarative+ END DECLARATIVES dot_fs ; procedureDeclarative - : procedureSectionHeader DOT_FS (useStatement DOT_FS) paragraphs + : procedureSectionHeader dot_fs (useStatement dot_fs) paragraphs ; procedureSectionHeader @@ -765,19 +757,20 @@ procedureDivisionBody // -- procedure section ---------------------------------- procedureSection - : procedureSectionHeader DOT_FS paragraphs + : procedureSectionHeader dot_fs paragraphs ; -paragraphs - : sentence* paragraph* +sentence + : statement * (endClause | dialectStatement) + | dialectStatement ; paragraph - : paragraphDefinitionName DOT_FS (alteredGoTo | sentence*) + : paragraphDefinitionName dot_fs (alteredGoTo | sentence*) ; -sentence - : statement * (endClause | dialectStatement) +paragraphs + : (sentence | paragraph)* ; conditionalStatementCall @@ -791,8 +784,35 @@ statement initiateStatement | inspectStatement | mergeStatement | moveStatement | multiplyStatement | openStatement | performStatement | purgeStatement | readStatement | readyResetTraceStatement | receiveStatement | releaseStatement | returnStatement | rewriteStatement | searchStatement | sendStatement | serviceReloadStatement | serviceLabelStatement | setStatement | sortStatement | startStatement | stopStatement | stringStatement | subtractStatement | - terminateStatement | unstringStatement | writeStatement | xmlParseStatement | jsonStatement - ; + terminateStatement | unstringStatement | writeStatement | xmlParseStatement | jsonStatement | xmlGenerate + ; + +xmlGenerate + : XML GENERATE xmlGenIdentifier1 FROM xmlGenIdentifier2 + (COUNT IN? xmlGenIdentifier3)? + (WITH? ENCODING integerLiteral)? (WITH? XML_DECLARATION)? (WITH? ATTRIBUTES)? + (NAMESPACE IS? (xmlGenIdentifier4 | literal))? (NAMESPACE_PREFIX IS? (xmlGenIdentifier5 | literal))? + (NAME OF? (xmlGenIdentifier6 IS? literal)+)? + (TYPE OF? (xmlGenIdentifier7 IS? (ATTRIBUTE | ELEMENT | CONTENT))+)? + (SUPPRESS ((xmlGenIdentifier8 when_phrase?) | generic_suppression_phrase)+)? + onExceptionClause? notOnExceptionClause? END_XML? + ; + +xmlGenIdentifier1: qualifiedDataName; + +xmlGenIdentifier2: qualifiedDataName; + +xmlGenIdentifier3: qualifiedDataName; + +xmlGenIdentifier4: qualifiedDataName; + +xmlGenIdentifier5: qualifiedDataName; + +xmlGenIdentifier6: qualifiedDataName; + +xmlGenIdentifier7: qualifiedDataName; + +xmlGenIdentifier8: qualifiedDataName; jsonStatement : jsonParse | jsonGenerate @@ -845,7 +865,9 @@ jsonGenIdentifier6: qualifiedDataName; when_phrase: WHEN json_phrases (OR? (json_phrases))*; -generic_suppression_phrase: (EVERY (NUMERIC | NONNUMERIC))? when_phrase; +generic_suppression_phrase: (EVERY ((NUMERIC generic_suppression_arguments?) | (NONNUMERIC generic_suppression_arguments?) | generic_suppression_arguments))? when_phrase; + +generic_suppression_arguments : ATTRIBUTE | CONTENT | ELEMENT; json_phrases: ZERO | ZEROES | ZEROS | SPACE | SPACES | LOW_VALUE | LOW_VALUES | HIGH_VALUE | HIGH_VALUES; @@ -2186,7 +2208,7 @@ literal : NONNUMERICLITERAL | figurativeConstant | numericLiteral | booleanLiteral | charString | dialectLiteral | utfLiteral | hexadecimalUtfLiteral ; -dialectLiteral: dialectNodeFiller+; +dialectLiteral: dialectNodeFiller+ DOT_FS?; utfLiteral: U_CHAR NONNUMERICLITERAL; @@ -2223,23 +2245,27 @@ power ; basis - : dialectNodeFiller | generalIdentifier | literal | LPARENCHAR arithmeticExpression RPARENCHAR + : (dialectNodeFiller DOT_FS?) | generalIdentifier | literal | LPARENCHAR arithmeticExpression RPARENCHAR ; cobolWord - : IDENTIFIER | SYMBOL | INTEGER | CHANNEL | PROCESS | REMOVE | WAIT | ANY | LIST | NAME | THREAD | U_CHAR - | cobolKeywords + : IDENTIFIER | SYMBOL | INTEGER | ELEMENT | CHANNEL | PROCESS | REMOVE | WAIT | NAMESPACE_PREFIX | NAMESPACE + | ATTRIBUTES | ATTRIBUTE | ANY | LIST | NAME | THREAD | U_CHAR | TYPE + | allowedCobolKeywords ; -cobolKeywords - : ADDRESS | BOTTOM | COUNT | CR | FIELD | FIRST | MMDDYYYY | PRINTER | DAY | TIME | DATE | DAY_OF_WEEK - | REMARKS | RESUME | TIMER | TODAYS_DATE | TODAYS_NAME | TOP | YEAR | YYYYDDD | YYYYMMDD | WHEN_COMPILED +allowedCobolKeywords + : CR | FIELD | MMDDYYYY | PRINTER | DAY_OF_WEEK + | REMARKS | RESUME | TIMER | TODAYS_DATE | TODAYS_NAME | YEAR | YYYYDDD | YYYYMMDD | WHEN_COMPILED | DISK | KEYBOARD | PORT | READER | REMOTE | VIRTUAL | LIBRARY | DEFINITION | PARSE | BOOL | ESCAPE | INITIALIZED - | LOC | BYTITLE | BYFUNCTION | ABORT | ORDERLY | ASSOCIATED_DATA | ASSOCIATED_DATA_LENGTH | CLOSE | CURRENCY - | DATA | DBCS | EXIT | EXTEND | INITIAL | NATIONAL | OBJECT | OFF | QUOTE | SEPARATE | SEQUENCE - | SERVICE | STANDARD | SUPPRESS | TERMINAL | TEST | VOLATILE + | LOC | BYTITLE | BYFUNCTION | ABORT | ORDERLY | ASSOCIATED_DATA | ASSOCIATED_DATA_LENGTH + | VOLATILE ; dialectNodeFiller - : ZERO_WIDTH_SPACE+ + : ZERO_WIDTH_SPACE+ DOT_FS? EOF? ; + +dot_fs + : DOT_FS | {notifyError("missing.period", _input.LT(1).getText());} + ; \ No newline at end of file diff --git a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolProcedureDivisionLexer.g4 b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolProcedureDivisionLexer.g4 index 2d5dd92a4d..976f5c8b9d 100644 --- a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolProcedureDivisionLexer.g4 +++ b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolProcedureDivisionLexer.g4 @@ -393,6 +393,7 @@ WS : [ \t\f]+ -> channel(HIDDEN); COMPILERLINE : DOUBLEMORETHANCHAR ~('\n' | '\r')* -> channel(HIDDEN); // period full stopPosition DOT_FS : '.' EOF?; +DOT : '.'; LEVEL_NUMBER : ([1-9])|([0][1-9])|([1234][0-9]); LEVEL_NUMBER_66 : '66'; diff --git a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolProcedureDivisionParser.g4 b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolProcedureDivisionParser.g4 index 6a2864ed58..13ac9251b9 100644 --- a/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolProcedureDivisionParser.g4 +++ b/server/parser/src/main/antlr4/org/eclipse/lsp/cobol/core/parser/CobolProcedureDivisionParser.g4 @@ -43,10 +43,6 @@ procedureDivisionBody commaSeparator: COMMACHAR | COMMASEPARATOR; -endClause - : DOT_FS - ; - // -- procedure section ---------------------------------- procedureSection @@ -62,7 +58,8 @@ paragraph ; sentence - : statement * (endClause | dialectStatement) + : statement + (EOF | DOT_FS | dialectStatement) + | dialectStatement ; conditionalStatementCall @@ -1499,5 +1496,5 @@ cobolKeywords ; dialectNodeFiller - : ZERO_WIDTH_SPACE+ + : ZERO_WIDTH_SPACE+ DOT? EOF? ; diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/CobolCodeGenerator.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/CobolCodeGenerator.java similarity index 93% rename from server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/CobolCodeGenerator.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/CobolCodeGenerator.java index 38d568b26a..05e3a5622e 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/CobolCodeGenerator.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/CobolCodeGenerator.java @@ -14,11 +14,11 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.test.codegen; +package org.eclipse.lsp.cobol.codegen; -import org.eclipse.lsp.cobol.test.codegen.snippets.ParagraphGenerator; -import org.eclipse.lsp.cobol.test.codegen.snippets.SectionGenerator; -import org.eclipse.lsp.cobol.test.codegen.snippets.SnippetGenerator; +import org.eclipse.lsp.cobol.codegen.snippets.ParagraphGenerator; +import org.eclipse.lsp.cobol.codegen.snippets.SectionGenerator; +import org.eclipse.lsp.cobol.codegen.snippets.SnippetGenerator; import java.util.Random; diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/GeneratorContext.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/GeneratorContext.java similarity index 95% rename from server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/GeneratorContext.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/GeneratorContext.java index a8d707b680..ff123fc4fa 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/GeneratorContext.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/GeneratorContext.java @@ -14,7 +14,7 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.test.codegen; +package org.eclipse.lsp.cobol.codegen; import java.util.HashMap; import java.util.Map; diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/GeneratorSettings.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/GeneratorSettings.java similarity index 96% rename from server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/GeneratorSettings.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/GeneratorSettings.java index 6393df700d..615d69e504 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/GeneratorSettings.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/GeneratorSettings.java @@ -14,9 +14,9 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.test.codegen; +package org.eclipse.lsp.cobol.codegen; -import org.eclipse.lsp.cobol.test.codegen.snippets.*; +import org.eclipse.lsp.cobol.codegen.snippets.*; import java.util.ArrayList; import java.util.HashMap; diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/IdentifierType.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/IdentifierType.java similarity index 93% rename from server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/IdentifierType.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/IdentifierType.java index 2e348c08f9..85f98b4853 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/IdentifierType.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/IdentifierType.java @@ -14,7 +14,7 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.test.codegen; +package org.eclipse.lsp.cobol.codegen; /** * Types of id that was used in the program. diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/DisplayStatementGenerator.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/DisplayStatementGenerator.java similarity index 82% rename from server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/DisplayStatementGenerator.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/DisplayStatementGenerator.java index aedbe0bda4..23385cf328 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/DisplayStatementGenerator.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/DisplayStatementGenerator.java @@ -14,10 +14,10 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.test.codegen.snippets; +package org.eclipse.lsp.cobol.codegen.snippets; -import org.eclipse.lsp.cobol.test.codegen.CobolCodeGenerator; -import org.eclipse.lsp.cobol.test.codegen.GeneratorContext; +import org.eclipse.lsp.cobol.codegen.GeneratorContext; +import org.eclipse.lsp.cobol.codegen.CobolCodeGenerator; /** * Display statement generator diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/OpenStatementGenerator.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/OpenStatementGenerator.java similarity index 83% rename from server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/OpenStatementGenerator.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/OpenStatementGenerator.java index b0cd4c2553..d1b1bdd51c 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/OpenStatementGenerator.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/OpenStatementGenerator.java @@ -14,10 +14,10 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.test.codegen.snippets; +package org.eclipse.lsp.cobol.codegen.snippets; -import org.eclipse.lsp.cobol.test.codegen.CobolCodeGenerator; -import org.eclipse.lsp.cobol.test.codegen.GeneratorContext; +import org.eclipse.lsp.cobol.codegen.GeneratorContext; +import org.eclipse.lsp.cobol.codegen.CobolCodeGenerator; /** * Open statement generator. diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/ParagraphGenerator.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/ParagraphGenerator.java similarity index 82% rename from server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/ParagraphGenerator.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/ParagraphGenerator.java index e82927d7fd..632e945492 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/ParagraphGenerator.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/ParagraphGenerator.java @@ -14,10 +14,10 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.test.codegen.snippets; +package org.eclipse.lsp.cobol.codegen.snippets; -import org.eclipse.lsp.cobol.test.codegen.GeneratorContext; -import org.eclipse.lsp.cobol.test.codegen.IdentifierType; +import org.eclipse.lsp.cobol.codegen.GeneratorContext; +import org.eclipse.lsp.cobol.codegen.IdentifierType; /** * Generates a PARAGRAPH diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/SectionGenerator.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/SectionGenerator.java similarity index 79% rename from server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/SectionGenerator.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/SectionGenerator.java index d200498853..bf99630ced 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/SectionGenerator.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/SectionGenerator.java @@ -14,11 +14,11 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.test.codegen.snippets; +package org.eclipse.lsp.cobol.codegen.snippets; -import org.eclipse.lsp.cobol.test.codegen.CobolCodeGenerator; -import org.eclipse.lsp.cobol.test.codegen.GeneratorContext; -import org.eclipse.lsp.cobol.test.codegen.IdentifierType; +import org.eclipse.lsp.cobol.codegen.GeneratorContext; +import org.eclipse.lsp.cobol.codegen.IdentifierType; +import org.eclipse.lsp.cobol.codegen.CobolCodeGenerator; /** * Generates a SECTION diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/SnippetGenerator.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/SnippetGenerator.java similarity index 87% rename from server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/SnippetGenerator.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/SnippetGenerator.java index 2d8a1cb3bd..7d30fac130 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/codegen/snippets/SnippetGenerator.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/codegen/snippets/SnippetGenerator.java @@ -14,9 +14,9 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.test.codegen.snippets; +package org.eclipse.lsp.cobol.codegen.snippets; -import org.eclipse.lsp.cobol.test.codegen.GeneratorContext; +import org.eclipse.lsp.cobol.codegen.GeneratorContext; /** * Interface for statements and other generators. diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/MessageServiceParser.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/core/MessageServiceParser.java index 78ab71f8ab..964a9d03a2 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/MessageServiceParser.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/core/MessageServiceParser.java @@ -22,6 +22,7 @@ import org.antlr.v4.runtime.Parser; import org.antlr.v4.runtime.TokenStream; import org.eclipse.lsp.cobol.common.message.MessageServiceProvider; +import org.eclipse.lsp.cobol.parser.WarningRecognitionException; /** * Provide the support of message externalization for Parser. diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/ParserUtils.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/core/ParserUtils.java deleted file mode 100644 index 5a67930441..0000000000 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/ParserUtils.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2024 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * DAF Trucks NV – implementation of DaCo COBOL statements - * and DAF development standards - * - */ -package org.eclipse.lsp.cobol.core; - -/** - * Parser related utils. - */ -public final class ParserUtils { - private ParserUtils() { - // no-op - } - private static final String HW_PARSER = "hw.parser"; - - public static boolean isHwParserEnabled() { - return System.getenv(HW_PARSER) != null || System.getProperty(HW_PARSER) != null; - } -} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/CobolLexer.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/CobolLexer.java deleted file mode 100644 index 1467f709da..0000000000 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/CobolLexer.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2024 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * DAF Trucks NV – implementation of DaCo COBOL statements - * and DAF development standards - * - */ -package org.eclipse.lsp.cobol.core.hw; - -import lombok.Data; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.function.Predicate; - -/** - * COBOL language lexer. - */ -public class CobolLexer { - private final String source; - private Position position = new Position(); - private Position lastTokenStartPosition = new Position(); - - public CobolLexer(String source) { - this.source = source; - } - - /** - * Check if we have more tokens. - * @return true if there are more tokens. - */ - public boolean hasMore() { - return position.getIndex() < source.length(); - } - - /** - * Return one token and move forward. - * @param rule current syntax rule. - * @return list of possible tokens (at least one). - */ - public List forward(GrammarRule rule) { - if (position.getIndex() == source.length()) { - return Collections.singletonList(new Token("", position.getLine(), position.getCharacter(), position.getIndex(), TokenType.EOF)); - } - String lexeme = scan(rule, false); - Token token = new Token(lexeme, lastTokenStartPosition.getLine(), lastTokenStartPosition.getCharacter(), position.getIndex(), detectType(rule, lexeme)); - return Collections.singletonList(token); - } - - /** - * Return one token but don't move forward. - * @param rule current syntax rule. - * @return list of possible tokens (at least one). - */ - public List peek(GrammarRule rule) { - if (position.getIndex() == source.length()) { - return Collections.singletonList(new Token("", position.getLine(), position.getCharacter(), position.getIndex(), TokenType.EOF)); - } - String lexeme = scan(rule, true); - Token token = new Token(lexeme, lastTokenStartPosition.getLine(), lastTokenStartPosition.getCharacter(), position.getIndex(), detectType(rule, lexeme)); - return Collections.singletonList(token); - } - - private TokenType detectType(GrammarRule rule, String lexeme) { - if (lexeme.trim().isEmpty()) { - return TokenType.WHITESPACE; - } - return null; - } - - private String scan(GrammarRule rule, boolean look) { - if (isWhitespace(source.charAt(position.getIndex()))) { - return consumeUntil(c -> !isWhitespace(c), look); - } - if (isNewLine(source.charAt(position.getIndex()))) { - return consumeUntil(c -> !isNewLine(c), look); - } - if (isSeparator(source.charAt(position.getIndex()))) { - return consumeUntil(c -> !isSeparator(c), look); - } - return consumeUntil(c -> isSeparator(c) || isWhitespace(c) || isNewLine(c), look); - } - - private String consumeUntil(Predicate predicate, boolean look) { - StringBuilder sb = new StringBuilder(); - Position localPos = new Position(position); - while (localPos.getIndex() < source.length()) { - char charAt = source.charAt(localPos.getIndex()); - if (predicate.test(charAt)) { - break; - } - sb.append(charAt); - localPos.updateLinePosition(charAt); - } - if (!look) { - lastTokenStartPosition = position; - position = localPos; - } - return sb.toString(); - } - - private boolean isSeparator(char c) { - return c == '.'; - } - - private boolean isWhitespace(char c) { - return c == ' ' || c == '\t'; - } - - private boolean isNewLine(char c) { - return c == '\n' || c == '\r'; - } - - /** - * Find a sequence of tokens ignoring one that passes skip predicate. - * @param rule current syntax rule. - * @param count how many tokens to take. - * @param skip predicate to ignore tokens. - * @return a list of tokens. - */ - // TODO: it should return a list of lists - public List peekSeq(GrammarRule rule, int count, Predicate skip) { - List result = new ArrayList<>(); - Position localPos = new Position(position); - while (result.size() < count && position.getIndex() < source.length()) { - Token token = forward(rule).get(0); - if (!skip.test(token)) { - result.add(token); - } - } - position = localPos; - - return result; - } -} - -/** - * A class to hold position data - */ -@Data -class Position { - int index = 0; - int line = 0; - int character = 0; - - Position(Position position) { - index = position.index; - line = position.line; - character = position.character; - } - Position() { - } - void updateLinePosition(char charAt) { - index++; - if (charAt == '\n') { - line++; - character = 0; - } else if (charAt != '\r') { - character++; - } - } -} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/CobolParser.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/CobolParser.java deleted file mode 100644 index de71017c8a..0000000000 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/CobolParser.java +++ /dev/null @@ -1,463 +0,0 @@ -/* - * Copyright (c) 2024 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * DAF Trucks NV – implementation of DaCo COBOL statements - * and DAF development standards - * - */ -package org.eclipse.lsp.cobol.core.hw; - -import java.util.*; - -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.text.similarity.JaroWinklerSimilarity; -import org.eclipse.lsp.cobol.core.cst.*; -import org.eclipse.lsp.cobol.core.cst.IdentificationDivision; -import org.eclipse.lsp.cobol.core.cst.base.CstNode; -import org.eclipse.lsp.cobol.core.cst.procedure.Paragraph; -import org.eclipse.lsp.cobol.core.cst.procedure.ProcedureDivision; -import org.eclipse.lsp.cobol.core.cst.procedure.Section; -import org.eclipse.lsp.cobol.core.cst.procedure.Statement; -import org.eclipse.lsp4j.Position; -import org.eclipse.lsp4j.Range; - -/** - * Cobol parser - */ -@Slf4j -public class CobolParser { - private final ParsingContext ctx; - private final ParserSettings settings; - private final List diagnostics = new ArrayList<>(); - private final JaroWinklerSimilarity sim = new JaroWinklerSimilarity(); - private static final int SIZE_THRESHOLD = 4; - - public CobolParser(CobolLexer lexer, ParserSettings settings) { - this.settings = settings; - ctx = new ParsingContext(lexer); - } - - /** - * Create the CST - * - * @return Concrete Syntax Tree - */ - public ParseResult parse() { - try { - parseSourceUnit(); - } catch (ParseError error) { - // TODO: unhandled error - log.error(error.getMessage(), error); - } - return new ParseResult((SourceUnit) ctx.pop(), diagnostics); - } - - private void parseSourceUnit() { - ctx.push(new SourceUnit()); - while (ctx.getLexer().hasMore()) { - try { - spaces(); - if (matchSeq("IDENTIFICATION", "DIVISION") || matchSeq("ID", "DIVISION")) { - parseProgram(); - } else { - Token token = ctx.getLexer().forward(GrammarRule.SourceUnit).get(0); - skip(token); - error(token, "Unknown input: '" + token.getLexeme() + "'"); - } - spaces(); - } catch (ParseError error) { - synchronize(); - } - } - } - - private void skip(Token token) { - if (ctx.peek().getChildren().isEmpty()) { - Skipped s = new Skipped(); - s.getChildren().add(token); - ctx.peek().getChildren().add(s); - return; - } - - CstNode lastChild = ctx.peek().getChildren().get(ctx.peek().getChildren().size() - 1); - if (lastChild instanceof Skipped) { - lastChild.getChildren().add(token); - } else { - Skipped s = new Skipped(); - s.getChildren().add(token); - ctx.peek().getChildren().add(s); - } - } - - private void synchronize() { - CobolLexer lexer = ctx.getLexer(); - GrammarRule rule = ctx.peek().getRule(); - Token t = lexer.forward(rule).get(0); - while (!isEOF(t) && !isContinuationSymbol(t)) { - skip(t); - t = lexer.forward(rule).get(0); - } - if (!isEOF(t)) { - skip(t); - } - } - - private boolean isContinuationSymbol(Token t) { - return Objects.equals(t.getLexeme(), "."); - } - - private static boolean isEOF(Token t) { - return t.getType() == TokenType.EOF; - } - - private boolean match(String... lexemes) { - Token token = ctx.getLexer().peek(ctx.peek().getRule()).get(0); - for (String l : lexemes) { - if (sameLexeme(token, l, 1.0)) { - return true; - } - } - return false; - } - - - private void parseProgram() { - try { - ProgramUnit programUnit = new ProgramUnit(); - ctx.push(programUnit); - try { - ctx.push(new IdentificationDivision()); - or("ID", "IDENTIFICATION"); - spaces(); - consume("DIVISION"); - consume("."); - spaces(); - consume("PROGRAM-ID"); - optional("."); - spaces(); - - List programName = ctx.getLexer().peek(GrammarRule.ProgramUnit); - programUnit.setName(programName.get(0).getLexeme()); - consume(); - spaces(); - if (match("IS")) { - consume("IS"); - spaces(); - or("RECURSIVE", "INITIAL", "COMMON"); - spaces(); - optional("INITIAL"); - optional("COMMON"); - optional("PROGRAM"); - } else if (match("RECURSIVE", "INITIAL")) { - spaces(); - optional("PROGRAM"); - } - spaces(); - optional("."); - identificationDivisionContent(); - } finally { - ctx.popAndAttach(); - } - - if (matchSeq("ENVIRONMENT", "DIVISION", ".")) { - environmentDivisionContent(); - } - - if (matchSeq("DATA", "DIVISION", ".")) { - dataDivisionContent(); - } - - if (matchSeq("PROCEDURE", "DIVISION")) { - procedureDivisionContent(); - } - - if (matchSeq("ID", "DIVISION", ".") - || matchSeq("IDENTIFICATION", "DIVISION", ".")) { - spaces(); - parseProgram(); - } - - if (matchSeq("END", "PROGRAM")) { - spaces(); - consume("END"); - spaces(); - consume("PROGRAM"); - spaces(); - consume(); // programId - consume("."); - spaces(); - } - } finally { - ctx.popAndAttach(); - } - } - - private void procedureDivisionContent() { - spaces(); - ctx.push(new ProcedureDivision()); - consume("PROCEDURE"); - spaces(); - consume("DIVISION"); - optional("."); - spaces(); - try { - while (!isNextDivisionEofOrEop()) { - if (isParagraph()) { - paragraph(); - } else if (isSection()) { - section(); - } else { - statement(); - } - spaces(); - } - } finally { - ctx.popAndAttach(); - } - } - - private void section() { - spaces(); - ctx.push(new Section()); - consume(); - spaces(); - consume("SECTION"); - spaces(); - consume("."); - spaces(); - try { - while (!isNextDivisionEofOrEop() && !isParagraph() && !isSection()) { - statement(); - spaces(); - } - } finally { - ctx.popAndAttach(); - } - } - - private boolean isSection() { - return matchSeq(null, "SECTION", "."); - } - - private void paragraph() { - spaces(); - ctx.push(new Paragraph()); - consume(); - spaces(); - consume("."); - spaces(); - try { - while (!isNextDivisionEofOrEop() && !isParagraph() && !isSection()) { - statement(); - spaces(); - } - } finally { - ctx.popAndAttach(); - } - } - - private void statement() { - ctx.push(new Statement()); - try { - while (!match(".") && ctx.getLexer().hasMore()) { - consume(); - } - optional("."); - } finally { - ctx.popAndAttach(); - } - } - - private boolean isParagraph() { - return matchSeq(null, "."); - } - - private void dataDivisionContent() { - spaces(); - ctx.push(new DataDivision()); - consume("DATA"); - spaces(); - consume("DIVISION"); - consume("."); - spaces(); - try { - while (!isNextDivisionEofOrEop()) { - consume(); - } - } finally { - ctx.popAndAttach(); - } - } - - private void environmentDivisionContent() { - spaces(); - ctx.push(new EnvironmentDivision()); - consume("ENVIRONMENT"); - spaces(); - consume("DIVISION"); - consume("."); - spaces(); - try { - while (!isNextDivisionEofOrEop()) { - consume(); - } - } finally { - ctx.popAndAttach(); - } - } - - private void identificationDivisionContent() { - while (!isNextDivisionEofOrEop()) { - consume(); - } - } - - private boolean isNextDivisionEofOrEop() { - return matchSeq("ENVIRONMENT", "DIVISION", ".") - || matchSeq("IDENTIFICATION", "DIVISION", ".") - || matchSeq("ID", "DIVISION", ".") - || matchSeq("DATA", "DIVISION", ".") - || matchSeq("PROCEDURE", "DIVISION") - || matchSeq("END", "PROGRAM") - || isEOF(ctx.getLexer().peek(ctx.peek().getRule()).get(0)); - } - - private boolean matchSeq(String... lexemes) { - List tokens = ctx.getLexer() - .peekSeq(ctx.peek().getRule(), lexemes.length, t -> t.getType() == TokenType.WHITESPACE); - if (tokens.size() != lexemes.length) { - return false; - } - if (settings.getFuzzyMatchThreshold() < 1) { - double d = calcDistance(tokens, lexemes); - return d > settings.getFuzzyMatchThreshold(); - } else { - for (int i = 0; i < tokens.size(); i++) { - if (!sameLexeme(tokens.get(i), lexemes[i], 1.0)) { - return false; - } - } - return true; - } - } - - private double calcDistance(List tokens, String[] lexemes) { - Double d = 0.0; - for (int i = 0; i < tokens.size(); i++) { - Token lexemeToken = tokens.get(i); - d += sim.apply(lexemeToken.getLexeme().toUpperCase(), lexemes[i].toUpperCase()); - } - return d / tokens.size(); - } - - private void optional(String lexeme) { - GrammarRule rule = ctx.peek().getRule(); - if (match(lexeme)) { - List forward = ctx.getLexer().forward(rule); - ctx.peek().getChildren().add(forward.get(0)); - } - } - - private void consume(String expectedLexeme) { - GrammarRule rule = ctx.peek().getRule(); - Token token = ctx.getLexer().peek(rule).get(0); - if (!sameLexeme(token, expectedLexeme, 1.0)) { - error(token, "Unexpected token: '" + token.getLexeme() + "'. Expect: '" + expectedLexeme + "'"); - } - List forward = ctx.getLexer().forward(rule); - ctx.peek().getChildren().add(forward.get(0)); - } - - private void consume() { - List forward = ctx.getLexer().forward(ctx.peek().getRule()); - ctx.peek().getChildren().add(forward.get(0)); - skipSkipToken(); - } - - private void or(String... expectedTokens) { - List next = ctx.getLexer().peek(ctx.peek().getRule()); - if (next.isEmpty()) { - return; - } - for (String content : expectedTokens) { - if (sameLexeme(next.get(0), content, null)) { - List id = ctx.getLexer().forward(ctx.peek().getRule()); - ctx.peek().getChildren().add(id.get(0)); - return; - } - } - error(next.get(0), "Unexpected token: '" + next.get(0).getLexeme() + "'. Expected: " + String.join(",", expectedTokens)); - } - - boolean sameLexeme(Token lexemeToken, String expectedLexeme, Double threshold) { - threshold = threshold == null ? settings.getFuzzyMatchThreshold() : threshold; - // TODO: better matchers, for now it's ANY token when it's null - if (expectedLexeme == null) { - return true; - } - if (lexemeToken.getLexeme() == null || expectedLexeme == null) { - return false; - } - /* - * It's not clear what heuristic to use here, but for short lexemes SIMILARITY_THRESHOLD gives false errors. - */ - if (threshold == 1.0 || expectedLexeme.length() < SIZE_THRESHOLD) { - return Objects.equals(lexemeToken.getLexeme().toUpperCase(), expectedLexeme.toUpperCase()); - } - Double apply = sim.apply(lexemeToken.getLexeme().toUpperCase(), expectedLexeme.toUpperCase()); - if (apply == 1) { - return true; - } - if (apply > threshold) { - diagnostics.add(getSimilarKeywordPassedSyntaxError(lexemeToken, expectedLexeme)); - return true; - } - return false; - } - - private Diagnostic getSimilarKeywordPassedSyntaxError(Token lexemeToken, String expectedLexeme) { - return new Diagnostic(getTokenRange(lexemeToken), - String.format("provided %s but expected %s", lexemeToken.getLexeme(), expectedLexeme)); - } - - private void skipSkipToken() { - if (match("SKIP1") - || match("SKIP2") - || match("SKIP3")) { - consume(); - if (match(".")) { - consume(); - } - } - } - - private void spaces() { - Token token = ctx.getLexer().peek(ctx.peek().getRule()).get(0); - while (token.getType() != TokenType.EOF - && (token.getType() == TokenType.WHITESPACE || token.getType() == TokenType.NEW_LINE)) { - ctx.peek().getChildren().add(ctx.getLexer().forward(ctx.peek().getRule()).get(0)); - skipSkipToken(); - token = ctx.getLexer().peek(ctx.peek().getRule()).get(0); - } - } - - private void error(Token token, String message) { - Diagnostic syntaxError = new Diagnostic(getTokenRange(token), message); - diagnostics.add(syntaxError); - throw new ParseError(message); - } - - private static Range getTokenRange(Token token) { - return new Range(new Position(token.getLine(), token.getStartPositionInLine()), new Position(token.getLine(), - token.getStartPositionInLine() + token.getLexeme().length())); - } -} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParsingContext.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParsingContext.java deleted file mode 100644 index 553f7a3c82..0000000000 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParsingContext.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2024 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * DAF Trucks NV – implementation of DaCo COBOL statements - * and DAF development standards - * - */ -package org.eclipse.lsp.cobol.core.hw; - -import lombok.Getter; -import org.eclipse.lsp.cobol.core.cst.base.CstNode; - -import java.util.LinkedList; - -/** - * Parsing context - */ -public class ParsingContext { - @Getter - private final CobolLexer lexer; - private final LinkedList nodeStack = new LinkedList<>(); - - public ParsingContext(CobolLexer lexer) { - this.lexer = lexer; - } - - /** - * Put on stack current node - * @param node a node to stack - */ - public void push(CstNode node) { - nodeStack.push(node); - } - - /** - * Remove a node from the tome of the stack - * @return the node - */ - public CstNode pop() { - return nodeStack.pop(); - } - - /** - * Remove a node from the tome of the stack and make it a child of the new stack top - * @return the node - */ - public CstNode popAndAttach() { - CstNode node = pop(); - peek().getChildren().add(node); - return node; - } - - /** - * Take a look at the top of the stack - * @return the nedo on the top - */ - public CstNode peek() { - return nodeStack.peek(); - } -} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/Token.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/Token.java deleted file mode 100644 index 85ddb61f15..0000000000 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/Token.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2024 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * DAF Trucks NV – implementation of DaCo COBOL statements - * and DAF development standards - * - */ -package org.eclipse.lsp.cobol.core.hw; - -import lombok.Getter; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; - -/** - * Token node. - */ -@Getter -public class Token extends CstNodeImpl { - private final int line; - private final int startPositionInLine; - private final int index; - private final String lexeme; - private final TokenType type; - - public Token(String lexeme, int line, int startPositionInLine, int index, TokenType type) { - this.line = line; - this.lexeme = lexeme; - this.startPositionInLine = startPositionInLine; - this.index = index; - this.type = type; - } - - /** - * Get the size of lexeme - * @return size of lexeme - */ - public int length() { - return lexeme.length(); - } - - @Override - public String toText() { - return lexeme; - } -} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/antlradapter/Utils.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/antlradapter/Utils.java deleted file mode 100644 index 0b3256972c..0000000000 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/antlradapter/Utils.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2024 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * DAF Trucks NV – implementation of DaCo COBOL statements - * and DAF development standards - * - */ -package org.eclipse.lsp.cobol.core.hw.antlradapter; - -import org.antlr.v4.runtime.CommonToken; -import org.antlr.v4.runtime.ParserRuleContext; -import org.eclipse.lsp.cobol.core.cst.base.CstNode; -import org.eclipse.lsp.cobol.core.hw.Token; -import org.eclipse.lsp.cobol.core.hw.TokenType; - -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; - -import static org.antlr.v4.runtime.Token.HIDDEN_CHANNEL; - -/** - * Token related utilities. - */ -public class Utils { - /** - * Transform cst token into antlr one. - * - * @param token cst token node. - * @return antlr token. - */ - public static CommonToken toAntlrToken(Token token) { - CommonToken commonToken = new CommonToken(0, token.toText()); - commonToken.setLine(token.getLine() + 1); - commonToken.setCharPositionInLine(token.getStartPositionInLine()); - commonToken.setStartIndex(token.getIndex()); - commonToken.setStopIndex(token.getIndex() + token.getLexeme().length()); - if (token.getType() == TokenType.WHITESPACE || token.getType() == TokenType.NEW_LINE) { - commonToken.setChannel(HIDDEN_CHANNEL); - } - return commonToken; - } - - /** - * Find the first token in CST. - * @param cstNode a CST node. - * @return Optionally token. - */ - public static Optional findStartToken(CstNode cstNode) { - return firstToken(cstNode.getChildren()); - } - - /** - * Initialize antlr node by CST node. - * @param cstNode the CST node. - * @param node tha ANTLR node to setup. - */ - public static void initNode(CstNode cstNode, ParserRuleContext node) { - node.start = findStartToken(cstNode).map(Utils::toAntlrToken).orElse(null); - node.stop = findStopToken(cstNode).map(Utils::toAntlrToken).orElse(null); - node.children = new ArrayList<>(); - } - - /** - * Find the first token in CST. - * @param cstNode a CST node. - * @return Optionally token. - */ - public static Optional findStopToken(CstNode cstNode) { - return lastToken(cstNode.getChildren()); - } - - private static Optional firstToken(List cstNodes) { - CstNode cstNode = cstNodes.get(0); - if (cstNode instanceof Token) { - return Optional.of((Token) cstNode); - } else { - return firstToken(cstNode.getChildren()); - } - } - - private static Optional lastToken(List cstNodes) { - CstNode cstNode = cstNodes.get(cstNodes.size() - 1); - if (cstNode instanceof Token) { - return Optional.of((Token) cstNode); - } else { - return lastToken(cstNode.getChildren()); - } - } -} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/DataDivision.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/DataDivision.java similarity index 86% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/DataDivision.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/DataDivision.java index c1a9de042d..b663f31350 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/DataDivision.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/DataDivision.java @@ -14,9 +14,9 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst; +package org.eclipse.lsp.cobol.cst; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; /** * DataDivision node. diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/EnvironmentDivision.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/EnvironmentDivision.java similarity index 86% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/EnvironmentDivision.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/EnvironmentDivision.java index fbb9195dc6..b293ad047b 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/EnvironmentDivision.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/EnvironmentDivision.java @@ -14,9 +14,9 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst; +package org.eclipse.lsp.cobol.cst; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; /** * EnvironmentDivision node. diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/IdentificationDivision.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/IdentificationDivision.java similarity index 77% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/IdentificationDivision.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/IdentificationDivision.java index 13ff76a558..4f889a9b2a 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/IdentificationDivision.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/IdentificationDivision.java @@ -14,12 +14,16 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst; +package org.eclipse.lsp.cobol.cst; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; +import lombok.Getter; +import lombok.Setter; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; /** * IdentificationDivision node. */ public class IdentificationDivision extends CstNodeImpl { + @Getter @Setter + String programName; } diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/ProgramUnit.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/ProgramUnit.java similarity index 87% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/ProgramUnit.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/ProgramUnit.java index 50f409ca63..68ac054162 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/ProgramUnit.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/ProgramUnit.java @@ -14,11 +14,11 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst; +package org.eclipse.lsp.cobol.cst; import lombok.Getter; import lombok.Setter; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; /** * ProgramUnit node. diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/Skipped.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/Skipped.java similarity index 86% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/Skipped.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/Skipped.java index 8a133945e5..5de725cefc 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/Skipped.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/Skipped.java @@ -14,9 +14,9 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst; +package org.eclipse.lsp.cobol.cst; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; /** * Node to hold skipped tokens diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/SourceUnit.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/SourceUnit.java similarity index 86% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/SourceUnit.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/SourceUnit.java index 6d3ac119a1..cf4c1dd439 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/SourceUnit.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/SourceUnit.java @@ -14,9 +14,9 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst; +package org.eclipse.lsp.cobol.cst; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; /** * SourceUnit node. diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/base/CstNode.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/base/CstNode.java similarity index 59% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/base/CstNode.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/base/CstNode.java index 067b896d4b..df44a77d1a 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/base/CstNode.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/base/CstNode.java @@ -14,10 +14,9 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst.base; - -import org.eclipse.lsp.cobol.core.hw.GrammarRule; +package org.eclipse.lsp.cobol.cst.base; +import java.util.ArrayList; import java.util.List; /** @@ -30,15 +29,27 @@ public interface CstNode { */ List getChildren(); - /** - * Get the syntax rule associated with the node. - * @return rule type. - */ - GrammarRule getRule(); - /** * Restore suorce code of the node. * @return source code string. */ String toText(); + + /** + * List of all nodes from the current one (this) children. + * @param clazz Node class to filter by + * @return a list of clazz nodes + * @param - node class + */ + default List list(Class clazz) { + List result = new ArrayList<>(); + for (CstNode child : getChildren()) { + if (clazz.isInstance(child)) { + result.add((T) child); + } else { + result.addAll(child.list(clazz)); + } + } + return result; + } } diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/base/CstNodeImpl.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/base/CstNodeImpl.java similarity index 84% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/base/CstNodeImpl.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/base/CstNodeImpl.java index a535a89e15..9c39332fb0 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/base/CstNodeImpl.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/base/CstNodeImpl.java @@ -14,10 +14,9 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst.base; +package org.eclipse.lsp.cobol.cst.base; import lombok.Getter; -import org.eclipse.lsp.cobol.core.hw.GrammarRule; import java.util.ArrayList; import java.util.List; @@ -29,11 +28,6 @@ public class CstNodeImpl implements CstNode { private final List children = new ArrayList<>(); - @Override - public GrammarRule getRule() { - return null; - } - @Override public String toText() { StringBuilder sb = new StringBuilder(); diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/GrammarRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Declaratives.java similarity index 76% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/GrammarRule.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Declaratives.java index d6dee1182b..8417a5c871 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/GrammarRule.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Declaratives.java @@ -14,12 +14,12 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.hw; +package org.eclipse.lsp.cobol.cst.procedure; + +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; /** - * Language rules + * Declaratives. */ -public enum GrammarRule { - SourceUnit, - ProgramUnit, +public class Declaratives extends CstNodeImpl { } diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/Paragraph.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Paragraph.java similarity index 86% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/Paragraph.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Paragraph.java index 49d266c170..6c4b1be7c8 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/Paragraph.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Paragraph.java @@ -14,11 +14,11 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst.procedure; +package org.eclipse.lsp.cobol.cst.procedure; import lombok.Getter; import lombok.Setter; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; /** * Paragraph node diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/ProcedureDivision.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/ProcedureDivision.java similarity index 64% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/ProcedureDivision.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/ProcedureDivision.java index 64e46092ed..0410242b62 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/ProcedureDivision.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/ProcedureDivision.java @@ -14,12 +14,18 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst.procedure; +package org.eclipse.lsp.cobol.cst.procedure; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; +import lombok.Getter; +import lombok.Setter; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; +import org.eclipse.lsp.cobol.parser.hw.lexer.Token; /** * ProcedureDivision node. */ public class ProcedureDivision extends CstNodeImpl { + // TODO: im now sure that keeping a start token of procedure division body is a good idea. + @Getter @Setter + Token bodyStartToken; } diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/Section.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Section.java similarity index 69% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/Section.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Section.java index 1c7c5e3c0f..95f897644a 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/Section.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Section.java @@ -14,16 +14,20 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst.procedure; +package org.eclipse.lsp.cobol.cst.procedure; import lombok.Getter; import lombok.Setter; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; +import org.eclipse.lsp.cobol.parser.hw.lexer.Token; /** * Section node */ @Getter @Setter public class Section extends CstNodeImpl { + // TODO: im now sure that keeping a start token of procedure division body is a good idea. + @Getter @Setter + Token bodyStartToken; String name; } diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/Statement.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Statement.java similarity index 85% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/Statement.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Statement.java index bcd37cbecc..54d668144a 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/cst/procedure/Statement.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/cst/procedure/Statement.java @@ -14,9 +14,9 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.cst.procedure; +package org.eclipse.lsp.cobol.cst.procedure; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; /** * Probably temporary container for statements. diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/AntlrCobolParser.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/AntlrCobolParser.java similarity index 92% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/AntlrCobolParser.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/parser/AntlrCobolParser.java index 63072bb3a7..2194a2e158 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/AntlrCobolParser.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/AntlrCobolParser.java @@ -14,13 +14,15 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core; +package org.eclipse.lsp.cobol.parser; import org.antlr.v4.runtime.BaseErrorListener; import org.antlr.v4.runtime.CharStream; import org.antlr.v4.runtime.CommonTokenStream; import org.antlr.v4.runtime.DefaultErrorStrategy; import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.eclipse.lsp.cobol.core.CobolLexer; +import org.eclipse.lsp.cobol.core.CobolParser; /** * ANTLR Parser Wrapper diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/AstBuilder.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/AstBuilder.java similarity index 89% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/AstBuilder.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/parser/AstBuilder.java index 414877d377..1cddb9a15d 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/AstBuilder.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/AstBuilder.java @@ -14,11 +14,12 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core; +package org.eclipse.lsp.cobol.parser; import com.google.common.collect.ImmutableList; import org.antlr.v4.runtime.CommonTokenStream; -import org.eclipse.lsp.cobol.core.hw.Diagnostic; +import org.eclipse.lsp.cobol.core.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.Diagnostic; import java.util.List; diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/SplitParser.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/SplitParser.java similarity index 78% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/SplitParser.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/parser/SplitParser.java index cda84af376..9fbe005d5a 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/SplitParser.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/SplitParser.java @@ -14,7 +14,7 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core; +package org.eclipse.lsp.cobol.parser; import lombok.Getter; import org.antlr.v4.runtime.BaseErrorListener; @@ -24,11 +24,13 @@ import org.antlr.v4.runtime.misc.Interval; import org.antlr.v4.runtime.tree.ParseTreeListener; import org.eclipse.lsp.cobol.common.utils.ThreadInterruptionUtil; -import org.eclipse.lsp.cobol.core.cst.SourceUnit; -import org.eclipse.lsp.cobol.core.hw.ParserSettings; -import org.eclipse.lsp.cobol.core.hw.antlradapter.AntlrAdapter; -import org.eclipse.lsp.cobol.core.hw.Diagnostic; -import org.eclipse.lsp.cobol.core.hw.ParseResult; +import org.eclipse.lsp.cobol.core.CobolParser; +import org.eclipse.lsp.cobol.cst.SourceUnit; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.antlradapter.AntlrAdapter; +import org.eclipse.lsp.cobol.parser.hw.Diagnostic; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; import java.util.List; @@ -42,15 +44,15 @@ public class SplitParser implements AstBuilder { org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext root; public SplitParser(CharStream input, BaseErrorListener listener, DefaultErrorStrategy errorStrategy, ParseTreeListener treeListener) { - org.eclipse.lsp.cobol.core.hw.CobolLexer lexer = new org.eclipse.lsp.cobol.core.hw.CobolLexer( + CobolLexer lexer = new CobolLexer( input.getText(Interval.of(0, input.size()))); ParserSettings settings = new ParserSettings(); - ParseResult parseResult = new org.eclipse.lsp.cobol.core.hw.CobolParser(lexer, settings).parse(); + ParseResult parseResult = new org.eclipse.lsp.cobol.parser.hw.CobolParser(lexer, settings).parse(); SourceUnit su = parseResult.getSourceUnit(); diagnostics = parseResult.getDiagnostics(); AntlrAdapter antlrAdapter = new AntlrAdapter(listener, errorStrategy, treeListener); - root = antlrAdapter.sourceUnitToStartRule(su); tokens = antlrAdapter.adaptTokens(su); + root = antlrAdapter.sourceUnitToStartRule(su); } /** diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/WarningRecognitionException.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/WarningRecognitionException.java similarity index 96% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/WarningRecognitionException.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/parser/WarningRecognitionException.java index 9c3c2c9bd8..09f441ee3f 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/WarningRecognitionException.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/WarningRecognitionException.java @@ -12,7 +12,7 @@ * Broadcom, Inc. - initial API and implementation * */ -package org.eclipse.lsp.cobol.core; +package org.eclipse.lsp.cobol.parser; import org.antlr.v4.runtime.IntStream; import org.antlr.v4.runtime.ParserRuleContext; diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/CobolParser.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/CobolParser.java new file mode 100644 index 0000000000..c890750738 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/CobolParser.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.parser.hw; + +import lombok.extern.slf4j.Slf4j; + +import org.eclipse.lsp.cobol.cst.*; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.SourceUnitRule; + +/** + * Cobol parser + */ +@Slf4j +public class CobolParser { + private final ParsingContext ctx; + private final CobolLanguage rules = new CobolLanguage(); + + public CobolParser(CobolLexer lexer, ParserSettings settings) { + ctx = new ParsingContext(lexer, settings); + } + + /** + * Create the CST + * + * @return Concrete Syntax Tree + */ + public ParseResult parse() { + try { + rules.parseRule(SourceUnitRule.class, ctx); + } catch (ParseError error) { + // TODO: unhandled error + log.error(error.getMessage(), error); + } + return new ParseResult((SourceUnit) ctx.pop(), ctx.getDiagnostics()); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/Diagnostic.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/Diagnostic.java similarity index 94% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/Diagnostic.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/Diagnostic.java index 74ef43a65d..52e826060f 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/Diagnostic.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/Diagnostic.java @@ -14,7 +14,7 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.hw; +package org.eclipse.lsp.cobol.parser.hw; import lombok.Data; import org.eclipse.lsp4j.Range; diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParseError.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParseError.java similarity index 94% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParseError.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParseError.java index 92fdc69e7b..13ab8f351f 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParseError.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParseError.java @@ -14,7 +14,7 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.hw; +package org.eclipse.lsp.cobol.parser.hw; /** * HW parser specific exception diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParseResult.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParseResult.java similarity index 89% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParseResult.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParseResult.java index eeef3955b2..95a4fb321b 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParseResult.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParseResult.java @@ -14,12 +14,12 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.hw; +package org.eclipse.lsp.cobol.parser.hw; import java.util.List; import lombok.AllArgsConstructor; import lombok.Value; -import org.eclipse.lsp.cobol.core.cst.SourceUnit; +import org.eclipse.lsp.cobol.cst.SourceUnit; /** * Parsing result container diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParserSettings.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParserSettings.java similarity index 94% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParserSettings.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParserSettings.java index 71898b26a0..cc758510af 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/ParserSettings.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParserSettings.java @@ -14,7 +14,7 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.hw; +package org.eclipse.lsp.cobol.parser.hw; import lombok.Data; diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParsingContext.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParsingContext.java new file mode 100644 index 0000000000..ce27f36cf8 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/ParsingContext.java @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * DAF Trucks NV – implementation of DaCo COBOL statements + * and DAF development standards + * + */ +package org.eclipse.lsp.cobol.parser.hw; + +import lombok.Getter; +import org.apache.commons.text.similarity.JaroWinklerSimilarity; +import org.eclipse.lsp.cobol.cst.base.CstNode; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.lexer.Token; +import org.eclipse.lsp.cobol.parser.hw.lexer.TokenType; +import org.eclipse.lsp4j.Position; +import org.eclipse.lsp4j.Range; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Objects; +import java.util.function.Predicate; + +/** Parsing context */ +public class ParsingContext { + public static final Predicate SKIP_WHITESPACE_AND_NEWLINE = t -> t.getType() == TokenType.WHITESPACE || t.getType() == TokenType.NEW_LINE; + @Getter private final CobolLexer lexer; + private final JaroWinklerSimilarity sim = new JaroWinklerSimilarity(); + @Getter private final List diagnostics = new ArrayList<>(); + private final LinkedList nodeStack = new LinkedList<>(); + private final ParserSettings settings; + private static final int SIZE_THRESHOLD = 4; + + public ParsingContext(CobolLexer lexer, ParserSettings settings) { + this.lexer = lexer; + this.settings = settings; + } + + /** + * Put on stack current node + * + * @param node a node to stack + */ + public void push(CstNode node) { + nodeStack.push(node); + } + + /** + * Remove a node from the tome of the stack + * + * @return the node + */ + public CstNode pop() { + return nodeStack.pop(); + } + + /** + * Remove a node from the tome of the stack and make it a child of the new stack top + * + * @return the node + */ + public CstNode popAndAttach() { + CstNode node = pop(); + peek().getChildren().add(node); + return node; + } + + /** Consume spaces */ + public void spaces() { + Token token = lexer.peek(); + while (token.getType() != TokenType.EOF + && (token.getType() == TokenType.WHITESPACE || token.getType() == TokenType.NEW_LINE)) { + peek().getChildren().add(lexer.forward()); + skipSkipToken(); + token = getLexer().peek(); + } + } + + /** + * Consume a token. + * + * @return a token. + */ + public Token consume() { + Token forward = lexer.forward(); + peek().getChildren().add(forward); + skipSkipToken(); + return forward; + } + + /** + * Consume expected token + * + * @param expectedLexeme expected lexeme + */ + public void consume(String expectedLexeme) { + Token token = lexer.peek(); + if (!sameLexeme(token, expectedLexeme, 1.0)) { + error( + token, "Unexpected token: '" + token.getLexeme() + "'. Expect: '" + expectedLexeme + "'"); + } + peek().getChildren().add(lexer.forward()); + } + + private void skipSkipToken() { + if (match("SKIP1") || match("SKIP2") || match("SKIP3")) { + consume(); + if (match(".")) { + consume(); + } + } + } + + /** + * Try to match sequence of lexemes. + * + * @param lexemes the sequence of lexemes. + * @return true if successful + */ + public boolean match(String... lexemes) { + Token token = lexer.peek(); + for (String l : lexemes) { + if (sameLexeme(token, l, 1.0)) { + return true; + } + } + return false; + } + + /** + * Optionally consume a token + * + * @param lexeme a token + */ + public void optional(String lexeme) { + if (match(lexeme)) { + peek().getChildren().add(lexer.forward()); + } + } + + /** + * Optionally consume a token + * + * @param type a token type + */ + public void optional(TokenType type) { + if (lexer.peek().getType() == type) { + peek().getChildren().add(lexer.forward()); + } + } + + /** + * Take a look at the top of the stack + * + * @return the nedo on the top + */ + public CstNode peek() { + return nodeStack.peek(); + } + + /** + * Check for a sequence of tokens ignoring whitespaces. + * + * @param lexemes a sequence of expected tokens + * @return true if we have a match + */ + public boolean matchSeq(String... lexemes) { + List tokens = lexer.peekSeq(lexemes.length, SKIP_WHITESPACE_AND_NEWLINE); + if (tokens.size() != lexemes.length) { + return false; + } + if (settings.getFuzzyMatchThreshold() < 1) { + double d = calcDistance(tokens, lexemes); + return d > settings.getFuzzyMatchThreshold(); + } else { + for (int i = 0; i < tokens.size(); i++) { + if (!sameLexeme(tokens.get(i), lexemes[i], 1.0)) { + return false; + } + } + return true; + } + } + + private double calcDistance(List tokens, String[] lexemes) { + Double d = 0.0; + for (int i = 0; i < tokens.size(); i++) { + Token lexemeToken = tokens.get(i); + d += sim.apply(lexemeToken.getLexeme().toUpperCase(), lexemes[i].toUpperCase()); + } + return d / tokens.size(); + } + + /** + * Expect one of the tokens. + * + * @param expectedTokens tokens to expect. + */ + public void or(String... expectedTokens) { + Token next = lexer.peek(); + if (next.getType() == TokenType.EOF) { + return; + } + for (String content : expectedTokens) { + if (sameLexeme(next, content, null)) { + Token id = lexer.forward(); + peek().getChildren().add(id); + return; + } + } + error( + next, + "Unexpected token: '" + + next.getLexeme() + + "'. Expected: " + + String.join(",", expectedTokens)); + } + + boolean sameLexeme(Token lexemeToken, String expectedLexeme, Double threshold) { + threshold = threshold == null ? settings.getFuzzyMatchThreshold() : threshold; + // TODO: better matchers, for now it's ANY token when it's null + if (expectedLexeme == null) { + return true; + } + if (lexemeToken.getLexeme() == null) { + return false; + } + /* + * It's not clear what heuristic to use here, but for short lexemes SIMILARITY_THRESHOLD gives false errors. + */ + if (threshold == 1.0 || expectedLexeme.length() < SIZE_THRESHOLD) { + return Objects.equals(lexemeToken.getLexeme().toUpperCase(), expectedLexeme.toUpperCase()); + } + Double apply = sim.apply(lexemeToken.getLexeme().toUpperCase(), expectedLexeme.toUpperCase()); + if (apply == 1) { + return true; + } + if (apply > threshold) { + diagnostics.add(getSimilarKeywordPassedSyntaxError(lexemeToken, expectedLexeme)); + return true; + } + return false; + } + + /** + * Report an error. + * + * @param token tocken related to the problem. + * @param message an error message. + */ + public void error(Token token, String message) { + Diagnostic syntaxError = new Diagnostic(getTokenRange(token), message); + diagnostics.add(syntaxError); + throw new ParseError(message); + } + + private Diagnostic getSimilarKeywordPassedSyntaxError(Token lexemeToken, String expectedLexeme) { + return new Diagnostic( + getTokenRange(lexemeToken), + String.format("provided %s but expected %s", lexemeToken.getLexeme(), expectedLexeme)); + } + + private static Range getTokenRange(Token token) { + return new Range( + new org.eclipse.lsp4j.Position(token.getLine(), token.getStartPositionInLine()), + new Position(token.getLine(), token.getStartPositionInLine() + token.getLexeme().length())); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/antlradapter/AntlrAdapted.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/AntlrAdapted.java similarity index 88% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/antlradapter/AntlrAdapted.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/AntlrAdapted.java index deb4830d9d..9024e21ab5 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/antlradapter/AntlrAdapted.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/AntlrAdapted.java @@ -14,10 +14,10 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.hw.antlradapter; +package org.eclipse.lsp.cobol.parser.hw.antlradapter; import org.antlr.v4.runtime.ParserRuleContext; -import org.eclipse.lsp.cobol.core.cst.base.CstNodeImpl; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; /** * AntlrIsland node diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/antlradapter/AntlrAdapter.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/AntlrAdapter.java similarity index 51% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/antlradapter/AntlrAdapter.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/AntlrAdapter.java index ef97ccd409..ac9819d8fb 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/antlradapter/AntlrAdapter.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/AntlrAdapter.java @@ -14,36 +14,34 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.hw.antlradapter; +package org.eclipse.lsp.cobol.parser.hw.antlradapter; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.Token; import org.antlr.v4.runtime.tree.ParseTreeListener; import org.antlr.v4.runtime.tree.TerminalNodeImpl; import org.eclipse.lsp.cobol.core.*; import org.eclipse.lsp.cobol.core.CobolParser; -import org.eclipse.lsp.cobol.core.cst.*; -import org.eclipse.lsp.cobol.core.cst.base.CstNode; -import org.eclipse.lsp.cobol.core.cst.IdentificationDivision; -import org.eclipse.lsp.cobol.core.cst.procedure.ProcedureDivision; -import org.eclipse.lsp.cobol.core.hw.TokenType; - -import java.util.*; -import java.util.function.Function; -import java.util.stream.Collectors; - -import static org.eclipse.lsp.cobol.core.hw.antlradapter.Utils.*; +import org.eclipse.lsp.cobol.cst.*; +import org.eclipse.lsp.cobol.cst.base.CstNode; +import org.eclipse.lsp.cobol.cst.procedure.ProcedureDivision; +import org.eclipse.lsp.cobol.parser.hw.lexer.TokenType; -/** - * Reconstruct the AST - */ +/** Reconstruct the AST */ public class AntlrAdapter { public static final int INT = 6; private final BaseErrorListener errorListener; private final DefaultErrorStrategy errorStrategy; private final ParseTreeListener treeListener; + private CharStream charStream; - public AntlrAdapter(BaseErrorListener errorListener, DefaultErrorStrategy errorStrategy, ParseTreeListener treeListener) { + public AntlrAdapter( + BaseErrorListener errorListener, + DefaultErrorStrategy errorStrategy, + ParseTreeListener treeListener) { this.errorListener = errorListener; this.errorStrategy = errorStrategy; this.treeListener = treeListener; @@ -56,40 +54,56 @@ public AntlrAdapter(BaseErrorListener errorListener, DefaultErrorStrategy errorS * @return ANTLR AST */ public CobolParser.StartRuleContext sourceUnitToStartRule(SourceUnit su) { + this.charStream = CharStreams.fromString(su.toText()); traversePrograms(su, p -> replaceWithAntlr(p, convertProgramNode(p))); CobolParser.StartRuleContext startRuleContext = convertSourceUnit(su); startRuleContext.addChild(new TerminalNodeImpl(new CommonToken(Token.EOF, ""))); return startRuleContext; } - private static CobolParser.ProgramUnitContext replaceWithAntlr(ProgramUnit p, CobolParser.ProgramUnitContext result) { - org.eclipse.lsp.cobol.core.hw.Token token = Utils.findStartToken(p).get(); + private static CobolParser.ProgramUnitContext replaceWithAntlr( + ProgramUnit p, CobolParser.ProgramUnitContext result) { + org.eclipse.lsp.cobol.parser.hw.lexer.Token token = Utils.findStartToken(p).get(); int startLine = token.getLine(); int startPos = token.getStartPositionInLine(); char[] chars = p.toText().toCharArray(); for (int i = 0; i < chars.length; i++) { - chars[i] = chars[i] != '\n' ? ' ' : '\n'; + if (chars[i] != '\n') { + chars[i] = ' '; + } } - String lexeme = new String(chars); p.getChildren().clear(); AntlrAdapted antlr = new AntlrAdapted(result); - antlr.getChildren().add(new org.eclipse.lsp.cobol.core.hw.Token(lexeme, startLine, startPos, token.getIndex(), TokenType.WHITESPACE)); + antlr + .getChildren() + .add( + new org.eclipse.lsp.cobol.parser.hw.lexer.Token( + startLine, + startPos, + token.getIndexStart(), + token.getIndexStop(), + TokenType.WHITESPACE, + token.getSource())); p.getChildren().add(antlr); return result; } - private void traversePrograms(CstNode su, Function processor) { - su.getChildren().forEach(s -> traversePrograms(s, processor)); - if (su instanceof ProgramUnit) { - processor.apply((ProgramUnit) su); + private void traversePrograms( + CstNode node, Function processor) { + node.getChildren().forEach(s -> traversePrograms(s, processor)); + if (node instanceof ProgramUnit) { + processor.apply((ProgramUnit) node); } } private CobolParser.StartRuleContext convertSourceUnit(SourceUnit cstNode) { CobolParser.StartRuleContext start = new CobolParser.StartRuleContext(null, 0); - initNode(cstNode, start); - CobolParser.CompilationUnitContext compilationUnit = new CobolParser.CompilationUnitContext(start, 0); - initNode(cstNode, compilationUnit); + start.children = new ArrayList<>(); + start.start = Utils.toAntlrToken(Utils.findStartToken(cstNode, true).get(), charStream); + start.stop = Utils.toAntlrToken(Utils.findStopToken(cstNode, true).get(), charStream); + CobolParser.CompilationUnitContext compilationUnit = + new CobolParser.CompilationUnitContext(start, 0); + Utils.initNode(cstNode, compilationUnit, charStream); start.addChild(compilationUnit); processChildNodes(cstNode, compilationUnit); return start; @@ -97,18 +111,27 @@ private CobolParser.StartRuleContext convertSourceUnit(SourceUnit cstNode) { private CobolParser.ProgramUnitContext convertProgramNode(CstNode programUnit) { CobolParser.ProgramUnitContext program = new CobolParser.ProgramUnitContext(null, 0); - initNode(programUnit, program); + Utils.initNode(programUnit, program, charStream); processChildNodes(programUnit, program); - Optional> endProgramName = getEndProgramName(programUnit); + Optional> endProgramName = + getEndProgramName(programUnit); if (endProgramName.isPresent()) { - CobolParser.EndProgramStatementContext endProgramStatementContext = new CobolParser.EndProgramStatementContext(program, 0); - endProgramStatementContext.start = toAntlrToken(findStartToken(programUnit).get()); - endProgramStatementContext.stop = toAntlrToken(findStopToken(programUnit).get()); - CobolParser.ProgramNameContext nameContext = new CobolParser.ProgramNameContext(endProgramStatementContext, 0); - nameContext.start = toAntlrToken(endProgramName.get().get(0)); - nameContext.stop = toAntlrToken((endProgramName.get().get(endProgramName.get().size() - 1))); + CobolParser.EndProgramStatementContext endProgramStatementContext = + new CobolParser.EndProgramStatementContext(program, 0); + endProgramStatementContext.start = + Utils.toAntlrToken(Utils.findStartToken(programUnit).get(), charStream); + endProgramStatementContext.stop = + Utils.toAntlrToken(Utils.findStopToken(programUnit).get(), charStream); + CobolParser.ProgramNameContext nameContext = + new CobolParser.ProgramNameContext(endProgramStatementContext, 0); + org.eclipse.lsp.cobol.parser.hw.lexer.Token nameToken = endProgramName.get().get(0); + nameContext.start = Utils.toAntlrToken(nameToken, charStream); + nameContext.stop = + Utils.toAntlrToken( + (endProgramName.get().get(endProgramName.get().size() - 1)), charStream); endProgramStatementContext.children = new ArrayList<>(); endProgramStatementContext.children.add(nameContext); + nameContext.addChild(new TerminalNodeImpl(Utils.toAntlrToken(nameToken, charStream))); program.addChild(endProgramStatementContext); } return program; @@ -119,36 +142,32 @@ private ParserRuleContext convertNode(CstNode cstNode) { // All programs should be adapted to this point return ((AntlrAdapted) cstNode.getChildren().get(0)).getRuleContext(); } else if (cstNode instanceof DataDivision) { - long startTime = System.currentTimeMillis(); - CobolDataDivisionParser.DataDivisionContext dataDivisionContext = antlrDataDivisionParser(cstNode).dataDivision(); - System.out.println("> DataDivision: " + (System.currentTimeMillis() - startTime)); + CobolDataDivisionParser.DataDivisionContext dataDivisionContext = + antlrDataDivisionParser(cstNode).dataDivision(); + Utils.removeEofNode(dataDivisionContext); return dataDivisionContext; } else if (cstNode instanceof IdentificationDivision) { - long startTime = System.currentTimeMillis(); - CobolIdentificationDivisionParser.IdentificationDivisionContext identificationDivisionContext = antlrIdDivisionParser(cstNode).identificationDivision(); - System.out.println("> IdentificationDivision: " + (System.currentTimeMillis() - startTime)); + CobolIdentificationDivisionParser.IdentificationDivisionContext + identificationDivisionContext = antlrIdDivisionParser(cstNode).identificationDivision(); + Utils.removeEofNode(identificationDivisionContext); return identificationDivisionContext; } else if (cstNode instanceof EnvironmentDivision) { - long startTime = System.currentTimeMillis(); - CobolParser.EnvironmentDivisionContext environmentDivisionContext = antlrParser(cstNode).environmentDivision(); - System.out.println("> EnvironmentDivision: " + (System.currentTimeMillis() - startTime)); + CobolParser.EnvironmentDivisionContext environmentDivisionContext = + antlrParser(cstNode).environmentDivision(); + Utils.removeEofNode(environmentDivisionContext); return environmentDivisionContext; } else if (cstNode instanceof ProcedureDivision) { - return processProcedureDivisionContext(cstNode); + ProcedureDivisionAntlrAdapter adapter = + new ProcedureDivisionAntlrAdapter(charStream, errorListener, errorStrategy, treeListener); + CobolProcedureDivisionParser.ProcedureDivisionContext procedureDivisionContext = + adapter.processProcedureDivisionContext((ProcedureDivision) cstNode); + Utils.removeEofNode(procedureDivisionContext); + return procedureDivisionContext; } else { return null; } } - private CobolProcedureDivisionParser.ProcedureDivisionContext processProcedureDivisionContext(CstNode cstNode) { - - CobolProcedureDivisionParser cobolProcedureDivisionParser = antlrProcedureDivisionParser(cstNode); - long startTime = System.currentTimeMillis(); - CobolProcedureDivisionParser.ProcedureDivisionContext procedureDivisionContext = cobolProcedureDivisionParser.procedureDivision(); - System.out.println("> ProcedureDivision: " + (System.currentTimeMillis() - startTime)); - return procedureDivisionContext; - } - void processChildNodes(CstNode cstNode, ParserRuleContext parent) { parent.children = new ArrayList<>(); for (CstNode child : cstNode.getChildren()) { @@ -161,23 +180,24 @@ void processChildNodes(CstNode cstNode, ParserRuleContext parent) { } private CobolIdentificationDivisionParser antlrIdDivisionParser(CstNode node) { - org.eclipse.lsp.cobol.core.hw.Token startToken = findStartToken(node).get(); - String input = generatePrefix(startToken.getLine(), startToken.getStartPositionInLine()) + node.toText(); - CobolIdentificationDivisionLexer antlrLexer = new CobolIdentificationDivisionLexer(CharStreams.fromString(input)); + org.eclipse.lsp.cobol.parser.hw.lexer.Token startToken = Utils.findStartToken(node).get(); + String input = Utils.generatePrefix(charStream, startToken) + node.toText().trim(); + CobolIdentificationDivisionLexer antlrLexer = + new CobolIdentificationDivisionLexer(CharStreams.fromString(input)); antlrLexer.removeErrorListeners(); antlrLexer.addErrorListener(errorListener); CommonTokenStream tokens = new CommonTokenStream(antlrLexer); CobolIdentificationDivisionParser antlrParser = new CobolIdentificationDivisionParser(tokens); antlrParser.removeErrorListeners(); antlrParser.addErrorListener(errorListener); - antlrParser.setErrorHandler(errorStrategy); antlrParser.addParseListener(treeListener); + antlrParser.setErrorHandler(errorStrategy); return antlrParser; } private CobolDataDivisionParser antlrDataDivisionParser(CstNode node) { - org.eclipse.lsp.cobol.core.hw.Token startToken = findStartToken(node).get(); - String input = generatePrefix(startToken.getLine(), startToken.getStartPositionInLine()) + node.toText(); + org.eclipse.lsp.cobol.parser.hw.lexer.Token startToken = Utils.findStartToken(node).get(); + String input = Utils.generatePrefix(charStream, startToken) + node.toText(); CobolDataDivisionLexer antlrLexer = new CobolDataDivisionLexer(CharStreams.fromString(input)); antlrLexer.removeErrorListeners(); antlrLexer.addErrorListener(errorListener); @@ -185,34 +205,21 @@ private CobolDataDivisionParser antlrDataDivisionParser(CstNode node) { CobolDataDivisionParser antlrParser = new CobolDataDivisionParser(tokens); antlrParser.removeErrorListeners(); antlrParser.addErrorListener(errorListener); - antlrParser.setErrorHandler(errorStrategy); antlrParser.addParseListener(treeListener); - return antlrParser; - } - - private CobolProcedureDivisionParser antlrProcedureDivisionParser(CstNode node) { - org.eclipse.lsp.cobol.core.hw.Token startToken = findStartToken(node).get(); - String input = generatePrefix(startToken.getLine(), startToken.getStartPositionInLine()) + node.toText(); - CobolProcedureDivisionLexer antlrLexer = new CobolProcedureDivisionLexer(CharStreams.fromString(input)); - antlrLexer.removeErrorListeners(); - antlrLexer.addErrorListener(errorListener); - CommonTokenStream tokens = new CommonTokenStream(antlrLexer); - CobolProcedureDivisionParser antlrParser = new CobolProcedureDivisionParser(tokens); - antlrParser.removeErrorListeners(); - antlrParser.addErrorListener(errorListener); antlrParser.setErrorHandler(errorStrategy); - antlrParser.addParseListener(treeListener); return antlrParser; } private CobolParser antlrParser(CstNode node) { - org.eclipse.lsp.cobol.core.hw.Token startToken = findStartToken(node).get(); - String input = generatePrefix(startToken.getLine(), startToken.getStartPositionInLine()) + node.toText(); - org.eclipse.lsp.cobol.core.CobolLexer antlrLexer = new org.eclipse.lsp.cobol.core.CobolLexer(CharStreams.fromString(input)); + org.eclipse.lsp.cobol.parser.hw.lexer.Token startToken = Utils.findStartToken(node).get(); + String input = Utils.generatePrefix(charStream, startToken) + node.toText(); + org.eclipse.lsp.cobol.core.CobolLexer antlrLexer = + new org.eclipse.lsp.cobol.core.CobolLexer(CharStreams.fromString(input)); antlrLexer.removeErrorListeners(); antlrLexer.addErrorListener(errorListener); CommonTokenStream tokens = new CommonTokenStream(antlrLexer); - org.eclipse.lsp.cobol.core.CobolParser antlrParser = new org.eclipse.lsp.cobol.core.CobolParser(tokens); + org.eclipse.lsp.cobol.core.CobolParser antlrParser = + new org.eclipse.lsp.cobol.core.CobolParser(tokens); antlrParser.removeErrorListeners(); antlrParser.addErrorListener(errorListener); antlrParser.setErrorHandler(errorStrategy); @@ -220,11 +227,6 @@ private CobolParser antlrParser(CstNode node) { return antlrParser; } - private String generatePrefix(int line, int startPositionInLine) { - return new String(new char[line]).replace('\0', '\n') - + new String(new char[startPositionInLine]).replace('\0', ' '); - } - /** * Collect tokens * @@ -234,46 +236,50 @@ private String generatePrefix(int line, int startPositionInLine) { public CommonTokenStream adaptTokens(SourceUnit su) { List tokens = new ArrayList<>(); collectTokens(su, tokens); - CommonTokenStream commonTokenStream = new CommonTokenStream(new ListTokenSource(tokens.stream() - .filter(t -> ((org.eclipse.lsp.cobol.core.hw.Token) t).getType() != TokenType.WHITESPACE) - .map(org.eclipse.lsp.cobol.core.hw.Token.class::cast) - .map(Utils::toAntlrToken).collect(Collectors.toList()))); + CommonTokenStream commonTokenStream = + new CommonTokenStream( + new ListTokenSource( + tokens.stream() + .map(org.eclipse.lsp.cobol.parser.hw.lexer.Token.class::cast) + .map(token -> Utils.toAntlrToken(token, charStream)) + .collect(Collectors.toList()))); commonTokenStream.fill(); return commonTokenStream; } private void collectTokens(CstNode su, List result) { - if (su instanceof org.eclipse.lsp.cobol.core.hw.Token) { + if (su instanceof org.eclipse.lsp.cobol.parser.hw.lexer.Token) { result.add(su); } for (CstNode node : su.getChildren()) { collectTokens(node, result); } } - static Optional> getEndProgramName(CstNode cstNode) { - List result = new ArrayList<>(); + + static Optional> getEndProgramName( + CstNode cstNode) { + List result = new ArrayList<>(); if (!(cstNode instanceof ProgramUnit)) { return Optional.empty(); } boolean nextName = false; int skip = 1; for (CstNode n : cstNode.getChildren()) { - if (!(n instanceof org.eclipse.lsp.cobol.core.hw.Token) || ((org.eclipse.lsp.cobol.core.hw.Token) n).getType() == TokenType.WHITESPACE) { + if (!(n instanceof org.eclipse.lsp.cobol.parser.hw.lexer.Token) + || ((org.eclipse.lsp.cobol.parser.hw.lexer.Token) n).getType() == TokenType.WHITESPACE) { continue; } if (nextName) { if (skip == 0) { - result.add((org.eclipse.lsp.cobol.core.hw.Token) n); + result.add((org.eclipse.lsp.cobol.parser.hw.lexer.Token) n); } else { skip--; } } - if ("END".equalsIgnoreCase(((org.eclipse.lsp.cobol.core.hw.Token) n).getLexeme())) { + if ("END".equalsIgnoreCase(((org.eclipse.lsp.cobol.parser.hw.lexer.Token) n).getLexeme())) { nextName = true; } } - return result.isEmpty() ? Optional.empty() : Optional.of(result); } - } diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/ProcedureDivisionAntlrAdapter.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/ProcedureDivisionAntlrAdapter.java new file mode 100644 index 0000000000..c24f548d34 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/ProcedureDivisionAntlrAdapter.java @@ -0,0 +1,285 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * DAF Trucks NV – implementation of DaCo COBOL statements + * and DAF development standards + * + */ +package org.eclipse.lsp.cobol.parser.hw.antlradapter; + +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.antlr.v4.runtime.tree.TerminalNodeImpl; +import org.eclipse.lsp.cobol.core.CobolProcedureDivisionLexer; +import org.eclipse.lsp.cobol.core.CobolProcedureDivisionParser; +import org.eclipse.lsp.cobol.core.CobolProcedureDivisionParser.*; +import org.eclipse.lsp.cobol.cst.base.CstNode; +import org.eclipse.lsp.cobol.cst.procedure.*; +import org.eclipse.lsp.cobol.parser.hw.lexer.Token; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +/** + * Procedure division mapping to antlr logic + */ +public class ProcedureDivisionAntlrAdapter { + private final CharStream charStream; + private final ANTLRErrorListener errorListener; + private final ANTLRErrorStrategy errorStrategy; + private final ParseTreeListener treeListener; + private CommonToken lastToken = null; + + public ProcedureDivisionAntlrAdapter( + CharStream charStream, + ANTLRErrorListener errorListener, + ANTLRErrorStrategy errorStrategy, + ParseTreeListener treeListener) { + this.charStream = charStream; + this.errorListener = errorListener; + this.errorStrategy = errorStrategy; + this.treeListener = treeListener; + } + + ProcedureDivisionContext processProcedureDivisionContext(ProcedureDivision cstNode) { + ProcedureDivisionContext pdCtx = parseProcedureDivision(cstNode); + createProcedureDivisionBodyContext(pdCtx, cstNode); + return pdCtx; + } + + private ProcedureDivisionBodyContext createProcedureDivisionBodyContext(ProcedureDivisionContext pdCtx, ProcedureDivision cstNode) { + Optional opt = findChild(pdCtx, ProcedureDivisionBodyContext.class); + ProcedureDivisionBodyContext pdbCtx; + pdCtx.stop = Utils.findStopToken(cstNode, true).map(token -> Utils.toAntlrToken(token, charStream)).orElse(null); + if (opt.isPresent()) { + pdbCtx = (ProcedureDivisionBodyContext) opt.get(); + pdbCtx.children = new ArrayList<>(); + } else { + pdbCtx = Utils.initNode(cstNode, new ProcedureDivisionBodyContext(null, 0), charStream); + pdCtx.addChild(pdbCtx); + pdbCtx.start = Utils.toAntlrToken(cstNode.getBodyStartToken(), charStream); + } + + LinkedList genStack = new LinkedList<>(); + genStack.push(pdbCtx); + + // make a tree flat + List nodes = cstNode.getChildren().stream() + .flatMap(m -> (m instanceof Section) ? Stream.concat(Stream.of(m), m.getChildren().stream()) : Stream.of(m)) + .flatMap(m -> (m instanceof Paragraph) ? Stream.concat(Stream.of(m), m.getChildren().stream()) : Stream.of(m)) + .collect(Collectors.toList()); + + lastToken = null; + + for (int idx = 0; idx < nodes.size(); idx++) { + CstNode node = nodes.get(idx); + + if (node instanceof Token) { + continue; + } + + if (node instanceof Paragraph) { + assureParagraphsCtx(genStack, pdbCtx, node); + handleParagraphNode(genStack, node); + } + + if (node instanceof Section) { + handleSectionNode(genStack, node); + } + + if (node instanceof Statement) { + assureParagraphsCtx(genStack, pdbCtx, node); + ParserRuleContext s = parseSentence((Statement) node); + lastToken = (CommonToken) s.stop; + s.setParent(genStack.peek()); + genStack.peek().addChild(s); + } + + if (node instanceof Declaratives) { + handleDeclaratives(genStack, (Declaratives) node); + } + + } + while (!genStack.isEmpty()) { + genStack.pop().stop = Utils.toAntlrToken(Utils.findStopToken(nodes, true).get(), charStream); + } + return pdbCtx; + + } + + private Optional findChild(ProcedureDivisionContext pdCtx, Class expectedClass) { + return pdCtx.children.stream().filter(c -> c.getClass() == expectedClass).findFirst(); + } + + private void handleDeclaratives(LinkedList genStack, Declaratives node) { + Token startToken = Utils.findStartToken(node).get(); + String input = Utils.generatePrefix(charStream, startToken) + node.toText(); + CobolProcedureDivisionLexer antlrLexer = + new CobolProcedureDivisionLexer(CharStreams.fromString(input)); + antlrLexer.removeErrorListeners(); + antlrLexer.addErrorListener(errorListener); + CommonTokenStream tokens = new CommonTokenStream(antlrLexer); + CobolProcedureDivisionParser antlrParser = new CobolProcedureDivisionParser(tokens); + antlrParser.removeErrorListeners(); + antlrParser.addErrorListener(errorListener); + antlrParser.setErrorHandler(errorStrategy); + antlrParser.addParseListener(treeListener); + ProcedureDeclarativesContext declaratives = antlrParser.procedureDeclaratives(); + Utils.removeEofNode(declaratives); + genStack.peek().getParent().addChild(declaratives); + } + + private void assureParagraphsCtx(LinkedList genStack, ProcedureDivisionBodyContext pdbCtx, CstNode node) { + if (!(genStack.peek() instanceof ParagraphsContext) && !(genStack.peek() instanceof ParagraphContext)) { + ParagraphsContext paragraphsCtx = new ParagraphsContext(pdbCtx, 0); + paragraphsCtx.start = Utils.findStartToken(node).map(token -> Utils.toAntlrToken(token, charStream)).orElse(null); + paragraphsCtx.children = new ArrayList<>(); + paragraphsCtx.setParent(genStack.peek()); + genStack.peek().addChild(paragraphsCtx); + genStack.push(paragraphsCtx); + } + } + + private void handleParagraphNode(LinkedList genStack, CstNode node) { + if (genStack.peek() instanceof ParagraphContext) { + genStack.pop().stop = lastToken; + } + ParagraphContext context = new ParagraphContext(genStack.peek(), 0); + genStack.peek().addChild(context); + genStack.push(context); + genStack.peek().children = new ArrayList<>(); + genStack.peek().start = Utils.toAntlrToken(Utils.findStartToken(node).get(), charStream); + Token name = (Token) node.getChildren().get(0); + ParagraphDefinitionNameContext paragraphDefinitionNameContext = + Utils.initNode(name, new ParagraphDefinitionNameContext(null, 0), charStream); + TerminalNodeImpl nameTN = new TerminalNodeImpl(Utils.toAntlrToken(name, charStream)); + paragraphDefinitionNameContext.addChild(nameTN); + paragraphDefinitionNameContext.setParent(genStack.peek()); + genStack.peek().addChild(paragraphDefinitionNameContext); + TerminalNodeImpl terminalNode = new TerminalNodeImpl(Utils.toAntlrToken((Token) node.getChildren().get(dotIdx(node.getChildren())), charStream)); + lastToken = (CommonToken) terminalNode.getSymbol(); + genStack.peek().addChild(terminalNode); + } + + private void handleSectionNode(LinkedList genStack, CstNode node) { + if (genStack.peek() instanceof ParagraphContext) { + genStack.pop().stop = lastToken; + } + if (genStack.peek() instanceof ParagraphsContext) { + genStack.pop().stop = lastToken; + } + if (genStack.peek() instanceof ProcedureSectionContext) { + genStack.pop().stop = lastToken; + } + Token name = (Token) node.getChildren().get(0); + Token section = (Token) node.getChildren().get(2); + Token dot = (Token) node.getChildren().get(3); + + ProcedureSectionContext sectionContext = + Utils.initNode(node, new ProcedureSectionContext(genStack.peek(), 0), charStream); + genStack.peek().addChild(sectionContext); + genStack.push(sectionContext); + + + ProcedureSectionHeaderContext header = createSectionHeader(node, name, section); + sectionContext.addChild(header); + + TerminalNodeImpl terminalNode = new TerminalNodeImpl(Utils.toAntlrToken(dot, charStream)); + sectionContext.addChild(terminalNode); + + ParagraphsContext paragraphsContext = + Utils.initNode(((Section) node).getBodyStartToken(), new ParagraphsContext(null, 0), charStream); + paragraphsContext.setParent(sectionContext); + sectionContext.addChild(paragraphsContext); + lastToken = (CommonToken) terminalNode.getSymbol(); + genStack.push(paragraphsContext); + } + + private ParserRuleContext parseSentence(Statement node) { + Token startToken = Utils.findStartToken(node).get(); + String input = Utils.generatePrefix(charStream, startToken) + node.toText(); + CobolProcedureDivisionLexer antlrLexer = + new CobolProcedureDivisionLexer(CharStreams.fromString(input)); + antlrLexer.removeErrorListeners(); + antlrLexer.addErrorListener(errorListener); + CommonTokenStream tokens = new CommonTokenStream(antlrLexer); + CobolProcedureDivisionParser antlrParser = new CobolProcedureDivisionParser(tokens); + antlrParser.removeErrorListeners(); + antlrParser.addErrorListener(errorListener); + antlrParser.setErrorHandler(errorStrategy); + antlrParser.addParseListener(treeListener); + SentenceContext sentence = antlrParser.sentence(); + Utils.removeEofNode(sentence); + return sentence; + } + + private ProcedureDivisionContext parseProcedureDivision(ProcedureDivision node) { + StringBuilder sb = new StringBuilder(); + for (CstNode c : node.getChildren()) { + if (hasToken(c, node.getBodyStartToken())) { + break; + } + sb.append(c.toText()); + } + String input = Utils.generatePrefix(charStream, Utils.findStartToken(node).get()) + sb; + CobolProcedureDivisionLexer antlrLexer = + new CobolProcedureDivisionLexer(CharStreams.fromString(input)); + antlrLexer.removeErrorListeners(); + antlrLexer.addErrorListener(errorListener); + CommonTokenStream tokens = new CommonTokenStream(antlrLexer); + CobolProcedureDivisionParser antlrParser = new CobolProcedureDivisionParser(tokens); + antlrParser.removeErrorListeners(); + antlrParser.addErrorListener(errorListener); + antlrParser.addParseListener(treeListener); + return antlrParser.procedureDivision(); + } + + private boolean hasToken(CstNode node, Token token) { + if (node.equals(token)) { + return true; + } + for (CstNode c : node.getChildren()) { + if (hasToken(c, token)) { + return true; + } + } + return false; + } + + private ProcedureSectionHeaderContext createSectionHeader(CstNode node, Token name, Token section) { + ProcedureSectionHeaderContext headerContext = new ProcedureSectionHeaderContext(null, 0); + headerContext.start = Utils.findStartToken(node).map(token -> Utils.toAntlrToken(token, charStream)).orElse(null); + headerContext.stop = Utils.findStopToken(node, true).map(token -> Utils.toAntlrToken(token, charStream)).orElse(null); + headerContext.children = new ArrayList<>(); + + SectionNameContext sectionNameContext = + Utils.initNode(name, new SectionNameContext(null, 0), charStream); + sectionNameContext.addChild(new TerminalNodeImpl(Utils.toAntlrToken(name, charStream))); + headerContext.addChild(sectionNameContext); + headerContext.addChild(new TerminalNodeImpl(Utils.toAntlrToken(section, charStream))); + return headerContext; + } + + private int dotIdx(List nodes) { + for (int i = 0; i < nodes.size(); i++) { + if (".".equals(nodes.get(i).toText())) { + return i; + } + } + return -1; + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/Utils.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/Utils.java new file mode 100644 index 0000000000..eb3929fdde --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/antlradapter/Utils.java @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * DAF Trucks NV – implementation of DaCo COBOL statements + * and DAF development standards + * + */ +package org.eclipse.lsp.cobol.parser.hw.antlradapter; + +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.misc.Interval; +import org.antlr.v4.runtime.misc.Pair; +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.TerminalNodeImpl; +import org.eclipse.lsp.cobol.cst.base.CstNode; +import org.eclipse.lsp.cobol.parser.hw.lexer.Token; +import org.eclipse.lsp.cobol.parser.hw.lexer.TokenType; + +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; + +import static org.antlr.v4.runtime.Token.HIDDEN_CHANNEL; + +/** Token related utilities. */ +public class Utils { + /** + * Transform cst token into antlr one. + * + * @param token cst token node. + * @param charStream the stream of program characters. + * @return antlr token. + */ + public static CommonToken toAntlrToken(Token token, CharStream charStream) { + Pair source = new Pair<>(null, charStream); + int channel = 0; + int type = 0; + switch (token.getType()) { + case EOF: + type = IntStream.EOF; + case NEW_LINE: + case WHITESPACE: + channel = HIDDEN_CHANNEL; + break; + default: + break; + } + CommonToken commonToken = + new CommonToken(source, type, channel, token.getIndexStart(), token.getIndexStop() - 1); + commonToken.setLine(token.getLine() + 1); + commonToken.setCharPositionInLine(token.getStartPositionInLine()); + commonToken.setText(token.toText()); + return commonToken; + } + + /** + * Find the first token in CST. + * + * @param cstNode a CST node. + * @param ignoreWhitespaces set to true if you want to ignore whitespace tokens + * @return Optionally token. + */ + public static Optional findStartToken(CstNode cstNode, boolean ignoreWhitespaces) { + if (cstNode.getChildren().isEmpty()) { + return Optional.of((Token) cstNode); + } + return firstToken(cstNode.getChildren(), ignoreWhitespaces); + } + + /** + * Find the first token in CST. + * + * @param cstNode a CST node. + * @return Optionally token. + */ + public static Optional findStartToken(CstNode cstNode) { + if (cstNode.getChildren().isEmpty()) { + return Optional.of((Token) cstNode); + } + return firstToken(cstNode.getChildren(), false); + } + + /** + * Initialize antlr node by CST node. + * + * @param cstNode the CST node. + * @param node tha ANTLR node to set up. + * @param charStream the stream of program characters. + * @param the type of ANTLR node + * @return node reference. + */ + public static T initNode( + CstNode cstNode, T node, CharStream charStream) { + node.start = findStartToken(cstNode).map(token -> toAntlrToken(token, charStream)).orElse(null); + node.stop = + findStopToken(cstNode, true).map(token -> toAntlrToken(token, charStream)).orElse(null); + node.children = new ArrayList<>(); + return node; + } + + /** + * Find the last token in CST. + * + * @param cstNode a CST node. + * @return Optionally token. + */ + public static Optional findStopToken(CstNode cstNode) { + if (cstNode.getChildren().isEmpty()) { + return Optional.of((Token) cstNode); + } + return lastToken(cstNode.getChildren(), false); + } + + /** + * Find the last token in CST. + * + * @param cstNodes a CST node list. + * @param ignoreWhitespaces set to true if you want to ignore whitespace tokens + * @return Optionally token. + */ + public static Optional findStopToken(List cstNodes, boolean ignoreWhitespaces) { + for (int i = cstNodes.size() - 1; i >= 0; i--) { + CstNode cstNode = cstNodes.get(i); + if (cstNode instanceof Token) { + TokenType type = ((Token) cstNode).getType(); + if ((type != TokenType.WHITESPACE + && type != TokenType.NEW_LINE) + || !ignoreWhitespaces) { + return Optional.of((Token) cstNode); + } + } else { + Optional result = lastToken(cstNode.getChildren(), ignoreWhitespaces); + if (result.isPresent()) { + return result; + } + } + } + return Optional.empty(); + } + + /** + * Find the last token in CST. + * + * @param cstNode a CST node. + * @param ignoreWhitespaces set to true if you want to ignore whitespace tokens + * @return Optionally token. + */ + public static Optional findStopToken(CstNode cstNode, boolean ignoreWhitespaces) { + if (cstNode.getChildren().isEmpty()) { + return Optional.of((Token) cstNode); + } + return lastToken(cstNode.getChildren(), ignoreWhitespaces); + } + + private static Optional firstToken(List cstNodes, boolean ignoreWhitespaces) { + for (CstNode cstNode : cstNodes) { + if (cstNode instanceof Token) { + TokenType type = ((Token) cstNode).getType(); + if (ignoreWhitespaces && (type == TokenType.WHITESPACE || type == TokenType.NEW_LINE)) { + continue; + } + return Optional.of((Token) cstNode); + } else if (cstNode instanceof AntlrAdapted) { + return Optional.of((Token) cstNode.getChildren().get(0)); + } else { + return firstToken(cstNode.getChildren(), ignoreWhitespaces); + } + } + return Optional.empty(); + } + + /** + * Find the last token in CST. + * + * @param cstNodes a list of nodes to check (ignore whitespaces) + * @param ignoreWhitespaces set to true if you want to ignore whitespace tokens + * @return possible the end node. + */ + public static Optional lastToken(List cstNodes, boolean ignoreWhitespaces) { + int i = 1; + if (ignoreWhitespaces) { + while (i < cstNodes.size()) { + CstNode n = cstNodes.get(cstNodes.size() - i); + if (!(n instanceof Token)) { + break; + } + TokenType type = ((Token) n).getType(); + if (type != TokenType.WHITESPACE && type != TokenType.NEW_LINE) { + break; + } + i++; + } + } + + CstNode cstNode = cstNodes.get(cstNodes.size() - i); + if (cstNode instanceof Token) { + return Optional.of((Token) cstNode); + } else { + return lastToken(cstNode.getChildren(), ignoreWhitespaces); + } + } + + static String generatePrefix(CharStream charStream, Token startToken) { + String prefix = charStream.getText(Interval.of(0, startToken.getIndexStart() - 1)); + char[] chars = prefix.toCharArray(); + for (int i = 0; i < chars.length; i++) { + chars[i] = chars[i] != '\n' ? ' ' : '\n'; + } + return new String(chars); + } + + /** + * Remove EOF token if eny + * + * @param parent a node to find a EOF token. + */ + static void removeEofNode(ParserRuleContext parent) { + if (parent.children == null) { + return; + } + ParseTree lastChild = parent.children.get(parent.children.size() - 1); + if (lastChild instanceof TerminalNodeImpl + && ((TerminalNodeImpl) lastChild).getSymbol().getType() == org.antlr.v4.runtime.Token.EOF) { + parent.removeLastChild(); + } + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/CobolLexer.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/CobolLexer.java new file mode 100644 index 0000000000..05eb595bf9 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/CobolLexer.java @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * DAF Trucks NV – implementation of DaCo COBOL statements + * and DAF development standards + * + */ +package org.eclipse.lsp.cobol.parser.hw.lexer; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.function.Predicate; + +/** COBOL language lexer. */ +public class CobolLexer { + private final List tokens = new ArrayList<>(); + private final TokenScanner scanner; + private int tokenIndex = 0; + + public CobolLexer(String source) { + this.scanner = new TokenScanner(source); + } + + /** + * Check if we have more tokens. + * + * @return true if there are more tokens. + */ + public boolean hasMore() { + return !scanner.isAtEnd(); + } + + /** + * Return one token and move forward. + * + * @return token. + */ + public Token forward() { + if (tokenIndex == tokens.size()) { + Token next = scanner.next(); + tokens.add(next); + tokenIndex++; + return next; + } + return tokens.get(tokenIndex++); + } + + /** + * Return one token but don't move forward. + * + * @return Next token. + */ + public Token peek() { + if (tokenIndex == tokens.size()) { + Token next = scanner.next(); + tokens.add(next); + return next; + } + return tokens.get(tokenIndex); + } + + /** + * Find a sequence of tokens ignoring one that passes skip predicate. + * + * @param count how many tokens to take. + * @param skip predicate to ignore tokens. + * @return a list of tokens. + */ + public List peekSeq(int count, Predicate skip) { + List result = new ArrayList<>(); + int idx = tokenIndex; + if (idx == tokens.size()) { + tokens.add(scanner.next()); + } + if (tokens.get(idx).getType() == TokenType.EOF) { + return Collections.singletonList(peek()); + } + + while (result.size() < count) { + Token token = tokens.get(idx); + if (!skip.test(token)) { + result.add(token); + } + idx++; + if (idx == tokens.size()) { + tokens.add(scanner.next()); + } + if (tokens.get(idx).getType() == TokenType.EOF) { + return result; + } + } + return result; + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/Token.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/Token.java new file mode 100644 index 0000000000..6ce6c24dbd --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/Token.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.parser.hw.lexer; + +import lombok.Getter; +import org.eclipse.lsp.cobol.cst.base.CstNodeImpl; + +import java.util.Objects; + +/** + * Token node. + */ +@Getter +public class Token extends CstNodeImpl { + public static final int PRIME = 31; + private final int line; + private final int startPositionInLine; + private final int indexStart; + private final int indexStop; + private final String source; + private final TokenType type; + + public Token(int line, int startPositionInLine, int indexStart, int indexStop, TokenType type, String source) { + this.line = line; + this.source = source; + this.startPositionInLine = startPositionInLine; + this.indexStart = indexStart; + this.indexStop = indexStop; + this.type = type; + } + + /** + * Get the size of lexeme + * @return size of lexeme + */ + public int length() { + return indexStop - indexStart; + } + + @Override + public String toText() { + return source.substring(indexStart, indexStop); + } + + @Override + public String toString() { + return "Token{" + + "line=" + line + + ", startPositionInLine=" + + startPositionInLine + // TODO: escape string? + + ", lexeme='" + toText().replace("\n", "\\n") + '\'' + + ", index=[" + indexStart + ", " + indexStop + "]" + + ", type=" + type + + '}'; + } + + public String getLexeme() { + // TODO: a good place for optimization maybe? + return toText(); + } + + /* FIXME: Lexer should not create new instances of tokens even if it's a peek call */ + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Token token = (Token) o; + return line == token.line && startPositionInLine == token.startPositionInLine && indexStart == token.indexStart && indexStop == token.indexStop && Objects.equals(source, token.source) && type == token.type; + } + + @Override + public int hashCode() { + int result = line; + result = 31 * result + startPositionInLine; + result = 31 * result + indexStart; + result = 31 * result + indexStop; + result = 31 * result + Objects.hashCode(source); + result = 31 * result + Objects.hashCode(type); + return result; + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/TokenScanner.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/TokenScanner.java new file mode 100644 index 0000000000..a55b8c7384 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/TokenScanner.java @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.parser.hw.lexer; + +import java.util.function.Predicate; +import java.util.regex.Pattern; +import lombok.Data; + +/** Class helps to group characters into tokens (TODO: it will be part of the lexer) */ +public class TokenScanner { + private final String source; + private final Position currentPosition = new Position(); + + public TokenScanner(String source) { + this.source = source; + } + + private boolean peek(char ch) { + return peek(c -> c == ch); + } + + private boolean peek(Predicate predicate) { + return peek(predicate, 1); + } + + private boolean peek(Predicate predicate, int shift) { + int nextPos = currentPosition.index + shift; + if (isAtEnd() || source.length() <= nextPos) { + return false; + } + return predicate.test(source.charAt(nextPos)); + } + + private void forward() { + currentPosition.forward(); + } + + /** + * Produces the next token. + * + * @return the next token. + */ + public Token next() { + if (isAtEnd()) { + return currentPosition.produceToken(TokenType.EOF); + } + + Position start = new Position(currentPosition); + + if (match(' ')) { + return whitespace(start); + } + if (match('\n')) { + return newLine(start); + } + if (match('(') || match(')') || match(',')) { + forward(); + return start.produceToken(TokenType.OTHER); + } + if (match('\'') || match('"')) { + return stringLiteral(start); + } + + Token num = numericLiteral(start); + if (num != null) { + return num; + } + + if (match('-')) { + while (match('-')) { + forward(); + } + return start.produceToken(TokenType.OTHER); + } + + if (match('<') || match('>')) { + forward(); + if (match('=')) { + forward(); + } + return start.produceToken(TokenType.OTHER); + } + return cobolWord(start); + } + + private Token stringLiteral(Position start) { + char q = at(); + do { + forward(); + // skip escape + if (match(q) && peek(q)) { + forward(); + forward(); + } + } while (!match(q)); + forward(); // consume q + return start.produceToken(TokenType.STRING_LITERAL); + } + + private Token numericLiteral(Position start) { + currentPosition.mark(); + if (match('-') || match('+') || match('.')) { + forward(); + } + if (!match(Character::isDigit)) { + currentPosition.backToMark(); + return null; + } + do { + forward(); + } while (match(Character::isDigit)); + if (match('.') && peek(Character::isDigit)) { + do { + forward(); + } while (match(Character::isDigit)); + } + if (match('E') && (peek(Character::isDigit) || peek('-') || peek('+'))) { + if (peek('-') || peek('+')) { + forward(); + } + do { + forward(); + } while (match(Character::isDigit)); + } + if (match('-')) { + // minus after number is unexpected, unless it's expression (TODO support 1-2-3-4 case) + currentPosition.backToMark(); + return null; + } + return start.produceToken(TokenType.NUMBER_LITERAL); + } + + private boolean mayBeNumericLiteral() { + if (match(Character::isDigit)) { + return true; + } + if (match('-')) { + return peek(Character::isDigit); + } + if (match('+') || match('.')) { + return peek(Character::isDigit); + } else { + return false; + } + } + + private Token cobolWord(Position start) { + do { + if (match('-')) { + currentPosition.mark(); + while (match('-')) { + forward(); + } + if (match(' ')) { + currentPosition.backToMark(); + return start.produceToken(TokenType.COBOL_WORD); + } + } else { + forward(); + } + } while (!isAtEnd() && isCobolWordSymbol()); + + return start.produceToken(TokenType.COBOL_WORD); + } + + private static final Pattern COBOL_WORD_CHAR = Pattern.compile("[-_a-zA-Z0-9]"); + + private boolean isCobolWordSymbol() { + return COBOL_WORD_CHAR.matcher(String.valueOf(source.charAt(currentPosition.index))).matches(); + } + + private Token newLine(Position start) { + forward(); + if (match('\r')) { + forward(); + } + return start.produceToken(TokenType.NEW_LINE); + } + + private Token whitespace(Position start) { + do { + forward(); + } while (match(' ') || match('\t')); + return start.produceToken(TokenType.WHITESPACE); + } + + private char at() { + return source.charAt(currentPosition.index); + } + + boolean match(Predicate predicate) { + if (isAtEnd()) { + return false; + } + return predicate.test(source.charAt(currentPosition.index)); + } + + boolean match(char ch) { + return match(c -> ch == c); + } + + public boolean isAtEnd() { + return currentPosition.index == source.length(); + } + + /** A class to hold position data */ + @Data + private class Position { + int index = 0; + int line = 0; + int character = 0; + Position mark; + + Position(Position position) { + index = position.index; + line = position.line; + character = position.character; + } + + Position() {} + + Token produceToken(TokenType type) { + return new Token(line, character, index, currentPosition.index, type, source); + } + + void forward() { + if (source.charAt(index) == '\n') { + line++; + character = 0; + } else if (source.charAt(index) != '\r') { + character++; + } + index++; + } + + void mark() { + mark = new Position(this); + } + + void backToMark() { + this.index = mark.index; + this.character = mark.character; + this.line = mark.line; + } + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/TokenType.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/TokenType.java similarity index 84% rename from server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/TokenType.java rename to server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/TokenType.java index 401ec0da78..26d0d1b770 100644 --- a/server/parser/src/main/java/org/eclipse/lsp/cobol/core/hw/TokenType.java +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/parser/hw/lexer/TokenType.java @@ -14,13 +14,17 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.hw; +package org.eclipse.lsp.cobol.parser.hw.lexer; /** * Token types. */ public enum TokenType { WHITESPACE, + STRING_LITERAL, + NUMBER_LITERAL, + COBOL_WORD, NEW_LINE, + OTHER, EOF } diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/CobolLanguage.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/CobolLanguage.java new file mode 100644 index 0000000000..1eeca0bc18 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/CobolLanguage.java @@ -0,0 +1,581 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.rules; + +import java.util.*; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.data.DataDivisionRule; +import org.eclipse.lsp.cobol.rules.environment.EnvironmentDivisionRule; +import org.eclipse.lsp.cobol.rules.identification.IdentificationDivisionRule; +import org.eclipse.lsp.cobol.rules.procedure.*; +import org.eclipse.lsp.cobol.rules.procedure.statements.ImperativeStatementRule; +import org.eclipse.lsp.cobol.rules.procedure.statements.MoveRule; +import org.eclipse.lsp.cobol.rules.procedure.statements.PerformRule; + +/** A container for COBOL language grammar rules. */ +public class CobolLanguage { + private final Map, LanguageRule> languageRules = new HashMap<>(); + private final Set reservedWord = new HashSet<>(); + + public CobolLanguage() { + languageRules.put(SourceUnitRule.class, new SourceUnitRule()); + languageRules.put(ProgramRule.class, new ProgramRule()); + + languageRules.put(EnvironmentDivisionRule.class, new EnvironmentDivisionRule()); + languageRules.put(DataDivisionRule.class, new DataDivisionRule()); + languageRules.put(ProcedureDivisionRule.class, new ProcedureDivisionRule()); + + languageRules.put(DeclarativesRule.class, new DeclarativesRule()); + + languageRules.put(ParagraphRule.class, new ParagraphRule()); + languageRules.put(IdentificationDivisionRule.class, new IdentificationDivisionRule()); + languageRules.put(SectionRule.class, new SectionRule()); + languageRules.put(SentenceRule.class, new SentenceRule()); + languageRules.put(PerformRule.class, new PerformRule()); + languageRules.put(MoveRule.class, new MoveRule()); + languageRules.put(ImperativeStatementRule.class, new ImperativeStatementRule()); + languageRules.put(ConditionExpressionRule.class, new ConditionExpressionRule()); + + //// Reserved Words P. 761 + // Arithmetic operator + reservedWord.add("+"); + reservedWord.add("-"); + reservedWord.add("*"); + reservedWord.add("/"); + reservedWord.add("**"); + reservedWord.add(">"); + reservedWord.add("<"); + reservedWord.add("="); + reservedWord.add("=="); + reservedWord.add(">="); + reservedWord.add("<="); + reservedWord.add("<>"); + reservedWord.add("*>"); + reservedWord.add(">>"); + // + reservedWord.add("ACCEPT"); + reservedWord.add("ACCESS"); + reservedWord.add("ACTIVE-CLASS"); + reservedWord.add("ADD"); + reservedWord.add("ADDRESS"); + reservedWord.add("ADVANCING"); + reservedWord.add("AFTER"); + reservedWord.add("ALIGNED"); + reservedWord.add("ALL"); + reservedWord.add("ALLOCATE"); + reservedWord.add("ALPHABET"); + reservedWord.add("ALPHABETIC"); + reservedWord.add("ALPHABETIC-LOWER"); + reservedWord.add("ALPHABETIC-UPPER"); + reservedWord.add("ALPHANUMERIC"); + reservedWord.add("ALPHANUMERIC-EDITED"); + reservedWord.add("ALSO"); + reservedWord.add("ALTER"); + reservedWord.add("ALTERNATE"); + reservedWord.add("AND"); + reservedWord.add("ANY"); + reservedWord.add("ANYCASE"); + reservedWord.add("APPLY"); + reservedWord.add("ARE"); + reservedWord.add("AREA"); + reservedWord.add("AREAS"); + reservedWord.add("ASCENDING"); + reservedWord.add("ASSIGN"); + reservedWord.add("AT"); + reservedWord.add("AUTHOR"); + reservedWord.add("BASIS"); + reservedWord.add("BEFORE"); + reservedWord.add("BEGINNING"); + reservedWord.add("BINARY"); + reservedWord.add("BLANK"); + reservedWord.add("BLOCK"); + reservedWord.add("BOTTOM"); + reservedWord.add("BY"); + reservedWord.add("BYTE-LENGTH"); + reservedWord.add("CALL"); + reservedWord.add("CANCEL"); + reservedWord.add("CBL"); + reservedWord.add("CD"); + reservedWord.add("CF"); + reservedWord.add("CH"); + reservedWord.add("CHARACTER"); + reservedWord.add("CHARACTERS"); + reservedWord.add("CLASS"); + reservedWord.add("CLASS-ID"); + reservedWord.add("CLOCK-UNITS"); + reservedWord.add("CLOSE"); + reservedWord.add("COBOL"); + reservedWord.add("CODE"); + reservedWord.add("CODE-SET"); + reservedWord.add("COLLATING"); + reservedWord.add("COLUMN"); + reservedWord.add("COM-REG"); + reservedWord.add("COMMA"); + reservedWord.add("COMMON"); + reservedWord.add("COMMUNICATION"); + reservedWord.add("COMP"); + reservedWord.add("COMP-1"); + reservedWord.add("COMP-2"); + reservedWord.add("COMP-3"); + reservedWord.add("COMP-4"); + reservedWord.add("COMP-5"); + reservedWord.add("COMPUTATIONAL"); + reservedWord.add("COMPUTATIONAL-1"); + reservedWord.add("COMPUTATIONAL-2"); + reservedWord.add("COMPUTATIONAL-3"); + reservedWord.add("COMPUTATIONAL-4"); + reservedWord.add("COMPUTATIONAL-5"); + reservedWord.add("COMPUTE"); + reservedWord.add("CONFIGURATION"); + reservedWord.add("CONTAINS"); + reservedWord.add("CONTENT"); + reservedWord.add("CONTINUE"); + reservedWord.add("CONTROL"); + reservedWord.add("CONTROLS"); + reservedWord.add("CONVERTING"); + reservedWord.add("COPY"); + reservedWord.add("CORR"); + reservedWord.add("CORRESPONDING"); + reservedWord.add("COUNT"); + reservedWord.add("CURRENCY"); + reservedWord.add("DATA"); + reservedWord.add("DATE"); + reservedWord.add("DATE-COMPILED"); + reservedWord.add("DATE-WRITTEN"); + reservedWord.add("DAY"); + reservedWord.add("DAY-OF-WEEK"); + reservedWord.add("DBCS"); + reservedWord.add("DE"); + reservedWord.add("DEBUG-CONTENTS"); + reservedWord.add("DEBUG-ITEM"); + reservedWord.add("DEBUG-LINE"); + reservedWord.add("DEBUG-NAME"); + reservedWord.add("DEBUG-SUB-1"); + reservedWord.add("DEBUG-SUB-2"); + reservedWord.add("DEBUG-SUB-3"); + reservedWord.add("DEBUGGING"); + reservedWord.add("DECIMAL-POINT"); + reservedWord.add("DECLARATIVES"); + reservedWord.add("DEFAULT"); + reservedWord.add("DELETE"); + reservedWord.add("DELIMITED"); + reservedWord.add("DELIMITER"); + reservedWord.add("DEPENDING"); + reservedWord.add("DESCENDING"); + reservedWord.add("DESTINATION"); + reservedWord.add("DETAIL"); + reservedWord.add("DISABLE"); + reservedWord.add("DISPLAY"); + reservedWord.add("DISPLAY-1"); + reservedWord.add("DIVIDE"); + reservedWord.add("DIVISION"); + reservedWord.add("DOWN"); + reservedWord.add("DUPLICATES"); + reservedWord.add("DYNAMIC"); + reservedWord.add("EGCS"); + reservedWord.add("EGI"); + reservedWord.add("EJECT"); + reservedWord.add("ELSE"); + reservedWord.add("EMI"); + reservedWord.add("ENABLE"); + reservedWord.add("END"); + reservedWord.add("END-ADD"); + reservedWord.add("END-CALL"); + reservedWord.add("END-COMPUTE"); + reservedWord.add("END-DELETE"); + reservedWord.add("END-DIVIDE"); + reservedWord.add("END-EVALUATE"); + reservedWord.add("END-EXEC"); + reservedWord.add("END-IF"); + reservedWord.add("END-INVOKE"); + reservedWord.add("END-JSON"); + reservedWord.add("END-MULTIPLY"); + reservedWord.add("END-OF-PAGE"); + reservedWord.add("END-PERFORM"); + reservedWord.add("END-READ"); + reservedWord.add("END-RECEIVE"); + reservedWord.add("END-RETURN"); + reservedWord.add("END-REWRITE"); + reservedWord.add("END-SEARCH"); + reservedWord.add("END-START"); + reservedWord.add("END-STRING"); + reservedWord.add("END-SUBTRACT"); + reservedWord.add("END-UNSTRING"); + reservedWord.add("END-WRITE"); + reservedWord.add("END-XML"); + reservedWord.add("ENDING"); + reservedWord.add("ENTER"); + reservedWord.add("ENTRY"); + reservedWord.add("ENVIRONMENT"); + reservedWord.add("EOP"); + reservedWord.add("EQUAL"); + reservedWord.add("ERROR"); + reservedWord.add("ESI"); + reservedWord.add("EVALUATE"); + reservedWord.add("EVERY"); + reservedWord.add("EXCEPTION"); + reservedWord.add("EXEC"); + reservedWord.add("EXECUTE"); + reservedWord.add("EXIT"); + reservedWord.add("EXTEND"); + reservedWord.add("EXTERNAL"); + reservedWord.add("FACTORY"); + reservedWord.add("FALSE"); + reservedWord.add("FD"); + reservedWord.add("FILE"); + reservedWord.add("FILE-CONTROL"); + reservedWord.add("FILLER"); + reservedWord.add("FINAL"); + reservedWord.add("FIRST"); + reservedWord.add("FOOTING"); + reservedWord.add("FOR"); + reservedWord.add("FREE"); + reservedWord.add("FROM"); + reservedWord.add("FUNCTION"); + reservedWord.add("FUNCTION-ID"); + reservedWord.add("FUNCTION-POINTER"); + reservedWord.add("GENERATE"); + reservedWord.add("GIVING"); + reservedWord.add("GLOBAL"); + reservedWord.add("GO"); + reservedWord.add("GOBACK"); + reservedWord.add("GREATER"); + reservedWord.add("GROUP"); + reservedWord.add("GROUP-USAGE"); + reservedWord.add("HEADING"); + reservedWord.add("HIGH-VALUE"); + reservedWord.add("HIGH-VALUES"); + reservedWord.add("I-O"); + reservedWord.add("I-O-CONTROL"); + reservedWord.add("ID"); + reservedWord.add("IDENTIFICATION"); + reservedWord.add("IF"); + reservedWord.add("IN"); + reservedWord.add("INDEX"); + reservedWord.add("INDEXED"); + reservedWord.add("INDICATE"); + reservedWord.add("INHERITS"); + reservedWord.add("INITIAL"); + reservedWord.add("INITIALIZE"); + reservedWord.add("INITIATE"); + reservedWord.add("INPUT"); + reservedWord.add("INPUT-OUTPUT"); + reservedWord.add("INSERT"); + reservedWord.add("INSPECT"); + reservedWord.add("INSTALLATION"); + reservedWord.add("INTO"); + reservedWord.add("INVALID"); + reservedWord.add("INVOKE"); + reservedWord.add("IS"); + reservedWord.add("JAVA"); + reservedWord.add("JNIENVPTR"); + reservedWord.add("JSON"); + reservedWord.add("JSON-CODE"); + reservedWord.add("JSON-STATUS"); + reservedWord.add("JUST"); + reservedWord.add("JUSTIFIED"); + reservedWord.add("KANJI"); + reservedWord.add("KEY"); + reservedWord.add("LABEL"); + reservedWord.add("LAST"); + reservedWord.add("LEADING"); + reservedWord.add("LEFT"); + reservedWord.add("LENGTH"); + reservedWord.add("LESS"); + reservedWord.add("LIMIT"); + reservedWord.add("LIMITS"); + reservedWord.add("LINAGE"); + reservedWord.add("LINAGE-COUNTER"); + reservedWord.add("LINE"); + reservedWord.add("LINE-COUNTER"); + reservedWord.add("LINES"); + reservedWord.add("LINKAGE"); + reservedWord.add("LOCAL-STORAGE"); + reservedWord.add("LOCK"); + reservedWord.add("LOW-VALUE"); + reservedWord.add("LOW-VALUES"); + reservedWord.add("MEMORY"); + reservedWord.add("MERGE"); + reservedWord.add("MESSAGE"); + reservedWord.add("METHOD"); + reservedWord.add("METHOD-ID"); + reservedWord.add("MODE"); + reservedWord.add("MODULES"); + reservedWord.add("MORE-LABELS"); + reservedWord.add("MOVE"); + reservedWord.add("MULTIPLE"); + reservedWord.add("MULTIPLY"); + reservedWord.add("NATIONAL"); + reservedWord.add("NATIONAL-EDITED"); + reservedWord.add("NATIVE"); + reservedWord.add("NEGATIVE"); + reservedWord.add("NEXT"); + reservedWord.add("NO"); + reservedWord.add("NOT"); + reservedWord.add("NULL"); + reservedWord.add("NULLS"); + reservedWord.add("NUMBER"); + reservedWord.add("NUMERIC"); + reservedWord.add("NUMERIC-EDITED"); + reservedWord.add("OBJECT"); + reservedWord.add("OBJECT-COMPUTER"); + reservedWord.add("OCCURS"); + reservedWord.add("OF"); + reservedWord.add("OFF"); + reservedWord.add("OMITTED"); + reservedWord.add("ON"); + reservedWord.add("OPEN"); + reservedWord.add("OPTIONAL"); + reservedWord.add("OPTIONS"); + reservedWord.add("OR"); + reservedWord.add("ORDER"); + reservedWord.add("ORGANIZATION"); + reservedWord.add("OTHER"); + reservedWord.add("OUTPUT"); + reservedWord.add("OVERFLOW"); + reservedWord.add("OVERRIDE"); + reservedWord.add("PACKED-DECIMAL"); + reservedWord.add("PADDING"); + reservedWord.add("PAGE"); + reservedWord.add("PAGE-COUNTER"); + reservedWord.add("PASSWORD"); + reservedWord.add("PERFORM"); + reservedWord.add("PF"); + reservedWord.add("PH"); + reservedWord.add("PIC"); + reservedWord.add("PICTURE"); + reservedWord.add("PLUS"); + reservedWord.add("POINTER"); + reservedWord.add("POINTER-32"); + reservedWord.add("POSITION"); + reservedWord.add("POSITIVE"); + reservedWord.add("PRINTING"); + reservedWord.add("PROCEDURE"); + reservedWord.add("PROCEDURE-POINTER"); + reservedWord.add("PROCEDURES"); + reservedWord.add("PROCEED"); + reservedWord.add("PROCESSING"); + reservedWord.add("PROGRAM"); + reservedWord.add("PROGRAM-ID"); + reservedWord.add("PROTOTYPE"); + reservedWord.add("PURGE"); + reservedWord.add("QUEUE"); + reservedWord.add("QUOTE"); + reservedWord.add("QUOTES"); + reservedWord.add("RANDOM"); + reservedWord.add("RD"); + reservedWord.add("READ"); + reservedWord.add("READY"); + reservedWord.add("RECEIVE"); + reservedWord.add("RECORD"); + reservedWord.add("RECORDING"); + reservedWord.add("RECORDS"); + reservedWord.add("RECURSIVE"); + reservedWord.add("REDEFINES"); + reservedWord.add("REEL"); + reservedWord.add("REFERENCE"); + reservedWord.add("REFERENCES"); + reservedWord.add("RELATIVE"); + reservedWord.add("RELEASE"); + reservedWord.add("RELOAD"); + reservedWord.add("REMAINDER"); + reservedWord.add("REMOVAL"); + reservedWord.add("RENAMES"); + reservedWord.add("REPLACE"); + reservedWord.add("REPLACING"); + reservedWord.add("REPORT"); + reservedWord.add("REPORTING"); + reservedWord.add("REPORTS"); + reservedWord.add("REPOSITORY"); + reservedWord.add("RERUN"); + reservedWord.add("RESERVE"); + reservedWord.add("RESET"); + reservedWord.add("RESUME"); + reservedWord.add("RETRY"); + reservedWord.add("RETURN"); + reservedWord.add("RETURN-CODE"); + reservedWord.add("RETURNING"); + reservedWord.add("REVERSED"); + reservedWord.add("REWIND"); + reservedWord.add("REWRITE"); + reservedWord.add("RF"); + reservedWord.add("RH"); + reservedWord.add("RIGHT"); + reservedWord.add("ROUNDED"); + reservedWord.add("RUN"); + reservedWord.add("SAME"); + reservedWord.add("SD"); + reservedWord.add("SEARCH"); + reservedWord.add("SECTION"); + reservedWord.add("SECURITY"); + reservedWord.add("SEGMENT"); + reservedWord.add("SEGMENT-LIMIT"); + reservedWord.add("SELECT"); + reservedWord.add("SELF"); + reservedWord.add("SEND"); + reservedWord.add("SENTENCE"); + reservedWord.add("SEPARATE"); + reservedWord.add("SEQUENCE"); + reservedWord.add("SEQUENTIAL"); + reservedWord.add("SERVICE"); + reservedWord.add("SET"); + reservedWord.add("SHIFT-IN"); + reservedWord.add("SHIFT-OUT"); + reservedWord.add("SIGN"); + reservedWord.add("SIZE"); + reservedWord.add("SKIP1"); + reservedWord.add("SKIP2"); + reservedWord.add("SKIP3"); + reservedWord.add("SORT"); + reservedWord.add("SORT-CONTROL"); + reservedWord.add("SORT-CORE-SIZE"); + reservedWord.add("SORT-FILE-SIZE"); + reservedWord.add("SORT-MERGE"); + reservedWord.add("SORT-MESSAGE"); + reservedWord.add("SORT-MODE-SIZE"); + reservedWord.add("SORT-RETURN"); + reservedWord.add("SOURCE"); + reservedWord.add("SOURCE-COMPUTER"); + reservedWord.add("SPACE"); + reservedWord.add("SPACES"); + reservedWord.add("SPECIAL-NAMES"); + reservedWord.add("SQL"); + reservedWord.add("SQLIMS"); + reservedWord.add("STANDARD"); + reservedWord.add("STANDARD-1"); + reservedWord.add("STANDARD-2"); + reservedWord.add("START"); + reservedWord.add("STATUS"); + reservedWord.add("STOP"); + reservedWord.add("STRING"); + reservedWord.add("SUB-QUEUE-1"); + reservedWord.add("SUB-QUEUE-2"); + reservedWord.add("SUB-QUEUE-3"); + reservedWord.add("SUBTRACT"); + reservedWord.add("SUM"); + reservedWord.add("SUPER"); + reservedWord.add("SUPPRESS"); + reservedWord.add("SYMBOLIC"); + reservedWord.add("SYNC"); + reservedWord.add("SYNCHRONIZED"); + reservedWord.add("TABLE"); + reservedWord.add("TALLY"); + reservedWord.add("TALLYING"); + reservedWord.add("TAPE"); + reservedWord.add("TERMINAL"); + reservedWord.add("TERMINATE"); + reservedWord.add("TEST"); + reservedWord.add("TEXT"); + reservedWord.add("THAN"); + reservedWord.add("THEN"); + reservedWord.add("THROUGH"); + reservedWord.add("THRU"); + reservedWord.add("TIME"); + reservedWord.add("TIMES"); + reservedWord.add("TITLE"); + reservedWord.add("TO"); + reservedWord.add("TOP"); + reservedWord.add("TRACE"); + reservedWord.add("TRAILING"); + reservedWord.add("TRUE"); + reservedWord.add("TYPE"); + reservedWord.add("UNIT"); + reservedWord.add("UNSTRING"); + reservedWord.add("UNTIL"); + reservedWord.add("UP"); + reservedWord.add("UPON"); + reservedWord.add("USAGE"); + reservedWord.add("USE"); + reservedWord.add("USING"); + reservedWord.add("UTF-8"); + reservedWord.add("VALUE"); + reservedWord.add("VALUES"); + reservedWord.add("VARYING"); + reservedWord.add("VOLATILE"); + reservedWord.add("WHEN"); + reservedWord.add("WHEN-COMPILED"); + reservedWord.add("WITH"); + reservedWord.add("WORDS"); + reservedWord.add("WORKING-STORAGE"); + reservedWord.add("WRITE"); + reservedWord.add("WRITE-ONLY"); + reservedWord.add("XML"); + reservedWord.add("XML-CODE"); + reservedWord.add("XML-EVENT"); + reservedWord.add("XML-INFORMATION"); + reservedWord.add("XML-NAMESPACE"); + reservedWord.add("XML-NAMESPACE-PREFIX"); + reservedWord.add("XML-NNAMESPACE"); + reservedWord.add("XML-NNAMESPACE-PREFIX"); + reservedWord.add("XML-NTEXT"); + reservedWord.add("XML-SCHEMA"); + reservedWord.add("XML-TEXT"); + reservedWord.add("ZERO"); + reservedWord.add("ZEROES"); + reservedWord.add("ZEROS"); + } + + /** + * Is the next sequence of tokens can be this rule. + * + * @param ruleClass a rule class. + * @param ctx parsing relater api. + * @return true if rule matches. + */ + public boolean tryMatchRule(Class ruleClass, ParsingContext ctx) { + return languageRules.get(ruleClass).tryMatch(ctx, this); + } + + /** + * Parse the rule. + * + * @param ruleClass a rule class. + * @param ctx parsing relater api. + */ + public void parseRule(Class ruleClass, ParsingContext ctx) { + languageRules.get(ruleClass).parse(ctx, this); + } + + /** + * Parse the rule if it matches. A combination of tryMatch and parse method calls. + * + * @param ruleClass a rule class + * @param ctx parsing relater api. + * @return optional true if rule matched even if parsing had errors. + */ + public Optional tryParseRule( + Class ruleClass, ParsingContext ctx) { + LanguageRule rule = languageRules.get(ruleClass); + if (rule.tryMatch(ctx, this)) { + rule.parse(ctx, this); + return Optional.of(true); + } + return Optional.empty(); + } + + /** + * Checks if lexeme can be user defined word + * + * @param lexeme a string to check + * @return true/false + */ + public boolean isUserDefinedWord(String lexeme) { + // P.11: A reserved word cannot be used as a user-defined word or as a system-name. + return !isReservedWord(lexeme); + } + + private boolean isReservedWord(String lexeme) { + return reservedWord.contains(lexeme); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/CobolLanguageUtils.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/CobolLanguageUtils.java new file mode 100644 index 0000000000..2df1a358d4 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/CobolLanguageUtils.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.rules; + +import lombok.experimental.UtilityClass; +import org.eclipse.lsp.cobol.cst.Skipped; +import org.eclipse.lsp.cobol.cst.base.CstNode; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.parser.hw.lexer.Token; +import org.eclipse.lsp.cobol.parser.hw.lexer.TokenType; + + +/** + * Language related utilities. + * FIXME: some methods doesn't belong here and should be evicted. + */ +@UtilityClass +public class CobolLanguageUtils { + /** + * Checks if token is in aria A. + * + * @param token a token to check. + * @return true if the token is in aria A. + */ + public boolean isInAriaA(Token token) { + return token.getStartPositionInLine() >= 7 && token.getStartPositionInLine() <= 10; + } + + /** + * Check for the end of the program. + * + * @param ctx parsing relater api. + * @return true if it is the end of the program. + */ + public boolean isEndOfProgram(ParsingContext ctx) { + return ctx.matchSeq("END", "PROGRAM"); + } + + /** + * Mark tokens as skipped. + * TODO: Probably it shouldn't be in utils. + * + * @param ctx parsing relater api. + * @param token a token to skip. + */ + public void skip(ParsingContext ctx, Token token) { + if (ctx.peek().getChildren().isEmpty()) { + Skipped s = new Skipped(); + s.getChildren().add(token); + ctx.peek().getChildren().add(s); + return; + } + + CstNode lastChild = ctx.peek().getChildren().get(ctx.peek().getChildren().size() - 1); + if (lastChild instanceof Skipped) { + lastChild.getChildren().add(token); + } else { + Skipped s = new Skipped(); + s.getChildren().add(token); + ctx.peek().getChildren().add(s); + } + } + + /** + * Check if next is division start or the end of the program. + * TODO: Probably it shouldn't be in utils. + * + * @param ctx parsing relater api. + * @return true if it is the division or eop. + */ + public boolean isNextDivisionEofOrEop(ParsingContext ctx) { + if (ctx.getLexer().peek().getType() == TokenType.EOF) { + return true; + } + if (CobolLanguageUtils.isEndOfProgram(ctx)) { + return true; + } + + if (ctx.matchSeq("ID", "DIVISION", ".")) { + return true; + } + if (ctx.matchSeq("IDENTIFICATION", "DIVISION", ".")) { + return true; + } + if (ctx.matchSeq("ENVIRONMENT", "DIVISION", ".")) { + return true; + } + if (ctx.matchSeq("DATA", "DIVISION", ".")) { + return true; + } + return ctx.matchSeq("PROCEDURE", "DIVISION"); + } + +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/LanguageRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/LanguageRule.java new file mode 100644 index 0000000000..8e6f0bf815 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/LanguageRule.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.rules; + +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; + +import java.util.Optional; + +/** + * Language grammar rule. + */ +public interface LanguageRule { + /** + * Parse the rule. + * + * @param ctx parsing relater api. + * @param language language description. + */ + void parse(ParsingContext ctx, CobolLanguage language); + + /** + * Is the next sequence of tokens can be this rule. + * + * @param ctx parsing relater api. + * @param language language description. + * @return true if rule matches. + */ + boolean tryMatch(ParsingContext ctx, CobolLanguage language); + + /** + * Parse the rule if it matches. A combination of tryMatch and parse method calls. + * + * @param ctx parsing relater api. + * @param language language description. + * @return optional true if rule matched even if parsing had errors. + */ + default Optional tryParse(ParsingContext ctx, CobolLanguage language) { + if (tryMatch(ctx, language)) { + parse(ctx, language); + return Optional.of(true); + } + return Optional.empty(); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/ProgramRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/ProgramRule.java new file mode 100644 index 0000000000..0607e5ca33 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/ProgramRule.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.rules; + +import org.eclipse.lsp.cobol.cst.IdentificationDivision; +import org.eclipse.lsp.cobol.cst.ProgramUnit; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.data.DataDivisionRule; +import org.eclipse.lsp.cobol.rules.environment.EnvironmentDivisionRule; +import org.eclipse.lsp.cobol.rules.identification.IdentificationDivisionRule; +import org.eclipse.lsp.cobol.rules.procedure.ProcedureDivisionRule; + +/** COBOL language grammar rule class. */ +public class ProgramRule implements LanguageRule { + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + try { + ProgramUnit programUnit = new ProgramUnit(); + ctx.push(programUnit); + language.parseRule(IdentificationDivisionRule.class, ctx); + programUnit.setName( + ((IdentificationDivision) ctx.peek().getChildren().get(0)).getProgramName()); + language.tryParseRule(EnvironmentDivisionRule.class, ctx); + language.tryParseRule(DataDivisionRule.class, ctx); + language.tryParseRule(ProcedureDivisionRule.class, ctx); + + if (ctx.matchSeq("ID", "DIVISION", ".") || ctx.matchSeq("IDENTIFICATION", "DIVISION", ".")) { + ctx.spaces(); + language.parseRule(ProgramRule.class, ctx); + } + + if (CobolLanguageUtils.isEndOfProgram(ctx)) { + ctx.spaces(); + ctx.consume("END"); + ctx.spaces(); + ctx.consume("PROGRAM"); + ctx.spaces(); + ctx.consume(); // programId + ctx.consume("."); + ctx.spaces(); + } + } finally { + ctx.popAndAttach(); + } + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + return false; + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/SourceUnitRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/SourceUnitRule.java new file mode 100644 index 0000000000..dc9665b9f4 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/SourceUnitRule.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.rules; + +import org.eclipse.lsp.cobol.cst.SourceUnit; +import org.eclipse.lsp.cobol.parser.hw.*; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.lexer.Token; +import org.eclipse.lsp.cobol.parser.hw.lexer.TokenType; + +import java.util.Objects; + +/** + * COBOL language grammar rule class. + */ +public class SourceUnitRule implements LanguageRule { + + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + ctx.push(new SourceUnit()); + while (ctx.getLexer().hasMore()) { + try { + ctx.spaces(); + if (ctx.matchSeq("IDENTIFICATION", "DIVISION") || ctx.matchSeq("ID", "DIVISION")) { + language.parseRule(ProgramRule.class, ctx); + } else { + Token token = ctx.getLexer().forward(); + CobolLanguageUtils.skip(ctx, token); + ctx.error(token, "Unknown input: '" + token.getLexeme() + "'"); + } + ctx.spaces(); + } catch (ParseError error) { + synchronize(ctx); + } + } + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + // this implementation shouldn't be called + return true; + } + + private void synchronize(ParsingContext ctx) { + CobolLexer lexer = ctx.getLexer(); + Token t = lexer.forward(); + while (t.getType() != TokenType.EOF && !isContinuationSymbol(t)) { + CobolLanguageUtils.skip(ctx, t); + t = lexer.forward(); + } + if (t.getType() != TokenType.EOF) { + CobolLanguageUtils.skip(ctx, t); + } + } + + private boolean isContinuationSymbol(Token t) { + return Objects.equals(t.getLexeme(), "."); + } + +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/data/DataDivisionRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/data/DataDivisionRule.java new file mode 100644 index 0000000000..aecf024863 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/data/DataDivisionRule.java @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.rules.data; + +import org.eclipse.lsp.cobol.cst.DataDivision; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.CobolLanguageUtils; +import org.eclipse.lsp.cobol.rules.LanguageRule; + +/** + * COBOL language grammar rule class. + */ +public class DataDivisionRule implements LanguageRule { + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + ctx.spaces(); + ctx.push(new DataDivision()); + ctx.consume("DATA"); + ctx.spaces(); + ctx.consume("DIVISION"); + ctx.consume("."); + ctx.spaces(); + try { + while (!CobolLanguageUtils.isNextDivisionEofOrEop(ctx)) { + ctx.consume(); + } + } finally { + ctx.popAndAttach(); + } + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + return ctx.matchSeq("DATA", "DIVISION", "."); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/environment/EnvironmentDivisionRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/environment/EnvironmentDivisionRule.java new file mode 100644 index 0000000000..9f8711a2bf --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/environment/EnvironmentDivisionRule.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.rules.environment; + +import org.eclipse.lsp.cobol.cst.EnvironmentDivision; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.CobolLanguageUtils; +import org.eclipse.lsp.cobol.rules.LanguageRule; + +/** + * COBOL language grammar rule class. + */ +public class EnvironmentDivisionRule implements LanguageRule { + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + ctx.spaces(); + ctx.push(new EnvironmentDivision()); + ctx.consume("ENVIRONMENT"); + ctx.spaces(); + ctx.consume("DIVISION"); + ctx.consume("."); + ctx.spaces(); + try { + while (!CobolLanguageUtils.isNextDivisionEofOrEop(ctx)) { + ctx.consume(); + } + } finally { + ctx.popAndAttach(); + } + + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + return ctx.matchSeq("ENVIRONMENT", "DIVISION", "."); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/identification/IdentificationDivisionRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/identification/IdentificationDivisionRule.java new file mode 100644 index 0000000000..1e9fddee49 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/identification/IdentificationDivisionRule.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.rules.identification; + +import org.eclipse.lsp.cobol.cst.IdentificationDivision; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.CobolLanguageUtils; +import org.eclipse.lsp.cobol.rules.LanguageRule; + +/** COBOL language grammar rule class. */ +public class IdentificationDivisionRule implements LanguageRule { + + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + try { + ctx.push(new IdentificationDivision()); + ctx.or("ID", "IDENTIFICATION"); + ctx.spaces(); + ctx.consume("DIVISION"); + ctx.consume("."); + ctx.spaces(); + ctx.consume("PROGRAM-ID"); + ctx.optional("."); + ctx.spaces(); + ((IdentificationDivision) ctx.peek()).setProgramName(ctx.getLexer().peek().getLexeme()); + ctx.consume(); + ctx.spaces(); + if (ctx.match("IS")) { + ctx.consume("IS"); + ctx.spaces(); + ctx.or("RECURSIVE", "INITIAL", "COMMON"); + ctx.spaces(); + ctx.optional("INITIAL"); + ctx.optional("COMMON"); + ctx.optional("PROGRAM"); + } else if (ctx.match("RECURSIVE", "INITIAL")) { + ctx.spaces(); + ctx.optional("PROGRAM"); + } + ctx.spaces(); + ctx.optional("."); + // Consume Identification Division Content + while (!CobolLanguageUtils.isNextDivisionEofOrEop(ctx)) { + ctx.consume(); + } + } finally { + ctx.popAndAttach(); + } + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + // as for now it's detected in Program rule + return true; + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ConditionExpressionRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ConditionExpressionRule.java new file mode 100644 index 0000000000..a7eb3a8bba --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ConditionExpressionRule.java @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.rules.procedure; + +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.LanguageRule; + +/** Condition rule */ +public class ConditionExpressionRule implements LanguageRule { + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + // Format 1: general relation condition P.273 + ctx.optional("NOT"); + ctx.spaces(); + conditionOperand(ctx, language); + ctx.optional("IS"); + ctx.spaces(); + if (ctx.match(">=", "<=")) { + ctx.or(">=", "<="); + ctx.spaces(); + ctx.consume(); // operand-2 + ctx.spaces(); + compositeCondition(ctx, language); + return; + } + ctx.optional("NOT"); + ctx.spaces(); + if (ctx.match("GREATER", "LESS")) { + ctx.or("GREATER", "LESS"); + ctx.spaces(); + ctx.optional("THAN"); + ctx.spaces(); + if (ctx.match("OR")) { + ctx.consume("OR"); + ctx.spaces(); + ctx.consume("EQUAL"); + ctx.spaces(); + ctx.optional("TO"); + ctx.spaces(); + } + conditionOperand(ctx, language); // operand-2 + ctx.spaces(); + compositeCondition(ctx, language); + return; + } + ctx.optional("NOT"); + ctx.spaces(); + if (ctx.match("<", ">", "=")) { + ctx.or("<", ">", "="); + ctx.spaces(); + ctx.spaces(); + ctx.consume(); // operand-2 + ctx.spaces(); + compositeCondition(ctx, language); + return; + } + if (ctx.match("EQUAL")) { + ctx.consume("EQUAL"); + ctx.spaces(); + ctx.optional("TO"); + ctx.spaces(); + ctx.consume(); // operand-2 + ctx.spaces(); + } + compositeCondition(ctx, language); + } + + private void conditionOperand(ParsingContext ctx, CobolLanguage language) { + if (ctx.match("(")) { + ctx.consume("("); + do { + conditionOperand(ctx, language); + } while (!ctx.match(")")); + ctx.consume(")"); + ctx.spaces(); + return; + } + if (ctx.match("FUNCTION")) { + functionIdentifier(ctx); + return; + } + identifier(ctx); + // p. 267 + if (ctx.match("+", "-", "*", "/", "**")) { + ctx.or("+", "-", "*", "/", "**"); + ctx.spaces(); + conditionOperand(ctx, language); + } + } + + private void compositeCondition(ParsingContext ctx, CobolLanguage language) { + if (ctx.match("AND", "OR")) { + ctx.or("AND", "OR"); + ctx.spaces(); + ctx.optional("NOT"); + ctx.spaces(); + conditionOperand(ctx, language); // operand-1 + ctx.optional("IS"); + ctx.spaces(); + if (ctx.match(">=", "<=")) { + ctx.or(">=", "<="); + ctx.spaces(); + ctx.consume(); // operand-2 + ctx.spaces(); + compositeCondition(ctx, language); + return; + } + ctx.optional("NOT"); + ctx.spaces(); + if (ctx.match("GREATER", "LESS")) { + ctx.or("GREATER", "LESS"); + ctx.spaces(); + ctx.optional("THAN"); + ctx.spaces(); + if (ctx.match("OR")) { + ctx.consume("OR"); + ctx.spaces(); + ctx.consume("EQUAL"); + ctx.spaces(); + ctx.optional("TO"); + ctx.spaces(); + } + ctx.consume(); // operand-2 + ctx.spaces(); + compositeCondition(ctx, language); + return; + } + ctx.optional("NOT"); + ctx.spaces(); + if (ctx.match("<", ">", "=")) { + ctx.or("<", ">", "="); + ctx.spaces(); + ctx.spaces(); + ctx.consume(); // operand-2 + ctx.spaces(); + compositeCondition(ctx, language); + return; + } + if (ctx.match("EQUAL")) { + ctx.consume("EQUAL"); + ctx.spaces(); + ctx.optional("TO"); + ctx.spaces(); + ctx.consume(); // operand-2 + ctx.spaces(); + } + compositeCondition(ctx, language); + } + } + + private void functionIdentifier(ParsingContext ctx) { + ctx.consume("FUNCTION"); + ctx.spaces(); + ctx.consume(); // function-name-1 + ctx.spaces(); + if (ctx.match("(")) { + ctx.spaces(); + while (!ctx.match(")")) { + ctx.consume(); // argument-1 + ctx.spaces(); + } + ctx.consume(")"); + ctx.spaces(); + } + // TODO: optional reference-modifier + } + + // TODO: move to rule? + private void identifier(ParsingContext ctx) { + ctx.consume(); + ctx.spaces(); + if (ctx.match("(")) { + ctx.consume("("); + ctx.spaces(); + do { + ctx.consume(); // indexes + ctx.spaces(); + } while (!ctx.match(")")); + ctx.consume(")"); // index + ctx.spaces(); + } + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + // TODO TBD + return isClassCondition(ctx); + } + + // P. 268 + private boolean isClassCondition(ParsingContext ctx) { + return true; + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/DeclarativesRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/DeclarativesRule.java new file mode 100644 index 0000000000..8d1175de6d --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/DeclarativesRule.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.rules.procedure; + +import org.eclipse.lsp.cobol.cst.procedure.Declaratives; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.CobolLanguageUtils; +import org.eclipse.lsp.cobol.rules.LanguageRule; + +/** + * Declaratives Rule + */ +// TODO: add link to language reference document. +public class DeclarativesRule implements LanguageRule { + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + ctx.spaces(); + ctx.push(new Declaratives()); + ctx.consume("DECLARATIVES"); + ctx.spaces(); + ctx.consume("."); + ctx.spaces(); + try { + while (!isDeclarativesEnd(ctx)) { + ctx.consume(); + ctx.spaces(); + } + ctx.spaces(); + ctx.consume("END"); + ctx.spaces(); + ctx.consume("DECLARATIVES"); + ctx.spaces(); + ctx.consume("."); + } finally { + ctx.popAndAttach(); + } + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + return ctx.matchSeq("DECLARATIVES", ".") + && CobolLanguageUtils.isInAriaA(ctx.getLexer().peek()); + } + + private boolean isDeclarativesEnd(ParsingContext ctx) { + return ctx.matchSeq("END", "DECLARATIVES", "."); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ParagraphRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ParagraphRule.java new file mode 100644 index 0000000000..3e3e9857f6 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ParagraphRule.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.rules.procedure; + +import org.eclipse.lsp.cobol.cst.procedure.Paragraph; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.parser.hw.lexer.Token; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.CobolLanguageUtils; +import org.eclipse.lsp.cobol.rules.LanguageRule; + +/** COBOL language grammar rule class. */ +public class ParagraphRule implements LanguageRule { + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + try { + ctx.spaces(); + ctx.push(new Paragraph()); + ((Paragraph) ctx.peek()).setName(ctx.consume().toText()); + ctx.spaces(); + ctx.consume("."); + // Altered GO TO + if (ctx.matchSeq("GO", "TO", ".") || ctx.matchSeq("GO", ".")) { + ctx.spaces(); + ctx.consume("GO"); + ctx.spaces(); + ctx.optional("TO"); + ctx.spaces(); + ctx.consume("."); + return; + } + + ctx.spaces(); + while (!CobolLanguageUtils.isNextDivisionEofOrEop(ctx) + && !language.tryMatchRule(ParagraphRule.class, ctx) + && !language.tryMatchRule(SectionRule.class, ctx) + && !CobolLanguageUtils.isEndOfProgram(ctx)) { + language.parseRule(SentenceRule.class, ctx); + ctx.spaces(); + } + } finally { + ctx.popAndAttach(); + } + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + /* + * P.226: A user-defined word that identifies a paragraph. + * A paragraph-name, because it can be qualified, need not be unique. + */ + Token nameToken = ctx.getLexer().peek(); + if (!ctx.matchSeq(null, ".")) { + return false; + } + if ("DECLARATIVES".equalsIgnoreCase(nameToken.getLexeme())) { + return false; + } + if (!CobolLanguageUtils.isInAriaA(nameToken)) { + return false; + } + return true; + // TODO: check if keyword can be paragraph name +// language.isUserDefinedWord( +// ctx.getLexer().peekSeq(1, ParsingContext.SKIP_WHITESPACE_AND_NEWLINE).get(0).getLexeme()); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ProcedureDivisionRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ProcedureDivisionRule.java new file mode 100644 index 0000000000..f0955bb5da --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/ProcedureDivisionRule.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.rules.procedure; + +import org.eclipse.lsp.cobol.cst.procedure.ProcedureDivision; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.CobolLanguageUtils; +import org.eclipse.lsp.cobol.rules.LanguageRule; + +/** + * COBOL language grammar rule class. + */ +public class ProcedureDivisionRule implements LanguageRule { + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + ctx.spaces(); + ctx.push(new ProcedureDivision()); + procedureDivisionHeader(ctx); + ((ProcedureDivision) ctx.peek()).setBodyStartToken(ctx.getLexer().peek()); + try { + if (language.tryParseRule(DeclarativesRule.class, ctx).isPresent()) { + ctx.spaces(); + } + while (!CobolLanguageUtils.isNextDivisionEofOrEop(ctx) && !CobolLanguageUtils.isEndOfProgram(ctx)) { + if (language.tryMatchRule(ParagraphRule.class, ctx)) { + language.parseRule(ParagraphRule.class, ctx); + } else if (language.tryMatchRule(SectionRule.class, ctx)) { + language.tryParseRule(SectionRule.class, ctx); + } else { + language.tryParseRule(SentenceRule.class, ctx); + } + ctx.spaces(); + } + } finally { + ctx.popAndAttach(); + } + } + + private void procedureDivisionHeader(ParsingContext ctx) { + ctx.consume("PROCEDURE"); + ctx.spaces(); + ctx.consume("DIVISION"); + ctx.spaces(); + while (!ctx.match(".")) { + ctx.consume(); + } + ctx.consume("."); + ctx.spaces(); + } + + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + return ctx.matchSeq("PROCEDURE", "DIVISION"); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/SectionRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/SectionRule.java new file mode 100644 index 0000000000..a48fee469b --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/SectionRule.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.rules.procedure; + +import org.eclipse.lsp.cobol.cst.procedure.Section; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.parser.hw.lexer.TokenType; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.CobolLanguageUtils; +import org.eclipse.lsp.cobol.rules.LanguageRule; + +/** + * COBOL language grammar rule class. + */ +public class SectionRule implements LanguageRule { + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + ctx.spaces(); + ctx.push(new Section()); + ctx.consume(); + ctx.spaces(); + ctx.consume("SECTION"); + ctx.spaces(); + ctx.optional(TokenType.NUMBER_LITERAL); + ctx.spaces(); + ctx.consume("."); + ctx.spaces(); + ((Section) ctx.peek()).setBodyStartToken(ctx.getLexer().peek()); + try { + while (!CobolLanguageUtils.isNextDivisionEofOrEop(ctx) + && !language.tryMatchRule(ParagraphRule.class, ctx) + && !language.tryMatchRule(SectionRule.class, ctx) + && !CobolLanguageUtils.isEndOfProgram(ctx)) { + language.parseRule(SentenceRule.class, ctx); + ctx.spaces(); + } + } finally { + ctx.popAndAttach(); + } + + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + return (ctx.matchSeq(null, "SECTION", ".") + || ctx.matchSeq(null, "SECTION", null, ".")) + && CobolLanguageUtils.isInAriaA(ctx.getLexer().peek()); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/SentenceRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/SentenceRule.java new file mode 100644 index 0000000000..eaab7ae676 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/SentenceRule.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.rules.procedure; + +import org.eclipse.lsp.cobol.cst.procedure.Statement; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.CobolLanguageUtils; +import org.eclipse.lsp.cobol.rules.LanguageRule; +import org.eclipse.lsp.cobol.rules.procedure.statements.PerformRule; + +/** COBOL language grammar rule class. */ +public class SentenceRule implements LanguageRule { + + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + if (language.tryParseRule(PerformRule.class, ctx).isPresent()) { + return; + } +// if (language.tryParseRule(MoveRule.class, ctx).isPresent()) { +// return; +// } + ctx.push(new Statement()); + try { + while (!ctx.match(".") + && !CobolLanguageUtils.isNextDivisionEofOrEop(ctx) + && !language.tryMatchRule(ParagraphRule.class, ctx) + && !language.tryMatchRule(SectionRule.class, ctx) + && !CobolLanguageUtils.isEndOfProgram(ctx)) { + ctx.consume(); + } + ctx.optional("."); + } finally { + ctx.popAndAttach(); + } + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + // For now, it can be anything. + return true; + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/ImperativeStatementRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/ImperativeStatementRule.java new file mode 100644 index 0000000000..b7bf91e656 --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/ImperativeStatementRule.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.rules.procedure.statements; + +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.LanguageRule; + +/** Imperative Statements */ +public class ImperativeStatementRule implements LanguageRule { + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + throw new UnsupportedOperationException("Not implemented yet"); + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + return ctx.match( + // Arithmetic + "ADD", + "COMPUTE", + "DIVIDE", + "MULTIPLY", + "SUBTRACT", + // Data movement + "ACCEPT", // Input-output too + "INITIALIZE", + "INSPECT", + "SET", + "MOVE", + "STRING", + "UNSTRING", + // Ending + "GOBACK", + // Input-output + "CLOSE", + "DELETE", + "DISPLAY", + "OPEN", + "READ", + "REWRITE", + "START", + "STOP", + "WRITE", + // Ordering + "ALLOCATE", + "SORT", // Format 1 SORT? + "FREE", + "MERGE", + "RELEASE", + "RETURN", + // Procedure-branching + "ALTER", + "CONTINUE", + "EXIT", // Format 1 EXIT? + "PERFORM", + // Program or method linkage + "CALL", + "CANCEL", + "INVOKE", + // Table-handling + // Format 2 SORT (table SORT) + "SET") + || ctx.matchSeq("XML", "GENERATE") + || ctx.matchSeq("XML", "PARSE") + || ctx.matchSeq("STOP", "RUN") + || ctx.matchSeq("EXIT", "PROGRAM") + || ctx.matchSeq("EXIT", "METHOD") + || ctx.matchSeq("GO", "TO"); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/MoveRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/MoveRule.java new file mode 100644 index 0000000000..ea54bd2a8b --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/MoveRule.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.rules.procedure.statements; + +import org.eclipse.lsp.cobol.cst.procedure.Statement; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.LanguageRule; + +/** Move rule at P. 400 */ +public class MoveRule implements LanguageRule { + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + // for now, it will be statement class + ctx.push(new Statement()); + try { + ctx.consume("MOVE"); + ctx.spaces(); + if (ctx.match("CORRESPONDING", "CORR")) { + ctx.consume(); // "CORRESPONDING" or "CORR" + ctx.spaces(); + } + ctx.consume(); // id ? + ctx.spaces(); + ctx.consume("TO"); + ctx.spaces(); + ctx.consume(); // id ? + ctx.spaces(); + ctx.optional("."); + } finally { + ctx.popAndAttach(); + } + } + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + return ctx.matchSeq("PERFORM"); + } +} diff --git a/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/PerformRule.java b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/PerformRule.java new file mode 100644 index 0000000000..380e7383db --- /dev/null +++ b/server/parser/src/main/java/org/eclipse/lsp/cobol/rules/procedure/statements/PerformRule.java @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.rules.procedure.statements; + +import org.eclipse.lsp.cobol.cst.procedure.Statement; +import org.eclipse.lsp.cobol.parser.hw.ParsingContext; +import org.eclipse.lsp.cobol.rules.CobolLanguage; +import org.eclipse.lsp.cobol.rules.LanguageRule; +import org.eclipse.lsp.cobol.rules.procedure.ConditionExpressionRule; + +/** Perform rule at P. 412 */ +public class PerformRule implements LanguageRule { + @Override + public void parse(ParsingContext ctx, CobolLanguage language) { + // for now, it will be statement class + ctx.push(new Statement()); + try { + ctx.consume("PERFORM"); + ctx.spaces(); + + // basic inline case + if (language.tryMatchRule(ImperativeStatementRule.class, ctx)) { + consumeUntilEndPerform(ctx); + return; + } + + if (isTimesPrefix(ctx)) { + inlineTimes(ctx, language); + consumeUntilEndPerform(ctx); + return; + } + + if (isVaryingPhrase1(ctx)) { + phraseVarying1(ctx, language); + consumeUntilEndPerform(ctx); + return; + } + + if (isUntilPhrase1(ctx)) { + untilPhrase1(ctx, language); + consumeUntilEndPerform(ctx); + return; + } + + // Out of the line case + procedureName(ctx); // procedure-name-1 or imperative-statement-1 or integer-1 + if (ctx.match("THROUGH", "THRU")) { + ctx.or("THROUGH", "THRU"); // "THROUGH" or "THRU" + ctx.spaces(); + procedureName(ctx); // procedure-name-2 + } + + if (isTimesPrefix(ctx)) { + identifier(ctx); // identifier-1 or integer-1 + ctx.consume("TIMES"); + ctx.spaces(); + ctx.optional("."); + ctx.spaces(); + return; + } + + if (isUntilPhrase1(ctx)) { + untilPhrase1(ctx, language); + ctx.optional("."); + ctx.spaces(); + return; + } + + if (isVaryingPhrase1(ctx)) { + phraseVarying1(ctx, language); + // I didn't find it in language reference, but code samples show that phrase2 is optional + if (ctx.match("AFTER")) { + phraseVarying2(ctx, language); + } + ctx.optional("."); + return; + } + + // basic case + ctx.optional("."); + } finally { + ctx.popAndAttach(); + } + } + + private static void consumeUntilEndPerform(ParsingContext ctx) { + while (!ctx.match("END-PERFORM")) { + ctx.consume(); + } + ctx.consume("END-PERFORM"); + ctx.spaces(); + ctx.optional("."); + ctx.spaces(); + } + + private void inlineTimes(ParsingContext ctx, CobolLanguage language) { + identifier(ctx); // identifier-1 or integer-1 + ctx.consume("TIMES"); + ctx.spaces(); + } + + private static boolean isTimesPrefix(ParsingContext ctx) { + return ctx.matchSeq(null, "TIMES") || ctx.matchSeq(null, "(", null, ")", "TIMES"); + } + + private static boolean isVaryingPhrase1(ParsingContext ctx) { + return ctx.match("VARYING") + || ctx.matchSeq("TEST", null, "VARYING") + || ctx.matchSeq("WITH", "TEST", null, "VARYING"); + } + + private static boolean isUntilPhrase1(ParsingContext ctx) { + return ctx.match("UNTIL") + || ctx.matchSeq("TEST", null, "UNTIL") + || ctx.matchSeq("WITH", "TEST", null, "UNTIL"); + } + + // TODO: move to rule? + private void identifier(ParsingContext ctx) { + ctx.consume(); + ctx.spaces(); + if (ctx.match("(")) { + ctx.consume("("); + ctx.spaces(); + do { + ctx.consume(); // indexes + ctx.spaces(); + } while (!ctx.match(")")); + ctx.consume(")"); // index + ctx.spaces(); + } + } + + private void procedureName(ParsingContext ctx) { + ctx.consume(); + ctx.spaces(); + if (ctx.match("OF", "IN")) { + ctx.or("OF", "IN"); + ctx.spaces(); + ctx.consume(); + ctx.spaces(); + } + } + + private void untilPhrase1(ParsingContext ctx, CobolLanguage language) { + withTestBeforeAfter(ctx); + ctx.consume("UNTIL"); + ctx.spaces(); + if (ctx.match("EXIT")) { + ctx.consume("EXIT"); + ctx.spaces(); + } else { + language.parseRule(ConditionExpressionRule.class, ctx); + } + } + + private void withTestBeforeAfter(ParsingContext ctx) { + boolean expectTest = false; + if (ctx.match("WITH")) { + ctx.consume("WITH"); + ctx.spaces(); + expectTest = true; + } + if (ctx.match("TEST") || expectTest) { + ctx.consume("TEST"); + ctx.spaces(); + ctx.or("BEFORE", "AFTER"); + ctx.spaces(); + } + } + + private void phraseVarying1(ParsingContext ctx, CobolLanguage language) { + withTestBeforeAfter(ctx); + ctx.consume("VARYING"); + ctx.spaces(); + identifier(ctx); // identifier-2 or index-name-1 + ctx.consume("FROM"); + ctx.spaces(); + identifier(ctx); // identifier-3 or index-name-2 or literal-1 + ctx.consume("BY"); + ctx.spaces(); + identifier(ctx); // identifier-4 or literal-2 + ctx.consume("UNTIL"); + ctx.spaces(); + language.parseRule(ConditionExpressionRule.class, ctx); // condition-1 + } + + private void phraseVarying2(ParsingContext ctx, CobolLanguage language) { + do { + ctx.consume("AFTER"); + ctx.spaces(); + ctx.consume(); // identifier-5 or index-name-3 + ctx.spaces(); + ctx.consume("FROM"); + ctx.spaces(); + ctx.consume(); // identifier-6 or index-name-4 or literal-3 + ctx.spaces(); + phraseVarying3(ctx, language); + } while ((ctx.match("AFTER"))); + } + + private void phraseVarying3(ParsingContext ctx, CobolLanguage language) { + ctx.consume("BY"); + ctx.spaces(); + ctx.consume(); // identifier-7 or literal-4 + ctx.spaces(); + ctx.consume("UNTIL"); + ctx.spaces(); + language.parseRule(ConditionExpressionRule.class, ctx); // condition-2 + } + + + @Override + public boolean tryMatch(ParsingContext ctx, CobolLanguage language) { + return ctx.matchSeq("PERFORM"); + } +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/EndNotTheEndTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/EndNotTheEndTest.java similarity index 85% rename from server/parser/src/test/java/org/eclipse/lsp/cobol/core/EndNotTheEndTest.java rename to server/parser/src/test/java/org/eclipse/lsp/cobol/EndNotTheEndTest.java index 5fcb56976c..09e6f56440 100644 --- a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/EndNotTheEndTest.java +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/EndNotTheEndTest.java @@ -14,12 +14,12 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core; +package org.eclipse.lsp.cobol; -import org.eclipse.lsp.cobol.core.hw.CobolLexer; -import org.eclipse.lsp.cobol.core.hw.CobolParser; -import org.eclipse.lsp.cobol.core.hw.ParseResult; -import org.eclipse.lsp.cobol.core.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/GenerativePerformanceTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/GenerativePerformanceTest.java similarity index 83% rename from server/parser/src/test/java/org/eclipse/lsp/cobol/core/GenerativePerformanceTest.java rename to server/parser/src/test/java/org/eclipse/lsp/cobol/GenerativePerformanceTest.java index 58408610dd..2020368865 100644 --- a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/GenerativePerformanceTest.java +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/GenerativePerformanceTest.java @@ -10,17 +10,14 @@ * * Contributors: * Broadcom, Inc. - initial API and implementation - * DAF Trucks NV – implementation of DaCo COBOL statements - * and DAF development standards - * */ -package org.eclipse.lsp.cobol.core; +package org.eclipse.lsp.cobol; -import org.eclipse.lsp.cobol.core.hw.CobolLexer; -import org.eclipse.lsp.cobol.core.hw.CobolParser; -import org.eclipse.lsp.cobol.core.hw.ParserSettings; -import org.eclipse.lsp.cobol.test.codegen.CobolCodeGenerator; -import org.eclipse.lsp.cobol.test.codegen.GeneratorSettings; +import org.eclipse.lsp.cobol.codegen.CobolCodeGenerator; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.eclipse.lsp.cobol.codegen.GeneratorSettings; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.params.ParameterizedTest; diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwCobolParserTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/HwCobolParserTest.java similarity index 76% rename from server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwCobolParserTest.java rename to server/parser/src/test/java/org/eclipse/lsp/cobol/HwCobolParserTest.java index 59c8138aba..8d9c57fb81 100644 --- a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwCobolParserTest.java +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/HwCobolParserTest.java @@ -14,17 +14,17 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core; +package org.eclipse.lsp.cobol; -import org.eclipse.lsp.cobol.core.cst.ProgramUnit; -import org.eclipse.lsp.cobol.core.cst.SourceUnit; -import org.eclipse.lsp.cobol.core.hw.CobolLexer; -import org.eclipse.lsp.cobol.core.hw.CobolParser; +import org.eclipse.lsp.cobol.cst.ProgramUnit; +import org.eclipse.lsp.cobol.cst.SourceUnit; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; import static org.junit.jupiter.api.Assertions.*; -import org.eclipse.lsp.cobol.core.hw.ParseResult; -import org.eclipse.lsp.cobol.core.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; import org.junit.jupiter.api.Test; import java.util.Collections; @@ -93,14 +93,14 @@ void twoProgramsOptDot() { @Test void twoProgramsIsRecursive() { final String source = - "ID DIVISION. PROGRAM-ID Pr1 IS RECURSIVE PROGRAM\n" - + "END PROGRAM Pr1.\n" - + "ID DIVISION. PROGRAM-ID. Pr2 IS PROGRAM.\n" - + "END PROGRAM Pr2.\n"; + " ID DIVISION. PROGRAM-ID Pr1 IS RECURSIVE PROGRAM\n" + + " END PROGRAM Pr1.\n" + + " ID DIVISION. PROGRAM-ID. Pr2 IS PROGRAM.\n" + + " END PROGRAM Pr2.\n"; CobolParser cobolParser = new CobolParser(new CobolLexer(source), new ParserSettings()); SourceUnit su = cobolParser.parse().getSourceUnit(); - assertEquals(7, su.getChildren().size()); - ProgramUnit pu1 = (ProgramUnit) su.getChildren().get(0); + assertEquals(9, su.getChildren().size()); + ProgramUnit pu1 = (ProgramUnit) su.getChildren().get(01); assertEquals("Pr1", pu1.getName()); assertEquals(source, su.toText()); } @@ -109,18 +109,18 @@ void twoProgramsIsRecursive() { @Test void nestedPrograms() { final String source = - "ID DIVISION. PROGRAM-ID. Pr1.\n" - + "ID DIVISION. PROGRAM-ID. Pr2.\n" - + "END PROGRAM Pr2.\n" - + "END PROGRAM Pr1.\n"; + " ID DIVISION. PROGRAM-ID. Pr1.\n" + + " ID DIVISION. PROGRAM-ID. Pr2.\n" + + " END PROGRAM Pr2.\n" + + " END PROGRAM Pr1.\n"; CobolParser cobolParser = new CobolParser(new CobolLexer(source), new ParserSettings()); ParseResult parseResult = cobolParser.parse(); SourceUnit su = parseResult.getSourceUnit(); assertEquals(Collections.emptyList(), parseResult.getDiagnostics()); - assertEquals(1, su.getChildren().size()); - ProgramUnit pu = (ProgramUnit) su.getChildren().get(0); + assertEquals(2, su.getChildren().size()); + ProgramUnit pu = (ProgramUnit) su.getChildren().get(1); assertEquals("Pr1", pu.getName()); - ProgramUnit npu = (ProgramUnit) pu.getChildren().get(2); // TODO: find program node + ProgramUnit npu = pu.list(ProgramUnit.class).get(0); assertEquals("Pr2", npu.getName()); assertEquals(source, su.toText()); diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwDivisionsTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/HwDivisionsTest.java similarity index 65% rename from server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwDivisionsTest.java rename to server/parser/src/test/java/org/eclipse/lsp/cobol/HwDivisionsTest.java index 20c76867a2..f7531270ef 100644 --- a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwDivisionsTest.java +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/HwDivisionsTest.java @@ -14,14 +14,13 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core; +package org.eclipse.lsp.cobol; -import org.eclipse.lsp.cobol.core.cst.*; -import org.eclipse.lsp.cobol.core.cst.IdentificationDivision; -import org.eclipse.lsp.cobol.core.cst.procedure.ProcedureDivision; -import org.eclipse.lsp.cobol.core.hw.CobolLexer; -import org.eclipse.lsp.cobol.core.hw.CobolParser; -import org.eclipse.lsp.cobol.core.hw.ParserSettings; +import org.eclipse.lsp.cobol.cst.*; +import org.eclipse.lsp.cobol.cst.procedure.ProcedureDivision; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -53,49 +52,49 @@ void testIdentificationDivision() { @Test void testEnvironmentDivision() { - final String edSource = "ENVIRONMENT DIVISION.\n" - + "CONFIGURATION SECTION.\n" - + "SOURCE-COMPUTER.\n" + final String edSource = " ENVIRONMENT DIVISION.\n" + + " CONFIGURATION SECTION.\n" + + " SOURCE-COMPUTER.\n" + " XXXXX023.\n" - + "OBJECT-COMPUTER.\n" + + " OBJECT-COMPUTER.\n" + " XXXXX034.\n" - + "INPUT-OUTPUT SECTION.\n" - + "FILE-CONTROL.\n" + + " INPUT-OUTPUT SECTION.\n" + + " FILE-CONTROL.\n" + " SELECT PRINT-FILE ASSIGN TO\n" + " XXXXX035.\n"; - final String source = "ID DIVISION. PROGRAM-ID. Pr1.\n" + edSource; + final String source = " ID DIVISION. PROGRAM-ID. Pr1.\n" + edSource; CobolParser cobolParser = new CobolParser(new CobolLexer(source), new ParserSettings()); SourceUnit su = cobolParser.parse().getSourceUnit(); assertFalse(su.getChildren().isEmpty()); - ProgramUnit pu = (ProgramUnit) su.getChildren().get(0); + ProgramUnit pu = (ProgramUnit) su.getChildren().get(1); assertEquals("Pr1", pu.getName()); - EnvironmentDivision ed = (EnvironmentDivision) pu.getChildren().get(2); - assertEquals(edSource, ed.toText()); + EnvironmentDivision ed = (EnvironmentDivision) pu.list(EnvironmentDivision.class).get(0); + assertEquals(edSource, " " + ed.toText()); assertEquals(source, su.toText()); } @Test void testDataDivision() { - final String ddSource = "DATA DIVISION.\n" - + "WORKING-STORAGE SECTION.\n" - + "77 PASSWORD1 PIC X(10) VALUE XXXXX012.\n"; + final String ddSource = " DATA DIVISION.\n" + + " WORKING-STORAGE SECTION.\n" + + " 77 PASSWORD1 PIC X(10) VALUE XXXXX012.\n"; - final String source = "ID DIVISION. PROGRAM-ID. Pr1.\n" + ddSource; + final String source = " ID DIVISION. PROGRAM-ID. Pr1.\n" + ddSource; CobolParser cobolParser = new CobolParser(new CobolLexer(source), new ParserSettings()); SourceUnit su = cobolParser.parse().getSourceUnit(); assertFalse(su.getChildren().isEmpty()); - ProgramUnit pu = (ProgramUnit) su.getChildren().get(0); + ProgramUnit pu = (ProgramUnit) su.getChildren().get(1); assertEquals("Pr1", pu.getName()); - DataDivision dd = (DataDivision) pu.getChildren().get(2); - assertEquals(ddSource, dd.toText()); + DataDivision dd = pu.list(DataDivision.class).get(0); + assertEquals(ddSource, " " + dd.toText()); assertEquals(source, su.toText()); } @Test void testProcedureDivision() { - final String pdSource = "PROCEDURE DIVISION.\n" + final String pdSource = " PROCEDURE DIVISION.\n" + " A-PARA.\n" + " PERFORM DISPLAY 'IN A-PARA'\n" + " END-PERFORM.\n" @@ -110,15 +109,15 @@ void testProcedureDivision() { + " DISPLAY 'IN D-PARA'.\n" + " E-PARA."; - final String source = "ID DIVISION. PROGRAM-ID. Pr1.\n" + pdSource; + final String source = " ID DIVISION. PROGRAM-ID. Pr1.\n" + pdSource; CobolParser cobolParser = new CobolParser(new CobolLexer(source), new ParserSettings()); SourceUnit su = cobolParser.parse().getSourceUnit(); assertFalse(su.getChildren().isEmpty()); - ProgramUnit pu = (ProgramUnit) su.getChildren().get(0); + ProgramUnit pu = (ProgramUnit) su.getChildren().get(1); assertEquals("Pr1", pu.getName()); - ProcedureDivision pd = (ProcedureDivision) pu.getChildren().get(2); - assertEquals(pdSource, pd.toText()); + ProcedureDivision pd = pu.list(ProcedureDivision.class).get(0); + assertEquals(pdSource, " " + pd.toText()); assertEquals(source, su.toText()); } } diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwParserErrorTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/HwParserErrorTest.java similarity index 86% rename from server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwParserErrorTest.java rename to server/parser/src/test/java/org/eclipse/lsp/cobol/HwParserErrorTest.java index 7e6b29ddfb..6a5cc87473 100644 --- a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwParserErrorTest.java +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/HwParserErrorTest.java @@ -14,13 +14,13 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core; +package org.eclipse.lsp.cobol; -import org.eclipse.lsp.cobol.core.cst.SourceUnit; -import org.eclipse.lsp.cobol.core.hw.CobolLexer; -import org.eclipse.lsp.cobol.core.hw.CobolParser; -import org.eclipse.lsp.cobol.core.hw.ParseResult; -import org.eclipse.lsp.cobol.core.hw.ParserSettings; +import org.eclipse.lsp.cobol.cst.SourceUnit; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/server/test/src/test/java/org/eclipse/lsp/cobol/test/codegen/GenProgramTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/codegen/GenProgramTest.java similarity index 96% rename from server/test/src/test/java/org/eclipse/lsp/cobol/test/codegen/GenProgramTest.java rename to server/parser/src/test/java/org/eclipse/lsp/cobol/codegen/GenProgramTest.java index 35617f31a4..216dc64e57 100644 --- a/server/test/src/test/java/org/eclipse/lsp/cobol/test/codegen/GenProgramTest.java +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/codegen/GenProgramTest.java @@ -14,7 +14,7 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.test.codegen; +package org.eclipse.lsp.cobol.codegen; import org.junit.jupiter.api.Test; diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwCobolLexerTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwCobolLexerTest.java deleted file mode 100644 index fa7363678f..0000000000 --- a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/HwCobolLexerTest.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2024 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - * DAF Trucks NV – implementation of DaCo COBOL statements - * and DAF development standards - * - */ -package org.eclipse.lsp.cobol.core; - -import org.eclipse.lsp.cobol.core.hw.CobolLexer; - -import static org.junit.jupiter.api.Assertions.*; - -import org.eclipse.lsp.cobol.core.hw.GrammarRule; -import org.eclipse.lsp.cobol.core.hw.Token; -import org.junit.jupiter.api.Test; - -/** - * test hw lexer - */ -class HwCobolLexerTest { - - @Test - void identificationDivision() { - CobolLexer lexer = new CobolLexer("Id DIVISION. PROGRAM-ID. Pr1."); - assertEquals("Id", tokenContent(lexer)); - assertEquals(" ", tokenContent(lexer)); - assertEquals("DIVISION", tokenContent(lexer)); - assertEquals(".", tokenContent(lexer)); - assertEquals(" ", tokenContent(lexer)); - assertEquals("PROGRAM-ID", tokenContent(lexer)); - assertEquals(".", tokenContent(lexer)); - assertEquals(" ", tokenContent(lexer)); - assertEquals("Pr1", tokenContent(lexer)); - assertEquals(".", tokenContent(lexer)); - assertFalse(lexer.hasMore()); - } - - @Test - void newLine() { - CobolLexer lexer = new CobolLexer("A \n B"); - assertToken(lexer.forward(GrammarRule.ProgramUnit).get(0), "A", 0, 0); - assertToken(lexer.forward(GrammarRule.ProgramUnit).get(0), " ", 0, 1); - assertToken(lexer.forward(GrammarRule.ProgramUnit).get(0), "\n", 0, 2); - assertToken(lexer.forward(GrammarRule.ProgramUnit).get(0), " ", 1, 0); - assertToken(lexer.forward(GrammarRule.ProgramUnit).get(0), "B", 1, 1); - assertFalse(lexer.hasMore()); - } - - private static void assertToken(Token token, String lexeme, int line, int charPos) { - assertEquals(lexeme, token.getLexeme()); - assertEquals(line, token.getLine()); - assertEquals(charPos, token.getStartPositionInLine()); - } - - private static String tokenContent(CobolLexer lexer) { - return lexer.forward(GrammarRule.ProgramUnit).get(0).getLexeme(); - } -} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/divisions/IdentificationDivisionTests.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/IdentificationDivisionTests.java similarity index 76% rename from server/parser/src/test/java/org/eclipse/lsp/cobol/core/divisions/IdentificationDivisionTests.java rename to server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/IdentificationDivisionTests.java index 1452a2f274..fb4804b76c 100644 --- a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/divisions/IdentificationDivisionTests.java +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/IdentificationDivisionTests.java @@ -10,16 +10,13 @@ * * Contributors: * Broadcom, Inc. - initial API and implementation - * DAF Trucks NV – implementation of DaCo COBOL statements - * and DAF development standards - * */ -package org.eclipse.lsp.cobol.core.divisions; +package org.eclipse.lsp.cobol.divisions; -import org.eclipse.lsp.cobol.core.hw.CobolLexer; -import org.eclipse.lsp.cobol.core.hw.CobolParser; -import org.eclipse.lsp.cobol.core.hw.ParseResult; -import org.eclipse.lsp.cobol.core.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -38,6 +35,5 @@ void test() { String reconstructed = parseResult.getSourceUnit().toText(); assertEquals(0, parseResult.getDiagnostics().size(), parseResult.getDiagnostics().toString()); assertEquals(source, reconstructed); - } } diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/AlterGoToTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/AlterGoToTest.java new file mode 100644 index 0000000000..c5668b7d54 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/AlterGoToTest.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.divisions.procedure; + +import org.eclipse.lsp.cobol.cst.ProgramUnit; +import org.eclipse.lsp.cobol.cst.procedure.Paragraph; +import org.eclipse.lsp.cobol.cst.procedure.ProcedureDivision; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** test alter go - to */ +public class AlterGoToTest { + @Test + void test() { + String source = " ID DIVISION. PROGRAM-ID. str1.\n" + + " PROCEDURE DIVISION.\n" + + " DISPLAY 'OUT'.\n" + + " PARAG2.\n" + + " GO TO.\n" + + " PARAG2.\n" + + " DISPLAY 'PARAG2'.\n"; + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + assertTrue(parseResult.getDiagnostics().isEmpty()); + ProgramUnit pu = (ProgramUnit) parseResult.getSourceUnit().getChildren().get(1); + ProcedureDivision pd = pu.list(ProcedureDivision.class).get(0); + assertEquals(2, pd.getChildren().stream().filter(Paragraph.class::isInstance).count()); + assertEquals(source, parseResult.getSourceUnit().toText()); + } + +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/BrokenTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/BrokenTest.java new file mode 100644 index 0000000000..cb2daff2ac --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/BrokenTest.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.divisions.procedure; + +import org.eclipse.lsp.cobol.cst.ProgramUnit; +import org.eclipse.lsp.cobol.cst.procedure.ProcedureDivision; +import org.eclipse.lsp.cobol.cst.procedure.Section; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +/** + * Error recovery test + */ +@Disabled("Waiting to be finished") +class BrokenTest { + @Test + void test() { + ParseResult result = new CobolParser(new CobolLexer(" identification division.\n" + + " program-id. DUMMY.\n" + + " author. COBOL-Test.\n" + + " environment division.\n" + + " data division.\n" + + " procedure division.\n" + + " A-MAIN section.\n" + + " perform B-SEC\n" + + " goback\n" + + " .\n" + + " \n" + + " B-SEC section.\n" + + " display 'Hello'\n" + + " exit section\n" + + " display '(... but no goodbye)'\n" + + " ."), new ParserSettings()).parse(); + ProgramUnit pu = (ProgramUnit) result.getSourceUnit().getChildren().get(1); + ProcedureDivision pd = (ProcedureDivision) pu.getChildren().get(5); + Section s1 = (Section) pd.getChildren().get(6); + Section s2 = (Section) pd.getChildren().get(7); + System.out.println(s1.toText()); + } +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/DeclarativesTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/DeclarativesTest.java new file mode 100644 index 0000000000..4ebe3fc391 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/DeclarativesTest.java @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * DAF Trucks NV – implementation of DaCo COBOL statements + * and DAF development standards + * + */ +package org.eclipse.lsp.cobol.divisions.procedure; + +import org.eclipse.lsp.cobol.cst.ProgramUnit; +import org.eclipse.lsp.cobol.cst.procedure.Declaratives; +import org.eclipse.lsp.cobol.cst.procedure.ProcedureDivision; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Test parsing of Declaratives. + */ +class DeclarativesTest { + @Test + void test() { + String source = "ID DIVISION. PROGRAM-ID. str1.\n" + + " PROCEDURE DIVISION.\n" + + " Declaratives.\n" + + " Debug-Declaratives Section.\n" + + " Use For Debugging On Some-Routine.\n" + + " Debug-Declaratives-Paragraph.\n" + + " Display Trace-Msg, Debug-Name, Total.\n" + + " End Declaratives.\n"; + + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + assertTrue(parseResult.getDiagnostics().isEmpty()); + ProgramUnit pu = (ProgramUnit) parseResult.getSourceUnit().getChildren().get(0); + ProcedureDivision pd = (ProcedureDivision) pu.list(ProcedureDivision.class).get(0); + + assertEquals(Declaratives.class, pd.getChildren().get(6).getClass()); + + assertEquals(source, parseResult.getSourceUnit().toText()); + } +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/EndProgramTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/EndProgramTest.java new file mode 100644 index 0000000000..fcba635fe7 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/EndProgramTest.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * DAF Trucks NV – implementation of DaCo COBOL statements + * and DAF development standards + * + */ +package org.eclipse.lsp.cobol.divisions.procedure; + +import org.eclipse.lsp.cobol.cst.ProgramUnit; +import org.eclipse.lsp.cobol.cst.procedure.Paragraph; +import org.eclipse.lsp.cobol.cst.procedure.ProcedureDivision; +import org.eclipse.lsp.cobol.cst.procedure.Statement; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Test that HW parser can understand end of program. + */ +class EndProgramTest { + @Test + void test() { + String source = "ID DIVISION. PROGRAM-ID. str1.\n" + + " PROCEDURE DIVISION.\n" + + " DISPLAY 'OUT'.\n" + + " PARAG1.\n" + + " DISPLAY 'PARAG1'.\n" + + " PARAG2.\n" + + " DISPLAY 'PARAG2'.\n" + + " END PROGRAM str1.\n"; + + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + assertTrue(parseResult.getDiagnostics().isEmpty()); + ProgramUnit pu = (ProgramUnit) parseResult.getSourceUnit().getChildren().get(0); + ProcedureDivision pd = pu.list(ProcedureDivision.class).get(0); + assertEquals(2, pd.getChildren().stream().filter(Paragraph.class::isInstance).count()); + Paragraph p1 = (Paragraph) pd.getChildren().get(9); + Paragraph p2 = (Paragraph) pd.getChildren().get(10); + assertEquals(1, pd.getChildren().stream().filter(Statement.class::isInstance).count()); + assertEquals(1, p1.getChildren().stream().filter(Statement.class::isInstance).count()); + assertEquals(1, p2.getChildren().stream().filter(Statement.class::isInstance).count()); + // TODO: check if everything is in the place + + assertEquals(source, parseResult.getSourceUnit().toText()); + } +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/divisions/procedure/ParagraphTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/ParagraphTest.java similarity index 68% rename from server/parser/src/test/java/org/eclipse/lsp/cobol/core/divisions/procedure/ParagraphTest.java rename to server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/ParagraphTest.java index f04d4bc163..3f0ed70156 100644 --- a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/divisions/procedure/ParagraphTest.java +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/ParagraphTest.java @@ -14,15 +14,15 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.divisions.procedure; +package org.eclipse.lsp.cobol.divisions.procedure; -import org.eclipse.lsp.cobol.core.cst.procedure.Paragraph; -import org.eclipse.lsp.cobol.core.cst.procedure.ProcedureDivision; -import org.eclipse.lsp.cobol.core.cst.ProgramUnit; -import org.eclipse.lsp.cobol.core.hw.CobolLexer; -import org.eclipse.lsp.cobol.core.hw.CobolParser; -import org.eclipse.lsp.cobol.core.hw.ParseResult; -import org.eclipse.lsp.cobol.core.hw.ParserSettings; +import org.eclipse.lsp.cobol.cst.procedure.Paragraph; +import org.eclipse.lsp.cobol.cst.procedure.ProcedureDivision; +import org.eclipse.lsp.cobol.cst.ProgramUnit; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -34,8 +34,8 @@ class ParagraphTest { @Test void test() { - String source = "ID DIVISION. PROGRAM-ID. str1.\n" - + "PROCEDURE DIVISION.\n" + String source = " ID DIVISION. PROGRAM-ID. str1.\n" + + " PROCEDURE DIVISION.\n" + " DISPLAY 'OUT'.\n" + " PARAG1.\n" + " DISPLAY 'PARAG1'.\n" @@ -43,8 +43,8 @@ void test() { + " DISPLAY 'PARAG2'.\n"; ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); assertTrue(parseResult.getDiagnostics().isEmpty()); - ProgramUnit pu = (ProgramUnit) parseResult.getSourceUnit().getChildren().get(0); - ProcedureDivision pd = (ProcedureDivision) pu.getChildren().get(2); + ProgramUnit pu = (ProgramUnit) parseResult.getSourceUnit().getChildren().get(1); + ProcedureDivision pd = (ProcedureDivision) pu.list(ProcedureDivision.class).get(0); assertEquals(2, pd.getChildren().stream().filter(Paragraph.class::isInstance).count()); // TODO: check if everything is in the place diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformBasicStatementTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformBasicStatementTest.java new file mode 100644 index 0000000000..8e5f3445b0 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformBasicStatementTest.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.divisions.procedure; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.eclipse.lsp.cobol.cst.procedure.Statement; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.junit.jupiter.api.Test; + +/** Perform tests */ +public class PerformBasicStatementTest { + private static final String HEADER = + " ID DIVISION. PROGRAM-ID. perf.\n" + " PROCEDURE DIVISION.\n"; + + @Test + void basicOutOfLine() { + String source = + HEADER + + " PERFORM PROC1.\n" + + " PERFORM PROC1 THROUGH PROC2.\n" + + " PERFORM PROC1 THRu PROC2.\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(3, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + @Test + void basicInline() { + String source = + HEADER + + " PERFORM\n" + + " DISPLAY \"Iteration: \" WS-I\n" + + " COMPUTE WS-I = WS-I + 1.\n" + + " END-PERFORM.\n" + + " PERFORM END-PERFORM\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(2, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformTimesStatementTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformTimesStatementTest.java new file mode 100644 index 0000000000..5c98996496 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformTimesStatementTest.java @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.divisions.procedure; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.eclipse.lsp.cobol.cst.procedure.Statement; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.junit.jupiter.api.Test; + +/** Test perform with times */ +public class PerformTimesStatementTest { + private static final String HEADER = + " ID DIVISION. PROGRAM-ID. perf.\n" + " PROCEDURE DIVISION.\n"; + + @Test + void timesOutOfLine() { + String source = + HEADER + + " PERFORM PROC1 A TIMES.\n" + + " PERFORM PROC1 3 TIMES.\n" + + " PERFORM PROC1 THROUGH PROC2 A TIMES.\n" + + " PERFORM PROC1 THROUGH PROC2 4 TIMES.\n" + + " PERFORM PROC1 THRU PROC2 B TIMES.\n" + + " PERFORM PROC1 THRU PROC2 67 TIMES.\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(6, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + @Test + void timesInline() { + String source = + HEADER + + " PERFORM A TIMES\n" + + " DISPLAY \"Iteration: \" WS-I\n" + + " COMPUTE WS-I = WS-I + 1.\n" + + " END-PERFORM.\n" + + " PERFORM 1000 TIMES\n" + + " DISPLAY \"Iteration: \" WS-I\n" + + " COMPUTE WS-I = WS-I + 1.\n" + + " END-PERFORM.\n" + + " PERFORM ZOO TIMES END-PERFORM.\n" + + " PERFORM 100 TIMES END-PERFORM.\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(4, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformUntilStatementTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformUntilStatementTest.java new file mode 100644 index 0000000000..fae84fbdcc --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformUntilStatementTest.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.divisions.procedure; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.eclipse.lsp.cobol.cst.procedure.Statement; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.junit.jupiter.api.Test; + +/** Test perform with until */ +public class PerformUntilStatementTest { + private static final String HEADER = + " ID DIVISION. PROGRAM-ID. perf.\n" + " PROCEDURE DIVISION.\n"; + + + @Test + void untilOutOfLine() { + String source = + HEADER + + " PERFORM PROC1 UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 UNTIL EXIT.\n" + + " PERFORM PROC1 TEST BEFORE UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 TEST AFTER UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 WITH TEST BEFORE UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 WITH TEST AFTER UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 TEST BEFORE UNTIL EXIT.\n" + + " PERFORM PROC1 TEST AFTER UNTIL EXIT.\n" + + " PERFORM PROC1 WITH TEST BEFORE UNTIL EXIT.\n" + + " PERFORM PROC1 WITH TEST AFTER UNTIL EXIT.\n" + + + " PERFORM PROC1 THROUGH PROC2 UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 THROUGH PROC2 UNTIL EXIT.\n" + + " PERFORM PROC1 THROUGH PROC2 TEST BEFORE UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 THROUGH PROC2 TEST AFTER UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 THROUGH PROC2 WITH TEST BEFORE UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 THROUGH PROC2 WITH TEST AFTER UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 THROUGH PROC2 TEST BEFORE UNTIL EXIT.\n" + + " PERFORM PROC1 THROUGH PROC2 TEST AFTER UNTIL EXIT.\n" + + " PERFORM PROC1 THROUGH PROC2 WITH TEST BEFORE UNTIL EXIT.\n" + + " PERFORM PROC1 THROUGH PROC2 WITH TEST AFTER UNTIL EXIT.\n" + + + " PERFORM PROC1 THRU PROC2 UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 THRU PROC2 UNTIL EXIT.\n" + + " PERFORM PROC1 THRU PROC2 TEST BEFORE UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 THRU PROC2 TEST AFTER UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 THRU PROC2 WITH TEST BEFORE UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 THRU PROC2 WITH TEST AFTER UNTIL A GREATER THAN 15.\n" + + " PERFORM PROC1 THRU PROC2 TEST BEFORE UNTIL EXIT.\n" + + " PERFORM PROC1 THRU PROC2 TEST AFTER UNTIL EXIT.\n" + + " PERFORM PROC1 THRU PROC2 WITH TEST BEFORE UNTIL EXIT.\n" + + " PERFORM PROC1 THRU PROC2 WITH TEST AFTER UNTIL EXIT.\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(30, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + @Test + void untilInline() { + String source = + HEADER + + " PERFORM WITH TEST BEFORE UNTIL A LESS THAN 2 DISPLAY A END-PERFORM.\n" + + " PERFORM WITH TEST AFTER UNTIL A LESS THAN 2 DISPLAY A END-PERFORM.\n" + + + " PERFORM WITH TEST BEFORE UNTIL A LESS THAN 2 END-PERFORM\n" + + " PERFORM WITH TEST AFTER UNTIL A LESS THAN 2 END-PERFORM\n" + + + " PERFORM TEST BEFORE UNTIL A LESS THAN 2 DISPLAY A END-PERFORM.\n" + + " PERFORM TEST AFTER UNTIL A LESS THAN 2 DISPLAY A END-PERFORM.\n" + + " PERFORM TEST BEFORE UNTIL A LESS THAN 2 END-PERFORM\n" + + " PERFORM TEST AFTER UNTIL A LESS THAN 2 END-PERFORM\n" + + + " PERFORM UNTIL A LESS THAN 2 DISPLAY A END-PERFORM.\n" + + " PERFORM UNTIL A LESS THAN 2 END-PERFORM\n" + + " PERFORM UNTIL A LESS THAN 2 END-PERFORM\n" + + + " PERFORM WITH TEST BEFORE UNTIL EXIT DISPLAY A END-PERFORM.\n" + + " PERFORM WITH TEST AFTER UNTIL EXIT DISPLAY A END-PERFORM.\n" + + + " PERFORM WITH TEST BEFORE UNTIL EXIT END-PERFORM\n" + + " PERFORM WITH TEST AFTER UNTIL EXIT END-PERFORM\n" + + + " PERFORM TEST BEFORE UNTIL EXIT DISPLAY A END-PERFORM.\n" + + " PERFORM TEST AFTER UNTIL EXIT DISPLAY A END-PERFORM.\n" + + " PERFORM TEST BEFORE UNTIL EXIT END-PERFORM\n" + + " PERFORM TEST AFTER UNTIL EXIT END-PERFORM\n" + + + " PERFORM UNTIL EXIT DISPLAY A END-PERFORM.\n" + + " PERFORM UNTIL EXIT END-PERFORM\n" + + " PERFORM UNTIL EXIT END-PERFORM\n"; + + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(22, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + @Test + void case1() { + String source = HEADER + + " PERFORM T-1 THRU T-2 UNTIL E-1 (IDX-1, IDX-6) EQUAL TO \"II\".\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(1, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + @Test + void case2() { + String source = HEADER + + " PERFORM CREATE-1 VARYING RECORD-COUNTER FROM 1 BY 1 UNTIL RECORD-COUNTER IS GREATER THAN 10.\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(1, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + @Test + void case3() { + String source = + HEADER + + " PERFORM UNTIL WRK-DU-6V0-1 = 99\n" + + " ADD 6 TO WRK-DU-6V0-1\n" + + " SUBTRACT 3 FROM WRK-DU-6V0-1\n" + + " END-PERFORM\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(1, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + @Test + void case4() { + String source = + HEADER + + " PERFORM F-17 UNTIL FUNCTION REM(5, ARG2) >= 2."; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(1, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformVaryingStatementTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformVaryingStatementTest.java new file mode 100644 index 0000000000..0dd2b5e809 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/PerformVaryingStatementTest.java @@ -0,0 +1,109 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.divisions.procedure; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.eclipse.lsp.cobol.cst.procedure.Statement; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.junit.jupiter.api.Test; + +/** Test perform with varying */ +public class PerformVaryingStatementTest { + private static final String HEADER = + " ID DIVISION. PROGRAM-ID. perf.\n" + " PROCEDURE DIVISION.\n"; + + @Test + void varyingOutOfLine() { + String source = + HEADER + + " PERFORM PROC1 THROUGH PROC2 WITH TEST AFTER VARYING A FROM 1 BY 100 UNTIL A LESS B AFTER A2 FROM 1 BY 100 UNTIL A2 LESS B2 AFTER C2 FROM D2 BY 10 UNTIL D2 LESS 10\n" + + " PERFORM PROC1 VARYING A FROM 1 BY 100 UNTIL A LESS B AFTER C FROM D BY 10 UNTIL D LESS 10\n" + + " PERFORM PROC1 THRU PROC2.\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(3, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + @Test + void varyingInline() { + String source = + HEADER + + " PERFORM VARYING A FROM B BY C UNTIL D ALTER B FROM 1 BY 4 UNTIL B LESS 100 END-PERFORM\n" + + " PERFORM WITH TEST BEFORE VARYING A FROM 10 BY 1 UNTIL A LESS 10 AFTER B FROM 1 BY 3 UNTIL B LESS 100 DISPLAY \"Iteration: \" WS-I\n END-PERFORM.\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(2, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + @Test + void case1() { + String source = HEADER + + " PERFORM CREATE-1 VARYING RECORD-COUNTER FROM 1 BY 1 UNTIL RECORD-COUNTER IS GREATER THAN 10.\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(1, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + @Test + void case2() { + String source = + HEADER + + " PERFORM PFM-A-4-6 VARYING WRK-DS-02V00 FROM A02TWOS-DS-02V00 BY A02TWOS-DS-02V00 UNTIL (WRK-DS-02V00 + 12) = 100.\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(1, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + @Test + void case3() { + String source = + HEADER + + " PERFORM PFM-A-4-6 VARYING WRK-DS-02V00 FROM A02TWOS-DS-02V00 BY A02TWOS-DS-02V00 UNTIL WRK-DS-02V00 + 12 > 100.\n"; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(1, result.getSourceUnit().list(Statement.class).size()); + assertEquals(source, result.getSourceUnit().toText()); + } + + @Test + void case4() { + String source = + HEADER + + " PERFORM VARYING COUNTER FROM 100 BY 4\n" + + " UNTIL COUNTER NOT GREATER THAN 15\n" + + " ADD 1 TO ANS\n" + + " ADD 1 TO ANS2\n" + + " END-PERFORM."; + CobolParser parser = new CobolParser(new CobolLexer(source), new ParserSettings()); + ParseResult result = parser.parse(); + assertEquals(0, result.getDiagnostics().size()); + assertEquals(1, result.getSourceUnit().list(Statement.class).size()); // should be 3, but for now it's one + assertEquals(source, result.getSourceUnit().toText()); + } + + +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/ProcedureDivisionWithVariablesTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/ProcedureDivisionWithVariablesTest.java new file mode 100644 index 0000000000..dcc16d5f04 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/ProcedureDivisionWithVariablesTest.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.divisions.procedure; + +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Procedure Division With Variables Test + */ +class ProcedureDivisionWithVariablesTest { + @Test + void test() { + String source = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. TEST1.\n" + + " PROCEDURE DIVISION USING var1, var2,\n" + + " var3, var4."; + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + assertTrue(parseResult.getDiagnostics().isEmpty()); + assertEquals(source, parseResult.getSourceUnit().toText()); + } +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/divisions/procedure/SectionTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/SectionTest.java similarity index 57% rename from server/parser/src/test/java/org/eclipse/lsp/cobol/core/divisions/procedure/SectionTest.java rename to server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/SectionTest.java index 8fc50a1c8a..b00a34c762 100644 --- a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/divisions/procedure/SectionTest.java +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/SectionTest.java @@ -14,16 +14,16 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.divisions.procedure; +package org.eclipse.lsp.cobol.divisions.procedure; -import org.eclipse.lsp.cobol.core.cst.ProgramUnit; -import org.eclipse.lsp.cobol.core.cst.procedure.Paragraph; -import org.eclipse.lsp.cobol.core.cst.procedure.ProcedureDivision; -import org.eclipse.lsp.cobol.core.cst.procedure.Section; -import org.eclipse.lsp.cobol.core.hw.CobolLexer; -import org.eclipse.lsp.cobol.core.hw.CobolParser; -import org.eclipse.lsp.cobol.core.hw.ParseResult; -import org.eclipse.lsp.cobol.core.hw.ParserSettings; +import org.eclipse.lsp.cobol.cst.ProgramUnit; +import org.eclipse.lsp.cobol.cst.procedure.Paragraph; +import org.eclipse.lsp.cobol.cst.procedure.ProcedureDivision; +import org.eclipse.lsp.cobol.cst.procedure.Section; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -37,7 +37,7 @@ class SectionTest { void test() { String source = "IDENTIFICATION DIVISION.\n" + " PROGRAM-ID. SECTST.\n" - + "PROCEDURE DIVISION.\n" + + " PROCEDURE DIVISION.\n" + " DISPLAY 'OUT'.\n" + " GO TO PARAG1.\n" + " SECT1 SECTION.\n" @@ -51,11 +51,26 @@ void test() { ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); assertTrue(parseResult.getDiagnostics().isEmpty()); ProgramUnit pu = (ProgramUnit) parseResult.getSourceUnit().getChildren().get(0); - ProcedureDivision pd = (ProcedureDivision) pu.getChildren().get(2); + ProcedureDivision pd = (ProcedureDivision) pu.list(ProcedureDivision.class).get(0); assertEquals(2, pd.getChildren().stream().filter(Paragraph.class::isInstance).count()); assertEquals(2, pd.getChildren().stream().filter(Section.class::isInstance).count()); // TODO: check if everything is in the place assertEquals(source, parseResult.getSourceUnit().toText()); } + + @Test + void prioritySection() { + String source = "IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. SECTST.\n" + + " PROCEDURE DIVISION.\n" + + " SECT1 SECTION 10.\n" + + " DISPLAY 'PARAG2'."; + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + assertTrue(parseResult.getDiagnostics().isEmpty()); + ProgramUnit pu = (ProgramUnit) parseResult.getSourceUnit().getChildren().get(0); + ProcedureDivision pd = (ProcedureDivision) pu.list(ProcedureDivision.class).get(0); + assertEquals(1, pd.getChildren().stream().filter(Section.class::isInstance).count()); + assertEquals(source, parseResult.getSourceUnit().toText()); + } } diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/bugs/PerformCommentEofTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/bugs/PerformCommentEofTest.java new file mode 100644 index 0000000000..daaa49f468 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/divisions/procedure/bugs/PerformCommentEofTest.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.divisions.procedure.bugs; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.eclipse.lsp.cobol.cst.procedure.Statement; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.junit.jupiter.api.Test; + +/** Perform \n PASS. - PASS. confused with PARAGRAPH name. */ +public class PerformCommentEofTest { + @Test + void test() { + String performStatement = "PERFORM\n" + " \n" + " PASS."; + String gotoStatement = " GO TO A.\n"; + String source = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. TEST1.\n" + + " PROCEDURE DIVISION.\n" + + " A.\n " + + performStatement + + gotoStatement; + + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + Statement statement = + (Statement) + parseResult + .getSourceUnit() + .getChildren() + .get(1) + .getChildren() + .get(3) + .getChildren() + .get(6) // PARAGRAPH A. + .getChildren() + .get(4); // The perform statement + assertTrue(parseResult.getDiagnostics().isEmpty()); + assertEquals(performStatement, statement.toText()); + assertEquals(source, parseResult.getSourceUnit().toText()); + } +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/HwCobolLexerTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/HwCobolLexerTest.java new file mode 100644 index 0000000000..20efe2ffd6 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/HwCobolLexerTest.java @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.lexer; + +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; + +import static org.junit.jupiter.api.Assertions.*; + +import org.junit.jupiter.api.Test; +import static org.eclipse.lsp.cobol.lexer.LexerTestUtils.*; + +/** + * test hw lexer + */ +class HwCobolLexerTest { + + @Test + void identificationDivision() { + CobolLexer lexer = new CobolLexer("Id DIVISION.\nPROGRAM-ID. Pr1.\n"); + assertToken(lexer.forward(), "Id", 0, 0, 0); + assertToken(lexer.forward(), " ", 0, 2, 2); + assertToken(lexer.forward(), "DIVISION", 0, 3, 3); + assertToken(lexer.forward(), ".", 0, 11, 11); + assertToken(lexer.forward(), "\n", 0, 12, 12); + assertToken(lexer.forward(), "PROGRAM-ID", 1, 0, 13); + assertToken(lexer.forward(), ".", 1, 10, 23); + assertToken(lexer.forward(), " ", 1, 11, 24); + assertToken(lexer.forward(), "Pr1", 1, 12, 25); + assertToken(lexer.forward(), ".", 1, 15, 28); + assertToken(lexer.forward(), "\n", 1, 16, 29); + assertToken(lexer.forward(), "", 2, 0, 30); + assertFalse(lexer.hasMore()); + } + + @Test + void newLine() { + CobolLexer lexer = new CobolLexer("A \n B"); + assertToken(lexer.forward(), "A", 0, 0, 0); + assertToken(lexer.forward(), " ", 0, 1, 1); + assertToken(lexer.forward(), "\n", 0, 2, 2); + assertToken(lexer.forward(), " ", 1, 0, 3); + assertToken(lexer.forward(), "B", 1, 1, 4); + assertFalse(lexer.hasMore()); + } + + @Test + void quotes() { + CobolLexer lexer = new CobolLexer("A '\n B'"); + assertToken(lexer.forward(), "A", 0, 0, 0); + assertToken(lexer.forward(), " ", 0, 1, 1); + assertToken(lexer.forward(), "'\n B'", 0, 2, 2); + assertFalse(lexer.hasMore()); + } + + @Test + void quotesEscape() { + CobolLexer lexer = new CobolLexer("A '''\n B'"); + assertToken(lexer.forward(), "A", 0, 0, 0); + assertToken(lexer.forward(), " ", 0, 1, 1); + assertToken(lexer.forward(), "'''\n B'", 0, 2, 2); + assertFalse(lexer.hasMore()); + } + + @Test + void doubleQuotes() { + CobolLexer lexer = new CobolLexer("A \"\n B\""); + assertToken(lexer.forward(), "A", 0, 0, 0); + assertToken(lexer.forward(), " ", 0, 1, 1); + assertToken(lexer.forward(), "\"\n B\"", 0, 2, 2); + assertFalse(lexer.hasMore()); + } + + @Test + void doubleQuotesEscape() { + CobolLexer lexer = new CobolLexer("A \"\"\"\n B\""); + assertToken(lexer.forward(), "A", 0, 0, 0); + assertToken(lexer.forward(), " ", 0, 1, 1); + assertToken(lexer.forward(), "\"\"\"\n B\"", 0, 2, 2); + assertFalse(lexer.hasMore()); + } + + @Test + void peekTest() { + CobolLexer lexer = new CobolLexer("Aa\n B"); + assertToken(lexer.peek(), "Aa", 0, 0, 0); + assertToken(lexer.peek(), "Aa", 0, 0, 0); + assertToken(lexer.forward(), "Aa", 0, 0, 0); + assertToken(lexer.peek(), "\n", 0, 2, 2); + assertToken(lexer.forward(), "\n", 0, 2, 2); + assertToken(lexer.peek(), " ", 1, 0, 3); + } +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/LexerTestUtils.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/LexerTestUtils.java new file mode 100644 index 0000000000..f1feef16cf --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/LexerTestUtils.java @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.lexer; + +import org.eclipse.lsp.cobol.parser.hw.lexer.Token; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** Utilities for lexer tests */ +public final class LexerTestUtils { + private LexerTestUtils() { + // no-op + } + + /** + * Assert a token + * + * @param token the token + * @param lexeme token text + * @param line token line + * @param charPos token position in line + * @param index token position in source + */ + public static void assertToken(Token token, String lexeme, int line, int charPos, int index) { + assertEquals(lexeme, token.getLexeme(), "lexeme"); + assertEquals(line, token.getLine(), "line"); + assertEquals(charPos, token.getStartPositionInLine(), "char in line position"); + assertEquals(index, token.getIndexStart(), "indexStart"); + assertEquals(index + lexeme.length(), token.getIndexStop(), "indexStop"); + } + +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/NonNumericLiteralTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/NonNumericLiteralTest.java new file mode 100644 index 0000000000..686890fc21 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/NonNumericLiteralTest.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.lexer; + +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.junit.jupiter.api.Test; + +import static org.eclipse.lsp.cobol.lexer.LexerTestUtils.assertToken; + +/** + * Make sure that we can distinguish 100-A from 100-100 + */ +class NonNumericLiteralTest { + @Test + void test() { + CobolLexer lexer = new CobolLexer("0000-MAIN "); + assertToken(lexer.forward(), "0000-MAIN", 0, 0, 0); + assertToken(lexer.forward(), " ", 0, 9, 9); + } + + @Test + void minusAtTheEndOfWord() { + CobolLexer lexer = new CobolLexer("W-11- -2"); + assertToken(lexer.forward(), "W-11", 0, 0, 0); + assertToken(lexer.forward(), "-", 0, 4, 4); + assertToken(lexer.forward(), " ", 0, 5, 5); + assertToken(lexer.forward(), "-2", 0, 6, 6); + } + + @Test + void minusMinusAtTheEndOfWord() { + CobolLexer lexer = new CobolLexer("W-11-- -2"); + assertToken(lexer.forward(), "W-11", 0, 0, 0); + assertToken(lexer.forward(), "--", 0, 4, 4); + assertToken(lexer.forward(), " ", 0, 6, 6); + assertToken(lexer.forward(), "-2", 0, 7, 7); + } + @Test + void minusMinusAtTheEndOfWord2() { + CobolLexer lexer = new CobolLexer("W---11-- -2"); + assertToken(lexer.forward(), "W---11", 0, 0, 0); + assertToken(lexer.forward(), "--", 0, 6, 6); + assertToken(lexer.forward(), " ", 0, 8, 8); + assertToken(lexer.forward(), "-2", 0, 9, 9); + } + + @Test + void minusesInCobolWord() { + CobolLexer lexer = new CobolLexer("SEP-WRITE-5 "); + assertToken(lexer.forward(), "SEP-WRITE-5", 0, 0, 0); + assertToken(lexer.forward(), " ", 0, 11, 11); + } + + @Test + void symbols() { + CobolLexer lexer = new CobolLexer("(A,B)"); + assertToken(lexer.forward(), "(", 0, 0, 0); + assertToken(lexer.forward(), "A", 0, 1, 1); + assertToken(lexer.forward(), ",", 0, 2, 2); + assertToken(lexer.forward(), "B", 0, 3, 3); + assertToken(lexer.forward(), ")", 0, 4, 4); + } + + @Test + void operands() { + CobolLexer lexer = new CobolLexer("<= >= =< =>"); + assertToken(lexer.forward(), "<=", 0, 0, 0); + assertToken(lexer.forward(), " ", 0, 2, 2); + assertToken(lexer.forward(), ">=", 0, 3, 3); + assertToken(lexer.forward(), " ", 0, 5, 5); + assertToken(lexer.forward(), "=", 0, 6, 6); + assertToken(lexer.forward(), "<", 0, 7, 7); + assertToken(lexer.forward(), " ", 0, 8, 8); + assertToken(lexer.forward(), "=", 0, 9, 9); + assertToken(lexer.forward(), ">", 0, 10, 10); + } + +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/NumericLiteralsTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/NumericLiteralsTest.java new file mode 100644 index 0000000000..d62d3c4b44 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/lexer/NumericLiteralsTest.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + */ +package org.eclipse.lsp.cobol.lexer; + +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import java.util.stream.Stream; + +import static org.eclipse.lsp.cobol.lexer.LexerTestUtils.assertToken; +import static org.junit.jupiter.api.Assertions.assertFalse; + +/** + * Test numeric literals tokenization + */ +class NumericLiteralsTest { + // https://www.ibm.com/docs/en/cobol-zos/6.4?topic=literals-numeric + + @ParameterizedTest(name = "[{index}] test {0}") + @MethodSource("numbers") + void floatingNumber(String token) { + CobolLexer lexer = new CobolLexer(token); + assertToken(lexer.forward(), token, 0, 0, 0); + assertFalse(lexer.hasMore()); + } + + public static Stream numbers() { + return Stream.of( + Arguments.of("1"), + Arguments.of("+1"), + Arguments.of("-1"), + Arguments.of("12"), + Arguments.of("+12"), + Arguments.of("-12"), + Arguments.of("12.01"), + Arguments.of("+12.01"), + Arguments.of("-12.01"), + Arguments.of("12.01E-78"), + Arguments.of("+12.01E-78"), + Arguments.of("-12.01E-78"), + Arguments.of("12.01E+8"), + Arguments.of("+12.01E+78"), + Arguments.of("-12.01E+78"), + Arguments.of("12E+8"), + Arguments.of("+1E+78"), + Arguments.of("-11E+78"), + Arguments.of(".12E+8"), + Arguments.of(".1E+78"), + Arguments.of(".11E+78") + ); + } +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/migration/CompositionTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/migration/CompositionTest.java similarity index 56% rename from server/parser/src/test/java/org/eclipse/lsp/cobol/core/migration/CompositionTest.java rename to server/parser/src/test/java/org/eclipse/lsp/cobol/migration/CompositionTest.java index 70348039ba..cedeef85f4 100644 --- a/server/parser/src/test/java/org/eclipse/lsp/cobol/core/migration/CompositionTest.java +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/migration/CompositionTest.java @@ -14,16 +14,16 @@ * and DAF development standards * */ -package org.eclipse.lsp.cobol.core.migration; +package org.eclipse.lsp.cobol.migration; import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.tree.ParseTree; import org.antlr.v4.runtime.tree.ParseTreeListener; -import org.eclipse.lsp.cobol.core.cst.SourceUnit; -import org.eclipse.lsp.cobol.core.hw.ParserSettings; -import org.eclipse.lsp.cobol.core.hw.antlradapter.AntlrAdapter; -import org.eclipse.lsp.cobol.core.hw.CobolLexer; -import org.eclipse.lsp.cobol.core.hw.CobolParser; +import org.eclipse.lsp.cobol.cst.SourceUnit; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.antlradapter.AntlrAdapter; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -33,15 +33,8 @@ * Test antlr composition */ class CompositionTest { - private static final String NESTED_PROGRAM = "ID DIVISION. PROGRAM-ID. Pr2.\n" + "END PROGRAM Pr2.\n"; - private static final String PROGRAM = "ID DIVISION. PROGRAM-ID. Pr1.\n" + NESTED_PROGRAM + "END PROGRAM Pr1.\n"; - private static final String PROGRAM_PARA = "ID DIVISION. PROGRAM-ID. str1.\n" - + "PROCEDURE DIVISION.\n" - + " DISPLAY 'OUT'.\n" - + " PARAG1.\n" - + " DISPLAY 'PARAG1'.\n" - + " PARAG2.\n" - + " DISPLAY 'PARAG2'.\n"; + private static final String NESTED_PROGRAM = " ID DIVISION. PROGRAM-ID. Pr2.\n" + " END PROGRAM Pr2.\n"; + private static final String PROGRAM = " ID DIVISION. PROGRAM-ID. Pr1.\n" + NESTED_PROGRAM + " END PROGRAM Pr1.\n"; @Test void nestedPrograms() { @@ -58,6 +51,22 @@ void nestedPrograms() { assertEquals(antlrNPu.getChildCount(), migratedNPu.getChildCount()); } + @Test + void programsWithEnd() { + SourceUnit su = new CobolParser(new CobolLexer(NESTED_PROGRAM), new ParserSettings()).parse().getSourceUnit(); + org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext migrated = new AntlrAdapter(mock(BaseErrorListener.class), mock(DefaultErrorStrategy.class), mock(ParseTreeListener.class)).sourceUnitToStartRule(su); + org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext antlr = antlrParse(NESTED_PROGRAM); + assertEquals(antlr.children.size(), migrated.children.size()); + assertEquals(antlr.children.get(0).getChildCount(), migrated.children.get(0).getChildCount()); + ParseTree antlrPu = antlr.getChild(0).getChild(0); + ParseTree migratedPu = migrated.getChild(0).getChild(0); + assertEquals(antlrPu.getChildCount(), migratedPu.getChildCount()); + org.eclipse.lsp.cobol.core.CobolParser.EndProgramStatementContext antlrNPu = (org.eclipse.lsp.cobol.core.CobolParser.EndProgramStatementContext) antlrPu.getChild(1); + org.eclipse.lsp.cobol.core.CobolParser.EndProgramStatementContext migratedNPu = (org.eclipse.lsp.cobol.core.CobolParser.EndProgramStatementContext) migratedPu.getChild(1); + // make sure that make are the same, we don't need ideally correct adoption + assertEquals(antlrNPu.programName().getText(), migratedNPu.programName().getText()); + } + org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext antlrParse(String input) { org.eclipse.lsp.cobol.core.CobolLexer antlrLexer = new org.eclipse.lsp.cobol.core.CobolLexer(CharStreams.fromString(input)); antlrLexer.removeErrorListeners(); @@ -69,9 +78,4 @@ org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext antlrParse(String input) antlrParser.addErrorListener(listener); return antlrParser.startRule(); } - - @Test - void paragraphTest() { - SourceUnit su = new CobolParser(new CobolLexer(PROGRAM_PARA), new ParserSettings()).parse().getSourceUnit(); - } } diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/migration/ElementsOrderTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/migration/ElementsOrderTest.java new file mode 100644 index 0000000000..f03b2d29c0 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/migration/ElementsOrderTest.java @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * DAF Trucks NV – implementation of DaCo COBOL statements + * and DAF development standards + * + */ +package org.eclipse.lsp.cobol.migration; + +import org.antlr.v4.runtime.BaseErrorListener; +import org.antlr.v4.runtime.DefaultErrorStrategy; +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.eclipse.lsp.cobol.cst.ProgramUnit; +import org.eclipse.lsp.cobol.cst.SourceUnit; +import org.eclipse.lsp.cobol.cst.procedure.Paragraph; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.antlradapter.AntlrAdapter; +import org.junit.jupiter.api.Test; + +import java.util.List; + +import static org.eclipse.lsp.cobol.migration.SectionCompositionTest.antlrParse; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; + +/** + * make sure that nodes are in the right order. + */ +class ElementsOrderTest { + @Test + void case4() { + String source = " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. CASE4.\n" + + " PROCEDURE DIVISION.\n" + + " DISPLAY 'OUT'.\n" + + " GO TO PARAG1.\n" + + " PARAG1.\n" + + " DISPLAY 'PARAG1'.\n" + + " PERFORM PARAG2.\n" + + " PARAG2.\n" + + " DISPLAY 'PARAG2'."; + + SourceUnit su = new CobolParser(new CobolLexer(source), new ParserSettings()).parse().getSourceUnit(); + ProgramUnit pu = (ProgramUnit) su.getChildren().get(1); + List paragraphs = pu.list(Paragraph.class); + Paragraph p1 = paragraphs.get(0); + Paragraph p2 = paragraphs.get(1); + assertEquals("PARAG1", p1.getName()); + assertEquals("PARAG2", p2.getName()); + + AntlrAdapter antlrAdapter = + new AntlrAdapter( + mock(BaseErrorListener.class), + mock(DefaultErrorStrategy.class), + mock(ParseTreeListener.class)); + + org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext migrated = + antlrAdapter.sourceUnitToStartRule(su); + org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext antlr = antlrParse(source); + ParseTree antlrPdc = antlr.getChild(0).getChild(0).getChild(1); + ParseTree migratedPdc = migrated.getChild(0).getChild(0).getChild(1); + + Utils.compareAll(antlrPdc, migratedPdc); + + ParseTree antlrP1 = antlrPdc.getChild(3).getChild(0).getChild(2); + ParseTree antlrP2 = antlrPdc.getChild(3).getChild(0).getChild(3); + ParseTree migratedP1 = migratedPdc.getChild(3).getChild(0).getChild(2); + ParseTree migratedP2 = migratedPdc.getChild(3).getChild(0).getChild(3); + assertEquals(antlrP1.getChildCount(), migratedP1.getChildCount()); + assertEquals(antlrP2.getChildCount(), migratedP2.getChildCount()); + Utils.compareStartStopPositions(antlrP1, migratedP1); + Utils.compareStartStopPositions(antlrP2, migratedP2); + } + + @Test + void case5() { + String source = " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. SECTST.\n" + + " PROCEDURE DIVISION.\n" + + " DISPLAY 'OUT'.\n" + + " GO TO PARAG1.\n" + + " SECT1 SECTION.\n" + + " PARAG1.\n" + + " DISPLAY 'PARAG1'.\n" + + " PERFORM PARAG2 OF SECT2.\n" + + " SECT2 SECTION.\n" + + " PARAG2.\n" + + " DISPLAY 'PARAG2'."; + + SourceUnit su = new CobolParser(new CobolLexer(source), new ParserSettings()).parse().getSourceUnit(); + ProgramUnit pu = (ProgramUnit) su.getChildren().get(1); + List paragraphs = pu.list(Paragraph.class); + Paragraph p1 = paragraphs.get(0); + Paragraph p2 = paragraphs.get(1); + assertEquals("PARAG1", p1.getName()); + assertEquals("PARAG2", p2.getName()); + + AntlrAdapter antlrAdapter = + new AntlrAdapter( + mock(BaseErrorListener.class), + mock(DefaultErrorStrategy.class), + mock(ParseTreeListener.class)); + + org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext migrated = + antlrAdapter.sourceUnitToStartRule(su); + org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext antlr = antlrParse(source); + ParseTree antlrPdc = antlr.getChild(0).getChild(0).getChild(1); + ParseTree migratedPdc = migrated.getChild(0).getChild(0).getChild(1); + ParseTree antlr1 = antlrPdc.getChild(3).getChild(1); + ParseTree antlr2 = antlrPdc.getChild(3).getChild(2); + ParseTree migrated1 = migratedPdc.getChild(3).getChild(1); + ParseTree migrated2 = migratedPdc.getChild(3).getChild(2); + Utils.compareStartStopPositions(antlr1, migrated1); + Utils.compareStartStopPositions(antlr2, migrated2); + assertEquals(antlr1.getChildCount(), migrated1.getChildCount()); + assertEquals(antlr2.getChildCount(), migrated2.getChildCount()); + } + +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/migration/SectionCompositionTest.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/migration/SectionCompositionTest.java new file mode 100644 index 0000000000..f4c46cd526 --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/migration/SectionCompositionTest.java @@ -0,0 +1,344 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * DAF Trucks NV – implementation of DaCo COBOL statements + * and DAF development standards + * + */ +package org.eclipse.lsp.cobol.migration; + +import org.antlr.v4.runtime.*; +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.eclipse.lsp.cobol.cst.SourceUnit; +import org.eclipse.lsp.cobol.parser.hw.lexer.CobolLexer; +import org.eclipse.lsp.cobol.parser.hw.CobolParser; +import org.eclipse.lsp.cobol.parser.hw.ParseResult; +import org.eclipse.lsp.cobol.parser.hw.ParserSettings; +import org.eclipse.lsp.cobol.parser.hw.antlradapter.AntlrAdapter; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; + +/** + * Test that HW parser can understand sections. + */ +class SectionCompositionTest { + @Test + void test() { + String source = + "IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. SECTST.\n" + + " PROCEDURE DIVISION.\n" + + " DISPLAY 'OUT'.\n" + + " GO TO PARAG1.\n" + + " SECT1 SECTION.\n" + + " DISPLAY 'SECT1'.\n" + + " PARAG1.\n" + + " DISPLAY 'PARAG1'.\n" + + " PERFORM PARAG2 OF SECT2.\n" + + " SECT2 SECTION.\n" + + " PARAG2.\n" + + " DISPLAY 'PARAG2'."; + + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + + SourceUnit su = parseResult.getSourceUnit(); + AntlrAdapter antlrAdapter = + new AntlrAdapter( + mock(BaseErrorListener.class), + mock(DefaultErrorStrategy.class), + mock(ParseTreeListener.class)); + + org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext migrated = + antlrAdapter.sourceUnitToStartRule(su); + org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext antlr = antlrParse(source); + + + ParseTree antlrPd = antlr.getChild(0).getChild(0).getChild(1); + ParseTree migratedPd = migrated.getChild(0).getChild(0).getChild(1); + assertEquals(antlrPd.getChildCount(), migratedPd.getChildCount()); + + ParseTree antlrPdb = antlrPd.getChild(3); + ParseTree migratedPdb = migratedPd.getChild(3); + + assertEquals(antlrPdb.getChild(0).getChildCount(), migratedPdb.getChild(0).getChildCount()); + + Utils.compareStartStopPositions(antlrPdb.getChild(0), migratedPdb.getChild(0)); + Utils.compareStartStopPositions(antlrPdb.getChild(1), migratedPdb.getChild(1)); + Utils.compareStartStopPositions(antlrPdb.getChild(2), migratedPdb.getChild(2)); + } + + @Test + void testParagraphSection2() { + String source = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. TX2.\n" + + " PROCEDURE DIVISION.\n" + + " GO TO PARAG1 OF SECTION-1.\n" + + " PARAG1.\n" + + " SECTION-1 SECTION.\n" + + " PARAG1."; + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + + SourceUnit su = parseResult.getSourceUnit(); + AntlrAdapter antlrAdapter = + new AntlrAdapter( + mock(BaseErrorListener.class), + mock(DefaultErrorStrategy.class), + mock(ParseTreeListener.class)); + + org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext migrated = + antlrAdapter.sourceUnitToStartRule(su); + org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext antlr = antlrParse(source); + + ParseTree antlrPd = antlr.getChild(0).getChild(0).getChild(1); + ParseTree migratedPd = migrated.getChild(0).getChild(0).getChild(1); + assertEquals(antlrPd.getChildCount(), migratedPd.getChildCount()); + Utils.compareStartStopPositions(antlrPd, migratedPd); + + ParseTree antlrPdb = antlrPd.getChild(3); + ParseTree migratedPdb = migratedPd.getChild(3); + Utils.compareStartStopPositions(antlrPdb, migratedPdb); + assertEquals(antlrPdb.getChildCount(), migratedPdb.getChildCount()); + Utils.compareStartStopPositions(antlrPdb, migratedPdb); + + ParserRuleContext antlrPdbP1 = (ParserRuleContext) antlrPdb.getChild(0); + ParserRuleContext migratedPdbP1 = (ParserRuleContext) migratedPdb.getChild(0); + assertEquals(antlrPdbP1.getChildCount(), migratedPdbP1.getChildCount()); + assertEquals(antlrPdbP1.getChild(1).getChild(0).getText(), migratedPdbP1.getChild(1).getChild(0).getText()); + + ParseTree antlrSection = antlrPdb.getChild(1); + ParseTree migratedSection = migratedPdb.getChild(1); + assertEquals(antlrSection.getChildCount(), migratedSection.getChildCount()); + ParseTree antlrSectionHeader = antlrSection.getChild(0); + ParseTree migratedSectionHeader = migratedSection.getChild(0); + assertEquals(antlrSectionHeader.getChildCount(), migratedSectionHeader.getChildCount()); + assertEquals(antlrSectionHeader.getText(), migratedSectionHeader.getText()); + + ParseTree antlrSP = antlrSection.getChild(2).getChild(0); + ParseTree migratedSP = migratedSection.getChild(2).getChild(0); + + assertEquals(antlrSP.getChildCount(), migratedSP.getChildCount()); + Utils.compareStartStopPositions(antlrSP, migratedSP); + assertEquals(antlrSP.getText(), migratedSP.getText()); + + assertEquals(antlrSection.getText(), migratedSection.getText()); + } + + @Test + void testMatchPositions() { + String source = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. MPT.\n" + + " PROCEDURE DIVISION.\n" + + " PARAG1.\n"; + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + SourceUnit su = parseResult.getSourceUnit(); + AntlrAdapter antlrAdapter = + new AntlrAdapter( + mock(BaseErrorListener.class), + mock(DefaultErrorStrategy.class), + mock(ParseTreeListener.class)); + + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext migrated = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrAdapter.sourceUnitToStartRule(su).getChild(0); + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext antlr = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrParse(source).getChild(0); + ParserRuleContext antlrP = (ParserRuleContext) antlr.getChild(0).getChild(1).getChild(3).getChild(0).getChild(0); + ParserRuleContext migratedP = (ParserRuleContext) migrated.getChild(0).getChild(1).getChild(3).getChild(0).getChild(0); + assertEquals(antlrP.getStop().getCharPositionInLine(), migratedP.getStop().getCharPositionInLine()); + } + + @Test + void testMatchPositionsPara() { + String source = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. MPT.\n" + + " PROCEDURE DIVISION.\n" + + " GO TO PARAG1 OF SECTION-1.\n"; + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + SourceUnit su = parseResult.getSourceUnit(); + AntlrAdapter antlrAdapter = + new AntlrAdapter( + mock(BaseErrorListener.class), + mock(DefaultErrorStrategy.class), + mock(ParseTreeListener.class)); + + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext migrated = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrAdapter.sourceUnitToStartRule(su).getChild(0); + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext antlr = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrParse(source).getChild(0); + ParserRuleContext antlrP = (ParserRuleContext) antlr.getChild(0).getChild(1).getChild(3).getChild(0) + .getChild(0) // sentence + .getChild(0) // statement + .getChild(0) // goto + .getChild(2) // procedure name + .getChild(0); // paragraph name + ParserRuleContext migratedP = (ParserRuleContext) migrated.getChild(0).getChild(1).getChild(3).getChild(0) + .getChild(0) // sentence + .getChild(0) // statement + .getChild(0) // goto + .getChild(2) // procedure name + .getChild(0); // paragraph name + + Utils.compareStartStopPositions(antlrP, migratedP); + } + + @Test + void testMatchPositions3() { + String source = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. AMB10.\n" + + " PROCEDURE DIVISION.\n" + + " GO TO PARAG1 OF SECTION-1.\n" + + " PARAG1.\n" + + " SECTION-1 SECTION.\n" + + " PARAG1."; + + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + SourceUnit su = parseResult.getSourceUnit(); + AntlrAdapter antlrAdapter = + new AntlrAdapter( + mock(BaseErrorListener.class), + mock(DefaultErrorStrategy.class), + mock(ParseTreeListener.class)); + + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext migrated = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrAdapter.sourceUnitToStartRule(su).getChild(0); + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext antlr = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrParse(source).getChild(0); + + ParseTree antlrS = antlr.getChild(0).getChild(1).getChild(3).getChild(1); + ParseTree migratedS = migrated.getChild(0).getChild(1).getChild(3).getChild(1); + Utils.compareStartStopPositions(antlrS, migratedS); + + + ParserRuleContext antlrP = (ParserRuleContext) antlr.getChild(0).getChild(1).getChild(3) + .getChild(0) // paragraphs + .getChild(0); + ParserRuleContext migratedP = (ParserRuleContext) migrated.getChild(0).getChild(1).getChild(3) + .getChild(0) // paragraphs + .getChild(0); + Utils.compareStartStopPositions(antlrP, migratedP); + + antlrP = (ParserRuleContext) antlr.getChild(0).getChild(1).getChild(3).getChild(1) + .getChild(2) + .getChild(0); + migratedP = (ParserRuleContext) migrated.getChild(0).getChild(1).getChild(3).getChild(1) + .getChild(2) + .getChild(0); + + assertEquals(antlrP.getChildCount(), migratedP.getChildCount()); + Utils.compareStartStopPositions(antlrP, migratedP); + } + + @Test + void testMatchPositions4() { + String source = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. AMB10.\n" + + " PROCEDURE DIVISION.\n" + + " SECTION-1 SECTION.\n" + + " GO TO PARAG1 OF SECTION-1.\n"; + + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + SourceUnit su = parseResult.getSourceUnit(); + AntlrAdapter antlrAdapter = + new AntlrAdapter( + mock(BaseErrorListener.class), + mock(DefaultErrorStrategy.class), + mock(ParseTreeListener.class)); + + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext migrated = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrAdapter.sourceUnitToStartRule(su).getChild(0); + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext antlr = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrParse(source).getChild(0); + + ParseTree antlrS = antlr.getChild(0).getChild(1).getChild(3).getChild(1); + ParseTree migratedS = migrated.getChild(0).getChild(1).getChild(3).getChild(0); + assertEquals(antlrS.getChildCount(), migratedS.getChildCount()); + Utils.compareStartStopPositions(antlrS, migratedS); + } + + + static org.eclipse.lsp.cobol.core.CobolParser.StartRuleContext antlrParse(String input) { + org.eclipse.lsp.cobol.core.CobolLexer antlrLexer = + new org.eclipse.lsp.cobol.core.CobolLexer(CharStreams.fromString(input)); + antlrLexer.removeErrorListeners(); + ANTLRErrorListener listener = new ConsoleErrorListener(); + antlrLexer.addErrorListener(listener); + CommonTokenStream tokens = new CommonTokenStream(antlrLexer); + org.eclipse.lsp.cobol.core.CobolParser antlrParser = new org.eclipse.lsp.cobol.core.CobolParser(tokens); + antlrParser.removeErrorListeners(); + antlrParser.addErrorListener(listener); + return antlrParser.startRule(); + } + + @Test + void testMatchSourceUnit() { + String source = + " IDENTIFICATION DIVISION.\n" + + " PROGRAM-ID. MPT.\n" + + " PROCEDURE DIVISION.\n" + + " PARAG1.\n"; + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + SourceUnit su = parseResult.getSourceUnit(); + AntlrAdapter antlrAdapter = + new AntlrAdapter( + mock(BaseErrorListener.class), + mock(DefaultErrorStrategy.class), + mock(ParseTreeListener.class)); + + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext migrated = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrAdapter.sourceUnitToStartRule(su).getChild(0); + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext antlr = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrParse(source).getChild(0); + ParseTree antlrPbc = antlr.getChild(0) // PU + .getChild(1) // DC + .getChild(3); + ParseTree migratedPbc = migrated.getChild(0) // PU + .getChild(1) // DC + .getChild(3); // Pdb + + Utils.compareAll(antlrPbc, migratedPbc); + + ParseTree antlrPc = antlrPbc.getChild(0).getChild(0); // PС + ParseTree migratedPc = migratedPbc.getChild(0).getChild(0); // PС + + Utils.compareStartStopPositions(antlrPc, migratedPc); + } + + @Test + void testParagraphMatchPositions() { + String source = " ID DIVISION.\n" + + " PROGRAM-ID. TESTREPL.\n" + + " PROCEDURE DIViSION. \n" + + " MAINLINE. \n" + + " GOBACK. "; + ParseResult parseResult = new CobolParser(new CobolLexer(source), new ParserSettings()).parse(); + SourceUnit su = parseResult.getSourceUnit(); + AntlrAdapter antlrAdapter = + new AntlrAdapter( + mock(BaseErrorListener.class), + mock(DefaultErrorStrategy.class), + mock(ParseTreeListener.class)); + + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext migrated = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrAdapter.sourceUnitToStartRule(su).getChild(0); + org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext antlr = + (org.eclipse.lsp.cobol.core.CobolParser.CompilationUnitContext) antlrParse(source).getChild(0); + Utils.compareAll(antlr.getChild(0).getChild(1), migrated.getChild(0).getChild(1)); + } + +} diff --git a/server/parser/src/test/java/org/eclipse/lsp/cobol/migration/Utils.java b/server/parser/src/test/java/org/eclipse/lsp/cobol/migration/Utils.java new file mode 100644 index 0000000000..8c1c74bb9b --- /dev/null +++ b/server/parser/src/test/java/org/eclipse/lsp/cobol/migration/Utils.java @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * DAF Trucks NV – implementation of DaCo COBOL statements + * and DAF development standards + * + */ +package org.eclipse.lsp.cobol.migration; + +import org.antlr.v4.runtime.ParserRuleContext; +import org.antlr.v4.runtime.tree.ParseTree; +import org.antlr.v4.runtime.tree.TerminalNodeImpl; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Parser Test Utilities + */ +public class Utils { + /** + * Recursively compare positions of nodes + * @param node1 the first node + * @param node2 the second node + */ + public static void compareAll(ParseTree node1, ParseTree node2) { + compareStartStopPositions(node1, node2); + for (int i = 0; i < node1.getChildCount(); i++) { + compareAll(node1.getChild(i), node2.getChild(i)); + } + } + + /** + * Compares Start and Stop Positions + * @param node1 the first node + * @param node2 the second node + */ + public static void compareStartStopPositions(ParseTree node1, ParseTree node2) { + if (node1 instanceof TerminalNodeImpl || node2 instanceof TerminalNodeImpl) { + return; + } + ParserRuleContext a = (ParserRuleContext) node1; + ParserRuleContext m = (ParserRuleContext) node2; + String prefix = "[" + a.getClass() + "] "; + assertEquals(a.getStart().getStartIndex(), m.getStart().getStartIndex(), prefix + "Start: StartIndex"); + assertEquals(a.getStart().getLine(), m.getStart().getLine(), prefix + "Start: Line"); + assertEquals(a.getStart().getCharPositionInLine(), m.getStart().getCharPositionInLine(), prefix + "Start: CharPositionInLine"); + assertEquals(a.getStop().getStartIndex(), m.getStop().getStartIndex(), prefix + "Stop: StartIndex"); + assertEquals(a.getStop().getLine(), m.getStop().getLine(), prefix + "Stop: Line"); + assertEquals(a.getStop().getCharPositionInLine(), m.getStop().getCharPositionInLine(), prefix + "Stop: CharPositionInLine"); + } +} diff --git a/server/pom.xml b/server/pom.xml index 5c03ef65ee..24b7e4c6d7 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -19,7 +19,7 @@ - 1.0.7 + 1.0.8 8 8 1.10.0 diff --git a/server/test/pom.xml b/server/test/pom.xml index d0b60bc35c..34fcadce45 100644 --- a/server/test/pom.xml +++ b/server/test/pom.xml @@ -22,8 +22,6 @@ 5.6.0 1.6.0 5.10.0 - 2.7 - 4.3.0 0.8.11 3.0.0-M3 4.2.2 @@ -232,28 +230,6 @@ - - org.codehaus.mojo - cobertura-maven-plugin - ${maven.cobertura.plugin.version} - - xml - 256m - true - - - org/eclipse/lsp/**/*.class - - - - - - - org.eluder.coveralls - coveralls-maven-plugin - ${maven.coveralls.plugin.version} - - org.jacoco jacoco-maven-plugin diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCaseEngine.java b/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCaseEngine.java index 2e0afc1058..4031a1f629 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCaseEngine.java +++ b/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCaseEngine.java @@ -38,6 +38,7 @@ import org.eclipse.lsp.cobol.common.AnalysisResult; import org.eclipse.lsp.cobol.common.copybook.CopybookProcessingMode; import org.eclipse.lsp.cobol.common.copybook.SQLBackend; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import org.eclipse.lsp.cobol.common.model.DefinedAndUsedStructure; import org.eclipse.lsp.cobol.common.model.NodeType; import org.eclipse.lsp.cobol.common.model.tree.CopyNode; @@ -131,11 +132,63 @@ public class UseCaseEngine { * @param copybooks - list of the copybooks used in the document * @param expectedDiagnostics - map of IDs and diagnostics that are expected to appear in the * document or copybooks. IDs are the same as in the diagnostic sections inside the text. + * @param languageId - language id + * @return analysis result object + */ + public AnalysisResult runTest( + String text, + List copybooks, + Map expectedDiagnostics, + CobolLanguageId languageId) { + return runTest(text, copybooks, expectedDiagnostics, ImmutableList.of(), languageId); + } + + /** + * Check if the language engine applies required syntax and semantic checks for "cobol" + * language id. All the semantic elements in the given text, as well as + * syntax errors, should be wrapped with according tags. The same extraction operation applied + * also for the given copybooks. Copybooks processing enabled. + * + *

Expected diagnostics should contain the full of list of syntax and semantic + * errors/warnings/info messages for the document and copybooks. Existing positions, if they are, + * for the diagnostics will be dropped and replaced with ones extracted by engine by their IDs. + * + * @param text - COBOL text to analyse. It will be cleaned up before analysis to exclude all the + * technical tokens and collect syntax and semantic elements + * @param copybooks - list of the copybooks used in the document + * @param expectedDiagnostics - map of IDs and diagnostics that are expected to appear in the + * document or copybooks. IDs are the same as in the diagnostic sections inside the text. * @return analysis result object */ public AnalysisResult runTest( String text, List copybooks, Map expectedDiagnostics) { - return runTest(text, copybooks, expectedDiagnostics, ImmutableList.of()); + return runTest(text, copybooks, expectedDiagnostics, ImmutableList.of(), CobolLanguageId.COBOL); + } + + /** + * Check if the language engine applies required syntax and semantic checks for "cobol" + * languageId. All the semantic elements in the given text, as well as syntax errors, should be + * wrapped with according tags. The same extraction operation applied also for the given + * copybooks. The copybook processing mode relies on processingMode parameter. + * + *

Expected diagnostics should contain the full of list of syntax and semantic + * errors/warnings/info messages for the document and copybooks. Existing positions, if they are, + * for the diagnostics will be dropped and replaced with ones extracted by engine by their IDs. + * + * @param text - COBOL text to analyse. It will be cleaned up before analysis to exclude all the + * technical tokens and collect syntax and semantic elements + * @param copybooks - list of the copybooks used in the document + * @param expectedDiagnostics - map of IDs and diagnostics that are expected to appear in the + * document or copybooks. IDs are the same as in the diagnostic sections inside the text. + * @param subroutineNames - list of subroutine names used in the document + * @return analysis result object + */ + public AnalysisResult runTest( + String text, + List copybooks, + Map expectedDiagnostics, + List subroutineNames) { + return runTest(text, copybooks, expectedDiagnostics, subroutineNames, CobolLanguageId.COBOL); } /** @@ -154,19 +207,22 @@ public AnalysisResult runTest( * @param expectedDiagnostics - map of IDs and diagnostics that are expected to appear in the * document or copybooks. IDs are the same as in the diagnostic sections inside the text. * @param subroutineNames - list of subroutine names used in the document + * @param languageId - language id * @return analysis result object */ public AnalysisResult runTest( String text, List copybooks, Map expectedDiagnostics, - List subroutineNames) { + List subroutineNames, + CobolLanguageId languageId) { return runTest( text, copybooks, expectedDiagnostics, subroutineNames, - AnalysisConfig.defaultConfig(CopybookProcessingMode.ENABLED)); + AnalysisConfig.defaultConfig(CopybookProcessingMode.ENABLED), + languageId); } /** @@ -187,6 +243,7 @@ public AnalysisResult runTest( * @param subroutineNames - list of subroutine names used in the document * @param analysisConfig - analysis settings: copybook processing mode and the SQL backend for the * analysis + * @param languageId - language Id * @return analysis result object */ public AnalysisResult runTest( @@ -194,20 +251,17 @@ public AnalysisResult runTest( List copybooks, Map expectedDiagnostics, List subroutineNames, - AnalysisConfig analysisConfig) { + AnalysisConfig analysisConfig, + CobolLanguageId languageId) { - SQLBackend sqlBackendSetting = Optional.ofNullable(analysisConfig.getDialectsSettings() - .get("target-sql-backend")) + SQLBackend sqlBackendSetting = + Optional.ofNullable(analysisConfig.getDialectsSettings().get("target-sql-backend")) .map(JsonElement::getAsString) .map(SQLBackend::valueOf) .orElse(SQLBackend.DB2_SERVER); PreprocessedDocument document = AnnotatedDocumentCleaning.prepareDocument( - text, - copybooks, - subroutineNames, - expectedDiagnostics, - sqlBackendSetting); + text, copybooks, subroutineNames, expectedDiagnostics, sqlBackendSetting); AnalysisResult actual = analyze( UseCase.builder() @@ -216,19 +270,55 @@ public AnalysisResult runTest( .copybooks(document.getCopybooks()) .subroutines(subroutineNames) .cicsTranslator(analysisConfig.isCicsTranslatorEnabled()) - .copybookProcessingMode( - analysisConfig.getCopybookProcessingMode()) + .copybookProcessingMode(analysisConfig.getCopybookProcessingMode()) .dialects(analysisConfig.getDialects()) .sqlBackend(sqlBackendSetting) .dialectsSettings(analysisConfig.getDialectsSettings()) .compilerOptions(analysisConfig.getCompilerOptions()) - .build()); + .build(), + languageId); assertResultEquals(actual, document.getTestData()); return actual; } + /** + * Check if the language engine applies required syntax and semantic checks for "cobol". All the + * semantic elements in the given text, as well as syntax errors, should be wrapped with according + * tags. The same extraction operation applied also for the given copybooks. The copybook + * configuration is built from processingMode and sqlBackend parameters. + * + *

Expected diagnostics should contain the full of list of syntax and semantic + * errors/warnings/info messages for the document and copybooks. Existing positions, if they are, + * for the diagnostics will be dropped and replaced with ones extracted by engine by their IDs. + * + * @param text - COBOL text to analyse. It will be cleaned up before analysis to exclude all the + * technical tokens and collect syntax and semantic elements + * @param copybooks - list of the copybooks used in the document + * @param expectedDiagnostics - map of IDs and diagnostics that are expected to appear in the + * document or copybooks. IDs are the same as in the diagnostic sections inside the text. + * @param subroutineNames - list of subroutine names used in the document + * @param analysisConfig - analysis settings: copybook processing mode and the SQL backend for the + * analysis + * @return analysis result object + */ + public AnalysisResult runTest( + String text, + List copybooks, + Map expectedDiagnostics, + List subroutineNames, + AnalysisConfig analysisConfig) { + return runTest( + text, + copybooks, + expectedDiagnostics, + subroutineNames, + analysisConfig, + CobolLanguageId.COBOL); + } + /** * Run test and check only diagnostic, other errors will be ignored + * * @param text - COBOL text to analyse. It will be cleaned up before analysis to exclude all the * technical tokens and collect syntax and semantic elements * @param copybooks - list of the copybooks used in the document @@ -239,23 +329,21 @@ public AnalysisResult runTest( * analysis * @return analysis result object */ - public AnalysisResult runTestForDiagnostics(String text, - List copybooks, - Map expectedDiagnostics, - List subroutineNames, - AnalysisConfig analysisConfig) { - SQLBackend sqlBackendSetting = Optional.ofNullable(analysisConfig.getDialectsSettings().get("target-sql-backend")) + public AnalysisResult runTestForDiagnostics( + String text, + List copybooks, + Map expectedDiagnostics, + List subroutineNames, + AnalysisConfig analysisConfig) { + SQLBackend sqlBackendSetting = + Optional.ofNullable(analysisConfig.getDialectsSettings().get("target-sql-backend")) .map(JsonElement::getAsString) .map(SQLBackend::valueOf) .orElse(SQLBackend.DB2_SERVER); PreprocessedDocument document = AnnotatedDocumentCleaning.prepareDocument( - text, - copybooks, - subroutineNames, - expectedDiagnostics, - sqlBackendSetting); + text, copybooks, subroutineNames, expectedDiagnostics, sqlBackendSetting); AnalysisResult actual = analyze( UseCase.builder() @@ -264,8 +352,7 @@ public AnalysisResult runTestForDiagnostics(String text, .copybooks(document.getCopybooks()) .subroutines(subroutineNames) .cicsTranslator(analysisConfig.isCicsTranslatorEnabled()) - .copybookProcessingMode( - analysisConfig.getCopybookProcessingMode()) + .copybookProcessingMode(analysisConfig.getCopybookProcessingMode()) .dialects(analysisConfig.getDialects()) .dialectsSettings(analysisConfig.getDialectsSettings()) .build()); @@ -333,18 +420,18 @@ private Map> extractVariables( Function> extractor) { return result - .getRootNode() - .getDepthFirstStream() - .filter(hasType(PROGRAM)) - .map(ProgramNode.class::cast) - .map(p -> result.getSymbolTableMap().get(SymbolTable.generateKey(p))) - .filter(Objects::nonNull) - .map(SymbolTable::getVariables) - .map(Multimap::values) - .flatMap(Collection::stream) - .filter(it -> !FILLER_NAME.equals(it.getName())) - .filter(predicate) - .collect(toMap(extractor, PROGRAM)); + .getRootNode() + .getDepthFirstStream() + .filter(hasType(PROGRAM)) + .map(ProgramNode.class::cast) + .map(p -> result.getSymbolTableMap().get(SymbolTable.generateKey(p))) + .filter(Objects::nonNull) + .map(SymbolTable::getVariables) + .map(Multimap::values) + .flatMap(Collection::stream) + .filter(it -> !FILLER_NAME.equals(it.getName())) + .filter(predicate) + .collect(toMap(extractor, PROGRAM)); } private Map> extractDefinitions(AnalysisResult result, NodeType nodeType) { @@ -358,7 +445,11 @@ private Map> extractDefinitions(AnalysisResult result, No } private Map> extractUsages(AnalysisResult result, NodeType nodeType) { - return extract(result, nodeType, DefinedAndUsedStructure::getUsages, context -> !context.getUsages().isEmpty()); + return extract( + result, + nodeType, + DefinedAndUsedStructure::getUsages, + context -> !context.getUsages().isEmpty()); } private Map> extract( @@ -376,7 +467,7 @@ private Map> extract( } private Collector>> toMap( - Function> extractor, NodeType nodeType) { + Function> extractor, NodeType nodeType) { return Collectors.toMap( ctx -> { if (nodeType != COPY) { diff --git a/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCaseUtils.java b/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCaseUtils.java index 757f3ab706..f0f46b6046 100644 --- a/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCaseUtils.java +++ b/server/test/src/main/java/org/eclipse/lsp/cobol/test/engine/UseCaseUtils.java @@ -14,40 +14,38 @@ */ package org.eclipse.lsp.cobol.test.engine; +import static java.util.Collections.emptyList; +import static java.util.Optional.ofNullable; +import static java.util.stream.Collectors.toList; + import com.google.inject.Injector; +import java.util.List; +import java.util.ServiceLoader; +import java.util.stream.StreamSupport; import lombok.experimental.UtilityClass; import lombok.extern.slf4j.Slf4j; -import org.eclipse.lsp.cobol.common.AnalysisResult; -import org.eclipse.lsp.cobol.common.CleanerPreprocessor; +import org.eclipse.lsp.cobol.common.*; import org.eclipse.lsp.cobol.common.copybook.CopybookModel; import org.eclipse.lsp.cobol.common.copybook.CopybookName; import org.eclipse.lsp.cobol.common.copybook.CopybookService; -import org.eclipse.lsp.cobol.common.SubroutineService; -import org.eclipse.lsp.cobol.common.LanguageEngineFacade; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.dialects.TrueDialectService; import org.eclipse.lsp.cobol.test.CobolText; import org.eclipse.lsp.cobol.test.UseCaseInitializer; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.DiagnosticSeverity; -import java.util.List; -import java.util.ServiceLoader; -import java.util.stream.StreamSupport; - -import static java.util.Collections.emptyList; -import static java.util.Optional.ofNullable; -import static java.util.stream.Collectors.toList; - /** * This utility class provides methods to run use cases with COBOL code examples. */ @Slf4j @UtilityClass public class UseCaseUtils { - public static final String DOCUMENT_URI = "file:///c:/workspace/document.cbl"; - public static final String DOCUMENT2_URI = "file:///c:/workspace/document2.cbl"; + public static final String DOCUMENT_URI = "file:c:/workspace/document.cbl"; + public static final String DOCUMENT2_URI = "file:c:/workspace/document2.cbl"; - public static final String COPYBOOK_URI = "file///c:/copybooks/copybook.cpy"; - private static final String CPY_URI_PREFIX = "file:///c:/workspace/.c4z/.copybooks/"; + public static final String COPYBOOK_URI = "file:c:/copybooks/copybook.cpy"; + private static final String CPY_URI_PREFIX = "c:/workspace/.c4z/.copybooks/"; private static final String CPY_URI_SUFFIX = ".cpy"; /** @@ -58,14 +56,16 @@ public class UseCaseUtils { * @return the URI */ public static String toURI(String name, String dialect) { - StringBuilder sb = new StringBuilder(CPY_URI_PREFIX); + StringBuilder sb = new StringBuilder(); + String currentWorkingDir = System.getProperty("user.dir"); + sb.append("file:").append(currentWorkingDir).append(System.getProperty("file.separator")).append(CPY_URI_PREFIX); if (dialect != null) { sb.append(dialect); sb.append("/"); } sb.append(name); sb.append(CPY_URI_SUFFIX); - return sb.toString(); + return sb.toString().replace("\\", "/"); } /** @@ -103,29 +103,37 @@ public static List analyzeForErrors(UseCase useCase) { * @return the entire analysis result */ public static AnalysisResult analyze(UseCase useCase) { + return analyze(useCase, CobolLanguageId.COBOL); + } + /** + * Analyze the given text using a real language engine providing copybooks required for the + * analysis with the required sync type + * + * @param useCase use case instance to analyze + * @param languageId language Id + * @return the entire analysis result + */ + public static AnalysisResult analyze(UseCase useCase, CobolLanguageId languageId) { ServiceLoader loader = ServiceLoader.load(UseCaseInitializer.class); Injector injector = StreamSupport.stream(loader.spliterator(), false).findFirst() .map(UseCaseInitializer::createInjector) .orElseThrow(() -> new RuntimeException("UseCase initializer not found")); - CleanerPreprocessor preprocessor = injector.getInstance(CleanerPreprocessor.class); + TrueDialectService dialectService = injector.getInstance(TrueDialectService.class); CopybookService copybookService = injector.getInstance(CopybookService.class); + CleanerPreprocessor preprocessor = dialectService.getPreprocessor(languageId); PredefinedCopybookUtils.loadPredefinedCopybooks(useCase.getSqlBackend(), useCase.getCopybooks(), useCase.documentUri) - .forEach(pc -> copybookService.store(pc, true)); + .forEach(pc -> copybookService.store(pc, preprocessor)); useCase.getCopybooks() .forEach(cobolText -> { String copybookText = cobolText.getFullText(); - if (cobolText.isPreprocess()) { - copybookText = preprocessor.cleanUpCode("uri", cobolText.getFullText()) - .getResult().toString(); - } cobolText = new CobolText(cobolText.getFileName().toUpperCase(), cobolText.getDialectType(), copybookText); - copybookService.store(UseCaseUtils.toCopybookModel(cobolText, useCase.documentUri), true); + copybookService.store(UseCaseUtils.toCopybookModel(cobolText, useCase.documentUri), preprocessor); }); SubroutineService subroutines = injector.getInstance(SubroutineService.class); @@ -133,7 +141,7 @@ public static AnalysisResult analyze(UseCase useCase) { return injector .getInstance(LanguageEngineFacade.class) - .analyze(useCase.getDocumentUri(), useCase.getText(), useCase.getAnalysisConfig()); + .analyze(useCase.getDocumentUri(), useCase.getText(), useCase.getAnalysisConfig(), languageId.getId()); } /** * Convert CobolText to CopybookModel diff --git a/sonar-project.properties b/sonar-project.properties index 1eebba55b8..68ab959b9f 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -15,15 +15,16 @@ sonar.sources=clients/cobol-lsp-vscode-extension/src,\ server/parser/src sonar.tests=clients/cobol-lsp-vscode-extension/src/__tests__, - server/common/src/test,\ + server/common/src/test, \ server/dialect-daco/src/test,\ server/dialect-idms/src/test,\ - server/engine/src/test, - server/parser/engine/src/test, + server/engine/src/test,\ + server/parser/src/test, sonar.coverage.jacoco.xmlReportPaths=server/common/target/site/jacoco/jacoco.xml,\ server/dialect-daco/target/site/jacoco/jacoco.xml,\ server/dialect-idms/target/site/jacoco/jacoco.xml,\ server/engine/target/site/jacoco/jacoco.xml,\ + server/engine/target/site/jacoco-aggregate/jacoco.xml,\ server/test/target/site/jacoco/jacoco.xml,\ server/parser/target/site/jacoco/jacoco.xml sonar.javascript.lcov.reportPaths=clients/cobol-lsp-vscode-extension/coverage/lcov.info @@ -31,15 +32,20 @@ sonar.genericcoverage.unitTestReportPaths=test-report.xml sonar.exclusions=clients/cobol-lsp-vscode-extension/**/__tests__/**/*.ts,\ clients/cobol-lsp-vscode-extension/**/test/**/*.ts,\ + clients/idms-dialect-support/**/test/**/*.ts,\ + clients/daco-dialect-support/**/test/**/*.ts,\ clients/cobol-lsp-vscode-extension/**/__mocks__/**/*.ts,\ server/common/src/test/**/*,\ server/dialect-daco/src/test/**/*,\ server/dialect-idms/src/test/**/*,\ - server/engine/src/test/**/* + server/engine/src/test/**/*,\ + server/parser/src/test/**/*,\ + server/test/src/test/**/* sonar.coverage.exclusions=clients/cobol-lsp-vscode-extension/src/__tests__/**/*.ts sonar.java.binaries=server/dialect-daco/target/classes,\ server/dialect-idms/target/classes,\ + server/common/target/classes,\ server/engine/target/classes,\ server/parser/target/classes,\ server/test/target/classes diff --git a/tests/test_files/cicsGenApp/copybooks/ssmap.cpy b/tests/test_files/cicsGenApp/copybooks/ssmap.cpy new file mode 100644 index 0000000000..450ef0b4c3 --- /dev/null +++ b/tests/test_files/cicsGenApp/copybooks/ssmap.cpy @@ -0,0 +1,612 @@ + 01 SSMAPC1I. + 02 FILLER PIC X(12). + 02 ENT1CNOL COMP PIC S9(4). + 02 ENT1CNOF PICTURE X. + 02 FILLER REDEFINES ENT1CNOF. + 03 ENT1CNOA PICTURE X. + 02 ENT1CNOI PIC X(10). + 02 ENT1FNAL COMP PIC S9(4). + 02 ENT1FNAF PICTURE X. + 02 FILLER REDEFINES ENT1FNAF. + 03 ENT1FNAA PICTURE X. + 02 ENT1FNAI PIC X(10). + 02 ENT1LNAL COMP PIC S9(4). + 02 ENT1LNAF PICTURE X. + 02 FILLER REDEFINES ENT1LNAF. + 03 ENT1LNAA PICTURE X. + 02 ENT1LNAI PIC X(20). + 02 ENT1DOBL COMP PIC S9(4). + 02 ENT1DOBF PICTURE X. + 02 FILLER REDEFINES ENT1DOBF. + 03 ENT1DOBA PICTURE X. + 02 ENT1DOBI PIC X(10). + 02 ENT1HNML COMP PIC S9(4). + 02 ENT1HNMF PICTURE X. + 02 FILLER REDEFINES ENT1HNMF. + 03 ENT1HNMA PICTURE X. + 02 ENT1HNMI PIC X(20). + 02 ENT1HNOL COMP PIC S9(4). + 02 ENT1HNOF PICTURE X. + 02 FILLER REDEFINES ENT1HNOF. + 03 ENT1HNOA PICTURE X. + 02 ENT1HNOI PIC X(4). + 02 ENT1HPCL COMP PIC S9(4). + 02 ENT1HPCF PICTURE X. + 02 FILLER REDEFINES ENT1HPCF. + 03 ENT1HPCA PICTURE X. + 02 ENT1HPCI PIC X(8). + 02 ENT1HP1L COMP PIC S9(4). + 02 ENT1HP1F PICTURE X. + 02 FILLER REDEFINES ENT1HP1F. + 03 ENT1HP1A PICTURE X. + 02 ENT1HP1I PIC X(20). + 02 ENT1HP2L COMP PIC S9(4). + 02 ENT1HP2F PICTURE X. + 02 FILLER REDEFINES ENT1HP2F. + 03 ENT1HP2A PICTURE X. + 02 ENT1HP2I PIC X(20). + 02 ENT1HMOL COMP PIC S9(4). + 02 ENT1HMOF PICTURE X. + 02 FILLER REDEFINES ENT1HMOF. + 03 ENT1HMOA PICTURE X. + 02 ENT1HMOI PIC X(27). + 02 ENT1OPTL COMP PIC S9(4). + 02 ENT1OPTF PICTURE X. + 02 FILLER REDEFINES ENT1OPTF. + 03 ENT1OPTA PICTURE X. + 02 ENT1OPTI PIC X(1). + 02 ERRFLDL COMP PIC S9(4). + 02 ERRFLDF PICTURE X. + 02 FILLER REDEFINES ERRFLDF. + 03 ERRFLDA PICTURE X. + 02 ERRFLDI PIC X(40). + 01 SSMAPC1O REDEFINES SSMAPC1I. + 02 FILLER PIC X(12). + 02 FILLER PICTURE X(3). + 02 ENT1CNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENT1FNAO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENT1LNAO PIC X(20). + 02 FILLER PICTURE X(3). + 02 ENT1DOBO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENT1HNMO PIC X(20). + 02 FILLER PICTURE X(3). + 02 ENT1HNOO PIC X(4). + 02 FILLER PICTURE X(3). + 02 ENT1HPCO PIC X(8). + 02 FILLER PICTURE X(3). + 02 ENT1HP1O PIC X(20). + 02 FILLER PICTURE X(3). + 02 ENT1HP2O PIC X(20). + 02 FILLER PICTURE X(3). + 02 ENT1HMOO PIC X(27). + 02 FILLER PICTURE X(3). + 02 ENT1OPTO PIC X(1). + 02 FILLER PICTURE X(3). + 02 ERRFLDO PIC X(40). + 01 SSMAPP1I. + 02 FILLER PIC X(12). + 02 ENP1PNOL COMP PIC S9(4). + 02 ENP1PNOF PICTURE X. + 02 FILLER REDEFINES ENP1PNOF. + 03 ENP1PNOA PICTURE X. + 02 ENP1PNOI PIC X(10). + 02 ENP1CNOL COMP PIC S9(4). + 02 ENP1CNOF PICTURE X. + 02 FILLER REDEFINES ENP1CNOF. + 03 ENP1CNOA PICTURE X. + 02 ENP1CNOI PIC X(10). + 02 ENP1IDAL COMP PIC S9(4). + 02 ENP1IDAF PICTURE X. + 02 FILLER REDEFINES ENP1IDAF. + 03 ENP1IDAA PICTURE X. + 02 ENP1IDAI PIC X(10). + 02 ENP1EDAL COMP PIC S9(4). + 02 ENP1EDAF PICTURE X. + 02 FILLER REDEFINES ENP1EDAF. + 03 ENP1EDAA PICTURE X. + 02 ENP1EDAI PIC X(10). + 02 ENP1CMKL COMP PIC S9(4). + 02 ENP1CMKF PICTURE X. + 02 FILLER REDEFINES ENP1CMKF. + 03 ENP1CMKA PICTURE X. + 02 ENP1CMKI PIC X(20). + 02 ENP1CMOL COMP PIC S9(4). + 02 ENP1CMOF PICTURE X. + 02 FILLER REDEFINES ENP1CMOF. + 03 ENP1CMOA PICTURE X. + 02 ENP1CMOI PIC X(20). + 02 ENP1VALL COMP PIC S9(4). + 02 ENP1VALF PICTURE X. + 02 FILLER REDEFINES ENP1VALF. + 03 ENP1VALA PICTURE X. + 02 ENP1VALI PIC X(6). + 02 ENP1REGL COMP PIC S9(4). + 02 ENP1REGF PICTURE X. + 02 FILLER REDEFINES ENP1REGF. + 03 ENP1REGA PICTURE X. + 02 ENP1REGI PIC X(7). + 02 ENP1COLL COMP PIC S9(4). + 02 ENP1COLF PICTURE X. + 02 FILLER REDEFINES ENP1COLF. + 03 ENP1COLA PICTURE X. + 02 ENP1COLI PIC X(8). + 02 ENP1CCL COMP PIC S9(4). + 02 ENP1CCF PICTURE X. + 02 FILLER REDEFINES ENP1CCF. + 03 ENP1CCA PICTURE X. + 02 ENP1CCI PIC X(8). + 02 ENP1MANL COMP PIC S9(4). + 02 ENP1MANF PICTURE X. + 02 FILLER REDEFINES ENP1MANF. + 03 ENP1MANA PICTURE X. + 02 ENP1MANI PIC X(10). + 02 ENP1ACCL COMP PIC S9(4). + 02 ENP1ACCF PICTURE X. + 02 FILLER REDEFINES ENP1ACCF. + 03 ENP1ACCA PICTURE X. + 02 ENP1ACCI PIC X(6). + 02 ENP1PREL COMP PIC S9(4). + 02 ENP1PREF PICTURE X. + 02 FILLER REDEFINES ENP1PREF. + 03 ENP1PREA PICTURE X. + 02 ENP1PREI PIC X(6). + 02 ENP1OPTL COMP PIC S9(4). + 02 ENP1OPTF PICTURE X. + 02 FILLER REDEFINES ENP1OPTF. + 03 ENP1OPTA PICTURE X. + 02 ENP1OPTI PIC X(1). + 02 ERP1FLDL COMP PIC S9(4). + 02 ERP1FLDF PICTURE X. + 02 FILLER REDEFINES ERP1FLDF. + 03 ERP1FLDA PICTURE X. + 02 ERP1FLDI PIC X(40). + 01 SSMAPP1O REDEFINES SSMAPP1I. + 02 FILLER PIC X(12). + 02 FILLER PICTURE X(3). + 02 ENP1PNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP1CNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP1IDAO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP1EDAO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP1CMKO PIC X(20). + 02 FILLER PICTURE X(3). + 02 ENP1CMOO PIC X(20). + 02 FILLER PICTURE X(3). + 02 ENP1VALO PIC X(6). + 02 FILLER PICTURE X(3). + 02 ENP1REGO PIC X(7). + 02 FILLER PICTURE X(3). + 02 ENP1COLO PIC X(8). + 02 FILLER PICTURE X(3). + 02 ENP1CCO PIC X(8). + 02 FILLER PICTURE X(3). + 02 ENP1MANO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP1ACCO PIC X(6). + 02 FILLER PICTURE X(3). + 02 ENP1PREO PIC X(6). + 02 FILLER PICTURE X(3). + 02 ENP1OPTO PIC X(1). + 02 FILLER PICTURE X(3). + 02 ERP1FLDO PIC X(40). + 01 SSMAPP2I. + 02 FILLER PIC X(12). + 02 ENP2PNOL COMP PIC S9(4). + 02 ENP2PNOF PICTURE X. + 02 FILLER REDEFINES ENP2PNOF. + 03 ENP2PNOA PICTURE X. + 02 ENP2PNOI PIC X(10). + 02 ENP2CNOL COMP PIC S9(4). + 02 ENP2CNOF PICTURE X. + 02 FILLER REDEFINES ENP2CNOF. + 03 ENP2CNOA PICTURE X. + 02 ENP2CNOI PIC X(10). + 02 ENP2IDAL COMP PIC S9(4). + 02 ENP2IDAF PICTURE X. + 02 FILLER REDEFINES ENP2IDAF. + 03 ENP2IDAA PICTURE X. + 02 ENP2IDAI PIC X(10). + 02 ENP2EDAL COMP PIC S9(4). + 02 ENP2EDAF PICTURE X. + 02 FILLER REDEFINES ENP2EDAF. + 03 ENP2EDAA PICTURE X. + 02 ENP2EDAI PIC X(10). + 02 ENP2FNML COMP PIC S9(4). + 02 ENP2FNMF PICTURE X. + 02 FILLER REDEFINES ENP2FNMF. + 03 ENP2FNMA PICTURE X. + 02 ENP2FNMI PIC X(10). + 02 ENP2TERL COMP PIC S9(4). + 02 ENP2TERF PICTURE X. + 02 FILLER REDEFINES ENP2TERF. + 03 ENP2TERA PICTURE X. + 02 ENP2TERI PIC X(2). + 02 ENP2SUML COMP PIC S9(4). + 02 ENP2SUMF PICTURE X. + 02 FILLER REDEFINES ENP2SUMF. + 03 ENP2SUMA PICTURE X. + 02 ENP2SUMI PIC X(6). + 02 ENP2LIFL COMP PIC S9(4). + 02 ENP2LIFF PICTURE X. + 02 FILLER REDEFINES ENP2LIFF. + 03 ENP2LIFA PICTURE X. + 02 ENP2LIFI PIC X(25). + 02 ENP2WPRL COMP PIC S9(4). + 02 ENP2WPRF PICTURE X. + 02 FILLER REDEFINES ENP2WPRF. + 03 ENP2WPRA PICTURE X. + 02 ENP2WPRI PIC X(1). + 02 ENP2EQUL COMP PIC S9(4). + 02 ENP2EQUF PICTURE X. + 02 FILLER REDEFINES ENP2EQUF. + 03 ENP2EQUA PICTURE X. + 02 ENP2EQUI PIC X(1). + 02 ENP2MANL COMP PIC S9(4). + 02 ENP2MANF PICTURE X. + 02 FILLER REDEFINES ENP2MANF. + 03 ENP2MANA PICTURE X. + 02 ENP2MANI PIC X(1). + 02 ENP2OPTL COMP PIC S9(4). + 02 ENP2OPTF PICTURE X. + 02 FILLER REDEFINES ENP2OPTF. + 03 ENP2OPTA PICTURE X. + 02 ENP2OPTI PIC X(1). + 02 ERP2FLDL COMP PIC S9(4). + 02 ERP2FLDF PICTURE X. + 02 FILLER REDEFINES ERP2FLDF. + 03 ERP2FLDA PICTURE X. + 02 ERP2FLDI PIC X(40). + 01 SSMAPP2O REDEFINES SSMAPP2I. + 02 FILLER PIC X(12). + 02 FILLER PICTURE X(3). + 02 ENP2PNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP2CNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP2IDAO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP2EDAO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP2FNMO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP2TERO PIC X(2). + 02 FILLER PICTURE X(3). + 02 ENP2SUMO PIC X(6). + 02 FILLER PICTURE X(3). + 02 ENP2LIFO PIC X(25). + 02 FILLER PICTURE X(3). + 02 ENP2WPRO PIC X(1). + 02 FILLER PICTURE X(3). + 02 ENP2EQUO PIC X(1). + 02 FILLER PICTURE X(3). + 02 ENP2MANO PIC X(1). + 02 FILLER PICTURE X(3). + 02 ENP2OPTO PIC X(1). + 02 FILLER PICTURE X(3). + 02 ERP2FLDO PIC X(40). + 01 SSMAPP3I. + 02 FILLER PIC X(12). + 02 ENP3PNOL COMP PIC S9(4). + 02 ENP3PNOF PICTURE X. + 02 FILLER REDEFINES ENP3PNOF. + 03 ENP3PNOA PICTURE X. + 02 ENP3PNOI PIC X(10). + 02 ENP3CNOL COMP PIC S9(4). + 02 ENP3CNOF PICTURE X. + 02 FILLER REDEFINES ENP3CNOF. + 03 ENP3CNOA PICTURE X. + 02 ENP3CNOI PIC X(10). + 02 ENP3IDAL COMP PIC S9(4). + 02 ENP3IDAF PICTURE X. + 02 FILLER REDEFINES ENP3IDAF. + 03 ENP3IDAA PICTURE X. + 02 ENP3IDAI PIC X(10). + 02 ENP3EDAL COMP PIC S9(4). + 02 ENP3EDAF PICTURE X. + 02 FILLER REDEFINES ENP3EDAF. + 03 ENP3EDAA PICTURE X. + 02 ENP3EDAI PIC X(10). + 02 ENP3TYPL COMP PIC S9(4). + 02 ENP3TYPF PICTURE X. + 02 FILLER REDEFINES ENP3TYPF. + 03 ENP3TYPA PICTURE X. + 02 ENP3TYPI PIC X(15). + 02 ENP3BEDL COMP PIC S9(4). + 02 ENP3BEDF PICTURE X. + 02 FILLER REDEFINES ENP3BEDF. + 03 ENP3BEDA PICTURE X. + 02 ENP3BEDI PIC X(3). + 02 ENP3VALL COMP PIC S9(4). + 02 ENP3VALF PICTURE X. + 02 FILLER REDEFINES ENP3VALF. + 03 ENP3VALA PICTURE X. + 02 ENP3VALI PIC X(8). + 02 ENP3HNML COMP PIC S9(4). + 02 ENP3HNMF PICTURE X. + 02 FILLER REDEFINES ENP3HNMF. + 03 ENP3HNMA PICTURE X. + 02 ENP3HNMI PIC X(20). + 02 ENP3HNOL COMP PIC S9(4). + 02 ENP3HNOF PICTURE X. + 02 FILLER REDEFINES ENP3HNOF. + 03 ENP3HNOA PICTURE X. + 02 ENP3HNOI PIC X(4). + 02 ENP3HPCL COMP PIC S9(4). + 02 ENP3HPCF PICTURE X. + 02 FILLER REDEFINES ENP3HPCF. + 03 ENP3HPCA PICTURE X. + 02 ENP3HPCI PIC X(8). + 02 ENP3OPTL COMP PIC S9(4). + 02 ENP3OPTF PICTURE X. + 02 FILLER REDEFINES ENP3OPTF. + 03 ENP3OPTA PICTURE X. + 02 ENP3OPTI PIC X(1). + 02 ERP3FLDL COMP PIC S9(4). + 02 ERP3FLDF PICTURE X. + 02 FILLER REDEFINES ERP3FLDF. + 03 ERP3FLDA PICTURE X. + 02 ERP3FLDI PIC X(40). + 01 SSMAPP3O REDEFINES SSMAPP3I. + 02 FILLER PIC X(12). + 02 FILLER PICTURE X(3). + 02 ENP3PNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP3CNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP3IDAO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP3EDAO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP3TYPO PIC X(15). + 02 FILLER PICTURE X(3). + 02 ENP3BEDO PIC X(3). + 02 FILLER PICTURE X(3). + 02 ENP3VALO PIC X(8). + 02 FILLER PICTURE X(3). + 02 ENP3HNMO PIC X(20). + 02 FILLER PICTURE X(3). + 02 ENP3HNOO PIC X(4). + 02 FILLER PICTURE X(3). + 02 ENP3HPCO PIC X(8). + 02 FILLER PICTURE X(3). + 02 ENP3OPTO PIC X(1). + 02 FILLER PICTURE X(3). + 02 ERP3FLDO PIC X(40). + 01 SSMAPP4I. + 02 FILLER PIC X(12). + 02 ENP4PNOL COMP PIC S9(4). + 02 ENP4PNOF PICTURE X. + 02 FILLER REDEFINES ENP4PNOF. + 03 ENP4PNOA PICTURE X. + 02 ENP4PNOI PIC X(10). + 02 ENP4CNOL COMP PIC S9(4). + 02 ENP4CNOF PICTURE X. + 02 FILLER REDEFINES ENP4CNOF. + 03 ENP4CNOA PICTURE X. + 02 ENP4CNOI PIC X(10). + 02 ENP4IDAL COMP PIC S9(4). + 02 ENP4IDAF PICTURE X. + 02 FILLER REDEFINES ENP4IDAF. + 03 ENP4IDAA PICTURE X. + 02 ENP4IDAI PIC X(10). + 02 ENP4EDAL COMP PIC S9(4). + 02 ENP4EDAF PICTURE X. + 02 FILLER REDEFINES ENP4EDAF. + 03 ENP4EDAA PICTURE X. + 02 ENP4EDAI PIC X(10). + 02 ENP4ADDL COMP PIC S9(4). + 02 ENP4ADDF PICTURE X. + 02 FILLER REDEFINES ENP4ADDF. + 03 ENP4ADDA PICTURE X. + 02 ENP4ADDI PIC X(25). + 02 ENP4HPCL COMP PIC S9(4). + 02 ENP4HPCF PICTURE X. + 02 FILLER REDEFINES ENP4HPCF. + 03 ENP4HPCA PICTURE X. + 02 ENP4HPCI PIC X(8). + 02 ENP4LATL COMP PIC S9(4). + 02 ENP4LATF PICTURE X. + 02 FILLER REDEFINES ENP4LATF. + 03 ENP4LATA PICTURE X. + 02 ENP4LATI PIC X(11). + 02 ENP4LONL COMP PIC S9(4). + 02 ENP4LONF PICTURE X. + 02 FILLER REDEFINES ENP4LONF. + 03 ENP4LONA PICTURE X. + 02 ENP4LONI PIC X(11). + 02 ENP4CUSL COMP PIC S9(4). + 02 ENP4CUSF PICTURE X. + 02 FILLER REDEFINES ENP4CUSF. + 03 ENP4CUSA PICTURE X. + 02 ENP4CUSI PIC X(25). + 02 ENP4PTYL COMP PIC S9(4). + 02 ENP4PTYF PICTURE X. + 02 FILLER REDEFINES ENP4PTYF. + 03 ENP4PTYA PICTURE X. + 02 ENP4PTYI PIC X(25). + 02 ENP4FPEL COMP PIC S9(4). + 02 ENP4FPEF PICTURE X. + 02 FILLER REDEFINES ENP4FPEF. + 03 ENP4FPEA PICTURE X. + 02 ENP4FPEI PIC X(4). + 02 ENP4FPRL COMP PIC S9(4). + 02 ENP4FPRF PICTURE X. + 02 FILLER REDEFINES ENP4FPRF. + 03 ENP4FPRA PICTURE X. + 02 ENP4FPRI PIC X(8). + 02 ENP4CPEL COMP PIC S9(4). + 02 ENP4CPEF PICTURE X. + 02 FILLER REDEFINES ENP4CPEF. + 03 ENP4CPEA PICTURE X. + 02 ENP4CPEI PIC X(4). + 02 ENP4CPRL COMP PIC S9(4). + 02 ENP4CPRF PICTURE X. + 02 FILLER REDEFINES ENP4CPRF. + 03 ENP4CPRA PICTURE X. + 02 ENP4CPRI PIC X(8). + 02 ENP4XPEL COMP PIC S9(4). + 02 ENP4XPEF PICTURE X. + 02 FILLER REDEFINES ENP4XPEF. + 03 ENP4XPEA PICTURE X. + 02 ENP4XPEI PIC X(4). + 02 ENP4XPRL COMP PIC S9(4). + 02 ENP4XPRF PICTURE X. + 02 FILLER REDEFINES ENP4XPRF. + 03 ENP4XPRA PICTURE X. + 02 ENP4XPRI PIC X(8). + 02 ENP4WPEL COMP PIC S9(4). + 02 ENP4WPEF PICTURE X. + 02 FILLER REDEFINES ENP4WPEF. + 03 ENP4WPEA PICTURE X. + 02 ENP4WPEI PIC X(4). + 02 ENP4WPRL COMP PIC S9(4). + 02 ENP4WPRF PICTURE X. + 02 FILLER REDEFINES ENP4WPRF. + 03 ENP4WPRA PICTURE X. + 02 ENP4WPRI PIC X(8). + 02 ENP4STAL COMP PIC S9(4). + 02 ENP4STAF PICTURE X. + 02 FILLER REDEFINES ENP4STAF. + 03 ENP4STAA PICTURE X. + 02 ENP4STAI PIC X(4). + 02 ENP4REJL COMP PIC S9(4). + 02 ENP4REJF PICTURE X. + 02 FILLER REDEFINES ENP4REJF. + 03 ENP4REJA PICTURE X. + 02 ENP4REJI PIC X(25). + 02 ENP4OPTL COMP PIC S9(4). + 02 ENP4OPTF PICTURE X. + 02 FILLER REDEFINES ENP4OPTF. + 03 ENP4OPTA PICTURE X. + 02 ENP4OPTI PIC X(1). + 02 ERP4FLDL COMP PIC S9(4). + 02 ERP4FLDF PICTURE X. + 02 FILLER REDEFINES ERP4FLDF. + 03 ERP4FLDA PICTURE X. + 02 ERP4FLDI PIC X(40). + 01 SSMAPP4O REDEFINES SSMAPP4I. + 02 FILLER PIC X(12). + 02 FILLER PICTURE X(3). + 02 ENP4PNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP4CNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP4IDAO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP4EDAO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP4ADDO PIC X(25). + 02 FILLER PICTURE X(3). + 02 ENP4HPCO PIC X(8). + 02 FILLER PICTURE X(3). + 02 ENP4LATO PIC X(11). + 02 FILLER PICTURE X(3). + 02 ENP4LONO PIC X(11). + 02 FILLER PICTURE X(3). + 02 ENP4CUSO PIC X(25). + 02 FILLER PICTURE X(3). + 02 ENP4PTYO PIC X(25). + 02 FILLER PICTURE X(3). + 02 ENP4FPEO PIC X(4). + 02 FILLER PICTURE X(3). + 02 ENP4FPRO PIC X(8). + 02 FILLER PICTURE X(3). + 02 ENP4CPEO PIC X(4). + 02 FILLER PICTURE X(3). + 02 ENP4CPRO PIC X(8). + 02 FILLER PICTURE X(3). + 02 ENP4XPEO PIC X(4). + 02 FILLER PICTURE X(3). + 02 ENP4XPRO PIC X(8). + 02 FILLER PICTURE X(3). + 02 ENP4WPEO PIC X(4). + 02 FILLER PICTURE X(3). + 02 ENP4WPRO PIC X(8). + 02 FILLER PICTURE X(3). + 02 ENP4STAO PIC X(4). + 02 FILLER PICTURE X(3). + 02 ENP4REJO PIC X(25). + 02 FILLER PICTURE X(3). + 02 ENP4OPTO PIC X(1). + 02 FILLER PICTURE X(3). + 02 ERP4FLDO PIC X(40). + 01 SSMAPP5I. + 02 FILLER PIC X(12). + 02 ENP5LNOL COMP PIC S9(4). + 02 ENP5LNOF PICTURE X. + 02 FILLER REDEFINES ENP5LNOF. + 03 ENP5LNOA PICTURE X. + 02 ENP5LNOI PIC X(10). + 02 ENP5PNOL COMP PIC S9(4). + 02 ENP5PNOF PICTURE X. + 02 FILLER REDEFINES ENP5PNOF. + 03 ENP5PNOA PICTURE X. + 02 ENP5PNOI PIC X(10). + 02 ENP5CNOL COMP PIC S9(4). + 02 ENP5CNOF PICTURE X. + 02 FILLER REDEFINES ENP5CNOF. + 03 ENP5CNOA PICTURE X. + 02 ENP5CNOI PIC X(10). + 02 ENP5CDAL COMP PIC S9(4). + 02 ENP5CDAF PICTURE X. + 02 FILLER REDEFINES ENP5CDAF. + 03 ENP5CDAA PICTURE X. + 02 ENP5CDAI PIC X(10). + 02 ENP5PADL COMP PIC S9(4). + 02 ENP5PADF PICTURE X. + 02 FILLER REDEFINES ENP5PADF. + 03 ENP5PADA PICTURE X. + 02 ENP5PADI PIC X(10). + 02 ENP5VALL COMP PIC S9(4). + 02 ENP5VALF PICTURE X. + 02 FILLER REDEFINES ENP5VALF. + 03 ENP5VALA PICTURE X. + 02 ENP5VALI PIC X(10). + 02 ENP5CAUL COMP PIC S9(4). + 02 ENP5CAUF PICTURE X. + 02 FILLER REDEFINES ENP5CAUF. + 03 ENP5CAUA PICTURE X. + 02 ENP5CAUI PIC X(25). + 02 ENP5OBSL COMP PIC S9(4). + 02 ENP5OBSF PICTURE X. + 02 FILLER REDEFINES ENP5OBSF. + 03 ENP5OBSA PICTURE X. + 02 ENP5OBSI PIC X(25). + 02 ENP5OPTL COMP PIC S9(4). + 02 ENP5OPTF PICTURE X. + 02 FILLER REDEFINES ENP5OPTF. + 03 ENP5OPTA PICTURE X. + 02 ENP5OPTI PIC X(1). + 02 ERP5FLDL COMP PIC S9(4). + 02 ERP5FLDF PICTURE X. + 02 FILLER REDEFINES ERP5FLDF. + 03 ERP5FLDA PICTURE X. + 02 ERP5FLDI PIC X(40). + 01 SSMAPP5O REDEFINES SSMAPP5I. + 02 FILLER PIC X(12). + 02 FILLER PICTURE X(3). + 02 ENP5LNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP5PNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP5CNOO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP5CDAO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP5PADO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP5VALO PIC X(10). + 02 FILLER PICTURE X(3). + 02 ENP5CAUO PIC X(25). + 02 FILLER PICTURE X(3). + 02 ENP5OBSO PIC X(25). + 02 FILLER PICTURE X(3). + 02 ENP5OPTO PIC X(1). + 02 FILLER PICTURE X(3). + 02 ERP5FLDO PIC X(40). diff --git a/tests/test_files/cicsGenApp/negative/lgtestc1.cbl b/tests/test_files/cicsGenApp/positive/lgtestc1.cbl similarity index 100% rename from tests/test_files/cicsGenApp/negative/lgtestc1.cbl rename to tests/test_files/cicsGenApp/positive/lgtestc1.cbl diff --git a/tests/test_files/cicsGenApp/negative/lgtestp1.cbl b/tests/test_files/cicsGenApp/positive/lgtestp1.cbl similarity index 100% rename from tests/test_files/cicsGenApp/negative/lgtestp1.cbl rename to tests/test_files/cicsGenApp/positive/lgtestp1.cbl diff --git a/tests/test_files/cicsGenApp/negative/lgtestp2.cbl b/tests/test_files/cicsGenApp/positive/lgtestp2.cbl similarity index 100% rename from tests/test_files/cicsGenApp/negative/lgtestp2.cbl rename to tests/test_files/cicsGenApp/positive/lgtestp2.cbl diff --git a/tests/test_files/cicsGenApp/negative/lgtestp3.cbl b/tests/test_files/cicsGenApp/positive/lgtestp3.cbl similarity index 100% rename from tests/test_files/cicsGenApp/negative/lgtestp3.cbl rename to tests/test_files/cicsGenApp/positive/lgtestp3.cbl diff --git a/tests/test_files/cicsGenApp/negative/lgtestp4.cbl b/tests/test_files/cicsGenApp/positive/lgtestp4.cbl similarity index 100% rename from tests/test_files/cicsGenApp/negative/lgtestp4.cbl rename to tests/test_files/cicsGenApp/positive/lgtestp4.cbl From 388ac71dc9fef7cb0c9a6c7706072aadd1c04f73 Mon Sep 17 00:00:00 2001 From: Kutlu Date: Tue, 4 Jun 2024 16:53:50 +0200 Subject: [PATCH 02/13] merge err --- .../download/getZoweExplorerMock.utility.ts | 87 ------------------- 1 file changed, 87 deletions(-) delete mode 100644 clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/getZoweExplorerMock.utility.ts diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/getZoweExplorerMock.utility.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/getZoweExplorerMock.utility.ts deleted file mode 100644 index 53dbbd39d5..0000000000 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/getZoweExplorerMock.utility.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2024 Broadcom. - * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Broadcom, Inc. - initial API and implementation - */ - -export const getContentMock = jest.fn(); -export const getUSSContentsMock = jest.fn(); -export const allMemberMock = jest.fn().mockReturnValue({ - apiResponse: { - items: [ - { - member: "copybook", - }, - { member: "DATASET2" }, - ], - }, -}); -const error = new Error("Error"); -(error as any).mDetails = { - errorCode: 401, -}; -export const allMemberErrorMock = jest.fn().mockRejectedValue(error); -export const mvsApiMock = jest.fn().mockReturnValue({ - allMembers: allMemberMock, - getContents: getContentMock, -}); - -export const mvsApiMockWithError = jest.fn().mockReturnValue({ - allMembers: allMemberErrorMock, - getContents: getContentMock, -}); - -export const allUSSFilemembers = jest.fn().mockReturnValue({ - apiResponse: { - items: [ - { name: "uss_copybook" }, - { name: "uss_withExt.cpy" }, - { name: "USS_DATASET2" }, - ], - }, -}); -export const ussApiMock = jest.fn().mockReturnValue({ - fileList: allUSSFilemembers, - getContents: getUSSContentsMock, -}); -const ussApiMockWithError = jest.fn().mockReturnValue({ - fileList: allMemberErrorMock, - getContents: getUSSContentsMock, -}); -export const zoweExplorerMock: IApiRegisterClient = { - getExplorerExtenderApi: jest.fn().mockReturnValue({ - getProfilesCache: jest.fn().mockReturnValue({ - loadNamedProfile: jest.fn().mockReturnValue({ - profile: { encoding: undefined, name: "profile" }, - }), - }), - }), - getMvsApi: mvsApiMock, - getUssApi: ussApiMock, - registeredApiTypes: jest.fn().mockReturnValue([]), -}; - -export const zoweExplorerErrorMock = { - getExplorerExtenderApi: jest.fn().mockReturnValue({ - getProfilesCache: jest.fn().mockReturnValue({ - loadNamedProfile: jest.fn().mockReturnValue({ - profile: { encoding: undefined, name: "profile" }, - }), - }), - }), - getMvsApi: mvsApiMockWithError, - getUssApi: ussApiMockWithError, - registeredApiTypes: jest.fn().mockReturnValue([]), -}; - -it("dummy", () => { - expect(true).toBeTruthy(); -}); From 135c018223b74ab765d652d2a88e583a43314e40 Mon Sep 17 00:00:00 2001 From: Kutlu Date: Thu, 6 Jun 2024 16:41:00 +0200 Subject: [PATCH 03/13] add settings --- clients/cobol-lsp-vscode-extension/package.json | 13 +++++++++++++ .../cobol-lsp-vscode-extension/src/constants.ts | 2 ++ .../src/services/Settings.ts | 14 ++++++++++++-- .../src/services/copybook/E4ECopybookService.ts | 6 ++++++ 4 files changed, 33 insertions(+), 2 deletions(-) diff --git a/clients/cobol-lsp-vscode-extension/package.json b/clients/cobol-lsp-vscode-extension/package.json index b14868df76..1f14407b9a 100644 --- a/clients/cobol-lsp-vscode-extension/package.json +++ b/clients/cobol-lsp-vscode-extension/package.json @@ -394,6 +394,19 @@ "iso646jp" ] }, + "cobol-lsp.cpy-manager.endevor-dependencies": { + "type": "string", + "enum": [ + "ZOWE", + "ENDEVOR_PROCESSOR" + ], + "enumDescriptions": [ + "ZOWE paths to retrieve copybooks", + "ENDEVOR_PROCESSOR to retrieve copybooks" + ], + "description": "The method that is used to retrieve copybooks for elements open via Explorer for Endevor.", + "default": "ZOWE" + }, "cobol-lsp.subroutine-manager.paths-local": { "type": "array", "items": { diff --git a/clients/cobol-lsp-vscode-extension/src/constants.ts b/clients/cobol-lsp-vscode-extension/src/constants.ts index 62cf748f37..dd0eae8bd3 100644 --- a/clients/cobol-lsp-vscode-extension/src/constants.ts +++ b/clients/cobol-lsp-vscode-extension/src/constants.ts @@ -77,6 +77,8 @@ export const E4E_FOLDER: string = ".e4e"; export const DATASET = "dataset"; export const ENVIRONMENT = "environment"; export const USE_MAP = "MAP"; +export const SETTINGS_CPY_NDVR_DEPENDENCIES = "endevor-dependencies"; +export const ENDEVOR_PROCESSOR = "ENDEVOR_PROCESSOR"; export enum PUNCH_CARD { SEQUENCE_AREA_END_POS = 6, diff --git a/clients/cobol-lsp-vscode-extension/src/services/Settings.ts b/clients/cobol-lsp-vscode-extension/src/services/Settings.ts index 3d3399c38b..041ff6194f 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/Settings.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/Settings.ts @@ -12,10 +12,8 @@ * Broadcom, Inc. - initial API and implementation */ -import * as fs from "node:fs"; import * as path from "node:path"; import * as vscode from "vscode"; -import { Utils } from "./util/Utils"; import { COPYBOOK_EXTENSIONS, PATHS_LOCAL_KEY, @@ -34,6 +32,7 @@ import { SETTINGS_COMPILE_OPTIONS, DIALECT_LIBS, COBOL_PRGM_LAYOUT, + SETTINGS_CPY_NDVR_DEPENDENCIES, } from "../constants"; import cobolSnippets = require("../services/snippetcompletion/cobolSnippets.json"); import { DialectRegistry, DIALECT_REGISTRY_SECTION } from "./DialectRegistry"; @@ -364,4 +363,15 @@ export class SettingsService { } return result; } + /** + * Gives the configured endevor dependecy from settings. + * + * @returns returns configured endevor dependency + */ + public static getCopybookEndevorDependencySettings(): string | undefined { + const setting: string | undefined = vscode.workspace + .getConfiguration(SETTINGS_CPY_SECTION) + .get(SETTINGS_CPY_NDVR_DEPENDENCIES); + return setting; + } } diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/E4ECopybookService.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/E4ECopybookService.ts index 97e2d9bbfb..956ffc5392 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/E4ECopybookService.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/E4ECopybookService.ts @@ -14,6 +14,7 @@ import * as vscode from "vscode"; import { DATASET, + ENDEVOR_PROCESSOR, ENVIRONMENT, OUTPUT_MSG_SEARCH_LOCATION, } from "../../constants"; @@ -28,6 +29,7 @@ import { EndevorType, } from "../../type/e4eApi.d"; import { Utils } from "../util/Utils"; +import { SettingsService } from "../Settings"; export class E4ECopybookService { private static E4EConfigs = new Map(); @@ -51,6 +53,10 @@ export class E4ECopybookService { uri: string, outputChannel?: vscode.OutputChannel, ): Promise { + const e4eSettings = SettingsService.getCopybookEndevorDependencySettings(); + if (e4eSettings != ENDEVOR_PROCESSOR) { + return undefined; + } const config = this.E4EConfigs.get(uri); if (config) { return config; From 7b4c20c4d53958f2c38bb7057256f2f1a626cec8 Mon Sep 17 00:00:00 2001 From: Kutlu Date: Thu, 6 Jun 2024 16:46:04 +0200 Subject: [PATCH 04/13] fix test --- .../src/__tests__/services/copybook/E4ECopybookService.spec.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts index a886110a44..b1b19b308d 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts @@ -32,6 +32,9 @@ describe("e4e copybook service tests", () => { it("check getE4EClient assembles client correctly / check getE4EClient returns already assembled client once called with same Uri ", async () => { E4ECopybookService.getE4EAPI = jest.fn().mockReturnValue(e4eMock); + vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ + get: jest.fn().mockReturnValue("ENDEVOR_PROCESSOR"), + }); await E4ECopybookService.getE4EClient("document-uri"); const spyApi = jest.spyOn(E4ECopybookService, "getE4EAPI"); expect(spyApi).toHaveBeenCalledTimes(1); From f8be187aca145a544ac5172dfbdcd97ce9da57eb Mon Sep 17 00:00:00 2001 From: Kutlu Date: Wed, 19 Jun 2024 10:46:23 +0200 Subject: [PATCH 05/13] fix zowe off case on resolve & remove redundant --- .../services/copybook/E4ECopybookService.spec.ts | 8 ++++++++ .../download/DownloadStrategyResolverTest.spec.ts | 4 ++-- .../src/services/copybook/CopybookMessageHandler.ts | 4 ++-- .../copybook/downloader/DownloadStrategyResolver.ts | 4 ++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts index b1b19b308d..dccceb489e 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts @@ -43,4 +43,12 @@ describe("e4e copybook service tests", () => { await E4ECopybookService.getE4EClient("new-uri"); expect(spyApi).toHaveBeenCalledTimes(2); }); + it("checks getE4EClient returns undefined when zowe settings is being used to retrieve copybooks", async () => { + vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ + get: jest.fn().mockReturnValue("ZOWE"), + }); + expect(await E4ECopybookService.getE4EClient("document-uri")).toEqual( + undefined, + ); + }); }); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts index a27e1807a8..ff7d61f957 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts @@ -132,7 +132,7 @@ describe("tests download resolver", () => { }); it("checks download fails if ZE apis are missing", async () => { - const resolver = new DownloadStrategyResolver("storage-path", undefined); + const resolver = new DownloadStrategyResolver("storage-path"); const result = await resolver.downloadCopybook( { name: "copybook", dialect: "COBOL" }, "doc-uri", @@ -141,7 +141,7 @@ describe("tests download resolver", () => { }); it("checks clear cache do not throw error when ZE apis are missing", () => { - const resolver = new DownloadStrategyResolver("storage-path", undefined); + const resolver = new DownloadStrategyResolver("storage-path"); expect(() => resolver.clearCache()).not.toThrowError(); }); diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts index 1a3212f12f..9725975662 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts @@ -46,8 +46,8 @@ export async function resolveCopybookHandler( dialectType: string, ): Promise { let result: string | undefined; - const e4eApi = await E4ECopybookService.getE4EAPI(); - if (e4eApi && e4eApi.isEndevorElement(documentUri)) { + + if (await E4ECopybookService.getE4EClient(documentUri)) { result = await getE4ECopyBookLocation( copybookName, documentUri, diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts index 97c7992bc9..083c09d0e1 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts @@ -30,8 +30,8 @@ export class DownloadStrategyResolver { constructor( storagePath: string, - explorerApi: IApiRegisterClient | undefined, - e4eApi: E4E | undefined, + explorerApi?: IApiRegisterClient, + e4eApi?: E4E, outputChannel?: vscode.OutputChannel, ) { if (e4eApi) { From 5413577d8ed136e042dc86cb6c8d709496d249e9 Mon Sep 17 00:00:00 2001 From: Kutlu Date: Wed, 19 Jun 2024 11:06:04 +0200 Subject: [PATCH 06/13] merge dev --- .../src/services/util/ProfileUtils.ts | 2 +- .../usecases/TestDacoCopynodeInsertion.java | 64 +++++ .../eclipse/lsp/cobol/cli/command/Cli.java | 247 ++---------------- .../lsp/cobol/cli/command/CliAnalysis.java | 114 +++++--- .../lsp/cobol/cli/command/CliUtils.java | 145 ++++++++++ .../lsp/cobol/cli/command/ListSources.java | 20 +- .../SectionNodeProcessorHelper.java | 121 +++++---- .../experimental/ExperimentalParserStage.java | 40 +-- 8 files changed, 418 insertions(+), 335 deletions(-) create mode 100644 server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDacoCopynodeInsertion.java create mode 100644 server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/CliUtils.java diff --git a/clients/cobol-lsp-vscode-extension/src/services/util/ProfileUtils.ts b/clients/cobol-lsp-vscode-extension/src/services/util/ProfileUtils.ts index b085981848..eb7781c7f8 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/util/ProfileUtils.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/util/ProfileUtils.ts @@ -60,7 +60,7 @@ export class ProfileUtils { programName: string, ): Promise { const vscodeOpenedDoc = vscode.workspace.textDocuments.find((doc) => - doc.fileName.endsWith(programName), + doc.fileName.endsWith(path.basename(programName)), ); if (!vscodeOpenedDoc) return; diff --git a/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDacoCopynodeInsertion.java b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDacoCopynodeInsertion.java new file mode 100644 index 0000000000..75e68e4634 --- /dev/null +++ b/server/dialect-daco/src/test/java/org/eclipse/lsp/cobol/dialects/daco/usecases/TestDacoCopynodeInsertion.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2024 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.dialects.daco.usecases; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import org.eclipse.lsp.cobol.dialects.daco.DaCoDialect; +import org.eclipse.lsp.cobol.dialects.daco.utils.DialectConfigs; +import org.eclipse.lsp.cobol.dialects.idms.IdmsDialect; +import org.eclipse.lsp.cobol.test.CobolText; +import org.eclipse.lsp.cobol.test.engine.UseCaseEngine; +import org.junit.jupiter.api.Test; + +/** Tests right insertion of {@link org.eclipse.lsp.cobol.dialects.daco.nodes.DaCoCopyNode} */ +public class TestDacoCopynodeInsertion { + public static final String TEXT = + "000200 IDENTIFICATION DIVISION.\n" + + "000300 PROGRAM-ID. TEST12.\n" + + "006700 ENVIRONMENT DIVISION.\n" + + "006800 IDMS-CONTROL SECTION.\n" + + "006900 PROTOCOL. MODE IS IDMS-DC-NONAUTO DEBUG\n" + + "007000 IDMS-RECORDS MANUAL.\n" + + "007100 CONFIGURATION SECTION.\n" + + "007200 OBJECT-COMPUTER. IBM-370.\n" + + "007300 DATA DIVISION.\n" + + "007400 WORKING-STORAGE SECTION.\n" + + "007500 01 {$*WS-AREA}.\n" + + "053500 03 {$*AREA-XWE}. \n" + + "053600 05 COPY MAID {~TESTCPY!DaCo} KMK. \n" + + "055300 01 COPY IDMS {~SUBSCHEMA-NAMES!IDMS}."; + + public static final String COPYBOOK_CONTENT = + " 1 01 {$*TEST-X`TEST-XWE}. \n" + + " 2 03 {$*TEST1-X`TEST1-XWE} PIC X(4) VALUE SPACE."; + + private static final String SUBSCHEMA_NAMES = + " * * This copybook remains empty,\n" + + " * * because the content is of no interest while editing COBOL\n" + + " 01 FILLER PIC X(0).\n"; + + @Test + void test() { + UseCaseEngine.runTest( + TEXT, + ImmutableList.of( + new CobolText("TESTCPY", DaCoDialect.NAME, COPYBOOK_CONTENT), + new CobolText("SUBSCHEMA-NAMES", IdmsDialect.NAME, SUBSCHEMA_NAMES, "url", true)), + ImmutableMap.of(), + ImmutableList.of(), + DialectConfigs.getDaCoAnalysisConfig()); + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/Cli.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/Cli.java index cf484ab76c..19687a1f49 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/Cli.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/Cli.java @@ -16,52 +16,39 @@ import com.google.gson.*; import com.google.inject.Injector; + import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.*; import java.util.concurrent.Callable; + import lombok.extern.slf4j.Slf4j; -import org.antlr.v4.runtime.tree.ParseTreeListener; import org.eclipse.lsp.cobol.cli.processorgroups.ProcessorGroupsResolver; import org.eclipse.lsp.cobol.common.AnalysisConfig; import org.eclipse.lsp.cobol.common.CleanerPreprocessor; import org.eclipse.lsp.cobol.common.ResultWithErrors; -import org.eclipse.lsp.cobol.common.SubroutineService; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkService; import org.eclipse.lsp.cobol.common.benchmark.BenchmarkSession; import org.eclipse.lsp.cobol.common.benchmark.Measurement; import org.eclipse.lsp.cobol.common.copybook.CopybookProcessingMode; -import org.eclipse.lsp.cobol.common.copybook.CopybookService; import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; -import org.eclipse.lsp.cobol.common.error.SyntaxError; + import org.eclipse.lsp.cobol.common.mapping.ExtendedDocument; import org.eclipse.lsp.cobol.common.mapping.ExtendedText; -import org.eclipse.lsp.cobol.common.message.MessageService; import org.eclipse.lsp.cobol.common.pipeline.Pipeline; import org.eclipse.lsp.cobol.common.pipeline.PipelineResult; import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; -import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; -import org.eclipse.lsp.cobol.core.engine.processor.AstProcessor; -import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; -import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessor; import org.eclipse.lsp.cobol.dialects.TrueDialectServiceImpl; -import org.eclipse.lsp.cobol.dialects.hp.HpCleanupStage; -import org.eclipse.lsp.cobol.dialects.hp.HpCopybookProcessingStage; -import org.eclipse.lsp.cobol.dialects.ibm.*; -import org.eclipse.lsp.cobol.dialects.ibm.experimental.ExperimentalParserStage; -import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; -import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; import picocli.CommandLine; -/** The Cli class represents a Command Line Interface (CLI) for interacting with the application. */ -@CommandLine.Command( - description = "COBOL Analysis CLI tools.", - mixinStandardHelpOptions = true, - scope = CommandLine.ScopeType.INHERIT, - subcommands = {ListSources.class, ListCopybooks.class, CliAnalysis.class}) +import static org.eclipse.lsp.cobol.cli.command.CliUtils.setupPipeline; + +/** + * The Cli class represents a Command Line Interface (CLI) for interacting with the application. + */ +@CommandLine.Command(description = "COBOL Analysis CLI tools.", mixinStandardHelpOptions = true, scope = CommandLine.ScopeType.INHERIT, subcommands = {ListSources.class, ListCopybooks.class, CliAnalysis.class}) @Slf4j public class Cli implements Callable { ProcessorGroupsResolver processorGroupsResolver; @@ -77,32 +64,25 @@ public Integer call() throws Exception { return 0; } - Result runAnalysis(File src, CobolLanguageId dialect, Injector diCtx, boolean isAnalysisRequired) - throws IOException { + Result runAnalysis(File src, CobolLanguageId dialect, Injector diCtx, boolean isAnalysisRequired) throws IOException { String documentUri = src.toURI().toString(); Pipeline pipeline = setupPipeline(diCtx, isAnalysisRequired, dialect); // Cleaning up - CleanerPreprocessor preprocessor = - diCtx.getInstance(TrueDialectServiceImpl.class).getPreprocessor(dialect); + CleanerPreprocessor preprocessor = diCtx.getInstance(TrueDialectServiceImpl.class).getPreprocessor(dialect); BenchmarkService benchmarkService = diCtx.getInstance(BenchmarkService.class); String text = new String(Files.readAllBytes(src.toPath())); ResultWithErrors resultWithErrors = preprocessor.cleanUpCode(documentUri, text); - AnalysisContext ctx = - new AnalysisContext( - new ExtendedDocument(resultWithErrors.getResult(), text), - createAnalysisConfiguration(), - benchmarkService.startSession(), - documentUri, - text, - dialect); + AnalysisContext ctx = new AnalysisContext(new ExtendedDocument(resultWithErrors.getResult(), text), createAnalysisConfiguration(), benchmarkService.startSession(), documentUri, text, dialect); ctx.getAccumulatedErrors().addAll(resultWithErrors.getErrors()); PipelineResult pipelineResult = pipeline.run(ctx); return new Result(ctx, pipelineResult); } - /** Result of analysis */ + /** + * Result of analysis + */ static class Result { final AnalysisContext ctx; final PipelineResult pipelineResult; @@ -121,10 +101,7 @@ void initProcessorGroupsReader(Path workspace) { Path groupsConfig = workspace.resolve(Paths.get(".cobolplugin", "proc_grps.json")); if (Files.exists(programConfig) && Files.exists(groupsConfig)) { try { - processorGroupsResolver = - new ProcessorGroupsResolver( - new String(Files.readAllBytes(programConfig)), - new String(Files.readAllBytes(groupsConfig))); + processorGroupsResolver = new ProcessorGroupsResolver(new String(Files.readAllBytes(programConfig)), new String(Files.readAllBytes(groupsConfig))); } catch (IOException e) { LOG.error("Processor group configuration read error", e); } @@ -133,202 +110,14 @@ void initProcessorGroupsReader(Path workspace) { } } - JsonObject toJson(SyntaxError syntaxError, Gson gson) { - JsonObject diagnostic = new JsonObject(); - Optional.ofNullable(syntaxError.getErrorCode()) - .ifPresent(code -> diagnostic.add("code", new JsonPrimitive(code.getLabel()))); - Optional.ofNullable(syntaxError.getErrorSource()) - .ifPresent(es -> diagnostic.add("source", new JsonPrimitive(es.getText()))); - Optional.ofNullable(syntaxError.getLocation()) - .ifPresent(l -> diagnostic.add("location", gson.toJsonTree(l))); - Optional.ofNullable(syntaxError.getSeverity()) - .ifPresent(s -> diagnostic.add("severity", new JsonPrimitive(s.name()))); - Optional.ofNullable(syntaxError.getSuggestion()) - .ifPresent(s -> diagnostic.add("suggestion", new JsonPrimitive(s))); - Optional.ofNullable(syntaxError.getRelatedInformation()) - .ifPresent(ri -> diagnostic.add("related", gson.toJsonTree(ri))); - return diagnostic; - } - void addTiming(JsonObject result, BenchmarkSession benchmarkSession) { JsonObject tObj = new JsonObject(); - benchmarkSession - .getMeasurements() - .forEach(m -> tObj.add(m.getId(), new JsonPrimitive(m.getTime() / 1_000_000_000.0))); + benchmarkSession.getMeasurements().forEach(m -> tObj.add(m.getId(), new JsonPrimitive(m.getTime() / 1_000_000_000.0))); result.add("timings", tObj); - benchmarkSession.getMeasurements().stream() - .map(Measurement::getTime) - .reduce(Long::sum) - .ifPresent(totalTime -> tObj.add("total", new JsonPrimitive(totalTime / 1_000_000_000.0))); + benchmarkSession.getMeasurements().stream().map(Measurement::getTime).reduce(Long::sum).ifPresent(totalTime -> tObj.add("total", new JsonPrimitive(totalTime / 1_000_000_000.0))); } private static AnalysisConfig createAnalysisConfiguration() { return AnalysisConfig.defaultConfig(CopybookProcessingMode.ENABLED); } - - private static Pipeline setupPipeline( - Injector diCtx, boolean isAnalysisRequired, CobolLanguageId dialect) { - DialectService dialectService = diCtx.getInstance(DialectService.class); - MessageService messageService = diCtx.getInstance(MessageService.class); - GrammarPreprocessor grammarPreprocessor = diCtx.getInstance(GrammarPreprocessor.class); - ParseTreeListener parseTreeListener = diCtx.getInstance(ParseTreeListener.class); - SymbolsRepository symbolsRepository = diCtx.getInstance(SymbolsRepository.class); - SubroutineService subroutineService = diCtx.getInstance(SubroutineService.class); - CleanerPreprocessor preprocessor = - diCtx.getInstance(TrueDialectServiceImpl.class).getPreprocessor(dialect); - CachingConfigurationService cachingConfigurationService = - diCtx.getInstance(CachingConfigurationService.class); - AstProcessor astProcessor = diCtx.getInstance(AstProcessor.class); - CodeLayoutStore layoutStore = diCtx.getInstance(CodeLayoutStore.class); - CopybookService copybookService = diCtx.getInstance(CopybookService.class); - - Pipeline pipeline = new Pipeline<>(); - switch (dialect) { - case COBOL: - return getPipelineForCobolDialect( - isAnalysisRequired, - pipeline, - preprocessor, - messageService, - dialectService, - grammarPreprocessor, - parseTreeListener, - symbolsRepository, - subroutineService, - cachingConfigurationService, - astProcessor, - layoutStore); - case EXPERIMENTAL_COBOL: - return getPipelineForExpCobol( - isAnalysisRequired, - pipeline, - preprocessor, - messageService, - dialectService, - grammarPreprocessor, - parseTreeListener, - symbolsRepository, - subroutineService, - cachingConfigurationService, - astProcessor, - layoutStore); - case HP_COBOL: - return getPipelineForHpCobol( - isAnalysisRequired, - pipeline, - preprocessor, - messageService, - copybookService, - grammarPreprocessor, - dialectService, - parseTreeListener, - symbolsRepository, - subroutineService, - cachingConfigurationService, - astProcessor, - layoutStore); - default: - return pipeline; - } - } - - private static Pipeline getPipelineForHpCobol( - boolean isAnalysisRequired, - Pipeline pipeline, - CleanerPreprocessor preprocessor, - MessageService messageService, - CopybookService copybookService, - GrammarPreprocessor grammarPreprocessor, - DialectService dialectService, - ParseTreeListener parseTreeListener, - SymbolsRepository symbolsRepository, - SubroutineService subroutineService, - CachingConfigurationService cachingConfigurationService, - AstProcessor astProcessor, - CodeLayoutStore layoutStore) { - pipeline.add(new HpCleanupStage(preprocessor)); - pipeline.add(new CompilerDirectivesStage(messageService)); - pipeline.add(new HpCopybookProcessingStage(messageService, copybookService)); - pipeline.add(new PreprocessorStage(grammarPreprocessor, preprocessor)); - if (isAnalysisRequired) { - pipeline.add(new ImplicitDialectProcessingStage(dialectService)); - pipeline.add(new ParserStage(messageService, parseTreeListener)); - pipeline.add( - new TransformTreeStage( - symbolsRepository, - messageService, - subroutineService, - cachingConfigurationService, - dialectService, - astProcessor, - layoutStore)); - } - return pipeline; - } - - private static Pipeline getPipelineForExpCobol( - boolean isAnalysisRequired, - Pipeline pipeline, - CleanerPreprocessor preprocessor, - MessageService messageService, - DialectService dialectService, - GrammarPreprocessor grammarPreprocessor, - ParseTreeListener parseTreeListener, - SymbolsRepository symbolsRepository, - SubroutineService subroutineService, - CachingConfigurationService cachingConfigurationService, - AstProcessor astProcessor, - CodeLayoutStore layoutStore) { - pipeline.add(new IbmCleanupStage(preprocessor)); - pipeline.add(new CompilerDirectivesStage(messageService)); - pipeline.add(new DialectProcessingStage(dialectService, preprocessor)); - pipeline.add(new PreprocessorStage(grammarPreprocessor, preprocessor)); - if (isAnalysisRequired) { - pipeline.add(new ImplicitDialectProcessingStage(dialectService)); - pipeline.add(new ExperimentalParserStage(messageService, parseTreeListener)); - pipeline.add( - new TransformTreeStage( - symbolsRepository, - messageService, - subroutineService, - cachingConfigurationService, - dialectService, - astProcessor, - layoutStore)); - } - return pipeline; - } - - private static Pipeline getPipelineForCobolDialect( - boolean isAnalysisRequired, - Pipeline pipeline, - CleanerPreprocessor preprocessor, - MessageService messageService, - DialectService dialectService, - GrammarPreprocessor grammarPreprocessor, - ParseTreeListener parseTreeListener, - SymbolsRepository symbolsRepository, - SubroutineService subroutineService, - CachingConfigurationService cachingConfigurationService, - AstProcessor astProcessor, - CodeLayoutStore layoutStore) { - pipeline.add(new IbmCleanupStage(preprocessor)); - pipeline.add(new CompilerDirectivesStage(messageService)); - pipeline.add(new DialectProcessingStage(dialectService, preprocessor)); - pipeline.add(new PreprocessorStage(grammarPreprocessor, preprocessor)); - if (isAnalysisRequired) { - pipeline.add(new ImplicitDialectProcessingStage(dialectService)); - pipeline.add(new ParserStage(messageService, parseTreeListener)); - pipeline.add( - new TransformTreeStage( - symbolsRepository, - messageService, - subroutineService, - cachingConfigurationService, - dialectService, - astProcessor, - layoutStore)); - } - return pipeline; - } } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/CliAnalysis.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/CliAnalysis.java index 9f04ba0045..a07ca6d381 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/CliAnalysis.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/CliAnalysis.java @@ -14,41 +14,48 @@ */ package org.eclipse.lsp.cobol.cli.command; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.inject.Guice; import com.google.inject.Injector; + import java.io.File; +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryType; import java.nio.file.Path; import java.util.Arrays; import java.util.List; import java.util.concurrent.Callable; import java.util.stream.Collectors; + import org.eclipse.lsp.cobol.cli.di.CliModule; import org.eclipse.lsp.cobol.cli.modules.CliClientProvider; import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; import picocli.CommandLine; -/** Analysis cli command */ +/** + * Analysis cli command + */ @CommandLine.Command(name = "analysis", description = "analyse cobol source") public class CliAnalysis implements Callable { - @CommandLine.ParentCommand private Cli parent; + @CommandLine.ParentCommand + private Cli parent; @CommandLine.Option( - names = {"-s", "--source"}, - required = true, - description = "The COBOL program file.") + names = {"-s", "--source"}, + required = true, + description = "The COBOL program file.") private File src; @CommandLine.ArgGroup(multiplicity = "1") private Args args; @CommandLine.Option( - description = "Supported dialect values: ${COMPLETION-CANDIDATES}", - names = {"-d", "--dialect"}, - defaultValue = "COBOL") + description = "Supported dialect values: ${COMPLETION-CANDIDATES}", + names = {"-d", "--dialect"}, + defaultValue = "COBOL") private CobolLanguageId dialect; @Override @@ -61,47 +68,86 @@ public Integer call() throws Exception { cliClientProvider.setCpyPaths(createCopybooksPaths()); cliClientProvider.setCpyExt(createCopybooksExtensions()); - Gson gson = new GsonBuilder().setPrettyPrinting().create(); JsonObject result = new JsonObject(); Cli.Result analysisResult = parent.runAnalysis(src, dialect, diCtx, true); parent.addTiming(result, analysisResult.ctx.getBenchmarkSession()); JsonArray diagnostics = new JsonArray(); analysisResult - .ctx - .getAccumulatedErrors() - .forEach( - err -> { - JsonObject diagnostic = parent.toJson(err, gson); - diagnostics.add(diagnostic); - }); + .ctx + .getAccumulatedErrors() + .forEach( + err -> { + JsonObject diagnostic = CliUtils.diagnosticToJson(err); + diagnostics.add(diagnostic); + }); result.add("diagnostics", diagnostics); - System.out.println(gson.toJson(result)); + result.addProperty("uri", analysisResult.ctx.getExtendedDocument().getUri()); + result.addProperty("language", analysisResult.ctx.getLanguageId().getId()); + result.addProperty("lines", String.valueOf(analysisResult.ctx.getExtendedDocument().toString().split("\n").length)); + result.addProperty("size", String.valueOf(analysisResult.ctx.getExtendedDocument().toString().length())); + collectGcAndMemoryStats(result); + System.out.println(CliUtils.GSON.toJson(result)); return 0; } - /** WorkspaceConfig options */ + private void collectGcAndMemoryStats(JsonObject result) { + long totalGarbageCollections = 0; + long garbageCollectionTime = 0; + + for (GarbageCollectorMXBean gc : ManagementFactory.getGarbageCollectorMXBeans()) { + long count = gc.getCollectionCount(); + if (count >= 0) { + totalGarbageCollections += count; + } + long time = gc.getCollectionTime(); + if (time >= 0) { + garbageCollectionTime += time; + } + } + result.addProperty("gc.count", totalGarbageCollections); + // milliseconds to seconds + result.addProperty("gc.time", garbageCollectionTime * 0.001); + + List pools = ManagementFactory.getMemoryPoolMXBeans(); + long total = 0; + for (MemoryPoolMXBean memoryPoolMXBean : pools) { + if (memoryPoolMXBean.getType() == MemoryType.HEAP) { + long peakUsed = memoryPoolMXBean.getPeakUsage().getUsed(); + total = total + peakUsed; + } + } + result.addProperty("memory.heap_peak", total / 1024 / 1024); + } + + /** + * WorkspaceConfig options + */ static class WorkspaceConfig { @CommandLine.Option( - description = "Path to workspace folder.", - names = {"-ws", "--workspace"}) + description = "Path to workspace folder.", + names = {"-ws", "--workspace"}) private Path workspace; } - /** explicit config options */ + /** + * explicit config options + */ static class ExplicitConfig { @CommandLine.Option( - names = {"-cf", "--copybook-folder"}, - description = "Path to the copybook folder.") + names = {"-cf", "--copybook-folder"}, + description = "Path to the copybook folder.") private File[] cpyPaths = {}; @CommandLine.Option( - names = {"-ce", "--copybook-extension"}, - description = "List of copybook paths.") + names = {"-ce", "--copybook-extension"}, + description = "List of copybook paths.") private String[] cpyExt = {"", ".cpy"}; } - /** options for analysis command */ + /** + * options for analysis command + */ static class Args { @CommandLine.ArgGroup(exclusive = false) ExplicitConfig explicitConfig; @@ -113,11 +159,11 @@ static class Args { private List createCopybooksPaths() { if (args.workspaceConfig != null && parent.processorGroupsResolver != null) { return parent - .processorGroupsResolver - .resolveCopybooksPaths(src.toPath(), args.workspaceConfig.workspace) - .stream() - .map(Path::toFile) - .collect(Collectors.toList()); + .processorGroupsResolver + .resolveCopybooksPaths(src.toPath(), args.workspaceConfig.workspace) + .stream() + .map(Path::toFile) + .collect(Collectors.toList()); } return Arrays.asList(args.explicitConfig.cpyPaths); } @@ -125,7 +171,7 @@ private List createCopybooksPaths() { private List createCopybooksExtensions() { if (args.workspaceConfig != null && parent.processorGroupsResolver != null) { return parent.processorGroupsResolver.resolveCopybooksExtensions( - src.toPath(), args.workspaceConfig.workspace); + src.toPath(), args.workspaceConfig.workspace); } return Arrays.asList(args.explicitConfig.cpyExt); } diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/CliUtils.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/CliUtils.java new file mode 100644 index 0000000000..7969ae1f24 --- /dev/null +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/CliUtils.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2023 Broadcom. + * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Broadcom, Inc. - initial API and implementation + * + */ +package org.eclipse.lsp.cobol.cli.command; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.google.inject.Injector; +import org.antlr.v4.runtime.tree.ParseTreeListener; +import org.eclipse.lsp.cobol.common.CleanerPreprocessor; +import org.eclipse.lsp.cobol.common.SubroutineService; +import org.eclipse.lsp.cobol.common.copybook.CopybookService; +import org.eclipse.lsp.cobol.common.dialects.CobolLanguageId; +import org.eclipse.lsp.cobol.common.error.SyntaxError; +import org.eclipse.lsp.cobol.common.message.MessageService; +import org.eclipse.lsp.cobol.common.pipeline.Pipeline; +import org.eclipse.lsp.cobol.core.engine.analysis.AnalysisContext; +import org.eclipse.lsp.cobol.core.engine.dialects.DialectService; +import org.eclipse.lsp.cobol.core.engine.processor.AstProcessor; +import org.eclipse.lsp.cobol.core.engine.symbols.SymbolsRepository; +import org.eclipse.lsp.cobol.core.preprocessor.delegates.GrammarPreprocessor; +import org.eclipse.lsp.cobol.dialects.TrueDialectServiceImpl; +import org.eclipse.lsp.cobol.dialects.hp.HpCleanupStage; +import org.eclipse.lsp.cobol.dialects.hp.HpCopybookProcessingStage; +import org.eclipse.lsp.cobol.dialects.ibm.*; +import org.eclipse.lsp.cobol.dialects.ibm.experimental.ExperimentalParserStage; +import org.eclipse.lsp.cobol.service.settings.CachingConfigurationService; +import org.eclipse.lsp.cobol.service.settings.layout.CodeLayoutStore; + +import java.util.Optional; + +/** + * CLI related utils + */ +public class CliUtils { + + public static final Gson GSON = new GsonBuilder().setPrettyPrinting().create(); + + /** + * Init CLI pipeline + * + * @param diCtx DI context + * @param isAnalysisRequired do we need analysis in the pipeline + * @param dialect cobol dialect + * @return new pipeline + */ + public static Pipeline setupPipeline(Injector diCtx, boolean isAnalysisRequired, CobolLanguageId dialect) { + switch (dialect) { + case COBOL: + return getPipelineForCobolDialect(diCtx, isAnalysisRequired); + case EXPERIMENTAL_COBOL: + return getPipelineForExpCobol(diCtx, isAnalysisRequired); + case HP_COBOL: + return getPipelineForHpCobol(diCtx, isAnalysisRequired); + default: + return new Pipeline<>(); + } + } + + /** + * Convert diagnostics to json format + * + * @param syntaxError error object + * @return Json object + */ + public static JsonObject diagnosticToJson(SyntaxError syntaxError) { + JsonObject diagnostic = new JsonObject(); + Optional.ofNullable(syntaxError.getErrorCode()).ifPresent(code -> diagnostic.add("code", new JsonPrimitive(code.getLabel()))); + Optional.ofNullable(syntaxError.getErrorSource()).ifPresent(es -> diagnostic.add("source", new JsonPrimitive(es.getText()))); + Optional.ofNullable(syntaxError.getLocation()).ifPresent(l -> diagnostic.add("location", GSON.toJsonTree(l))); + Optional.ofNullable(syntaxError.getSeverity()).ifPresent(s -> diagnostic.add("severity", new JsonPrimitive(s.name()))); + Optional.ofNullable(syntaxError.getSuggestion()).ifPresent(s -> diagnostic.add("suggestion", new JsonPrimitive(s))); + Optional.ofNullable(syntaxError.getRelatedInformation()).ifPresent(ri -> diagnostic.add("related", GSON.toJsonTree(ri))); + return diagnostic; + } + + + private static Pipeline getPipelineForHpCobol(Injector diCtx, boolean isAnalysisRequired) { + Pipeline pipeline = new Pipeline<>(); + DialectService dialectService = diCtx.getInstance(DialectService.class); + MessageService messageService = diCtx.getInstance(MessageService.class); + CleanerPreprocessor preprocessor = diCtx.getInstance(TrueDialectServiceImpl.class).getPreprocessor(CobolLanguageId.HP_COBOL); + + pipeline.add(new HpCleanupStage(preprocessor)); + pipeline.add(new CompilerDirectivesStage(messageService)); + pipeline.add(new HpCopybookProcessingStage(messageService, diCtx.getInstance(CopybookService.class))); + pipeline.add(new PreprocessorStage(diCtx.getInstance(GrammarPreprocessor.class), preprocessor)); + if (isAnalysisRequired) { + pipeline.add(new ImplicitDialectProcessingStage(dialectService)); + pipeline.add(new ParserStage(messageService, diCtx.getInstance(ParseTreeListener.class))); + pipeline.add(new TransformTreeStage(diCtx.getInstance(SymbolsRepository.class), messageService, diCtx.getInstance(SubroutineService.class), diCtx.getInstance(CachingConfigurationService.class), dialectService, diCtx.getInstance(AstProcessor.class), diCtx.getInstance(CodeLayoutStore.class))); + } + return pipeline; + } + + private static Pipeline getPipelineForExpCobol(Injector diCtx, boolean isAnalysisRequired) { + MessageService messageService = diCtx.getInstance(MessageService.class); + CleanerPreprocessor preprocessor = diCtx.getInstance(TrueDialectServiceImpl.class).getPreprocessor(CobolLanguageId.EXPERIMENTAL_COBOL); + DialectService dialectService = diCtx.getInstance(DialectService.class); + Pipeline pipeline = new Pipeline<>(); + + pipeline.add(new IbmCleanupStage(preprocessor)); + pipeline.add(new CompilerDirectivesStage(messageService)); + pipeline.add(new DialectProcessingStage(dialectService, preprocessor)); + pipeline.add(new PreprocessorStage(diCtx.getInstance(GrammarPreprocessor.class), preprocessor)); + if (isAnalysisRequired) { + pipeline.add(new ImplicitDialectProcessingStage(dialectService)); + pipeline.add(new ExperimentalParserStage(messageService, diCtx.getInstance(ParseTreeListener.class))); + pipeline.add(new TransformTreeStage(diCtx.getInstance(SymbolsRepository.class), messageService, diCtx.getInstance(SubroutineService.class), diCtx.getInstance(CachingConfigurationService.class), dialectService, diCtx.getInstance(AstProcessor.class), diCtx.getInstance(CodeLayoutStore.class))); + } + return pipeline; + } + + private static Pipeline getPipelineForCobolDialect(Injector diCtx, boolean isAnalysisRequired) { + Pipeline pipeline = new Pipeline<>(); + DialectService dialectService = diCtx.getInstance(DialectService.class); + MessageService messageService = diCtx.getInstance(MessageService.class); + GrammarPreprocessor grammarPreprocessor = diCtx.getInstance(GrammarPreprocessor.class); + CleanerPreprocessor preprocessor = diCtx.getInstance(TrueDialectServiceImpl.class).getPreprocessor(CobolLanguageId.COBOL); + + pipeline.add(new IbmCleanupStage(preprocessor)); + pipeline.add(new CompilerDirectivesStage(messageService)); + pipeline.add(new DialectProcessingStage(dialectService, preprocessor)); + pipeline.add(new PreprocessorStage(grammarPreprocessor, preprocessor)); + if (isAnalysisRequired) { + pipeline.add(new ImplicitDialectProcessingStage(dialectService)); + pipeline.add(new ParserStage(messageService, diCtx.getInstance(ParseTreeListener.class))); + pipeline.add(new TransformTreeStage(diCtx.getInstance(SymbolsRepository.class), messageService, diCtx.getInstance(SubroutineService.class), diCtx.getInstance(CachingConfigurationService.class), dialectService, diCtx.getInstance(AstProcessor.class), diCtx.getInstance(CodeLayoutStore.class))); + } + return pipeline; + } +} diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/ListSources.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/ListSources.java index 0ced6eea1d..1ca1c57b69 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/ListSources.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/cli/command/ListSources.java @@ -39,6 +39,12 @@ public class ListSources implements Callable { names = {"-ws", "--workspace"}) private Path workspace; + @CommandLine.Option( + description = "show absolute path of sources", + names = {"-ap", "--absolutePath"}, + arity = "0") + private boolean showAbsolutePath; + /** * execute list source command * @@ -52,12 +58,14 @@ public Integer call() throws Exception { JsonArray sources = new JsonArray(); if (Objects.nonNull(workspace)) { try (Stream paths = Files.walk(workspace)) { - paths - .filter(Files::isRegularFile) - .map(f -> workspace.relativize(f)) - .filter(this::isSourceFile) - .map(Path::toString) - .forEach(sources::add); + Stream pathStream = + paths + .filter(Files::isRegularFile) + .filter(f -> this.isSourceFile(workspace.relativize(f))); + if (!showAbsolutePath) { + pathStream = pathStream.map(f -> workspace.relativize(f)); + } + pathStream.map(Path::toString).forEach(sources::add); } } result.add("sources", sources); diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/SectionNodeProcessorHelper.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/SectionNodeProcessorHelper.java index 7fbd1a0a80..4ac19b4d17 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/SectionNodeProcessorHelper.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/core/engine/processors/SectionNodeProcessorHelper.java @@ -25,7 +25,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import java.util.*; -import java.util.concurrent.atomic.AtomicInteger; import java.util.function.Function; import java.util.stream.Collectors; import lombok.experimental.UtilityClass; @@ -41,6 +40,9 @@ import org.eclipse.lsp.cobol.common.model.tree.Node; import org.eclipse.lsp.cobol.common.model.tree.variable.*; import org.eclipse.lsp.cobol.common.model.tree.variables.*; +import org.eclipse.lsp.cobol.common.utils.RangeUtils; +import org.eclipse.lsp4j.Position; +import org.eclipse.lsp4j.Range; /** The utility class is for converting VariableDefinitionNode into appropriate VariableNode. */ @UtilityClass @@ -104,14 +106,14 @@ public List processNodeWithVariableDefinitions(Node node) { * @return a list of unwrapped variables */ private List unwrapVariables(Node node) { - List variables = new ArrayList<>(); + List variables = new ArrayList<>(); List copybooks = new LinkedList<>(); node.getChildren() .forEach( c -> { if (c.getNodeType() == NodeType.VARIABLE_DEFINITION) { - variables.add((VariableDefinitionNode) c); + variables.add(c); } if (c.getNodeType() == NodeType.COPY) { copybooks.add((CopyNode) c); @@ -127,48 +129,77 @@ private List unwrapVariables(Node node) { .map(CopyNode.class::cast) .collect(Collectors.toList()); -// Below could be problematic if a copybook is referenced at multiple places in a cobol doc. -// As the uri of copybooks would match with all variable definition and would result in a wrong node tree structure. -// -// allCopybooks.stream() -// .filter(c -> c.getUri() != null) -// .forEach( -// c -> -// new ArrayList<>(variables) -// .stream() -// .filter(Objects::nonNull) -// .filter(v -> v.getLocality() != null) -// .filter(v -> v.getLocality().getUri() != null) -// .filter(v -> v.getLocality().getUri().equals(c.getUri())) -// .forEach( -// v -> { -// variables.remove(v); -// c.addChild(v); -// })); - - allCopybooks.forEach( - copyNode -> { - int copybookLine = copyNode.getLocality().getRange().getStart().getLine(); - String uri = copyNode.getLocality().getUri(); - AtomicInteger index = new AtomicInteger(); - for (Node variable : variables) { - int variableLine = variable.getLocality().getRange().getStart().getLine(); - if (variable.getLocality().getUri().equals(uri) && variableLine > copybookLine) { - break; - } - index.incrementAndGet(); - } - - copyNode - .getDepthFirstStream() - .filter(hasType(NodeType.COPY)) - .flatMap(Node::getDepthFirstStream) - .filter(hasType(NodeType.VARIABLE_DEFINITION)) - .map(VariableDefinitionNode.class::cast) - .forEach( - copyNodeVariable -> variables.add(index.getAndIncrement(), copyNodeVariable)); - }); - return variables; + int index = 0; + for (CopyNode copyNode : allCopybooks) { + index = insertCopybook(variables, index, copyNode); + } + + return variables.stream() + .flatMap( + n -> { + if (n.getNodeType() == NodeType.COPY) { + return n.getDepthFirstStream(); + } + return ImmutableList.of(n).stream(); + }) + .filter(hasType(NodeType.VARIABLE_DEFINITION)) + .map(VariableDefinitionNode.class::cast) + .collect(Collectors.toList()); + } + + private static int insertCopybook(List variables, int index, CopyNode copyNode) { + if (index > variables.size() - 1) { + variables.add(copyNode); + return index; + } + for (int i = index; i < variables.size(); i++) { + index++; + if (!canInsertCopyNodeAtIndex(copyNode, i, variables)) { + index = i; + break; + } + } + + // append at last + if (index >= variables.size()) { + variables.add(copyNode); + return variables.indexOf(copyNode); + } + + variables.add(index, copyNode); + if (adjustCopyNodeChild(copyNode, variables, index + 1)) { + return variables.indexOf(copyNode) + 1; + } + return index; + } + + private static boolean adjustCopyNodeChild(CopyNode copyNode, List variables, int index) { + boolean areNodesAdjusted = false; + ArrayList nodes = new ArrayList<>(variables); + for (int i = index; i < nodes.size(); i++) { + Node variable = nodes.get(i); + String variableNodeUri = variable.getLocality().getUri(); + String copybookNodeUri = copyNode.getUri(); + if (variableNodeUri.equals(copybookNodeUri)) { + copyNode.addChild(variable); + variables.remove(variable); + areNodesAdjusted = true; + } else { + break; + } + } + return areNodesAdjusted; + } + + private static boolean canInsertCopyNodeAtIndex( + CopyNode copyNode, int index, List variables) { + String copybookLocalityUri = copyNode.getLocality().getUri(); + Range copybookLocalityRange = copyNode.getLocality().getRange(); + Node variableDefinitionNode = variables.get(index); + String variableUri = variableDefinitionNode.getLocality().getUri(); + Position variableStartPosition = variableDefinitionNode.getLocality().getRange().getEnd(); + return variableUri.equals(copybookLocalityUri) + && RangeUtils.isBefore(variableStartPosition, copybookLocalityRange.getStart()); } /** diff --git a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/ExperimentalParserStage.java b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/ExperimentalParserStage.java index 7d2a67e44a..55dd2f9a7d 100644 --- a/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/ExperimentalParserStage.java +++ b/server/engine/src/main/java/org/eclipse/lsp/cobol/dialects/ibm/experimental/ExperimentalParserStage.java @@ -15,8 +15,10 @@ package org.eclipse.lsp.cobol.dialects.ibm.experimental; import com.google.common.collect.ImmutableList; + import java.util.List; import java.util.stream.Collectors; + import lombok.RequiredArgsConstructor; import org.antlr.v4.runtime.CharStreams; import org.antlr.v4.runtime.DefaultErrorStrategy; @@ -49,21 +51,19 @@ public class ExperimentalParserStage implements Stage run(AnalysisContext context, StageResult prevStageResult) { - return context.getBenchmarkSession().measure("pipeline.parser", () -> { - // Run parser; - context.setDialectNodes(ImmutableList.builder() - .addAll(context.getDialectNodes()) - .addAll(prevStageResult.getData().getDialectNodes()) - .build()); - ParserListener listener = new ParserListener(context.getExtendedDocument(), context.getCopybooksRepository()); - DefaultErrorStrategy errorStrategy = new BasicCobolErrorHandler(messageService); - AstBuilder parser = new SplitParser(CharStreams.fromString(context.getExtendedDocument().toString()), - listener, errorStrategy, treeListener); - CobolParser.StartRuleContext tree = parser.runParser(); - context.getAccumulatedErrors().addAll(listener.getErrors()); - context.getAccumulatedErrors().addAll(getParsingError(context, parser)); - return new StageResult<>(new ParserStageResult(parser.getTokens(), tree)); - }); + // Run parser; + context.setDialectNodes(ImmutableList.builder() + .addAll(context.getDialectNodes()) + .addAll(prevStageResult.getData().getDialectNodes()) + .build()); + ParserListener listener = new ParserListener(context.getExtendedDocument(), context.getCopybooksRepository()); + DefaultErrorStrategy errorStrategy = new BasicCobolErrorHandler(messageService); + AstBuilder parser = new SplitParser(CharStreams.fromString(context.getExtendedDocument().toString()), + listener, errorStrategy, treeListener); + CobolParser.StartRuleContext tree = parser.runParser(); + context.getAccumulatedErrors().addAll(listener.getErrors()); + context.getAccumulatedErrors().addAll(getParsingError(context, parser)); + return new StageResult<>(new ParserStageResult(parser.getTokens(), tree)); } private List getParsingError(AnalysisContext context, AstBuilder parser) { @@ -71,11 +71,11 @@ private List getParsingError(AnalysisContext context, AstBuilder pa Location location = context.getExtendedDocument().mapLocation(diagnostic.getRange()); String copybookId = context.getCopybooksRepository().getCopybookIdByUri(location.getUri()); return SyntaxError.syntaxError() - .errorSource(ErrorSource.PARSING) - .severity(ErrorSeverity.ERROR) - .location(new OriginalLocation(location, copybookId)) - .suggestion(diagnostic.getMessage()) - .build(); + .errorSource(ErrorSource.PARSING) + .severity(ErrorSeverity.ERROR) + .location(new OriginalLocation(location, copybookId)) + .suggestion(diagnostic.getMessage()) + .build(); }).collect(Collectors.toList()); } From 288db934478b0449d6ad90fbf19653e047b7c2a4 Mon Sep 17 00:00:00 2001 From: Kutlu Date: Wed, 19 Jun 2024 11:16:31 +0200 Subject: [PATCH 07/13] merge err --- .../src/services/copybook/CopybookMessageHandler.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts index 9725975662..9cba832d61 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts @@ -21,6 +21,7 @@ import { CopybookURI } from "./CopybookURI"; import { CopybookName } from "./CopybookDownloadService"; import * as path from "path"; import { + COPYBOOKS_FOLDER, DATASET, E4E_FOLDER, E4E_SCHEME, @@ -69,7 +70,7 @@ export async function resolveCopybookHandler( await CopybookURI.createPathForCopybookDownloaded( documentUri, dialectType, - path.join(storagePath, ZOWE_FOLDER), + path.join(storagePath, ZOWE_FOLDER, COPYBOOKS_FOLDER), ), SettingsService.getCopybookExtension(documentUri), storagePath, From 589c5e1071e52fc9f9aaeaedddb432d373652a79 Mon Sep 17 00:00:00 2001 From: Kutlu Date: Thu, 20 Jun 2024 11:36:31 +0200 Subject: [PATCH 08/13] revert irrevelant --- .../download/DownloadStrategyResolverTest.spec.ts | 12 ++++++++++-- .../copybook/downloader/DownloadStrategyResolver.ts | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts index ff7d61f957..9f5baed26d 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/download/DownloadStrategyResolverTest.spec.ts @@ -132,7 +132,11 @@ describe("tests download resolver", () => { }); it("checks download fails if ZE apis are missing", async () => { - const resolver = new DownloadStrategyResolver("storage-path"); + const resolver = new DownloadStrategyResolver( + "storage-path", + undefined, + undefined, + ); const result = await resolver.downloadCopybook( { name: "copybook", dialect: "COBOL" }, "doc-uri", @@ -141,7 +145,11 @@ describe("tests download resolver", () => { }); it("checks clear cache do not throw error when ZE apis are missing", () => { - const resolver = new DownloadStrategyResolver("storage-path"); + const resolver = new DownloadStrategyResolver( + "storage-path", + undefined, + undefined, + ); expect(() => resolver.clearCache()).not.toThrowError(); }); diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts index 083c09d0e1..97c7992bc9 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/downloader/DownloadStrategyResolver.ts @@ -30,8 +30,8 @@ export class DownloadStrategyResolver { constructor( storagePath: string, - explorerApi?: IApiRegisterClient, - e4eApi?: E4E, + explorerApi: IApiRegisterClient | undefined, + e4eApi: E4E | undefined, outputChannel?: vscode.OutputChannel, ) { if (e4eApi) { From a57fc54fb90487f951d5afbd06557f87d51f5bed Mon Sep 17 00:00:00 2001 From: Kutlu Date: Fri, 21 Jun 2024 09:10:09 +0200 Subject: [PATCH 09/13] fix e4e fails scenario --- .../copybook/CopybookMessageHandlerTest.spec.ts | 2 +- .../src/services/copybook/CopybookMessageHandler.ts | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts index 7e4e65940b..ae122acb03 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts @@ -143,7 +143,7 @@ describe("Test the copybook message handler", () => { }); it("checks E4E downloaded member copybooks are resolved", async () => { vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ - get: jest.fn().mockReturnValue(""), + get: jest.fn().mockReturnValue("ENDEVOR_PROCESSOR"), }); (vscode.workspace.workspaceFolders as any) = undefined; (globSync as any) = jest.fn().mockImplementation((x: any) => [x]); diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts index 9cba832d61..c82442fcd4 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookMessageHandler.ts @@ -25,6 +25,7 @@ import { DATASET, E4E_FOLDER, E4E_SCHEME, + ENDEVOR_PROCESSOR, ENVIRONMENT, USE_MAP, ZOWE_FOLDER, @@ -47,8 +48,12 @@ export async function resolveCopybookHandler( dialectType: string, ): Promise { let result: string | undefined; - - if (await E4ECopybookService.getE4EClient(documentUri)) { + const e4eApi = await E4ECopybookService.getE4EAPI(); + if ( + e4eApi && + e4eApi.isEndevorElement(documentUri) && + SettingsService.getCopybookEndevorDependencySettings() == ENDEVOR_PROCESSOR + ) { result = await getE4ECopyBookLocation( copybookName, documentUri, @@ -172,7 +177,7 @@ async function getE4ECopyBookLocation( documentUri: string, storagePath: string, outputChannel: vscode.OutputChannel, -) { +): Promise { const config = await E4ECopybookService.getE4EClient( documentUri, outputChannel, From 9ac762e995933e5ff9b32eaa1877c72c7eb03341 Mon Sep 17 00:00:00 2001 From: Kutlu Date: Fri, 21 Jun 2024 09:46:26 +0200 Subject: [PATCH 10/13] fix download scenario when e4e fails --- .../services/copybook/CopybookDownloadService.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookDownloadService.ts b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookDownloadService.ts index 40109bdb68..4938c0e18c 100644 --- a/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookDownloadService.ts +++ b/clients/cobol-lsp-vscode-extension/src/services/copybook/CopybookDownloadService.ts @@ -14,11 +14,12 @@ import * as vscode from "vscode"; import { DownloadStrategyResolver } from "./downloader/DownloadStrategyResolver"; -import { PROVIDE_PROFILE_MSG } from "../../constants"; +import { ENDEVOR_PROCESSOR, PROVIDE_PROFILE_MSG } from "../../constants"; import { ProfileUtils } from "../util/ProfileUtils"; import { DownloadUtil } from "./downloader/DownloadUtil"; import { E4ECopybookService } from "./E4ECopybookService"; import { E4E } from "../../type/e4eApi"; +import { SettingsService } from "../Settings"; export class CopybookName { constructor(public name: string, public dialect: string) {} @@ -108,8 +109,15 @@ export class CopybookDownloadService { documentUri: string, copybookNames: CopybookName[], ): Promise { - if (await E4ECopybookService.getE4EClient(documentUri)) { - return true; + if ( + this.e4eAPI && + this.e4eAPI.isEndevorElement(documentUri) && + SettingsService.getCopybookEndevorDependencySettings() == + ENDEVOR_PROCESSOR + ) { + return (await E4ECopybookService.getE4EClient(documentUri)) + ? true + : false; } if ( !DownloadUtil.areCopybookDownloadConfigurationsPresent( From 4f5bde065872e0647d79b82ca91b5d5a60a2e6c9 Mon Sep 17 00:00:00 2001 From: Kutlu Date: Fri, 21 Jun 2024 13:05:33 +0200 Subject: [PATCH 11/13] descripton changes --- clients/cobol-lsp-vscode-extension/package.json | 12 ++++++------ .../copybook/CopybookMessageHandlerTest.spec.ts | 2 +- .../services/copybook/E4ECopybookService.spec.ts | 4 ++-- clients/cobol-lsp-vscode-extension/src/constants.ts | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/clients/cobol-lsp-vscode-extension/package.json b/clients/cobol-lsp-vscode-extension/package.json index 127a470da8..51a86566c9 100644 --- a/clients/cobol-lsp-vscode-extension/package.json +++ b/clients/cobol-lsp-vscode-extension/package.json @@ -408,15 +408,15 @@ "cobol-lsp.cpy-manager.endevor-dependencies": { "type": "string", "enum": [ - "ZOWE", - "ENDEVOR_PROCESSOR" + "COBOL LS", + "ENDEVOR" ], "enumDescriptions": [ - "ZOWE paths to retrieve copybooks", - "ENDEVOR_PROCESSOR to retrieve copybooks" + "Retrieve copybooks from mainframe data sets and USS files specified in the COBOL Language Support extension settings", + "Retrieve copybooks from locations specified in the Endevor element processor group." ], - "description": "The method that is used to retrieve copybooks for elements open via Explorer for Endevor.", - "default": "ZOWE" + "description": "The method that is used to retrieve remote copybooks for elements opened in Explorer for Endevor.", + "default": "COBOL LS" }, "cobol-lsp.subroutine-manager.paths-local": { "type": "array", diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts index ae122acb03..a68f2ad76b 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts @@ -143,7 +143,7 @@ describe("Test the copybook message handler", () => { }); it("checks E4E downloaded member copybooks are resolved", async () => { vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ - get: jest.fn().mockReturnValue("ENDEVOR_PROCESSOR"), + get: jest.fn().mockReturnValue("ENDEVOR"), }); (vscode.workspace.workspaceFolders as any) = undefined; (globSync as any) = jest.fn().mockImplementation((x: any) => [x]); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts index dccceb489e..c0ef6ff899 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts @@ -33,7 +33,7 @@ describe("e4e copybook service tests", () => { it("check getE4EClient assembles client correctly / check getE4EClient returns already assembled client once called with same Uri ", async () => { E4ECopybookService.getE4EAPI = jest.fn().mockReturnValue(e4eMock); vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ - get: jest.fn().mockReturnValue("ENDEVOR_PROCESSOR"), + get: jest.fn().mockReturnValue("ENDEVOR"), }); await E4ECopybookService.getE4EClient("document-uri"); const spyApi = jest.spyOn(E4ECopybookService, "getE4EAPI"); @@ -45,7 +45,7 @@ describe("e4e copybook service tests", () => { }); it("checks getE4EClient returns undefined when zowe settings is being used to retrieve copybooks", async () => { vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ - get: jest.fn().mockReturnValue("ZOWE"), + get: jest.fn().mockReturnValue("COBOL LS"), }); expect(await E4ECopybookService.getE4EClient("document-uri")).toEqual( undefined, diff --git a/clients/cobol-lsp-vscode-extension/src/constants.ts b/clients/cobol-lsp-vscode-extension/src/constants.ts index dd0eae8bd3..a11982802e 100644 --- a/clients/cobol-lsp-vscode-extension/src/constants.ts +++ b/clients/cobol-lsp-vscode-extension/src/constants.ts @@ -78,7 +78,7 @@ export const DATASET = "dataset"; export const ENVIRONMENT = "environment"; export const USE_MAP = "MAP"; export const SETTINGS_CPY_NDVR_DEPENDENCIES = "endevor-dependencies"; -export const ENDEVOR_PROCESSOR = "ENDEVOR_PROCESSOR"; +export const ENDEVOR_PROCESSOR = "ENDEVOR"; export enum PUNCH_CARD { SEQUENCE_AREA_END_POS = 6, From 20e9b91cb57f28897cd241133731f32208f1ecb8 Mon Sep 17 00:00:00 2001 From: Kutlu Date: Mon, 24 Jun 2024 15:16:53 +0200 Subject: [PATCH 12/13] update description --- clients/cobol-lsp-vscode-extension/package.json | 10 +++++----- .../copybook/CopybookMessageHandlerTest.spec.ts | 2 +- .../services/copybook/E4ECopybookService.spec.ts | 4 ++-- clients/cobol-lsp-vscode-extension/src/constants.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/clients/cobol-lsp-vscode-extension/package.json b/clients/cobol-lsp-vscode-extension/package.json index 51a86566c9..d59f43f579 100644 --- a/clients/cobol-lsp-vscode-extension/package.json +++ b/clients/cobol-lsp-vscode-extension/package.json @@ -408,15 +408,15 @@ "cobol-lsp.cpy-manager.endevor-dependencies": { "type": "string", "enum": [ - "COBOL LS", - "ENDEVOR" + "ZOWE", + "ENDEVOR_PROCESSOR" ], "enumDescriptions": [ - "Retrieve copybooks from mainframe data sets and USS files specified in the COBOL Language Support extension settings", - "Retrieve copybooks from locations specified in the Endevor element processor group." + "Use ZOWE Explorer to retrieve copybooks from mainframe data sets and USS files specified in the COBOL Language Support extension settings.", + "Use Explorer for Endevor to retrieve copybooks from locations specified in the Endevor element processor group." ], "description": "The method that is used to retrieve remote copybooks for elements opened in Explorer for Endevor.", - "default": "COBOL LS" + "default": "ZOWE" }, "cobol-lsp.subroutine-manager.paths-local": { "type": "array", diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts index a68f2ad76b..ae122acb03 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/CopybookMessageHandlerTest.spec.ts @@ -143,7 +143,7 @@ describe("Test the copybook message handler", () => { }); it("checks E4E downloaded member copybooks are resolved", async () => { vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ - get: jest.fn().mockReturnValue("ENDEVOR"), + get: jest.fn().mockReturnValue("ENDEVOR_PROCESSOR"), }); (vscode.workspace.workspaceFolders as any) = undefined; (globSync as any) = jest.fn().mockImplementation((x: any) => [x]); diff --git a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts index c0ef6ff899..dccceb489e 100644 --- a/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts +++ b/clients/cobol-lsp-vscode-extension/src/__tests__/services/copybook/E4ECopybookService.spec.ts @@ -33,7 +33,7 @@ describe("e4e copybook service tests", () => { it("check getE4EClient assembles client correctly / check getE4EClient returns already assembled client once called with same Uri ", async () => { E4ECopybookService.getE4EAPI = jest.fn().mockReturnValue(e4eMock); vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ - get: jest.fn().mockReturnValue("ENDEVOR"), + get: jest.fn().mockReturnValue("ENDEVOR_PROCESSOR"), }); await E4ECopybookService.getE4EClient("document-uri"); const spyApi = jest.spyOn(E4ECopybookService, "getE4EAPI"); @@ -45,7 +45,7 @@ describe("e4e copybook service tests", () => { }); it("checks getE4EClient returns undefined when zowe settings is being used to retrieve copybooks", async () => { vscode.workspace.getConfiguration = jest.fn().mockReturnValue({ - get: jest.fn().mockReturnValue("COBOL LS"), + get: jest.fn().mockReturnValue("ZOWE"), }); expect(await E4ECopybookService.getE4EClient("document-uri")).toEqual( undefined, diff --git a/clients/cobol-lsp-vscode-extension/src/constants.ts b/clients/cobol-lsp-vscode-extension/src/constants.ts index a11982802e..dd0eae8bd3 100644 --- a/clients/cobol-lsp-vscode-extension/src/constants.ts +++ b/clients/cobol-lsp-vscode-extension/src/constants.ts @@ -78,7 +78,7 @@ export const DATASET = "dataset"; export const ENVIRONMENT = "environment"; export const USE_MAP = "MAP"; export const SETTINGS_CPY_NDVR_DEPENDENCIES = "endevor-dependencies"; -export const ENDEVOR_PROCESSOR = "ENDEVOR"; +export const ENDEVOR_PROCESSOR = "ENDEVOR_PROCESSOR"; export enum PUNCH_CARD { SEQUENCE_AREA_END_POS = 6, From f73fcc5266b3cf7dfbcad49514bcbed4198d2168 Mon Sep 17 00:00:00 2001 From: Kutlu <104970275+KutluOzel-b@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:35:33 +0200 Subject: [PATCH 13/13] Update clients/cobol-lsp-vscode-extension/package.json Co-authored-by: slavek-kucera <53339291+slavek-kucera@users.noreply.github.com> --- clients/cobol-lsp-vscode-extension/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/cobol-lsp-vscode-extension/package.json b/clients/cobol-lsp-vscode-extension/package.json index d59f43f579..e086021937 100644 --- a/clients/cobol-lsp-vscode-extension/package.json +++ b/clients/cobol-lsp-vscode-extension/package.json @@ -412,7 +412,7 @@ "ENDEVOR_PROCESSOR" ], "enumDescriptions": [ - "Use ZOWE Explorer to retrieve copybooks from mainframe data sets and USS files specified in the COBOL Language Support extension settings.", + "Use Zowe Explorer to retrieve copybooks from mainframe data sets and USS files specified in the COBOL Language Support extension settings.", "Use Explorer for Endevor to retrieve copybooks from locations specified in the Endevor element processor group." ], "description": "The method that is used to retrieve remote copybooks for elements opened in Explorer for Endevor.",