@cratis/screenplay-language 5.3.0 → 5.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundles/TypeReferenceSymbol.js.map +1 -1
- package/dist/bundles/action-subject-authoring.js.map +1 -1
- package/dist/bundles/bmp-word-characters.js.map +1 -1
- package/dist/bundles/case-authoring.js +1 -1
- package/dist/bundles/case-authoring.js.map +1 -1
- package/dist/bundles/code-actions.js.map +1 -1
- package/dist/bundles/command-read-completions.js.map +1 -1
- package/dist/bundles/compiler/Authoring/ActionSubjectQuickFixes.js +3 -3
- package/dist/bundles/compiler/Authoring/ActionSubjectQuickFixes.js.map +1 -1
- package/dist/bundles/compiler/Authoring/QuickFixes.js +4 -4
- package/dist/bundles/compiler/Authoring/QuickFixes.js.map +1 -1
- package/dist/bundles/compiler/Authoring/StructuredValueQuickFix.js +1 -1
- package/dist/bundles/compiler/Authoring/StructuredValueQuickFix.js.map +1 -1
- package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js +4 -4
- package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js.map +1 -1
- package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js +2 -2
- package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js.map +1 -1
- package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js +1 -1
- package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/DeclaredDependencies.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/DeclaredDependencyTargets.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/DependencyGraph.js +1 -1
- package/dist/bundles/compiler/Dependencies/DependencyGraph.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/DependencyKind.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/InvalidDependencyQuery.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/SliceReferences.js.map +1 -1
- package/dist/bundles/compiler/Dependencies/StronglyConnectedGroups.js.map +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticArgument.js.map +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
- package/dist/bundles/compiler/Diagnostics/ProductionDestinationDiagnostics.js +1 -1
- package/dist/bundles/compiler/Diagnostics/ProductionDestinationDiagnostics.js.map +1 -1
- package/dist/bundles/compiler/Diagnostics/SourceLocation.js.map +1 -1
- package/dist/bundles/compiler/Files/AuthoredOrder.js +1 -1
- package/dist/bundles/compiler/Files/AuthoredOrder.js.map +1 -1
- package/dist/bundles/compiler/Files/OrderingRoot.js +1 -1
- package/dist/bundles/compiler/Files/OrderingRoot.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +1 -1
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayDocumentSource.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayFolderMerge.js +1 -1
- package/dist/bundles/compiler/Files/PlayFolderMerge.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayGlob.js +2 -1
- package/dist/bundles/compiler/Files/PlayGlob.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayImports.js +1 -1
- package/dist/bundles/compiler/Files/PlayImports.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayPlacement.js.map +1 -1
- package/dist/bundles/compiler/Files/TimelineOrder.js +1 -1
- package/dist/bundles/compiler/Files/TimelineOrder.js.map +1 -1
- package/dist/bundles/compiler/Generation/FiniteGenerationRules.js +1 -1
- package/dist/bundles/compiler/Generation/GenerationAssessmentCache.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationChecksum.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationPattern.js +1 -1
- package/dist/bundles/compiler/Generation/GenerationPattern.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationPatternAssessment.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationPatternParser.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationPatternToken.js.map +1 -1
- package/dist/bundles/compiler/Generation/GenerationRuleProof.js +1 -1
- package/dist/bundles/compiler/Generation/InvalidGenerationPattern.js.map +1 -1
- package/dist/bundles/compiler/Generation/RegexCharacters.js.map +1 -1
- package/dist/bundles/compiler/Generation/RegexExpression.js.map +1 -1
- package/dist/bundles/compiler/Generation/RuleConsistency.js +1 -1
- package/dist/bundles/compiler/Parsing/ActionSubjectClause.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ActionSubjectInputs.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ActionSubjectResolution.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ApplicationContextParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ApplicationContextParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/AuthorizeParser.js +1 -1
- package/dist/bundles/compiler/Parsing/AuthorizeParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CanvasPlacement.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CaptureEventFixturesValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CaptureParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CaptureParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ClockOperandParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CodeBlockParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandDestinationTypes.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandHandlerValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CommandParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandReadSources.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandResponseParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CommandResponseParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CommandStreamCandidates.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CompositeStreamIdValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/CompositionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CompositionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ConceptComplianceParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ConditionDepthBudget.js +2 -0
- package/dist/bundles/compiler/Parsing/ConditionDepthBudget.js.map +1 -0
- package/dist/bundles/compiler/Parsing/ConditionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ConditionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ConstraintParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ConstraintParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ConstraintPropertyValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/ConstraintPropertyValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ContinuationValues.js.map +1 -1
- package/dist/bundles/compiler/Parsing/DeclarationParsers.js +1 -1
- package/dist/bundles/compiler/Parsing/DeclarationParsers.js.map +1 -1
- package/dist/bundles/compiler/Parsing/DependencySourceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/DependencySourceParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/DependsOnParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/DescriptionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/DescriptionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/DocumentationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/DocumentationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/EnumerationMembers.js +1 -1
- package/dist/bundles/compiler/Parsing/EnumerationMembers.js.map +1 -1
- package/dist/bundles/compiler/Parsing/EventMetadataParser.js +1 -1
- package/dist/bundles/compiler/Parsing/EventMetadataParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/EventSourceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/EventSourceParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/EventSourceValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/EventSourceValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/EventSubjectValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/EventSubjectValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ExpressionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ExpressionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/FeatureBody.js +1 -1
- package/dist/bundles/compiler/Parsing/FeatureBody.js.map +1 -1
- package/dist/bundles/compiler/Parsing/FileImportParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/FileReferences.js.map +1 -1
- package/dist/bundles/compiler/Parsing/FoldedEventSources.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GenerationBodyParser.js +1 -1
- package/dist/bundles/compiler/Parsing/GenerationBodyParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GenerationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/GenerationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionInputs.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionShadowing.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/GuardedActionValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/GuardedInteractions.js +1 -1
- package/dist/bundles/compiler/Parsing/GuardedInteractions.js.map +1 -1
- package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/IdentifierComplianceValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/IdentityParser.js +1 -1
- package/dist/bundles/compiler/Parsing/IdentityParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/IdentityValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ImplementationParser.js +2 -2
- package/dist/bundles/compiler/Parsing/ImplementationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ImportDiscovery.js +1 -1
- package/dist/bundles/compiler/Parsing/ImportDiscovery.js.map +1 -1
- package/dist/bundles/compiler/Parsing/InlineEventValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/InputUses.js +1 -1
- package/dist/bundles/compiler/Parsing/InputUses.js.map +1 -1
- package/dist/bundles/compiler/Parsing/InteractionAlternatives.js +1 -1
- package/dist/bundles/compiler/Parsing/InteractionAlternatives.js.map +1 -1
- package/dist/bundles/compiler/Parsing/InteractionExecutions.js +1 -1
- package/dist/bundles/compiler/Parsing/InteractionExecutions.js.map +1 -1
- package/dist/bundles/compiler/Parsing/LegacyTextRulePatterns.js.map +1 -1
- package/dist/bundles/compiler/Parsing/LineReader.js.map +1 -1
- package/dist/bundles/compiler/Parsing/LineText.js.map +1 -1
- package/dist/bundles/compiler/Parsing/MatchAmbiguity.js +1 -1
- package/dist/bundles/compiler/Parsing/MatchAmbiguity.js.map +1 -1
- package/dist/bundles/compiler/Parsing/MatchAmbiguityCharacters.js.map +1 -1
- package/dist/bundles/compiler/Parsing/MatchAmbiguityGraph.js.map +1 -1
- package/dist/bundles/compiler/Parsing/MatchAmbiguityParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/MatchOperandValidation.js +1 -1
- package/dist/bundles/compiler/Parsing/MatchOperandValidation.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ModuleBody.js +1 -1
- package/dist/bundles/compiler/Parsing/ModuleBody.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ObserverFilterParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ObserverFilterParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ObserverFilterValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/OperationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/OperationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/OperationValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/OperationValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ParserContext.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PersonaCallerValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PolicyParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PolicyParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PortableMatchGroupName.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PortableMatchPattern.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PortableMatchSuggestions.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PossibleEventsParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PossibleEventsParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProducesParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ProducesParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionEventScopeValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionExpressionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionExpressionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionTargetValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/ProjectionTargetValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PropertyLineParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PropertyLineParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventMetadataValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventMetadataValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventUsageCollector.js +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventUsageCollector.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventUsageValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/PublicEventUsageValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PurposeParser.js +1 -1
- package/dist/bundles/compiler/Parsing/PurposeParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/PurposeValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/QueryParser.js +1 -1
- package/dist/bundles/compiler/Parsing/QueryParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReactionIdentityParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ReactionIdentityParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReactionParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ReactionParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReactionRefusalValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/ReactionRefusalValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReadModelKeyValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReadModelMemberTypeValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ReadsParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ReadsParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/RedeliveryValues.js.map +1 -1
- package/dist/bundles/compiler/Parsing/RefusalDeclarations.js +1 -1
- package/dist/bundles/compiler/Parsing/RefusalDeclarations.js.map +1 -1
- package/dist/bundles/compiler/Parsing/RefusalValueWalker.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ResponseCommandResolver.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ResponseDateValues.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ResponseValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/ResponseValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ScreenParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ScreenParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js +1 -1
- package/dist/bundles/compiler/Parsing/ScreenplayParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SeedParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SeedParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SliceParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SliceParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SourceLine.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SourceLineSplitter.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SourceOptionsParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SourceOptionsParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCaseParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCaseValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCaseValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationCommandExamples.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationExampleParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationRedeliveryValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationRedeliveryValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationResponseParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationRouteComparison.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationRouteComparison.js.map +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js +1 -1
- package/dist/bundles/compiler/Parsing/SpecificationStreamValidator.js.map +1 -1
- package/dist/bundles/compiler/Parsing/StateMachineParser.js +1 -1
- package/dist/bundles/compiler/Parsing/StateMachineParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/StructuralInteractionSites.js.map +1 -1
- package/dist/bundles/compiler/Parsing/StructuredBlockParser.js +1 -1
- package/dist/bundles/compiler/Parsing/StructuredBlockParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/StructuredValueParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/TemplateReferenceText.js +1 -1
- package/dist/bundles/compiler/Parsing/TemplateReferenceText.js.map +1 -1
- package/dist/bundles/compiler/Parsing/TriggerDataParser.js +1 -1
- package/dist/bundles/compiler/Parsing/TriggerDataParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/UiBindingParser.js +1 -1
- package/dist/bundles/compiler/Parsing/UiBindingParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/UiProfileLegacyLayout.js +1 -1
- package/dist/bundles/compiler/Parsing/UiProfileLegacyLayout.js.map +1 -1
- package/dist/bundles/compiler/Parsing/WorkflowParser.js +1 -1
- package/dist/bundles/compiler/Parsing/WorkflowParser.js.map +1 -1
- package/dist/bundles/compiler/Parsing/checkPortableMatchPattern.js.map +1 -1
- package/dist/bundles/compiler/Parsing/hasExponentialMatchAmbiguity.js.map +1 -1
- package/dist/bundles/compiler/Parsing/trimMatchAmbiguityGraph.js.map +1 -1
- package/dist/bundles/compiler/ScreenActionSubjects.js.map +1 -1
- package/dist/bundles/compiler/ScreenplayCompiler.js +1 -1
- package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -1
- package/dist/bundles/compiler/Syntax/ActionSubjectInvariants.js.map +1 -1
- package/dist/bundles/compiler/Syntax/AuthoringProductionResolver.js.map +1 -1
- package/dist/bundles/compiler/Syntax/CaptureEventsSource.js.map +1 -1
- package/dist/bundles/compiler/Syntax/DependencySources.js.map +1 -1
- package/dist/bundles/compiler/Syntax/EventDeclarations.js.map +1 -1
- package/dist/bundles/compiler/Syntax/EventSourceCatalog.js.map +1 -1
- package/dist/bundles/compiler/Syntax/EventSourceReadConfidence.js.map +1 -1
- package/dist/bundles/compiler/Syntax/ExactMathFacts.js.map +1 -1
- package/dist/bundles/compiler/Syntax/ExactNumber.js.map +1 -1
- package/dist/bundles/compiler/Syntax/InvalidSyntaxJson.js.map +1 -1
- package/dist/bundles/compiler/Syntax/LegacyWireProjection.js.map +1 -1
- package/dist/bundles/compiler/Syntax/Operations.js.map +1 -1
- package/dist/bundles/compiler/Syntax/PersonaCallers.js.map +1 -1
- package/dist/bundles/compiler/Syntax/ProductionDestinations.js.map +1 -1
- package/dist/bundles/compiler/Syntax/PublicEventInvariants.js.map +1 -1
- package/dist/bundles/compiler/Syntax/ScreenplaySyntaxWalker.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SourceOptions.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SpecificationCaseOrigin.js.map +1 -1
- package/dist/bundles/compiler/Syntax/StreamIdFormatter.js.map +1 -1
- package/dist/bundles/compiler/Syntax/StrictSyntaxJson.js +1 -1
- package/dist/bundles/compiler/Syntax/Structure.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxCollections.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxInvariants.js +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxInvariants.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxJson.js +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxJson.js.map +1 -1
- package/dist/bundles/compiler/Syntax/SyntaxMemberContracts.js.map +1 -1
- package/dist/bundles/compiler/Syntax/index.js +1 -1
- package/dist/bundles/compiler/Text/ImplementationHintText.js.map +1 -1
- package/dist/bundles/compiler/Text/ReservedWords.js.map +1 -1
- package/dist/bundles/compiler/Text/SourceStreamNames.js.map +1 -1
- package/dist/bundles/compiler/Text/StringLiteral.js.map +1 -1
- package/dist/bundles/compiler/Text/ordinalIgnoreCaseKey.js.map +1 -1
- package/dist/bundles/compiler/Text/patterns.js.map +1 -1
- package/dist/bundles/compiler/index.js +1 -1
- package/dist/bundles/completion-items.js +4 -4
- package/dist/bundles/completion-items.js.map +1 -1
- package/dist/bundles/completion-planner.js +2 -2
- package/dist/bundles/completion-planner.js.map +1 -1
- package/dist/bundles/completions.js +1 -1
- package/dist/bundles/completions.js.map +1 -1
- package/dist/bundles/continuation-responses.js +1 -1
- package/dist/bundles/continuation-responses.js.map +1 -1
- package/dist/bundles/declarations.js.map +1 -1
- package/dist/bundles/dependency-completions.js.map +1 -1
- package/dist/bundles/dependency-target-analysis.js.map +1 -1
- package/dist/bundles/diagnostic-codes.js +1 -1
- package/dist/bundles/diagnostic-codes.js.map +1 -1
- package/dist/bundles/diagnostics.js +1 -1
- package/dist/bundles/diagnostics.js.map +1 -1
- package/dist/bundles/document-context.js.map +1 -1
- package/dist/bundles/documentation-item.js.map +1 -1
- package/dist/bundles/event-analysis-source.js.map +1 -1
- package/dist/bundles/event-context-catalog.js.map +1 -1
- package/dist/bundles/event-context.js.map +1 -1
- package/dist/bundles/event-source-authoring.js +11 -11
- package/dist/bundles/event-source-authoring.js.map +1 -1
- package/dist/bundles/example-analysis.js +2 -2
- package/dist/bundles/example-analysis.js.map +1 -1
- package/dist/bundles/example-authoring.js +2 -2
- package/dist/bundles/example-authoring.js.map +1 -1
- package/dist/bundles/example-declaration-items.js.map +1 -1
- package/dist/bundles/example-values.js.map +1 -1
- package/dist/bundles/file-imports.js.map +1 -1
- package/dist/bundles/file-references.js.map +1 -1
- package/dist/bundles/generation-completions.js.map +1 -1
- package/dist/bundles/hover-content.js +5 -5
- package/dist/bundles/hover-content.js.map +1 -1
- package/dist/bundles/hover.js.map +1 -1
- package/dist/bundles/index.js +1 -1
- package/dist/bundles/index.js.map +1 -1
- package/dist/bundles/inlay-hints.js.map +1 -1
- package/dist/bundles/inline-completions.js +1 -1
- package/dist/bundles/inline-completions.js.map +1 -1
- package/dist/bundles/inline-event-validation.js +1 -1
- package/dist/bundles/inline-event-validation.js.map +1 -1
- package/dist/bundles/keyword-docs.js.map +1 -1
- package/dist/bundles/language.js.map +1 -1
- package/dist/bundles/named-rule-context.js.map +1 -1
- package/dist/bundles/operation-authoring.js +6 -6
- package/dist/bundles/operation-authoring.js.map +1 -1
- package/dist/bundles/persona-analysis.js +1 -1
- package/dist/bundles/persona-analysis.js.map +1 -1
- package/dist/bundles/production-destinations.js +1 -1
- package/dist/bundles/production-destinations.js.map +1 -1
- package/dist/bundles/purpose-items.js.map +1 -1
- package/dist/bundles/reaction-authoring.js +3 -3
- package/dist/bundles/reaction-authoring.js.map +1 -1
- package/dist/bundles/read-model-key-completions.js +1 -1
- package/dist/bundles/read-model-key-completions.js.map +1 -1
- package/dist/bundles/refusal-context.js.map +1 -1
- package/dist/bundles/response-analysis.js.map +1 -1
- package/dist/bundles/response-completions.js +1 -1
- package/dist/bundles/response-completions.js.map +1 -1
- package/dist/bundles/response-tokens.js +2 -2
- package/dist/bundles/response-tokens.js.map +1 -1
- package/dist/bundles/scope-items.js +3 -3
- package/dist/bundles/scope-items.js.map +1 -1
- package/dist/bundles/structure-completions.js.map +1 -1
- package/dist/bundles/sub-language-registry.js.map +1 -1
- package/dist/bundles/sub-languages/capture/CompletionProvider.js.map +1 -1
- package/dist/bundles/sub-languages/capture/HoverProvider.js.map +1 -1
- package/dist/bundles/sub-languages/capture/Validator.js.map +1 -1
- package/dist/bundles/sub-languages/capture/index.js.map +1 -1
- package/dist/bundles/sub-languages/capture/language.js.map +1 -1
- package/dist/bundles/sub-languages/cdl.js.map +1 -1
- package/dist/bundles/sub-languages/pdl.js.map +1 -1
- package/dist/bundles/sub-languages/projection/CodeActionProvider.js.map +1 -1
- package/dist/bundles/sub-languages/projection/CompletionProvider.js +1 -1
- package/dist/bundles/sub-languages/projection/CompletionProvider.js.map +1 -1
- package/dist/bundles/sub-languages/projection/HoverProvider.js.map +1 -1
- package/dist/bundles/sub-languages/projection/Validator.js.map +1 -1
- package/dist/bundles/sub-languages/projection/index.js.map +1 -1
- package/dist/bundles/sub-languages/projection/language.js.map +1 -1
- package/dist/bundles/symbols.js +2 -2
- package/dist/bundles/symbols.js.map +1 -1
- package/dist/bundles/themes/screenplay-dark.js.map +1 -1
- package/dist/bundles/themes/screenplay-light.js.map +1 -1
- package/dist/bundles/tokens.js.map +1 -1
- package/dist/bundles/validation.js +2 -2
- package/dist/bundles/validation.js.map +1 -1
- package/dist/diagnostic-codes.d.ts +1 -0
- package/dist/diagnostic-codes.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{stringBodyPattern as t,unescapeString as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{locationOf as i}from"./SourceLine.js";import{combineAuthorize as a,parseAuthorize as o}from"./AuthorizeParser.js";import{dependencySources as s}from"../Syntax/DependencySources.js";import{parseMappingSource as c}from"./ExpressionParser.js";import{validateHandlerContracts as l}from"./CommandHandlerValidator.js";import{firstWord as u}from"./LineText.js";import{reportInvalidModifierOrder as d,reportLegacyOptionalSuffix as f,tryParseProperty as p}from"./PropertyLineParser.js";import{parseDescription as m}from"./DescriptionParser.js";import{parseDocumentation as h}from"./DocumentationParser.js";import{parseCondition as g}from"./ConditionParser.js";import{ParserContext as _}from"./ParserContext.js";import{isReactionIdentityLine as v,misplacedReactionIdentity as y}from"./ReactionIdentityParser.js";import{sourceStreamPattern as b}from"../Text/SourceStreamNames.js";import{parseCommandStream as x}from"./EventSourceParser.js";import{isFileDirectiveAmongProperties as S}from"./FileReferences.js";import{isCode as C,isFile as w,parseCode as T,parseFile as E,parseHandler as D,parseImplementationWrapper as O}from"./ImplementationParser.js";import{parseCommandResponse as k,scalarResponsePattern as A}from"./CommandResponseParser.js";import{matchSubject as j,validateMatchOperand as M}from"./MatchOperandValidation.js";import{commandReadSources as N}from"./CommandReadSources.js";import{captureConcurrency as P}from"./DependencySourceParser.js";import{parseReads as F}from"./ReadsParser.js";import{parseProduces as I}from"./ProducesParser.js";const L=r(`^command\\s+([A-Za-z_]\\w*)$`),R=b(`^stream\\s+[A-Za-z_]\\w*\\.[A-Za-z_]\\w*$`),ee=r(`^calendar\\s+(?:"|from\\s+\\$context\\.)`),z=r(`^calendar\\s+(?:"(${t})"|from\\s+\\$context\\.([A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*))$`),B=r(`\\bseverity\\s+(\\S+)$`),V=r(`\\bmessage\\s+(?:"(${t})"|(\\$strings\\.\\S*))$`),H=r(`^([\\w.]+)\\s+(.+)$`),U=r(`^(?:(not empty|matches|not contains|contains|starts with|ends with|max|min|rule)(?:\\s+|$)|(length ==|decimals <=|all >=|all >|>=|<=|==|!=|>|<)\\s*)(.*)$`),W=b(`^[A-Za-z_]\\w*$`),G=r(`^reads\\s+[A-Z]\\w*\\s+optional(?:\\s|$)`),K={max:`Max`,min:`Min`,">":`GreaterThan`,">=":`GreaterThanOrEqual`,"<":`LessThan`,"<=":`LessThanOrEqual`,"==":`Equal`,"!=":`NotEqual`,"length ==":`Length`,"decimals <=":`DecimalPlaces`,matches:`Matches`,contains:`Contains`,"not contains":`NotContains`,"starts with":`StartsWith`,"ends with":`EndsWith`,"all >":`AllGreaterThan`,"all >=":`AllGreaterThanOrEqual`},q={information:`Information`,warning:`Warning`,error:`Error`},J=/* @__PURE__ */ new Set([`reads`,`concurrency`]),Y=/* @__PURE__ */ new Set([`description`,`documentation`,`handler`,`concurrency`]);function parseCommand(e,t){let n=/* @__PURE__ */ new Set,r=new _(e.reader.fork(),e.path,e.languages);return r.sourceOptions=e.sourceOptions,r.streamCandidates=e.streamCandidates,parseCommandBody(r,t,void 0,n),parseCommandBody(e,t,n)}function parseCommandBody(t,r,c,f){let g=L.exec(r.content)?.[1]??``;g===``&&t.error(e.InvalidCommandDeclaration,`Invalid command declaration '${r.content}' - expected 'command <Name>'`,i(r));let _=[],b=[],S,C=[],w=[],T=[],E=[],O,j=null,M=null,B=null,V=null,H=[],U=null,W=[],K=null;for(let s=t.peekChild(r.indent);s!==void 0;s=t.peekChild(r.indent)){t.reader.takeSignificant();let r=u(s.content),l=p(s);if(r===`calendar`&&ee.test(s.content)){let r=z.exec(s.content);K!==null||r===null?t.error(e.InvalidCommandCalendar,`A command declares at most one 'calendar "<id>"' or 'calendar from $context.<member>'.`,i(s)):K={kind:`CommandCalendarSyntax`,id:r[1]===void 0?null:n(r[1]),contextMember:r[2]??null,location:i(s)}}else if(l!==void 0&&(Y.has(r)||r===`validate`&&s.content!==`validate csharp`))S=addProperty(t,_,l,g,s,S);else if(r===`returns`){let e=A.exec(s.content);e!==null&&!e[1].startsWith(`@`)&&l!==void 0?c===void 0?(_.push(l),b.push({line:s,candidate:l,response:null})):c.has(l.type.name)?b.push({line:s,candidate:null,response:k(t,s)}):S=addProperty(t,_,l,g,s,S):l===void 0?d(t,s)?t.skipBlock(s.indent):b.push({line:s,candidate:null,response:k(t,s)}):S=addProperty(t,_,l,g,s,S)}else if(r===`stream`&&R.test(s.content)&&l!==void 0&&t.streamCandidates?.hasSource(l.type.name.split(`.`)[0])===!0){let[n,r]=l.type.name.split(`.`),a=t.streamCandidates.hasPropertyType(l.type.name)&&t.streamCandidates.hasUniqueStream(n,r),o=x(t,s,l,a);(U!==null||W.length>0)&&t.error(e.InvalidCommandStream,`A command declares at most one stream route.`,i(s)),a||U!==null?W.push(o):U=o}else if(r===`runs`&&v(s))y(t,s);else if(r===`description`)j=m(t,s,j,`Command '${g}'`);else if(r===`documentation`)M=h(t,s,M,`Command '${g}'`);else if(r===`authorize`)B=a(B,o(t,s));else if(r===`validate`){let e=parseValidate(t,s,`command`,g);e!==void 0&&C.push(e)}else if(r===`produces`){let e=I(t,s,!0);e!==void 0&&w.push(e)}else if(r===`handler`)V=D(t,s),H.push({handler:V,location:i(s)});else if(J.has(r)){let n=r===`reads`?F(t,s):void 0;n!==void 0&&E.push(n),r===`concurrency`&&O===void 0&&(O=P(t,s));let a=/^reads\s+([A-Z]\w*)(?:\s+as\s+([a-z_]\w*))?(?:\s+by\s+([a-z_]\w*))?$/.exec(s.content);a!==null&&T.push({readModel:a[1],alias:a[2]??null}),G.test(s.content)&&t.error(e.OptionalReadsNotSupported,`Optional reads are not yet supported (see #308).`,i(s)),t.skipOpaqueBlock(s.indent)}else l===void 0?(d(t,s),t.error(e.UnknownCommandDirective,`Unexpected '${s.content}' in command body`,i(s)),t.skipBlock(s.indent)):S=addProperty(t,_,l,g,s,S)}let q=new Set(b.flatMap(e=>e.candidate===null?[]:[e.candidate])),X=new Set(_.filter(e=>!q.has(e)).map(e=>e.name));b.some(e=>e.candidate!==null&&!X.has(e.candidate.type.name)&&e.candidate.type.name!==`returns`)&&X.add(`returns`);for(let e of X)f?.add(e);let Z=null,Q=/* @__PURE__ */ new Set;for(let n of b){let r=n.response;if(n.candidate!==null){if(!X.has(n.candidate.type.name))continue;Q.add(n.candidate),r={kind:`ScalarCommandResponseSyntax`,source:{kind:`PropertyResponseSourceSyntax`,property:n.candidate.type.name,location:n.candidate.type.location},location:i(n.line)}}r!==null&&(Z===null?Z=r:t.error(e.InvalidCommandResponse,`A command declares at most one unconditional response.`,i(n.line)))}l(H,V,w.length>0,t);let $={kind:`CommandSyntax`,name:g,description:j,documentation:M,authorize:B,properties:_.filter(e=>!Q.has(e)),validations:C,produces:w,handler:V,response:Z,stream:U,streamCandidates:W,...K===null?{}:{calendar:K},location:i(r)};return N.set($,T),s.set($,{reads:E,concurrency:O}),$}function addProperty(t,n,r,i,a,o){return f(t,r.type,a),r.isIdentifier&&o!==void 0&&(t.error(e.DuplicateCommandIdentifier,`Command '${i}' already marks '${o.name}' as identifier - only one property can be the identifier`,r.location),r={...r,isIdentifier:!1}),n.push(r),o??(r.isIdentifier?r:void 0)}function parseValidationFile(e,t,n){let r=E(e,n);return r===void 0?void 0:{kind:`FileValidateSyntax`,file:r,location:i(t)}}function hasValidationOperand(e){let t=H.exec(e.content);if(t===null)return!1;let n=t[2];return u(n)===`not`&&u(n.substring(3).trimStart())===`empty`||u(n)===`checksum`||U.test(n)}function isValidationFileBody(e,t,n){if(!S(n)||hasValidationOperand(n))return!1;let r=e.reader.fork();r.takeSignificant();let i=r.peekSignificant();return i===void 0||i.indent<=t.indent}function parseValidate(t,r,a,o){if(r.content===`validate`){let s=t.peekChild(r.indent);if(s!==void 0&&isValidationFileBody(t,r,s))return t.reader.takeSignificant(),parseValidationFile(t,r,s);if(s!==void 0&&s.content.startsWith("```")){t.reader.takeSignificant();let e=T(t.valueContext,s);return e===null&&t.skipFencedBody(),{kind:`CodeValidateSyntax`,code:e,location:i(r)}}let c=[],l=[],d;for(let s=t.peekChild(r.indent);s!==void 0;s=t.peekChild(r.indent)){if(t.reader.takeSignificant(),a===`concept`){if(t.sourceOptions.numericMode===`legacy`&&s.content.startsWith("```")){t.skipFencedBody();continue}if(d!==void 0&&s.indent<=d&&(d=void 0),d!==void 0||u(s.content)===`implementation`){t.error(e.InvalidValidationRule,`Invalid validation rule '${s.content}'`,i(s)),d??=s.indent;continue}}if(u(s.content)===`require`){let e=g(a===`concept`?t.valueContext:t,s.content.substring(7).trim(),i(s)),r=null,o=`Error`,c=!1;for(let e=t.peekChild(s.indent);e!==void 0;e=t.peekChild(s.indent)){t.reader.takeSignificant();let i=V.exec(e.content);i!==null&&i.index===0?r=i[1]===void 0?i[2]:n(i[1]):u(e.content)===`severity`?(c||(o=q[e.content.substring(8).trim()]??`Error`),c=!0):t.skipOpaqueBlock(e.indent)}e!==null&&l.push({kind:`RequirementSyntax`,condition:e,message:r,severity:o,location:i(s)});continue}let r=parseValidationRule(t,a===`concept`?{...s,content:`value ${s.content}`}:s,a,o);r!==void 0&&c.push(r)}return{kind:`DeclarativeValidateSyntax`,rules:c,requirements:l,location:i(r)}}if(a===`concept`&&u(r.content.substring(8).trimStart())===`checksum`){let e=parseValidationRule(t,{...r,content:`value ${r.content.substring(8).trimStart()}`},a,o);return e===void 0?void 0:{kind:`DeclarativeValidateSyntax`,rules:[e],requirements:[],location:i(r)}}if(r.content===`validate csharp`){let e=T(t.valueContext,{...r,content:`csharp`});return e===null&&t.skipOpaqueBlock(r.indent),{kind:`CodeValidateSyntax`,code:e,location:i(r)}}t.error(e.InvalidValidateDeclaration,`Invalid validate declaration '${r.content}' - expected 'validate' or 'validate csharp'`,i(r)),t.skipBlock(r.indent)}function parseValidationRule(t,n,r,a){let o=u(H.exec(n.content)?.[2]??``)===`checksum`,s=r===`concept`&&!o?t.valueContext:t,{content:c,message:l}=splitMessage(n.content),d=splitSeverity(s,n,c);if(d===void 0)return;let f=H.exec(d.content);if(f===null){s.error(e.InvalidValidationRule,`Invalid validation rule '${n.content}'`,i(n));return}let p=parseRule(s,f[2],n);if(p===void 0)return;p.kind===`Matches`&&p.value!==null&&M(t,p.value,i(n),n.raw,j(t,r,a,f[1]));let m=p.kind===`Rule`?parseRuleImplementation(t,n,r===`command`):{file:null,code:null,implementation:null};return{kind:`ValidationRuleSyntax`,property:f[1],rule:p.kind,value:p.value,message:l,severity:d.severity,...m,location:i(n)}}function parseRuleImplementation(t,n,r){let a=t.peekChild(n.indent);if(a===void 0)return{file:null,code:null,implementation:null};t.reader.takeSignificant();let o=r&&u(a.content)===`implementation`,s=o?O(t,a):{file:w(a)?E(t,a):null,code:!w(a)&&C(t,a)?T(t,a):null,implementation:null};!o&&s.file===null&&s.code===null&&(t.error(e.UnknownRuleImplementationDirective,`Unexpected '${a.content}' in rule implementation - expected 'file <path>' or an inline code block`,i(a)),t.skipBlock(a.indent));for(let a=t.peekChild(n.indent);a!==void 0&&(o||r&&u(a.content)===`implementation`);a=t.peekChild(n.indent))t.reader.takeSignificant(),t.error(o&&u(a.content)===`implementation`?e.InvalidImplementationBlock:e.ConflictingImplementationSources,`A named rule has one implementation wrapper and cannot mix wrapped and direct sources.`,i(a)),C(t,a)?T(t,a):t.skipBlock(a.indent);return s}function splitMessage(e){let t=V.exec(e);if(t===null)return{content:e,message:null};let r=t[1]===void 0?t[2]:n(t[1]);return{content:e.substring(0,t.index).trimEnd(),message:r}}function splitSeverity(t,n,r){let a=B.exec(r);if(a===null)return{content:r,severity:`Error`};let o=q[a[1]];if(o===void 0)t.error(e.InvalidValidationSeverity,`Unknown validation severity '${a[1]}' - expected information, warning or error`,i(n));else return{content:r.substring(0,a.index).trimEnd(),severity:o}}function parseRule(t,n,r){if(n===`not empty`)return{kind:`NotEmpty`,value:null};if(u(n)===`checksum`){let a=n.substring(8).trim();if(a!==`luhn`&&a!==`mod11`&&a!==`mod97`){t.error(e.InvalidGenerationArgument,`Checksum validation requires luhn, mod11 or mod97.`,i(r));return}return{kind:`Checksum`,value:{kind:`LiteralExpressionSyntax`,value:a,location:i(r)}}}let a=U.exec(n);if(a===null){t.error(e.InvalidValidationRule,`Invalid validation rule '${r.content}'`,i(r));return}let o=a[1]??a[2];if(o===`rule`){let n=a[3].trim();if(!W.test(n)){t.error(e.InvalidRuleName,`Invalid rule name '${n}' in '${r.content}' - expected 'rule <Name>' with an identifier`,i(r));return}return{kind:`Rule`,value:{kind:`PathExpressionSyntax`,path:n,location:i(r)}}}return{kind:K[o],value:c(a[3],i(r),t)}}export{parseCommand,parseValidate};
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{validateHandlerContracts as t}from"./CommandHandlerValidator.js";import{parseCondition as n}from"./ConditionParser.js";import{parseCommandStream as r}from"./EventSourceParser.js";import{pattern as i}from"../Text/patterns.js";import{sourceStreamPattern as a}from"../Text/SourceStreamNames.js";import{stringBodyPattern as o,unescapeString as s}from"../Text/StringLiteral.js";import{combineAuthorize as c,parseAuthorize as l}from"./AuthorizeParser.js";import{parseCommandResponse as u,scalarResponsePattern as d}from"./CommandResponseParser.js";import{parseDescription as f}from"./DescriptionParser.js";import{parseDocumentation as p}from"./DocumentationParser.js";import{isCode as m,isFile as h,parseCode as g,parseFile as _,parseHandler as v,parseImplementationWrapper as y}from"./ImplementationParser.js";import{parseMappingSource as b}from"./ExpressionParser.js";import{firstWord as x}from"./LineText.js";import{ParserContext as S}from"./ParserContext.js";import{matchSubject as C,validateMatchOperand as w}from"./MatchOperandValidation.js";import{isReactionIdentityLine as T,misplacedReactionIdentity as E}from"./ReactionIdentityParser.js";import{commandReadSources as D}from"./CommandReadSources.js";import{dependencySources as O}from"../Syntax/DependencySources.js";import{captureConcurrency as k}from"./DependencySourceParser.js";import{parseReads as A}from"./ReadsParser.js";import{parseProduces as j}from"./ProducesParser.js";import{reportInvalidModifierOrder as M,reportLegacyOptionalSuffix as N,tryParseProperty as P}from"./PropertyLineParser.js";import{locationOf as F}from"./SourceLine.js";import{isFileDirectiveAmongProperties as I}from"./FileReferences.js";const ee=i(`^command\\s+([A-Za-z_]\\w*)$`),te=a(`^stream\\s+[A-Za-z_]\\w*\\.[A-Za-z_]\\w*$`),L=i(`^calendar\\s+(?:"|from\\s+\\$context\\.)`),R=i(`^calendar\\s+(?:"(${o})"|from\\s+\\$context\\.([A-Za-z_][A-Za-z0-9_]*(?:\\.[A-Za-z_][A-Za-z0-9_]*)*))$`),z=i(`\\bseverity\\s+(\\S+)$`),B=i(`\\bmessage\\s+(?:"(${o})"|(\\$strings\\.\\S*))$`),V=i(`^([\\w.]+)\\s+(.+)$`),H=i(`^(?:(not empty|matches|not contains|contains|starts with|ends with|max|min|rule)(?:\\s+|$)|(length ==|decimals <=|all >=|all >|>=|<=|==|!=|>|<)\\s*)(.*)$`),U=a(`^[A-Za-z_]\\w*$`),W=i(`^reads\\s+[A-Z]\\w*\\s+optional(?:\\s|$)`),G={max:`Max`,min:`Min`,">":`GreaterThan`,">=":`GreaterThanOrEqual`,"<":`LessThan`,"<=":`LessThanOrEqual`,"==":`Equal`,"!=":`NotEqual`,"length ==":`Length`,"decimals <=":`DecimalPlaces`,matches:`Matches`,contains:`Contains`,"not contains":`NotContains`,"starts with":`StartsWith`,"ends with":`EndsWith`,"all >":`AllGreaterThan`,"all >=":`AllGreaterThanOrEqual`},K={information:`Information`,warning:`Warning`,error:`Error`},q=/* @__PURE__ */ new Set([`reads`,`concurrency`]),J=/* @__PURE__ */ new Set([`description`,`documentation`,`handler`,`concurrency`]);function parseCommand(e,t){let n=/* @__PURE__ */ new Set,r=new S(e.reader.fork(),e.path,e.languages);return r.sourceOptions=e.sourceOptions,r.streamCandidates=e.streamCandidates,parseCommandBody(r,t,void 0,n),parseCommandBody(e,t,n)}function parseCommandBody(n,i,a,o){let m=ee.exec(i.content)?.[1]??``;m===``&&n.error(e.InvalidCommandDeclaration,`Invalid command declaration '${i.content}' - expected 'command <Name>'`,F(i));let h=[],g=[],_,y=[],b=[],S=[],C=[],w,N=null,I=null,z=null,B=!1,V=null,H=[],U=null,G=[],K=null;for(let t=n.peekChild(i.indent);t!==void 0;t=n.peekChild(i.indent)){n.reader.takeSignificant();let i=x(t.content),o=P(t);if(i===`calendar`&&L.test(t.content)){let r=R.exec(t.content);K!==null||r===null?n.error(e.InvalidCommandCalendar,`A command declares at most one 'calendar "<id>"' or 'calendar from $context.<member>'.`,F(t)):K={kind:`CommandCalendarSyntax`,id:r[1]===void 0?null:s(r[1]),contextMember:r[2]??null,location:F(t)}}else if(o!==void 0&&(J.has(i)||i===`validate`&&t.content!==`validate csharp`))_=addProperty(n,h,o,m,t,_);else if(i===`returns`){let e=d.exec(t.content);e!==null&&!e[1].startsWith(`@`)&&o!==void 0?a===void 0?(h.push(o),g.push({line:t,candidate:o,response:null})):a.has(o.type.name)?g.push({line:t,candidate:null,response:u(n,t)}):_=addProperty(n,h,o,m,t,_):o===void 0?M(n,t)?n.skipBlock(t.indent):g.push({line:t,candidate:null,response:u(n,t)}):_=addProperty(n,h,o,m,t,_)}else if(i===`stream`&&te.test(t.content)&&o!==void 0&&n.streamCandidates?.hasSource(o.type.name.split(`.`)[0])===!0){let[i,a]=o.type.name.split(`.`),s=n.streamCandidates.hasPropertyType(o.type.name)&&n.streamCandidates.hasUniqueStream(i,a),c=r(n,t,o,s);(U!==null||G.length>0)&&n.error(e.InvalidCommandStream,`A command declares at most one stream route.`,F(t)),s||U!==null?G.push(c):U=c}else if(i===`runs`&&T(t))E(n,t);else if(i===`description`)N=f(n,t,N,`Command '${m}'`);else if(i===`documentation`)I=p(n,t,I,`Command '${m}'`);else if(i===`authorize`){let e=l(n,t);if(!B){let t=z;z=c(z,e,n),B=t!==null&&z===null}}else if(i===`validate`){let e=parseValidate(n,t,`command`,m);e!==void 0&&y.push(e)}else if(i===`produces`){let e=j(n,t,!0);e!==void 0&&b.push(e)}else if(i===`handler`)V=v(n,t),H.push({handler:V,location:F(t)});else if(q.has(i)){let r=i===`reads`?A(n,t):void 0;r!==void 0&&C.push(r),i===`concurrency`&&w===void 0&&(w=k(n,t));let a=/^reads\s+([A-Z]\w*)(?:\s+as\s+([a-z_]\w*))?(?:\s+by\s+([a-z_]\w*))?$/.exec(t.content);a!==null&&S.push({readModel:a[1],alias:a[2]??null}),W.test(t.content)&&n.error(e.OptionalReadsNotSupported,`Optional reads are not yet supported (see #308).`,F(t)),n.skipOpaqueBlock(t.indent)}else o===void 0?(M(n,t),n.error(e.UnknownCommandDirective,`Unexpected '${t.content}' in command body`,F(t)),n.skipBlock(t.indent)):_=addProperty(n,h,o,m,t,_)}let Y=new Set(g.flatMap(e=>e.candidate===null?[]:[e.candidate])),X=new Set(h.filter(e=>!Y.has(e)).map(e=>e.name));g.some(e=>e.candidate!==null&&!X.has(e.candidate.type.name)&&e.candidate.type.name!==`returns`)&&X.add(`returns`);for(let e of X)o?.add(e);let Z=null,Q=/* @__PURE__ */ new Set;for(let t of g){let r=t.response;if(t.candidate!==null){if(!X.has(t.candidate.type.name))continue;Q.add(t.candidate),r={kind:`ScalarCommandResponseSyntax`,source:{kind:`PropertyResponseSourceSyntax`,property:t.candidate.type.name,location:t.candidate.type.location},location:F(t.line)}}r!==null&&(Z===null?Z=r:n.error(e.InvalidCommandResponse,`A command declares at most one unconditional response.`,F(t.line)))}t(H,V,b.length>0,n);let $={kind:`CommandSyntax`,name:m,description:N,documentation:I,authorize:z,properties:h.filter(e=>!Q.has(e)),validations:y,produces:b,handler:V,response:Z,stream:U,streamCandidates:G,...K===null?{}:{calendar:K},location:F(i)};return D.set($,S),O.set($,{reads:C,concurrency:w}),$}function addProperty(t,n,r,i,a,o){return N(t,r.type,a),r.isIdentifier&&o!==void 0&&(t.error(e.DuplicateCommandIdentifier,`Command '${i}' already marks '${o.name}' as identifier - only one property can be the identifier`,r.location),r={...r,isIdentifier:!1}),n.push(r),o??(r.isIdentifier?r:void 0)}function parseValidationFile(e,t,n){let r=_(e,n);return r===void 0?void 0:{kind:`FileValidateSyntax`,file:r,location:F(t)}}function hasValidationOperand(e){let t=V.exec(e.content);if(t===null)return!1;let n=t[2];return x(n)===`not`&&x(n.substring(3).trimStart())===`empty`||x(n)===`checksum`||H.test(n)}function isValidationFileBody(e,t,n){if(!I(n)||hasValidationOperand(n))return!1;let r=e.reader.fork();r.takeSignificant();let i=r.peekSignificant();return i===void 0||i.indent<=t.indent}function parseValidate(t,r,i,a){if(r.content===`validate`){let o=t.peekChild(r.indent);if(o!==void 0&&isValidationFileBody(t,r,o))return t.reader.takeSignificant(),parseValidationFile(t,r,o);if(o!==void 0&&o.content.startsWith("```")){t.reader.takeSignificant();let e=g(t.valueContext,o);return e===null&&t.skipFencedBody(),{kind:`CodeValidateSyntax`,code:e,location:F(r)}}let c=[],l=[],u;for(let o=t.peekChild(r.indent);o!==void 0;o=t.peekChild(r.indent)){if(t.reader.takeSignificant(),i===`concept`){if(t.sourceOptions.numericMode===`legacy`&&o.content.startsWith("```")){t.skipFencedBody();continue}if(u!==void 0&&o.indent<=u&&(u=void 0),u!==void 0||x(o.content)===`implementation`){t.error(e.InvalidValidationRule,`Invalid validation rule '${o.content}'`,F(o)),u??=o.indent;continue}}if(x(o.content)===`require`){let e=n(i===`concept`?t.valueContext:t,o.content.substring(7).trim(),F(o),!1,t),r=null,a=`Error`,c=!1;for(let e=t.peekChild(o.indent);e!==void 0;e=t.peekChild(o.indent)){t.reader.takeSignificant();let n=B.exec(e.content);n!==null&&n.index===0?r=n[1]===void 0?n[2]:s(n[1]):x(e.content)===`severity`?(c||(a=K[e.content.substring(8).trim()]??`Error`),c=!0):t.skipOpaqueBlock(e.indent)}e!==null&&l.push({kind:`RequirementSyntax`,condition:e,message:r,severity:a,location:F(o)});continue}let r=parseValidationRule(t,i===`concept`?{...o,content:`value ${o.content}`}:o,i,a);r!==void 0&&c.push(r)}return{kind:`DeclarativeValidateSyntax`,rules:c,requirements:l,location:F(r)}}if(i===`concept`&&x(r.content.substring(8).trimStart())===`checksum`){let e=parseValidationRule(t,{...r,content:`value ${r.content.substring(8).trimStart()}`},i,a);return e===void 0?void 0:{kind:`DeclarativeValidateSyntax`,rules:[e],requirements:[],location:F(r)}}if(r.content===`validate csharp`){let e=g(t.valueContext,{...r,content:`csharp`});return e===null&&t.skipOpaqueBlock(r.indent),{kind:`CodeValidateSyntax`,code:e,location:F(r)}}t.error(e.InvalidValidateDeclaration,`Invalid validate declaration '${r.content}' - expected 'validate' or 'validate csharp'`,F(r)),t.skipBlock(r.indent)}function parseValidationRule(t,n,r,i){let a=x(V.exec(n.content)?.[2]??``)===`checksum`,o=r===`concept`&&!a?t.valueContext:t,{content:s,message:c}=splitMessage(n.content),l=splitSeverity(o,n,s);if(l===void 0)return;let u=V.exec(l.content);if(u===null){o.error(e.InvalidValidationRule,`Invalid validation rule '${n.content}'`,F(n));return}let d=parseRule(o,u[2],n);if(d===void 0)return;d.kind===`Matches`&&d.value!==null&&w(t,d.value,F(n),n.raw,C(t,r,i,u[1]));let f=d.kind===`Rule`?parseRuleImplementation(t,n,r===`command`):{file:null,code:null,implementation:null};return{kind:`ValidationRuleSyntax`,property:u[1],rule:d.kind,value:d.value,message:c,severity:l.severity,...f,location:F(n)}}function parseRuleImplementation(t,n,r){let i=t.peekChild(n.indent);if(i===void 0)return{file:null,code:null,implementation:null};t.reader.takeSignificant();let a=r&&x(i.content)===`implementation`,o=a?y(t,i):{file:h(i)?_(t,i):null,code:!h(i)&&m(t,i)?g(t,i):null,implementation:null};!a&&o.file===null&&o.code===null&&(t.error(e.UnknownRuleImplementationDirective,`Unexpected '${i.content}' in rule implementation - expected 'file <path>' or an inline code block`,F(i)),t.skipBlock(i.indent));for(let i=t.peekChild(n.indent);i!==void 0&&(a||r&&x(i.content)===`implementation`);i=t.peekChild(n.indent))t.reader.takeSignificant(),t.error(a&&x(i.content)===`implementation`?e.InvalidImplementationBlock:e.ConflictingImplementationSources,`A named rule has one implementation wrapper and cannot mix wrapped and direct sources.`,F(i)),m(t,i)?g(t,i):t.skipBlock(i.indent);return o}function splitMessage(e){let t=B.exec(e);if(t===null)return{content:e,message:null};let n=t[1]===void 0?t[2]:s(t[1]);return{content:e.substring(0,t.index).trimEnd(),message:n}}function splitSeverity(t,n,r){let i=z.exec(r);if(i===null)return{content:r,severity:`Error`};let a=K[i[1]];if(a===void 0)t.error(e.InvalidValidationSeverity,`Unknown validation severity '${i[1]}' - expected information, warning or error`,F(n));else return{content:r.substring(0,i.index).trimEnd(),severity:a}}function parseRule(t,n,r){if(n===`not empty`)return{kind:`NotEmpty`,value:null};if(x(n)===`checksum`){let i=n.substring(8).trim();if(i!==`luhn`&&i!==`mod11`&&i!==`mod97`){t.error(e.InvalidGenerationArgument,`Checksum validation requires luhn, mod11 or mod97.`,F(r));return}return{kind:`Checksum`,value:{kind:`LiteralExpressionSyntax`,value:i,location:F(r)}}}let i=H.exec(n);if(i===null){t.error(e.InvalidValidationRule,`Invalid validation rule '${r.content}'`,F(r));return}let a=i[1]??i[2];if(a===`rule`){let n=i[3].trim();if(!U.test(n)){t.error(e.InvalidRuleName,`Invalid rule name '${n}' in '${r.content}' - expected 'rule <Name>' with an identifier`,F(r));return}return{kind:`Rule`,value:{kind:`PathExpressionSyntax`,path:n,location:F(r)}}}return{kind:G[a],value:b(i[3],F(r),t)}}export{parseCommand,parseValidate};
|
|
2
2
|
//# sourceMappingURL=CommandParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandParser.js","names":["header","pattern","routeHeader","sourceStreamPattern","calendarPrefix","calendarPattern","stringBodyPattern","severityPattern","messagePattern","rulePattern","operandPattern","ruleNamePattern","optionalReads","operandKinds","severities","opaqueDirectives","propertyShapedDirectives","names","lookahead","ParserContext","context","line","name","DiagnosticCodes","locationOf","properties","responses","identifier","validations","produces","reads","referenceReads","concurrency","description","documentation","authorize","handler","handlers","stream","streamCandidates","calendar","child","keyword","firstWord","asProperty","tryParseProperty","match","unescapeString","scalar","scalarResponsePattern","responseNames","parseCommandResponse","reportInvalidModifierOrder","source","streamName","ambiguous","route","parseCommandStream","isReactionIdentityLine","misplacedReactionIdentity","parseDescription","parseDocumentation","combineAuthorize","parseAuthorize","validate","production","parseProduces","parseHandler","reference","parseReads","captureConcurrency","read","candidates","entry","property","discoveredNames","response","removed","parsed","validateHandlerContracts","syntax","commandReadSources","dependencySources","reportLegacyOptionalSuffix","commandName","file","parseFile","body","rule","isFileDirectiveAmongProperties","next","fence","code","parseCode","rules","requirements","wrapperIndent","owner","condition","parseCondition","message","severity","hasSeverity","directive","matched","ownerName","checksum","valueContext","withSeverity","validateMatchOperand","matchSubject","wrapped","commandOwner","parseImplementationWrapper","isFile","isCode","extra","content","text","algorithm","operand","operator","parseMappingSource"],"sources":["../../../../../../Compiler/Parsing/CommandParser.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { validateHandlerContracts } from './CommandHandlerValidator';\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { RequirementSyntax } from '../Syntax/Conditions';\nimport { parseCondition } from './ConditionParser';\nimport { AuthorizeSyntax } from '../Syntax/Authorization';\nimport { CommandSyntax, ValidateSyntax, ValidationRuleKind, ValidationRuleSyntax, ValidationSeverity } from '../Syntax/Commands';\nimport { PropertySyntax } from '../Syntax/Declarations';\nimport { CommandCalendarSyntax } from '../Syntax/Calendar';\nimport { CommandStreamSyntax } from '../Syntax/EventSources';\nimport { parseCommandStream } from './EventSourceParser';\nimport { ExpressionSyntax } from '../Syntax/Expressions';\nimport { ProducesSyntax } from '../Syntax/Reactions';\nimport { CommandResponseSyntax } from '../Syntax/Responses';\nimport { pattern } from '../Text/patterns';\nimport { sourceStreamPattern } from '../Text/SourceStreamNames';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { combineAuthorize, parseAuthorize } from './AuthorizeParser';\nimport { parseCommandResponse, scalarResponsePattern } from './CommandResponseParser';\nimport { parseDescription } from './DescriptionParser';\nimport { parseDocumentation } from './DocumentationParser';\nimport { isCode, isFile, parseCode, parseFile, parseHandler, parseImplementationWrapper } from './ImplementationParser';\nimport { CodeBlockSyntax, FileReferenceSyntax, HandlerSyntax, ImplementationSyntax } from '../Syntax/Implementations';\nimport { parseMappingSource } from './ExpressionParser';\nimport { firstWord } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { matchSubject, validateMatchOperand } from './MatchOperandValidation';\nimport { isReactionIdentityLine, misplacedReactionIdentity } from './ReactionIdentityParser';\nimport { commandReadSources } from './CommandReadSources';\nimport { dependencySources, ReadsSyntax, ConcurrencySyntax } from '../Syntax/DependencySources';\nimport { captureConcurrency } from './DependencySourceParser';\nimport { parseReads } from './ReadsParser';\nimport { parseProduces } from './ProducesParser';\nimport { reportInvalidModifierOrder, reportLegacyOptionalSuffix, tryParseProperty } from './PropertyLineParser';\nimport { locationOf, SourceLine } from './SourceLine';\nimport { isFileDirectiveAmongProperties } from './FileReferences';\n\nconst header = pattern('^command\\\\s+([A-Za-z_]\\\\w*)$');\nconst routeHeader = sourceStreamPattern('^stream\\\\s+[A-Za-z_]\\\\w*\\\\.[A-Za-z_]\\\\w*$');\nconst calendarPrefix = pattern('^calendar\\\\s+(?:\"|from\\\\s+\\\\$context\\\\.)');\nconst calendarPattern = pattern(`^calendar\\\\s+(?:\"(${stringBodyPattern})\"|from\\\\s+\\\\$context\\\\.([A-Za-z_][A-Za-z0-9_]*(?:\\\\.[A-Za-z_][A-Za-z0-9_]*)*))$`);\nconst severityPattern = pattern('\\\\bseverity\\\\s+(\\\\S+)$');\nconst messagePattern = pattern(`\\\\bmessage\\\\s+(?:\"(${stringBodyPattern})\"|(\\\\$strings\\\\.\\\\S*))$`);\nconst rulePattern = pattern('^([\\\\w.]+)\\\\s+(.+)$');\nconst operandPattern = pattern('^(?:(not empty|matches|not contains|contains|starts with|ends with|max|min|rule)(?:\\\\s+|$)|(length ==|decimals <=|all >=|all >|>=|<=|==|!=|>|<)\\\\s*)(.*)$');\nconst ruleNamePattern = sourceStreamPattern('^[A-Za-z_]\\\\w*$');\nconst optionalReads = pattern('^reads\\\\s+[A-Z]\\\\w*\\\\s+optional(?:\\\\s|$)');\n\n// Every operand the pattern matches has a kind, so an operand never goes unrecognized here.\nconst operandKinds: Record<string, ValidationRuleKind> = {\n max: 'Max',\n min: 'Min',\n '>': 'GreaterThan',\n '>=': 'GreaterThanOrEqual',\n '<': 'LessThan',\n '<=': 'LessThanOrEqual',\n '==': 'Equal',\n '!=': 'NotEqual',\n 'length ==': 'Length',\n 'decimals <=': 'DecimalPlaces',\n matches: 'Matches',\n contains: 'Contains',\n 'not contains': 'NotContains',\n 'starts with': 'StartsWith',\n 'ends with': 'EndsWith',\n 'all >': 'AllGreaterThan',\n 'all >=': 'AllGreaterThanOrEqual',\n};\n\nconst severities: Record<string, ValidationSeverity> = { information: 'Information', warning: 'Warning', error: 'Error' };\n\n// Command directives this compiler does not model. They are skipped whole.\nconst opaqueDirectives = new Set(['reads', 'concurrency']);\n\n// The bare directives cannot take a type reference, so a line with property shape is a property whatever\n// keyword it starts with - 'description String' declares a property called description.\nconst propertyShapedDirectives = new Set(['description', 'documentation', 'handler', 'concurrency']);\n\nexport function parseCommand(context: ParserContext, line: SourceLine): CommandSyntax {\n // Properties are leaves, not indentation owners. Resolve ambiguous returns spelling\n // before the committed pass decides whether its deeper lines belong to a response.\n const names = new Set<string>();\n const lookahead = new ParserContext(context.reader.fork(), context.path, context.languages);\n lookahead.sourceOptions = context.sourceOptions;\n lookahead.streamCandidates = context.streamCandidates;\n parseCommandBody(lookahead, line, undefined, names);\n return parseCommandBody(context, line, names);\n}\n\nfunction parseCommandBody(context: ParserContext, line: SourceLine, responseNames?: ReadonlySet<string>, discoveredNames?: Set<string>): CommandSyntax {\n const name = header.exec(line.content)?.[1] ?? '';\n if (name === '') {\n context.error(DiagnosticCodes.InvalidCommandDeclaration, `Invalid command declaration '${line.content}' - expected 'command <Name>'`, locationOf(line));\n }\n const properties: PropertySyntax[] = [];\n const responses: { line: SourceLine; candidate: PropertySyntax | null; response: CommandResponseSyntax | null }[] = [];\n let identifier: PropertySyntax | undefined;\n const validations: ValidateSyntax[] = [];\n const produces: ProducesSyntax[] = [];\n const reads: { readModel: string; alias: string | null }[] = [];\n const referenceReads: ReadsSyntax[] = [];\n let concurrency: ConcurrencySyntax | undefined;\n let description: string | null = null;\n let documentation: string | null = null;\n let authorize: AuthorizeSyntax | null = null;\n let handler: HandlerSyntax | null = null;\n const handlers: { handler: HandlerSyntax | null; location: SourceLocation }[] = [];\n let stream: CommandStreamSyntax | null = null;\n const streamCandidates: CommandStreamSyntax[] = [];\n let calendar: CommandCalendarSyntax | null = null;\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const keyword = firstWord(child.content);\n const asProperty = tryParseProperty(child);\n if (keyword === 'calendar' && calendarPrefix.test(child.content)) {\n const match = calendarPattern.exec(child.content);\n if (calendar !== null || match === null) {\n context.error(DiagnosticCodes.InvalidCommandCalendar, 'A command declares at most one \\'calendar \"<id>\"\\' or \\'calendar from $context.<member>\\'.', locationOf(child));\n } else {\n calendar = { kind: 'CommandCalendarSyntax', id: match[1] === undefined ? null : unescapeString(match[1]), contextMember: match[2] ?? null, location: locationOf(child) };\n }\n } else if (asProperty !== undefined && (propertyShapedDirectives.has(keyword) || (keyword === 'validate' && child.content !== 'validate csharp'))) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else if (keyword === 'returns') {\n const scalar = scalarResponsePattern.exec(child.content);\n if (scalar !== null && !scalar[1].startsWith('@') && asProperty !== undefined) {\n if (responseNames === undefined) {\n properties.push(asProperty);\n responses.push({ line: child, candidate: asProperty, response: null });\n } else if (responseNames.has(asProperty.type.name)) {\n responses.push({ line: child, candidate: null, response: parseCommandResponse(context, child) });\n } else {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n }\n } else if (asProperty !== undefined) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else if (reportInvalidModifierOrder(context, child)) {\n context.skipBlock(child.indent);\n } else {\n responses.push({ line: child, candidate: null, response: parseCommandResponse(context, child) });\n }\n } else if (keyword === 'stream' && routeHeader.test(child.content) && asProperty !== undefined && context.streamCandidates?.hasSource(asProperty.type.name.split('.')[0]) === true) {\n const [source, streamName] = asProperty.type.name.split('.');\n const ambiguous = context.streamCandidates.hasPropertyType(asProperty.type.name) && context.streamCandidates.hasUniqueStream(source, streamName);\n const route = parseCommandStream(context, child, asProperty, ambiguous);\n if (stream !== null || streamCandidates.length > 0) context.error(DiagnosticCodes.InvalidCommandStream, 'A command declares at most one stream route.', locationOf(child));\n if (ambiguous || stream !== null) streamCandidates.push(route);\n else stream = route;\n } else if (keyword === 'runs' && isReactionIdentityLine(child)) {\n misplacedReactionIdentity(context, child);\n } else if (keyword === 'description') {\n description = parseDescription(context, child, description, `Command '${name}'`);\n } else if (keyword === 'documentation') {\n documentation = parseDocumentation(context, child, documentation, `Command '${name}'`);\n } else if (keyword === 'authorize') {\n authorize = combineAuthorize(authorize, parseAuthorize(context, child));\n } else if (keyword === 'validate') {\n const validate = parseValidate(context, child, 'command', name);\n if (validate !== undefined) {\n validations.push(validate);\n }\n } else if (keyword === 'produces') {\n const production = parseProduces(context, child, true);\n if (production !== undefined) produces.push(production);\n } else if (keyword === 'handler') {\n handler = parseHandler(context, child);\n handlers.push({ handler, location: locationOf(child) });\n } else if (opaqueDirectives.has(keyword)) {\n const reference = keyword === 'reads' ? parseReads(context, child) : undefined;\n if (reference !== undefined) referenceReads.push(reference);\n if (keyword === 'concurrency' && concurrency === undefined) concurrency = captureConcurrency(context, child);\n const read = /^reads\\s+([A-Z]\\w*)(?:\\s+as\\s+([a-z_]\\w*))?(?:\\s+by\\s+([a-z_]\\w*))?$/.exec(child.content);\n if (read !== null) reads.push({ readModel: read[1], alias: read[2] ?? null });\n if (optionalReads.test(child.content)) {\n context.error(DiagnosticCodes.OptionalReadsNotSupported, 'Optional reads are not yet supported (see #308).', locationOf(child));\n }\n context.skipOpaqueBlock(child.indent);\n } else if (asProperty !== undefined) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else {\n reportInvalidModifierOrder(context, child);\n context.error(DiagnosticCodes.UnknownCommandDirective, `Unexpected '${child.content}' in command body`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n const candidates = new Set(responses.flatMap(entry => entry.candidate === null ? [] : [entry.candidate]));\n const names = new Set(properties.filter(property => !candidates.has(property)).map(property => property.name));\n if (responses.some(entry => entry.candidate !== null && !names.has(entry.candidate.type.name) && entry.candidate.type.name !== 'returns')) names.add('returns');\n for (const name of names) discoveredNames?.add(name);\n let response: CommandResponseSyntax | null = null;\n const removed = new Set<PropertySyntax>();\n for (const entry of responses) {\n let parsed = entry.response;\n if (entry.candidate !== null) {\n if (!names.has(entry.candidate.type.name)) continue;\n removed.add(entry.candidate);\n parsed = { kind: 'ScalarCommandResponseSyntax', source: { kind: 'PropertyResponseSourceSyntax', property: entry.candidate.type.name, location: entry.candidate.type.location }, location: locationOf(entry.line) };\n }\n if (parsed === null) continue;\n if (response !== null) {\n context.error(DiagnosticCodes.InvalidCommandResponse, 'A command declares at most one unconditional response.', locationOf(entry.line));\n } else {\n response = parsed;\n }\n }\n validateHandlerContracts(handlers, handler, produces.length > 0, context);\n const syntax: CommandSyntax = { kind: 'CommandSyntax', name, description, documentation, authorize, properties: properties.filter(property => !removed.has(property)), validations, produces, handler, response, stream, streamCandidates, ...(calendar === null ? {} : { calendar }), location: locationOf(line) };\n commandReadSources.set(syntax, reads);\n dependencySources.set(syntax, { reads: referenceReads, concurrency });\n return syntax;\n}\n\nfunction addProperty(context: ParserContext, properties: PropertySyntax[], property: PropertySyntax, commandName: string, line: SourceLine, identifier: PropertySyntax | undefined): PropertySyntax | undefined {\n reportLegacyOptionalSuffix(context, property.type, line);\n if (property.isIdentifier && identifier !== undefined) {\n context.error(DiagnosticCodes.DuplicateCommandIdentifier, `Command '${commandName}' already marks '${identifier.name}' as identifier - only one property can be the identifier`, property.location);\n property = { ...property, isIdentifier: false };\n }\n properties.push(property);\n return identifier ?? (property.isIdentifier ? property : undefined);\n}\n\nfunction parseValidationFile(context: ParserContext, header: SourceLine, body: SourceLine): ValidateSyntax | undefined {\n const file = parseFile(context, body);\n return file === undefined ? undefined : { kind: 'FileValidateSyntax', file, location: locationOf(header) };\n}\n\nfunction hasValidationOperand(line: SourceLine): boolean {\n const match = rulePattern.exec(line.content);\n if (match === null) return false;\n const rule = match[2];\n return (firstWord(rule) === 'not' && firstWord(rule.substring('not'.length).trimStart()) === 'empty') ||\n firstWord(rule) === 'checksum' || operandPattern.test(rule);\n}\n\nfunction isValidationFileBody(context: ParserContext, header: SourceLine, body: SourceLine): boolean {\n if (!isFileDirectiveAmongProperties(body) || hasValidationOperand(body)) return false;\n const lookahead = context.reader.fork();\n lookahead.takeSignificant();\n const next = lookahead.peekSignificant();\n return next === undefined || next.indent <= header.indent;\n}\n\n// Reads a 'validate' block: declarative rules, or code - which is recognized but not modeled.\nexport function parseValidate(context: ParserContext, line: SourceLine, owner: 'command' | 'concept', ownerName: string): ValidateSyntax | undefined {\n if (line.content === 'validate') {\n const fence = context.peekChild(line.indent);\n if (fence !== undefined && isValidationFileBody(context, line, fence)) {\n context.reader.takeSignificant();\n return parseValidationFile(context, line, fence);\n }\n if (fence !== undefined && fence.content.startsWith('```')) {\n context.reader.takeSignificant();\n const code = parseCode(context.valueContext, fence);\n if (code === null) context.skipFencedBody();\n return { kind: 'CodeValidateSyntax', code, location: locationOf(line) };\n }\n const rules: ValidationRuleSyntax[] = [];\n const requirements: RequirementSyntax[] = [];\n let wrapperIndent: number | undefined;\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n if (owner === 'concept') {\n if (context.sourceOptions.numericMode === 'legacy' && child.content.startsWith('```')) { context.skipFencedBody(); continue; }\n if (wrapperIndent !== undefined && child.indent <= wrapperIndent) wrapperIndent = undefined;\n if (wrapperIndent !== undefined || firstWord(child.content) === 'implementation') {\n context.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${child.content}'`, locationOf(child));\n wrapperIndent ??= child.indent;\n continue;\n }\n }\n if (firstWord(child.content) === 'require') {\n const condition = parseCondition(owner === 'concept' ? context.valueContext : context, child.content.substring('require'.length).trim(), locationOf(child));\n let message: string | null = null;\n let severity: ValidationSeverity = 'Error';\n let hasSeverity = false;\n for (let directive = context.peekChild(child.indent); directive !== undefined; directive = context.peekChild(child.indent)) {\n context.reader.takeSignificant();\n const matched = messagePattern.exec(directive.content);\n if (matched !== null && matched.index === 0) message = matched[1] !== undefined ? unescapeString(matched[1]) : matched[2];\n else if (firstWord(directive.content) === 'severity') {\n if (!hasSeverity) severity = severities[directive.content.substring('severity'.length).trim()] ?? 'Error';\n hasSeverity = true;\n } else context.skipOpaqueBlock(directive.indent);\n }\n if (condition !== null) requirements.push({ kind: 'RequirementSyntax', condition, message, severity, location: locationOf(child) });\n continue;\n }\n const rule = parseValidationRule(context, owner === 'concept' ? { ...child, content: `value ${child.content}` } : child, owner, ownerName);\n if (rule !== undefined) {\n rules.push(rule);\n }\n }\n return { kind: 'DeclarativeValidateSyntax', rules, requirements, location: locationOf(line) };\n }\n if (owner === 'concept' && firstWord(line.content.substring('validate'.length).trimStart()) === 'checksum') {\n const ruleLine = { ...line, content: `value ${line.content.substring('validate'.length).trimStart()}` };\n const rule = parseValidationRule(context, ruleLine, owner, ownerName);\n return rule === undefined ? undefined : { kind: 'DeclarativeValidateSyntax', rules: [rule], requirements: [], location: locationOf(line) };\n }\n if (line.content === 'validate csharp') {\n const code = parseCode(context.valueContext, { ...line, content: 'csharp' });\n if (code === null) context.skipOpaqueBlock(line.indent);\n return { kind: 'CodeValidateSyntax', code, location: locationOf(line) };\n }\n context.error(DiagnosticCodes.InvalidValidateDeclaration, `Invalid validate declaration '${line.content}' - expected 'validate' or 'validate csharp'`, locationOf(line));\n context.skipBlock(line.indent);\n return undefined;\n}\n\nfunction parseValidationRule(context: ParserContext, line: SourceLine, owner: 'command' | 'concept', ownerName: string): ValidationRuleSyntax | undefined {\n // Checksum is a new declaration, not enrichment of a formerly opaque Legacy rule.\n const checksum = firstWord(rulePattern.exec(line.content)?.[2] ?? '') === 'checksum';\n const valueContext = owner === 'concept' && !checksum ? context.valueContext : context;\n const { content: withSeverity, message } = splitMessage(line.content);\n const severity = splitSeverity(valueContext, line, withSeverity);\n if (severity === undefined) {\n return undefined;\n }\n const match = rulePattern.exec(severity.content);\n if (match === null) {\n valueContext.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${line.content}'`, locationOf(line));\n return undefined;\n }\n const parsed = parseRule(valueContext, match[2], line);\n if (parsed === undefined) {\n return undefined;\n }\n if (parsed.kind === 'Matches' && parsed.value !== null) validateMatchOperand(context, parsed.value, locationOf(line), line.raw, matchSubject(context, owner, ownerName, match[1]));\n const source = parsed.kind === 'Rule' ? parseRuleImplementation(context, line, owner === 'command') : { file: null, code: null, implementation: null };\n return {\n kind: 'ValidationRuleSyntax',\n property: match[1],\n rule: parsed.kind,\n value: parsed.value,\n message,\n severity: severity.severity,\n ...source,\n location: locationOf(line),\n };\n}\n\nfunction parseRuleImplementation(context: ParserContext, rule: SourceLine, commandOwner: boolean): { file: FileReferenceSyntax | null; code: CodeBlockSyntax | null; implementation: ImplementationSyntax | null } {\n const body = context.peekChild(rule.indent);\n if (body === undefined) return { file: null, code: null, implementation: null };\n context.reader.takeSignificant();\n const wrapped = commandOwner && firstWord(body.content) === 'implementation';\n const source = wrapped ? parseImplementationWrapper(context, body) : {\n file: isFile(body) ? parseFile(context, body) : null,\n code: !isFile(body) && isCode(context, body) ? parseCode(context, body) : null,\n implementation: null,\n };\n if (!wrapped && source.file === null && source.code === null) {\n context.error(DiagnosticCodes.UnknownRuleImplementationDirective, `Unexpected '${body.content}' in rule implementation - expected 'file <path>' or an inline code block`, locationOf(body));\n context.skipBlock(body.indent);\n }\n for (let extra = context.peekChild(rule.indent); extra !== undefined && (wrapped || (commandOwner && firstWord(extra.content) === 'implementation')); extra = context.peekChild(rule.indent)) {\n context.reader.takeSignificant();\n context.error(wrapped && firstWord(extra.content) === 'implementation' ? DiagnosticCodes.InvalidImplementationBlock : DiagnosticCodes.ConflictingImplementationSources,\n 'A named rule has one implementation wrapper and cannot mix wrapped and direct sources.', locationOf(extra));\n if (isCode(context, extra)) parseCode(context, extra);\n else context.skipBlock(extra.indent);\n }\n return source;\n}\n\nfunction splitMessage(content: string): { content: string; message: string | null } {\n const match = messagePattern.exec(content);\n if (match === null) {\n return { content, message: null };\n }\n const message = match[1] !== undefined ? unescapeString(match[1]) : match[2];\n return { content: content.substring(0, match.index).trimEnd(), message };\n}\n\nfunction splitSeverity(context: ParserContext, line: SourceLine, text: string): { content: string; severity: ValidationSeverity } | undefined {\n const match = severityPattern.exec(text);\n if (match === null) {\n return { content: text, severity: 'Error' };\n }\n const severity = severities[match[1]];\n if (severity === undefined) {\n context.error(DiagnosticCodes.InvalidValidationSeverity, `Unknown validation severity '${match[1]}' - expected information, warning or error`, locationOf(line));\n return undefined;\n }\n return { content: text.substring(0, match.index).trimEnd(), severity };\n}\n\nfunction parseRule(context: ParserContext, rule: string, line: SourceLine): { kind: ValidationRuleKind; value: ExpressionSyntax | null } | undefined {\n if (rule === 'not empty') {\n return { kind: 'NotEmpty', value: null };\n }\n if (firstWord(rule) === 'checksum') {\n const algorithm = rule.substring('checksum'.length).trim();\n if (algorithm !== 'luhn' && algorithm !== 'mod11' && algorithm !== 'mod97') {\n context.error(DiagnosticCodes.InvalidGenerationArgument, 'Checksum validation requires luhn, mod11 or mod97.', locationOf(line));\n return undefined;\n }\n return { kind: 'Checksum', value: { kind: 'LiteralExpressionSyntax', value: algorithm, location: locationOf(line) } };\n }\n const operand = operandPattern.exec(rule);\n if (operand === null) {\n context.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${line.content}'`, locationOf(line));\n return undefined;\n }\n const operator = operand[1] ?? operand[2];\n if (operator === 'rule') {\n const name = operand[3].trim();\n if (!ruleNamePattern.test(name)) {\n context.error(DiagnosticCodes.InvalidRuleName, `Invalid rule name '${name}' in '${line.content}' - expected 'rule <Name>' with an identifier`, locationOf(line));\n return undefined;\n }\n return { kind: 'Rule', value: { kind: 'PathExpressionSyntax', path: name, location: locationOf(line) } };\n }\n return { kind: operandKinds[operator], value: parseMappingSource(operand[3], locationOf(line), context) };\n}\n"],"mappings":"swDAwCA,MAAMA,EAASC,EAAQ,8BAA8B,EAC/CC,EAAcC,EAAoB,2CAA2C,EAC7EC,GAAiBH,EAAQ,0CAA0C,EACnEI,EAAkBJ,EAAQ,qBAAqBK,EAAkB,iFAAiF,EAClJC,EAAkBN,EAAQ,wBAAwB,EAClDO,EAAiBP,EAAQ,sBAAsBK,EAAkB,yBAAyB,EAC1FG,EAAcR,EAAQ,qBAAqB,EAC3CS,EAAiBT,EAAQ,2JAA2J,EACpLU,EAAkBR,EAAoB,iBAAiB,EACvDS,EAAgBX,EAAQ,0CAA0C,EAGlEY,EAAmD,CACrD,IAAK,MACL,IAAK,MACL,IAAK,cACL,KAAM,qBACN,IAAK,WACL,KAAM,kBACN,KAAM,QACN,KAAM,WACN,YAAa,SACb,cAAe,gBACf,QAAS,UACT,SAAU,WACV,eAAgB,cAChB,cAAe,aACf,YAAa,WACb,QAAS,iBACT,SAAU,uBACd,EAEMC,EAAiD,CAAE,YAAa,cAAe,QAAS,UAA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kG,EAAQ,EAAE,CAAC,KAAK,EAC7B,GAAI,CAAC7G,EAAgB,KAAKW,CAAI,EAAG,CAC7BF,EAAQ,MAAMG,EAAgB,gBAAiB,sBAAsBD,EAAK,QAAQD,EAAK,QAAQ,+CAAgDG,EAAWH,CAAI,CAAC,EAC/J,MACJ,CACA,MAAO,CAAE,KAAM,OAAQ,MAAO,CAAE,KAAM,uBAAwB,KAAMC,EAAM,SAAUE,EAAWH,CAAI,CAAE,CAAE,CAC3G,CACA,MAAO,CAAE,KAAMR,EAAa4G,GAAW,MAAOC,EAAmBF,EAAQ,GAAIhG,EAAWH,CAAI,EAAGD,CAAO,CAAE,CAC5G"}
|
|
1
|
+
{"version":3,"file":"CommandParser.js","names":["header","pattern","routeHeader","sourceStreamPattern","calendarPrefix","calendarPattern","stringBodyPattern","severityPattern","messagePattern","rulePattern","operandPattern","ruleNamePattern","optionalReads","operandKinds","severities","opaqueDirectives","propertyShapedDirectives","names","lookahead","ParserContext","context","line","name","DiagnosticCodes","locationOf","properties","responses","identifier","validations","produces","reads","referenceReads","concurrency","description","documentation","authorize","authorizationDepthExceeded","handler","handlers","stream","streamCandidates","calendar","child","keyword","firstWord","asProperty","tryParseProperty","match","unescapeString","scalar","scalarResponsePattern","responseNames","parseCommandResponse","reportInvalidModifierOrder","source","streamName","ambiguous","route","parseCommandStream","isReactionIdentityLine","misplacedReactionIdentity","parseDescription","parseDocumentation","next","parseAuthorize","previous","combineAuthorize","validate","production","parseProduces","parseHandler","reference","parseReads","captureConcurrency","read","candidates","entry","property","discoveredNames","response","removed","parsed","validateHandlerContracts","syntax","commandReadSources","dependencySources","reportLegacyOptionalSuffix","commandName","file","parseFile","body","rule","isFileDirectiveAmongProperties","fence","code","parseCode","rules","requirements","wrapperIndent","owner","condition","parseCondition","message","severity","hasSeverity","directive","matched","ownerName","checksum","valueContext","withSeverity","validateMatchOperand","matchSubject","wrapped","commandOwner","parseImplementationWrapper","isFile","isCode","extra","content","text","algorithm","operand","operator","parseMappingSource"],"sources":["../../../../../../Compiler/Parsing/CommandParser.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { validateHandlerContracts } from './CommandHandlerValidator';\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { RequirementSyntax } from '../Syntax/Conditions';\nimport { parseCondition } from './ConditionParser';\nimport { AuthorizeSyntax } from '../Syntax/Authorization';\nimport { CommandSyntax, ValidateSyntax, ValidationRuleKind, ValidationRuleSyntax, ValidationSeverity } from '../Syntax/Commands';\nimport { PropertySyntax } from '../Syntax/Declarations';\nimport { CommandCalendarSyntax } from '../Syntax/Calendar';\nimport { CommandStreamSyntax } from '../Syntax/EventSources';\nimport { parseCommandStream } from './EventSourceParser';\nimport { ExpressionSyntax } from '../Syntax/Expressions';\nimport { ProducesSyntax } from '../Syntax/Reactions';\nimport { CommandResponseSyntax } from '../Syntax/Responses';\nimport { pattern } from '../Text/patterns';\nimport { sourceStreamPattern } from '../Text/SourceStreamNames';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { combineAuthorize, parseAuthorize } from './AuthorizeParser';\nimport { parseCommandResponse, scalarResponsePattern } from './CommandResponseParser';\nimport { parseDescription } from './DescriptionParser';\nimport { parseDocumentation } from './DocumentationParser';\nimport { isCode, isFile, parseCode, parseFile, parseHandler, parseImplementationWrapper } from './ImplementationParser';\nimport { CodeBlockSyntax, FileReferenceSyntax, HandlerSyntax, ImplementationSyntax } from '../Syntax/Implementations';\nimport { parseMappingSource } from './ExpressionParser';\nimport { firstWord } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { matchSubject, validateMatchOperand } from './MatchOperandValidation';\nimport { isReactionIdentityLine, misplacedReactionIdentity } from './ReactionIdentityParser';\nimport { commandReadSources } from './CommandReadSources';\nimport { dependencySources, ReadsSyntax, ConcurrencySyntax } from '../Syntax/DependencySources';\nimport { captureConcurrency } from './DependencySourceParser';\nimport { parseReads } from './ReadsParser';\nimport { parseProduces } from './ProducesParser';\nimport { reportInvalidModifierOrder, reportLegacyOptionalSuffix, tryParseProperty } from './PropertyLineParser';\nimport { locationOf, SourceLine } from './SourceLine';\nimport { isFileDirectiveAmongProperties } from './FileReferences';\n\nconst header = pattern('^command\\\\s+([A-Za-z_]\\\\w*)$');\nconst routeHeader = sourceStreamPattern('^stream\\\\s+[A-Za-z_]\\\\w*\\\\.[A-Za-z_]\\\\w*$');\nconst calendarPrefix = pattern('^calendar\\\\s+(?:\"|from\\\\s+\\\\$context\\\\.)');\nconst calendarPattern = pattern(`^calendar\\\\s+(?:\"(${stringBodyPattern})\"|from\\\\s+\\\\$context\\\\.([A-Za-z_][A-Za-z0-9_]*(?:\\\\.[A-Za-z_][A-Za-z0-9_]*)*))$`);\nconst severityPattern = pattern('\\\\bseverity\\\\s+(\\\\S+)$');\nconst messagePattern = pattern(`\\\\bmessage\\\\s+(?:\"(${stringBodyPattern})\"|(\\\\$strings\\\\.\\\\S*))$`);\nconst rulePattern = pattern('^([\\\\w.]+)\\\\s+(.+)$');\nconst operandPattern = pattern('^(?:(not empty|matches|not contains|contains|starts with|ends with|max|min|rule)(?:\\\\s+|$)|(length ==|decimals <=|all >=|all >|>=|<=|==|!=|>|<)\\\\s*)(.*)$');\nconst ruleNamePattern = sourceStreamPattern('^[A-Za-z_]\\\\w*$');\nconst optionalReads = pattern('^reads\\\\s+[A-Z]\\\\w*\\\\s+optional(?:\\\\s|$)');\n\n// Every operand the pattern matches has a kind, so an operand never goes unrecognized here.\nconst operandKinds: Record<string, ValidationRuleKind> = {\n max: 'Max',\n min: 'Min',\n '>': 'GreaterThan',\n '>=': 'GreaterThanOrEqual',\n '<': 'LessThan',\n '<=': 'LessThanOrEqual',\n '==': 'Equal',\n '!=': 'NotEqual',\n 'length ==': 'Length',\n 'decimals <=': 'DecimalPlaces',\n matches: 'Matches',\n contains: 'Contains',\n 'not contains': 'NotContains',\n 'starts with': 'StartsWith',\n 'ends with': 'EndsWith',\n 'all >': 'AllGreaterThan',\n 'all >=': 'AllGreaterThanOrEqual',\n};\n\nconst severities: Record<string, ValidationSeverity> = { information: 'Information', warning: 'Warning', error: 'Error' };\n\n// Command directives this compiler does not model. They are skipped whole.\nconst opaqueDirectives = new Set(['reads', 'concurrency']);\n\n// The bare directives cannot take a type reference, so a line with property shape is a property whatever\n// keyword it starts with - 'description String' declares a property called description.\nconst propertyShapedDirectives = new Set(['description', 'documentation', 'handler', 'concurrency']);\n\nexport function parseCommand(context: ParserContext, line: SourceLine): CommandSyntax {\n // Properties are leaves, not indentation owners. Resolve ambiguous returns spelling\n // before the committed pass decides whether its deeper lines belong to a response.\n const names = new Set<string>();\n const lookahead = new ParserContext(context.reader.fork(), context.path, context.languages);\n lookahead.sourceOptions = context.sourceOptions;\n lookahead.streamCandidates = context.streamCandidates;\n parseCommandBody(lookahead, line, undefined, names);\n return parseCommandBody(context, line, names);\n}\n\nfunction parseCommandBody(context: ParserContext, line: SourceLine, responseNames?: ReadonlySet<string>, discoveredNames?: Set<string>): CommandSyntax {\n const name = header.exec(line.content)?.[1] ?? '';\n if (name === '') {\n context.error(DiagnosticCodes.InvalidCommandDeclaration, `Invalid command declaration '${line.content}' - expected 'command <Name>'`, locationOf(line));\n }\n const properties: PropertySyntax[] = [];\n const responses: { line: SourceLine; candidate: PropertySyntax | null; response: CommandResponseSyntax | null }[] = [];\n let identifier: PropertySyntax | undefined;\n const validations: ValidateSyntax[] = [];\n const produces: ProducesSyntax[] = [];\n const reads: { readModel: string; alias: string | null }[] = [];\n const referenceReads: ReadsSyntax[] = [];\n let concurrency: ConcurrencySyntax | undefined;\n let description: string | null = null;\n let documentation: string | null = null;\n let authorize: AuthorizeSyntax | null = null;\n let authorizationDepthExceeded = false;\n let handler: HandlerSyntax | null = null;\n const handlers: { handler: HandlerSyntax | null; location: SourceLocation }[] = [];\n let stream: CommandStreamSyntax | null = null;\n const streamCandidates: CommandStreamSyntax[] = [];\n let calendar: CommandCalendarSyntax | null = null;\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const keyword = firstWord(child.content);\n const asProperty = tryParseProperty(child);\n if (keyword === 'calendar' && calendarPrefix.test(child.content)) {\n const match = calendarPattern.exec(child.content);\n if (calendar !== null || match === null) {\n context.error(DiagnosticCodes.InvalidCommandCalendar, 'A command declares at most one \\'calendar \"<id>\"\\' or \\'calendar from $context.<member>\\'.', locationOf(child));\n } else {\n calendar = { kind: 'CommandCalendarSyntax', id: match[1] === undefined ? null : unescapeString(match[1]), contextMember: match[2] ?? null, location: locationOf(child) };\n }\n } else if (asProperty !== undefined && (propertyShapedDirectives.has(keyword) || (keyword === 'validate' && child.content !== 'validate csharp'))) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else if (keyword === 'returns') {\n const scalar = scalarResponsePattern.exec(child.content);\n if (scalar !== null && !scalar[1].startsWith('@') && asProperty !== undefined) {\n if (responseNames === undefined) {\n properties.push(asProperty);\n responses.push({ line: child, candidate: asProperty, response: null });\n } else if (responseNames.has(asProperty.type.name)) {\n responses.push({ line: child, candidate: null, response: parseCommandResponse(context, child) });\n } else {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n }\n } else if (asProperty !== undefined) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else if (reportInvalidModifierOrder(context, child)) {\n context.skipBlock(child.indent);\n } else {\n responses.push({ line: child, candidate: null, response: parseCommandResponse(context, child) });\n }\n } else if (keyword === 'stream' && routeHeader.test(child.content) && asProperty !== undefined && context.streamCandidates?.hasSource(asProperty.type.name.split('.')[0]) === true) {\n const [source, streamName] = asProperty.type.name.split('.');\n const ambiguous = context.streamCandidates.hasPropertyType(asProperty.type.name) && context.streamCandidates.hasUniqueStream(source, streamName);\n const route = parseCommandStream(context, child, asProperty, ambiguous);\n if (stream !== null || streamCandidates.length > 0) context.error(DiagnosticCodes.InvalidCommandStream, 'A command declares at most one stream route.', locationOf(child));\n if (ambiguous || stream !== null) streamCandidates.push(route);\n else stream = route;\n } else if (keyword === 'runs' && isReactionIdentityLine(child)) {\n misplacedReactionIdentity(context, child);\n } else if (keyword === 'description') {\n description = parseDescription(context, child, description, `Command '${name}'`);\n } else if (keyword === 'documentation') {\n documentation = parseDocumentation(context, child, documentation, `Command '${name}'`);\n } else if (keyword === 'authorize') {\n const next = parseAuthorize(context, child);\n if (!authorizationDepthExceeded) {\n const previous = authorize;\n authorize = combineAuthorize(authorize, next, context);\n authorizationDepthExceeded = previous !== null && authorize === null;\n }\n } else if (keyword === 'validate') {\n const validate = parseValidate(context, child, 'command', name);\n if (validate !== undefined) {\n validations.push(validate);\n }\n } else if (keyword === 'produces') {\n const production = parseProduces(context, child, true);\n if (production !== undefined) produces.push(production);\n } else if (keyword === 'handler') {\n handler = parseHandler(context, child);\n handlers.push({ handler, location: locationOf(child) });\n } else if (opaqueDirectives.has(keyword)) {\n const reference = keyword === 'reads' ? parseReads(context, child) : undefined;\n if (reference !== undefined) referenceReads.push(reference);\n if (keyword === 'concurrency' && concurrency === undefined) concurrency = captureConcurrency(context, child);\n const read = /^reads\\s+([A-Z]\\w*)(?:\\s+as\\s+([a-z_]\\w*))?(?:\\s+by\\s+([a-z_]\\w*))?$/.exec(child.content);\n if (read !== null) reads.push({ readModel: read[1], alias: read[2] ?? null });\n if (optionalReads.test(child.content)) {\n context.error(DiagnosticCodes.OptionalReadsNotSupported, 'Optional reads are not yet supported (see #308).', locationOf(child));\n }\n context.skipOpaqueBlock(child.indent);\n } else if (asProperty !== undefined) {\n identifier = addProperty(context, properties, asProperty, name, child, identifier);\n } else {\n reportInvalidModifierOrder(context, child);\n context.error(DiagnosticCodes.UnknownCommandDirective, `Unexpected '${child.content}' in command body`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n const candidates = new Set(responses.flatMap(entry => entry.candidate === null ? [] : [entry.candidate]));\n const names = new Set(properties.filter(property => !candidates.has(property)).map(property => property.name));\n if (responses.some(entry => entry.candidate !== null && !names.has(entry.candidate.type.name) && entry.candidate.type.name !== 'returns')) names.add('returns');\n for (const name of names) discoveredNames?.add(name);\n let response: CommandResponseSyntax | null = null;\n const removed = new Set<PropertySyntax>();\n for (const entry of responses) {\n let parsed = entry.response;\n if (entry.candidate !== null) {\n if (!names.has(entry.candidate.type.name)) continue;\n removed.add(entry.candidate);\n parsed = { kind: 'ScalarCommandResponseSyntax', source: { kind: 'PropertyResponseSourceSyntax', property: entry.candidate.type.name, location: entry.candidate.type.location }, location: locationOf(entry.line) };\n }\n if (parsed === null) continue;\n if (response !== null) {\n context.error(DiagnosticCodes.InvalidCommandResponse, 'A command declares at most one unconditional response.', locationOf(entry.line));\n } else {\n response = parsed;\n }\n }\n validateHandlerContracts(handlers, handler, produces.length > 0, context);\n const syntax: CommandSyntax = { kind: 'CommandSyntax', name, description, documentation, authorize, properties: properties.filter(property => !removed.has(property)), validations, produces, handler, response, stream, streamCandidates, ...(calendar === null ? {} : { calendar }), location: locationOf(line) };\n commandReadSources.set(syntax, reads);\n dependencySources.set(syntax, { reads: referenceReads, concurrency });\n return syntax;\n}\n\nfunction addProperty(context: ParserContext, properties: PropertySyntax[], property: PropertySyntax, commandName: string, line: SourceLine, identifier: PropertySyntax | undefined): PropertySyntax | undefined {\n reportLegacyOptionalSuffix(context, property.type, line);\n if (property.isIdentifier && identifier !== undefined) {\n context.error(DiagnosticCodes.DuplicateCommandIdentifier, `Command '${commandName}' already marks '${identifier.name}' as identifier - only one property can be the identifier`, property.location);\n property = { ...property, isIdentifier: false };\n }\n properties.push(property);\n return identifier ?? (property.isIdentifier ? property : undefined);\n}\n\nfunction parseValidationFile(context: ParserContext, header: SourceLine, body: SourceLine): ValidateSyntax | undefined {\n const file = parseFile(context, body);\n return file === undefined ? undefined : { kind: 'FileValidateSyntax', file, location: locationOf(header) };\n}\n\nfunction hasValidationOperand(line: SourceLine): boolean {\n const match = rulePattern.exec(line.content);\n if (match === null) return false;\n const rule = match[2];\n return (firstWord(rule) === 'not' && firstWord(rule.substring('not'.length).trimStart()) === 'empty') ||\n firstWord(rule) === 'checksum' || operandPattern.test(rule);\n}\n\nfunction isValidationFileBody(context: ParserContext, header: SourceLine, body: SourceLine): boolean {\n if (!isFileDirectiveAmongProperties(body) || hasValidationOperand(body)) return false;\n const lookahead = context.reader.fork();\n lookahead.takeSignificant();\n const next = lookahead.peekSignificant();\n return next === undefined || next.indent <= header.indent;\n}\n\n// Reads a 'validate' block: declarative rules, or code - which is recognized but not modeled.\nexport function parseValidate(context: ParserContext, line: SourceLine, owner: 'command' | 'concept', ownerName: string): ValidateSyntax | undefined {\n if (line.content === 'validate') {\n const fence = context.peekChild(line.indent);\n if (fence !== undefined && isValidationFileBody(context, line, fence)) {\n context.reader.takeSignificant();\n return parseValidationFile(context, line, fence);\n }\n if (fence !== undefined && fence.content.startsWith('```')) {\n context.reader.takeSignificant();\n const code = parseCode(context.valueContext, fence);\n if (code === null) context.skipFencedBody();\n return { kind: 'CodeValidateSyntax', code, location: locationOf(line) };\n }\n const rules: ValidationRuleSyntax[] = [];\n const requirements: RequirementSyntax[] = [];\n let wrapperIndent: number | undefined;\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n if (owner === 'concept') {\n if (context.sourceOptions.numericMode === 'legacy' && child.content.startsWith('```')) { context.skipFencedBody(); continue; }\n if (wrapperIndent !== undefined && child.indent <= wrapperIndent) wrapperIndent = undefined;\n if (wrapperIndent !== undefined || firstWord(child.content) === 'implementation') {\n context.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${child.content}'`, locationOf(child));\n wrapperIndent ??= child.indent;\n continue;\n }\n }\n if (firstWord(child.content) === 'require') {\n // Keep legacy operand enrichment quiet, but never discard the depth refusal.\n const condition = parseCondition(owner === 'concept' ? context.valueContext : context, child.content.substring('require'.length).trim(), locationOf(child), false, context);\n let message: string | null = null;\n let severity: ValidationSeverity = 'Error';\n let hasSeverity = false;\n for (let directive = context.peekChild(child.indent); directive !== undefined; directive = context.peekChild(child.indent)) {\n context.reader.takeSignificant();\n const matched = messagePattern.exec(directive.content);\n if (matched !== null && matched.index === 0) message = matched[1] !== undefined ? unescapeString(matched[1]) : matched[2];\n else if (firstWord(directive.content) === 'severity') {\n if (!hasSeverity) severity = severities[directive.content.substring('severity'.length).trim()] ?? 'Error';\n hasSeverity = true;\n } else context.skipOpaqueBlock(directive.indent);\n }\n if (condition !== null) requirements.push({ kind: 'RequirementSyntax', condition, message, severity, location: locationOf(child) });\n continue;\n }\n const rule = parseValidationRule(context, owner === 'concept' ? { ...child, content: `value ${child.content}` } : child, owner, ownerName);\n if (rule !== undefined) {\n rules.push(rule);\n }\n }\n return { kind: 'DeclarativeValidateSyntax', rules, requirements, location: locationOf(line) };\n }\n if (owner === 'concept' && firstWord(line.content.substring('validate'.length).trimStart()) === 'checksum') {\n const ruleLine = { ...line, content: `value ${line.content.substring('validate'.length).trimStart()}` };\n const rule = parseValidationRule(context, ruleLine, owner, ownerName);\n return rule === undefined ? undefined : { kind: 'DeclarativeValidateSyntax', rules: [rule], requirements: [], location: locationOf(line) };\n }\n if (line.content === 'validate csharp') {\n const code = parseCode(context.valueContext, { ...line, content: 'csharp' });\n if (code === null) context.skipOpaqueBlock(line.indent);\n return { kind: 'CodeValidateSyntax', code, location: locationOf(line) };\n }\n context.error(DiagnosticCodes.InvalidValidateDeclaration, `Invalid validate declaration '${line.content}' - expected 'validate' or 'validate csharp'`, locationOf(line));\n context.skipBlock(line.indent);\n return undefined;\n}\n\nfunction parseValidationRule(context: ParserContext, line: SourceLine, owner: 'command' | 'concept', ownerName: string): ValidationRuleSyntax | undefined {\n // Checksum is a new declaration, not enrichment of a formerly opaque Legacy rule.\n const checksum = firstWord(rulePattern.exec(line.content)?.[2] ?? '') === 'checksum';\n const valueContext = owner === 'concept' && !checksum ? context.valueContext : context;\n const { content: withSeverity, message } = splitMessage(line.content);\n const severity = splitSeverity(valueContext, line, withSeverity);\n if (severity === undefined) {\n return undefined;\n }\n const match = rulePattern.exec(severity.content);\n if (match === null) {\n valueContext.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${line.content}'`, locationOf(line));\n return undefined;\n }\n const parsed = parseRule(valueContext, match[2], line);\n if (parsed === undefined) {\n return undefined;\n }\n if (parsed.kind === 'Matches' && parsed.value !== null) validateMatchOperand(context, parsed.value, locationOf(line), line.raw, matchSubject(context, owner, ownerName, match[1]));\n const source = parsed.kind === 'Rule' ? parseRuleImplementation(context, line, owner === 'command') : { file: null, code: null, implementation: null };\n return {\n kind: 'ValidationRuleSyntax',\n property: match[1],\n rule: parsed.kind,\n value: parsed.value,\n message,\n severity: severity.severity,\n ...source,\n location: locationOf(line),\n };\n}\n\nfunction parseRuleImplementation(context: ParserContext, rule: SourceLine, commandOwner: boolean): { file: FileReferenceSyntax | null; code: CodeBlockSyntax | null; implementation: ImplementationSyntax | null } {\n const body = context.peekChild(rule.indent);\n if (body === undefined) return { file: null, code: null, implementation: null };\n context.reader.takeSignificant();\n const wrapped = commandOwner && firstWord(body.content) === 'implementation';\n const source = wrapped ? parseImplementationWrapper(context, body) : {\n file: isFile(body) ? parseFile(context, body) : null,\n code: !isFile(body) && isCode(context, body) ? parseCode(context, body) : null,\n implementation: null,\n };\n if (!wrapped && source.file === null && source.code === null) {\n context.error(DiagnosticCodes.UnknownRuleImplementationDirective, `Unexpected '${body.content}' in rule implementation - expected 'file <path>' or an inline code block`, locationOf(body));\n context.skipBlock(body.indent);\n }\n for (let extra = context.peekChild(rule.indent); extra !== undefined && (wrapped || (commandOwner && firstWord(extra.content) === 'implementation')); extra = context.peekChild(rule.indent)) {\n context.reader.takeSignificant();\n context.error(wrapped && firstWord(extra.content) === 'implementation' ? DiagnosticCodes.InvalidImplementationBlock : DiagnosticCodes.ConflictingImplementationSources,\n 'A named rule has one implementation wrapper and cannot mix wrapped and direct sources.', locationOf(extra));\n if (isCode(context, extra)) parseCode(context, extra);\n else context.skipBlock(extra.indent);\n }\n return source;\n}\n\nfunction splitMessage(content: string): { content: string; message: string | null } {\n const match = messagePattern.exec(content);\n if (match === null) {\n return { content, message: null };\n }\n const message = match[1] !== undefined ? unescapeString(match[1]) : match[2];\n return { content: content.substring(0, match.index).trimEnd(), message };\n}\n\nfunction splitSeverity(context: ParserContext, line: SourceLine, text: string): { content: string; severity: ValidationSeverity } | undefined {\n const match = severityPattern.exec(text);\n if (match === null) {\n return { content: text, severity: 'Error' };\n }\n const severity = severities[match[1]];\n if (severity === undefined) {\n context.error(DiagnosticCodes.InvalidValidationSeverity, `Unknown validation severity '${match[1]}' - expected information, warning or error`, locationOf(line));\n return undefined;\n }\n return { content: text.substring(0, match.index).trimEnd(), severity };\n}\n\nfunction parseRule(context: ParserContext, rule: string, line: SourceLine): { kind: ValidationRuleKind; value: ExpressionSyntax | null } | undefined {\n if (rule === 'not empty') {\n return { kind: 'NotEmpty', value: null };\n }\n if (firstWord(rule) === 'checksum') {\n const algorithm = rule.substring('checksum'.length).trim();\n if (algorithm !== 'luhn' && algorithm !== 'mod11' && algorithm !== 'mod97') {\n context.error(DiagnosticCodes.InvalidGenerationArgument, 'Checksum validation requires luhn, mod11 or mod97.', locationOf(line));\n return undefined;\n }\n return { kind: 'Checksum', value: { kind: 'LiteralExpressionSyntax', value: algorithm, location: locationOf(line) } };\n }\n const operand = operandPattern.exec(rule);\n if (operand === null) {\n context.error(DiagnosticCodes.InvalidValidationRule, `Invalid validation rule '${line.content}'`, locationOf(line));\n return undefined;\n }\n const operator = operand[1] ?? operand[2];\n if (operator === 'rule') {\n const name = operand[3].trim();\n if (!ruleNamePattern.test(name)) {\n context.error(DiagnosticCodes.InvalidRuleName, `Invalid rule name '${name}' in '${line.content}' - expected 'rule <Name>' with an identifier`, locationOf(line));\n return undefined;\n }\n return { kind: 'Rule', value: { kind: 'PathExpressionSyntax', path: name, location: locationOf(line) } };\n }\n return { kind: operandKinds[operator], value: parseMappingSource(operand[3], locationOf(line),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@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandReadSources.js","names":["commandReadSources"],"sources":["../../../../../../Compiler/Parsing/CommandReadSources.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { CommandSyntax } from '../Syntax/Commands';\n\n// Reads remain outside the narrowed TypeScript wire contract. Retain source evidence for\n// operation mapping checks without guessing that an unavailable state shape is a command field.\nexport const commandReadSources = new WeakMap<CommandSyntax, readonly { readModel: string; alias: string | null }[]>();\n"],"mappings":"AAOA,MAAaA,kBAAqB,IAAI"}
|
|
1
|
+
{"version":3,"file":"CommandReadSources.js","names":["commandReadSources"],"sources":["../../../../../../Compiler/Parsing/CommandReadSources.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { CommandSyntax } from '../Syntax/Commands';\n\n// Reads remain outside the narrowed TypeScript wire contract. Retain source evidence for\n// operation mapping checks without guessing that an unavailable state shape is a command field.\nexport const commandReadSources = new WeakMap<CommandSyntax, readonly { readModel: string; alias: string | null }[]>();\n"],"mappings":"AAOA,MAAaA,kBAAqB,IAAI,Q"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{pattern as t}from"../Text/patterns.js";import{
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{pattern as t}from"../Text/patterns.js";import{unescapeIdentifier as n}from"./LineText.js";import{parseTypeRef as r,reportLegacyOptionalSuffix as i,tryParseProperty as a}from"./PropertyLineParser.js";import{locationOf as o}from"./SourceLine.js";const s=t(`^returns\\s+(@?[A-Za-z_]\\w*)$`),c=t(`^(@?[a-z_]\\w*)(?:\\s+([\\w.]+(?:\\[\\])?(?:\\?|\\s+optional)?))?\\s*=(?!=|>)\\s*(@?[a-z_]\\w*)$`);function parseCommandResponse(t,l){let u=o(l);if(l.content!==`returns`){let r=s.exec(l.content);if(r===null)return t.error(e.InvalidCommandResponse,`Expected 'returns <property>' or an unconditional 'returns' block.`,u),t.skipBlock(l.indent),null;let i=t.peekChild(l.indent);i!==void 0&&(t.error(e.InvalidCommandResponse,`A scalar response cannot have child directives.`,o(i)),t.skipBlock(l.indent));let a=r.index+r[0].length-r[1].length;return{kind:`ScalarCommandResponseSyntax`,source:{kind:`PropertyResponseSourceSyntax`,property:n(r[1]),location:{...u,column:u.column+a}},location:u}}let d=[];for(let s=t.peekChild(l.indent);s!==void 0;s=t.peekChild(l.indent)){t.reader.takeSignificant();let l=c.exec(s.content);if(l===null){a({...s,content:s.content.split(`=`,1)[0].trimEnd()})?.isSubject?t.error(e.InvalidSubjectOwner,`The subject modifier is only valid on event properties, not response fields (decision 0008: one data subject per event).`,o(s)):t.error(e.InvalidCommandResponse,`Expected '<field> [<Type>] = <property>' in a response block.`,o(s)),t.skipBlock(s.indent);continue}let u=o(s),f=l[2]===void 0?null:r(l[2],{...u,column:u.column+s.content.indexOf(l[2],l[1].length)});f!==null&&i(t,f,s),d.push({kind:`ResponseFieldSyntax`,name:n(l[1]),type:f,source:{kind:`PropertyResponseSourceSyntax`,property:n(l[3]),location:{...u,column:u.column+s.content.lastIndexOf(l[3])}},location:u});let p=t.peekChild(s.indent);p!==void 0&&(t.error(e.InvalidCommandResponse,`A response field cannot have child directives.`,o(p)),t.skipBlock(s.indent))}return{kind:`RecordCommandResponseSyntax`,fields:d,location:u}}export{parseCommandResponse,s as scalarResponsePattern};
|
|
2
2
|
//# sourceMappingURL=CommandResponseParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandResponseParser.js","names":["scalarResponsePattern","pattern","fieldPattern","location","locationOf","line","match","context","DiagnosticCodes","child","sourceOffset","unescapeIdentifier","fields","tryParseProperty","fieldLocation","type","parseTypeRef","reportLegacyOptionalSuffix","nested"],"sources":["../../../../../../Compiler/Parsing/CommandResponseParser.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { CommandResponseSyntax, ResponseFieldSyntax } from '../Syntax/Responses';\nimport { pattern } from '../Text/patterns';\nimport { unescapeIdentifier } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { parseTypeRef, reportLegacyOptionalSuffix, tryParseProperty } from './PropertyLineParser';\nimport { locationOf, SourceLine } from './SourceLine';\n\nexport const scalarResponsePattern = pattern('^returns\\\\s+(@?[A-Za-z_]\\\\w*)$');\nconst fieldPattern = pattern('^(@?[a-z_]\\\\w*)(?:\\\\s+([\\\\w.]+(?:\\\\[\\\\])?(?:\\\\?|\\\\s+optional)?))?\\\\s*=(?!=|>)\\\\s*(@?[a-z_]\\\\w*)$');\n\nexport function parseCommandResponse(context: ParserContext, line: SourceLine): CommandResponseSyntax | null {\n const location = locationOf(line);\n if (line.content !== 'returns') {\n const match = scalarResponsePattern.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidCommandResponse, \"Expected 'returns <property>' or an unconditional 'returns' block.\", location);\n context.skipBlock(line.indent);\n return null;\n }\n const child = context.peekChild(line.indent);\n if (child !== undefined) {\n context.error(DiagnosticCodes.InvalidCommandResponse, 'A scalar response cannot have child directives.', locationOf(child));\n context.skipBlock(line.indent);\n }\n // The operand capture ends the anchored match, so its offset cannot resolve inside 'returns'.\n const sourceOffset = match.index + match[0].length - match[1].length;\n return { kind: 'ScalarCommandResponseSyntax', source: { kind: 'PropertyResponseSourceSyntax', property: unescapeIdentifier(match[1]), location: { ...location, column: location.column + sourceOffset } }, location };\n }\n const fields: ResponseFieldSyntax[] = [];\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const match = fieldPattern.exec(child.content);\n if (match === null) {\n const candidate = tryParseProperty({ ...child, content: child.content.split('=', 1)[0].trimEnd() });\n if (candidate?.isSubject) context.error(DiagnosticCodes.InvalidSubjectOwner, 'The subject modifier is only valid on event properties, not response fields (decision 0008: one data subject per event).', locationOf(child));\n else context.error(DiagnosticCodes.InvalidCommandResponse, \"Expected '<field> [<Type>] = <property>' in a response block.\", locationOf(child));\n context.skipBlock(child.indent);\n continue;\n }\n const fieldLocation = locationOf(child);\n const type = match[2] === undefined ? null : parseTypeRef(match[2], { ...fieldLocation, column: fieldLocation.column + child.content.indexOf(match[2], match[1].length) });\n if (type !== null) reportLegacyOptionalSuffix(context, type, child);\n fields.push({ kind: 'ResponseFieldSyntax', name: unescapeIdentifier(match[1]), type, source: { kind: 'PropertyResponseSourceSyntax', property: unescapeIdentifier(match[3]), location: { ...fieldLocation, column: fieldLocation.column + child.content.lastIndexOf(match[3]) } }, location: fieldLocation });\n const nested = context.peekChild(child.indent);\n if (nested !== undefined) {\n context.error(DiagnosticCodes.InvalidCommandResponse, 'A response field cannot have child directives.', locationOf(nested));\n context.skipBlock(child.indent);\n }\n }\n return { kind: 'RecordCommandResponseSyntax', fields, location };\n}\n"],"mappings":"oXAWA,MAAaA,EAAwBC,EAAQ,gCAAgC,EACvEC,EAAeD,EAAQ,kGAAkG,EAE/H,SAAgB,qBAAqB,EAAwB,EAAgD,CACzG,IAAME,EAAWC,EAAWC,CAAI,EAChC,GAAIA,EAAK,UAAY,UAAW,CAC5B,IAAMC,EAAQN,EAAsB,KAAKK,EAAK,OAAO,EACrD,GAAIC,IAAU,KAGV,OAFAC,EAAQ,MAAMC,EAAgB,uBAAwB,qEAAsEL,CAAQ,EACpII,EAAQ,UAAUF,EAAK,MAAM,EACtB,KAEX,IAAMI,EAAQF,EAAQ,UAAUF,EAAK,MAAM,EACvCI,IAAU,IAAA,KACVF,EAAQ,MAAMC,EAAgB,uBAAwB,kDAAmDJ,EAAWK,CAAK,CAAC,EAC1HF,EAAQ,UAAUF,EA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AAe,OAAQA,EAAc,OAASL,EAAM,QAAQ,YAAYH,EAAM,EAAE,CAAE,CAAE,EAAG,SAAUQ,CAAc,CAAC,EAC5S,IAAMI,EAASX,EAAQ,UAAUE,EAAM,MAAM,EACzCS,IAAW,IAAA,KACXX,EAAQ,MAAMC,EAAgB,uBAAwB,iDAAkDJ,EAAWc,CAAM,CAAC,EAC1HX,EAAQ,UAAUE,EAAM,MAAM,EAEtC,CACA,MAAO,CAAE,KAAM,8BAA+B,SAAQ,UAAS,CACnE"}
|
|
1
|
+
{"version":3,"file":"CommandResponseParser.js","names":["scalarResponsePattern","pattern","fieldPattern","location","locationOf","line","match","context","DiagnosticCodes","child","sourceOffset","unescapeIdentifier","fields","tryParseProperty","fieldLocation","type","parseTypeRef","reportLegacyOptionalSuffix","nested"],"sources":["../../../../../../Compiler/Parsing/CommandResponseParser.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { CommandResponseSyntax, ResponseFieldSyntax } from '../Syntax/Responses';\nimport { pattern } from '../Text/patterns';\nimport { unescapeIdentifier } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { parseTypeRef, reportLegacyOptionalSuffix, tryParseProperty } from './PropertyLineParser';\nimport { locationOf, SourceLine } from './SourceLine';\n\nexport const scalarResponsePattern = pattern('^returns\\\\s+(@?[A-Za-z_]\\\\w*)$');\nconst fieldPattern = pattern('^(@?[a-z_]\\\\w*)(?:\\\\s+([\\\\w.]+(?:\\\\[\\\\])?(?:\\\\?|\\\\s+optional)?))?\\\\s*=(?!=|>)\\\\s*(@?[a-z_]\\\\w*)$');\n\nexport function parseCommandResponse(context: ParserContext, line: SourceLine): CommandResponseSyntax | null {\n const location = locationOf(line);\n if (line.content !== 'returns') {\n const match = scalarResponsePattern.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidCommandResponse, \"Expected 'returns <property>' or an unconditional 'returns' block.\", location);\n context.skipBlock(line.indent);\n return null;\n }\n const child = context.peekChild(line.indent);\n if (child !== undefined) {\n context.error(DiagnosticCodes.InvalidCommandResponse, 'A scalar response cannot have child directives.', locationOf(child));\n context.skipBlock(line.indent);\n }\n // The operand capture ends the anchored match, so its offset cannot resolve inside 'returns'.\n const sourceOffset = match.index + match[0].length - match[1].length;\n return { kind: 'ScalarCommandResponseSyntax', source: { kind: 'PropertyResponseSourceSyntax', property: unescapeIdentifier(match[1]), location: { ...location, column: location.column + sourceOffset } }, location };\n }\n const fields: ResponseFieldSyntax[] = [];\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const match = fieldPattern.exec(child.content);\n if (match === null) {\n const candidate = tryParseProperty({ ...child, content: child.content.split('=', 1)[0].trimEnd() });\n if (candidate?.isSubject) context.error(DiagnosticCodes.InvalidSubjectOwner, 'The subject modifier is only valid on event properties, not response fields (decision 0008: one data subject per event).', locationOf(child));\n else context.error(DiagnosticCodes.InvalidCommandResponse, \"Expected '<field> [<Type>] = <property>' in a response block.\", locationOf(child));\n context.skipBlock(child.indent);\n continue;\n }\n const fieldLocation = locationOf(child);\n const type = match[2] === undefined ? null : parseTypeRef(match[2], { ...fieldLocation, column: fieldLocation.column + child.content.indexOf(match[2], match[1].length) });\n if (type !== null) reportLegacyOptionalSuffix(context, type, child);\n fields.push({ kind: 'ResponseFieldSyntax', name: unescapeIdentifier(match[1]), type, source: { kind: 'PropertyResponseSourceSyntax', property: unescapeIdentifier(match[3]), location: { ...fieldLocation, column: fieldLocation.column + child.content.lastIndexOf(match[3]) } }, location: fieldLocation });\n const nested = context.peekChild(child.indent);\n if (nested !== undefined) {\n context.error(DiagnosticCodes.InvalidCommandResponse, 'A response field cannot have child directives.', locationOf(nested));\n context.skipBlock(child.indent);\n }\n }\n return { kind: 'RecordCommandResponseSyntax', fields, location };\n}\n"],"mappings":"A,oXAWA,MAAaA,EAAwB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CAAC,EAC7IF,EAAQ,UAAUE,EAAM,MAAM,EAC9B,QACJ,CACA,IAAMK,EAAgBV,EAAWK,CAAK,EAChCM,EAAOT,EAAM,KAAO,IAAA,GAAY,KAAOU,EAAaV,EAAM,GAAI,CAAE,GAAGQ,EAAe,OAAQA,EAAc,OAASL,EAAM,QAAQ,QAAQH,EAAM,GAAIA,EAAM,EAAE,CAAC,MAAM,CAAE,CAAC,EACrKS,IAAS,MAAME,EAA2BV,EAASQ,EAAMN,CAAK,EAClEG,EAAO,KAAK,CAAE,KAAM,sBAAuB,KAAMD,EAAmBL,EAAM,EAAE,EAAG,OAAM,OAAQ,CAAE,KAAM,+BAAgC,SAAUK,EAAmBL,EAAM,EAAE,EAAG,SAAU,CAAE,GAAGQ,EAAe,OAAQA,EAAc,OAASL,EAAM,QAAQ,YAAYH,EAAM,EAAE,CAAE,CAAE,EAAG,SAAUQ,CAAc,CAAC,EAC5S,IAAMI,EAASX,EAAQ,UAAUE,EAAM,MAAM,EACzCS,IAAW,IAAA,KACXX,EAAQ,MAAMC,EAAgB,uBAAwB,iDAAkDJ,EAAWc,CAAM,CAAC,EAC1HX,EAAQ,UAAUE,EAAM,MAAM,EAEtC,CACA,MAAO,CAAE,KAAM,8BAA+B,SAAQ,UAAS,CACnE,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandStreamCandidates.js","names":["CommandStreamCandidates","sources","qualifiedTypes","name","parents","source","stream","documentPlacement","documents","languages","types","imports","context","sourceContext","lines","placement","application","parseApplication","type","concept","imported","qualified"],"sources":["../../../../../../Compiler/Parsing/CommandStreamCandidates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { documentPlacement, PlayPlacement } from '../Files/PlayPlacement';\nimport { sourceContext } from './SourceOptionsParser';\nimport { parseApplication } from './ScreenplayParser';\nimport { SourceLine } from './SourceLine';\n\n// One noncommitting real parse per immutable document, without stream candidates. Commands retain\n// legacy properties; the parser owns leaf/block/fence rules. Capture never calls itself recursively.\nexport class CommandStreamCandidates {\n private constructor(private readonly sources: ReadonlyMap<string, readonly (readonly string[])[]>, private readonly qualifiedTypes: ReadonlySet<string>) {}\n\n hasSource(name: string): boolean { return this.sources.has(name); }\n hasPropertyType(name: string): boolean { return this.qualifiedTypes.has(name); }\n hasUniqueStream(source: string, stream: string): boolean {\n const parents = this.sources.get(source);\n return parents?.length === 1 && parents[0].filter(name => name === stream).length === 1;\n }\n\n static capture(documents: Iterable<readonly SourceLine[]>, placement: PlayPlacement = documentPlacement, languages?: ReadonlySet<string>): CommandStreamCandidates {\n return this.capturePlaced([...documents].map(lines => ({ lines, placement })), languages);\n }\n\n static capturePlaced(documents: Iterable<{ readonly lines: readonly SourceLine[]; readonly placement: PlayPlacement }>, languages?: ReadonlySet<string>): CommandStreamCandidates {\n const sources = new Map<string, string[][]>();\n const types = new Set<string>();\n const imports = new Set<string>();\n for (const { lines, placement } of documents) {\n const context = sourceContext(lines, lines[0]?.path, languages);\n context.scope = placement;\n const application = parseApplication(context, lines, placement);\n for (const type of application.types) types.add(type.name);\n for (const concept of application.concepts) types.add(concept.name);\n for (const imported of application.imports) imports.add(imported.qualifiedName);\n for (const source of application.eventSources ?? []) {\n sources.set(source.name, [...sources.get(source.name) ?? [], source.streams.map(stream => stream.name)]);\n }\n }\n const qualified = new Set([...imports].filter(name => types.has(name.substring(name.lastIndexOf('.') + 1))));\n return new CommandStreamCandidates(sources, qualified);\n }\n}\n"],"mappings":"qOAUA,IAAaA,EAAb,MAAa,uBAAwB,CACI,QAA+E,eAApH,YAAoB,EAA+E,EAAsD,CAApH,KAAA,QAAAC,EAA+E,KAAA,eAAAC,CAAsC,CAE1J,UAAU,EAAuB,CAAE,OAAO,KAAK,QAAQ,IAAIC,CAAI,CAAG,CAClE,gBAAgB,EAAuB,CAAE,OAAO,KAAK,eAAe,IAAIA,CAAI,CAAG,CAC/E,gBAAgB,EAAgB,EAAyB,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names":["CommandStreamCandidates","sources","qualifiedTypes","name","parents","source","stream","documentPlacement","documents","languages","types","imports","context","sourceContext","lines","placement","application","parseApplication","type","concept","imported","qualified"],"sources":["../../../../../../Compiler/Parsing/CommandStreamCandidates.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { documentPlacement, PlayPlacement } from '../Files/PlayPlacement';\nimport { sourceContext } from './SourceOptionsParser';\nimport { parseApplication } from './ScreenplayParser';\nimport { SourceLine } from './SourceLine';\n\n// One noncommitting real parse per immutable document, without stream candidates. Commands retain\n// legacy properties; the parser owns leaf/block/fence rules. Capture never calls itself recursively.\nexport class CommandStreamCandidates {\n private constructor(private readonly sources: ReadonlyMap<string, readonly (readonly string[])[]>, private readonly qualifiedTypes: ReadonlySet<string>) {}\n\n hasSource(name: string): boolean { return this.sources.has(name); }\n hasPropertyType(name: string): boolean { return this.qualifiedTypes.has(name); }\n hasUniqueStream(source: string, stream: string): boolean {\n const parents = this.sources.get(source);\n return parents?.length === 1 && parents[0].filter(name => name === stream).length === 1;\n }\n\n static capture(documents: Iterable<readonly SourceLine[]>, placement: PlayPlacement = documentPlacement, languages?: ReadonlySet<string>): CommandStreamCandidates {\n return this.capturePlaced([...documents].map(lines => ({ lines, placement })), languages);\n }\n\n static capturePlaced(documents: Iterable<{ readonly lines: readonly SourceLine[]; readonly placement: PlayPlacement }>, languages?: ReadonlySet<string>): CommandStreamCandidates {\n const sources = new Map<string, string[][]>();\n const types = new Set<string>();\n const imports = new Set<string>();\n for (const { lines, placement } of documents) {\n const context = sourceContext(lines, lines[0]?.path, languages);\n context.scope = placement;\n const application = parseApplication(context, lines, placement);\n for (const type of application.types) types.add(type.name);\n for (const concept of application.concepts) types.add(concept.name);\n for (const imported of application.imports) imports.add(imported.qualifiedName);\n for (const source of application.eventSources ?? []) {\n sources.set(source.name, [...sources.get(source.name) ?? [], source.streams.map(stream => stream.name)]);\n }\n }\n const qualified = new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,EAAO,KAAM,CAAC,GAAGJ,EAAQ,IAAII,EAAO,IAAI,GAAK,CAAC,EAAGA,EAAO,QAAQ,IAAI,GAAUC,EAAO,IAAI,CAAC,CAAC,CAE/G,CACA,IAAMe,EAAY,IAAI,IAAI,CAAC,GAAGV,CAAO,CAAC,CAAC,OAAO,GAAQD,EAAM,IAAIP,EAAK,UAAUA,EAAK,YAAY,GAAG,EAAI,CAAC,CAAC,CAAC,CAAC,EAC3G,OAAO,IAAI,wBAAwBF,EAASoB,CAAS,CACzD,CACJ,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositeStreamIdValidator.js","names":["scalar","context","code","location","parts","stream","part","mappings","mapping","names","validate"],"sources":["../../../../../../Compiler/Parsing/CompositeStreamIdValidator.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { TypeRefSyntax } from '../Syntax/Declarations';\nimport { EventStreamSyntax } from '../Syntax/EventSources';\nimport { PropertyMappingSyntax } from '../Syntax/Expressions';\nimport { ParserContext } from './ParserContext';\n\nexport function validateStreamIdParts(stream: EventStreamSyntax, mappings: readonly PropertyMappingSyntax[], scalar: boolean, location: SourceLocation, code: string, context: ParserContext, validate: (mapping: PropertyMappingSyntax, target: TypeRefSyntax) => void): void {\n if (scalar) {\n context.error(code, 'A composite stream requires a streamId part block, not a scalar mapping.', location);\n return;\n }\n const parts = stream.streamIdParts;\n for (const part of parts.filter(part => !mappings.some(mapping => mapping.property === part.name)))\n context.error(code, `Stream id part '${part.name}' requires a mapping.`, location);\n const names = new Set<string>();\n for (const mapping of mappings) {\n const part = parts.find(part => part.name === mapping.property);\n if (part === undefined) context.error(code, `Unknown stream id part '${mapping.property}'.`, mapping.location);\n else if (names.has(mapping.property)) context.error(code, `Stream id part '${mapping.property}' is mapped more than once.`, mapping.location);\n else {\n names.add(mapping.property);\n validate(mapping, part.type);\n }\n }\n}\n"],"mappings":"qDASA,SAAgB,sBAAsB,EAA2B,EAA4C,EAAiB,EAA0B,EAAc,EAAwB,EAAiF,CAC3Q,GAAIA,EAAQ,CACRC,EAAQ,MAAMC,EAAM,2EAA4EC,CAAQ,EACxG,MACJ,CACA,IAAMC,EAAQC,EAAO,cACrB,IAAK,IAAMC,KAAQF,EAAM,OAAO,GAAQ,CAACG,EAAS,KAAK,GAAWC,EAAQ,WAAaF,EAAK,IAAI,CAAC,EAC7FL,EAAQ,MAAMC,EAAM,mBAAmBI,EAAK,KAAK,uBAAwBH,CAAQ,EACrF,IAAMM,kBAAQ,IAAI,IAClB,IAAK,IAAMD,KAAWD,EAAU,CAC5B,IAAMD,EAAOF,EAAM,KAAK,GAAQE,EAAK,OAASE,EAAQ,QAAQ,EAC1DF,IAAS,IAAA,GAAWL,EAAQ,MAAMC,EAAM,2BAA2BM,EAAQ,SAAS,IAAKA,EAAQ,QAAQ,EACpGC,EAAM,IAAID,EAAQ,QAAQ,EAAGP,EAAQ,MAAMC,EAAM,mBAAmBM,EAAQ,SAAS,6BAA8BA,EAAQ,QAAQ,GAExIC,EAAM,IAAID,EAAQ,QAAQ,EAC1BE,EAASF,EAASF,EAAK,IAAI,EAEnC,CACJ"}
|
|
1
|
+
{"version":3,"file":"CompositeStreamIdValidator.js","names":["scalar","context","code","location","parts","stream","part","mappings","mapping","names","validate"],"sources":["../../../../../../Compiler/Parsing/CompositeStreamIdValidator.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { TypeRefSyntax } from '../Syntax/Declarations';\nimport { EventStreamSyntax } from '../Syntax/EventSources';\nimport { PropertyMappingSyntax } from '../Syntax/Expressions';\nimport { ParserContext } from './ParserContext';\n\nexport function validateStreamIdParts(stream: EventStreamSyntax, mappings: readonly PropertyMappingSyntax[], scalar: boolean, location: SourceLocation, code: string, context: ParserContext, validate: (mapping: PropertyMappingSyntax, target: TypeRefSyntax) => void): void {\n if (scalar) {\n context.error(code, 'A composite stream requires a streamId part block, not a scalar mapping.', location);\n return;\n }\n const parts = stream.streamIdParts;\n for (const part of parts.filter(part => !mappings.some(mapping => mapping.property === part.name)))\n context.error(code, `Stream id part '${part.name}' requires a mapping.`, location);\n const names = new Set<string>();\n for (const mapping of mappings) {\n const part = parts.find(part => part.name === mapping.property);\n if (part === undefined) context.error(code, `Unknown stream id part '${mapping.property}'.`, mapping.location);\n else if (names.has(mapping.property)) context.error(code, `Stream id part '${mapping.property}' is mapped more than once.`, mapping.location);\n else {\n names.add(mapping.property);\n validate(mapping, part.type);\n }\n }\n}\n"],"mappings":"A,qDASA,SAAgB,sBAAsB,EAA2B,EAA4C,EAAiB,EAA0B,EAAc,EAAwB,EAAiF,CAC3Q,GAAIA,EAAQ,CACRC,EAAQ,MAAMC,EAAM,2EAA4EC,CAAQ,EACxG,MACJ,CACA,IAAMC,EAAQC,EAAO,cACrB,IAAK,IAAMC,KAAQF,EAAM,OAAO,GAAQ,CAACG,EAAS,KAAK,GAAWC,EAAQ,WAAaF,EAAK,IAAI,CAAC,EAC7FL,EAAQ,MAAMC,EAAM,mBAAmBI,EAAK,KAAK,uBAAwBH,CAAQ,EACrF,IAAMM,kBAAQ,IAAI,IAClB,IAAK,IAAMD,KAAWD,EAAU,CAC5B,IAAMD,EAAOF,EAAM,KAAK,GAAQE,EAAK,OAASE,EAAQ,QAAQ,EAC1DF,IAAS,IAAA,GAAWL,EAAQ,MAAMC,EAAM,2BAA2BM,EAAQ,SAAS,IAAKA,EAAQ,QAAQ,EACpGC,EAAM,IAAID,EAAQ,QAAQ,EAAGP,EAAQ,MAAMC,EAAM,mBAAmBM,EAAQ,SAAS,6BAA8BA,EAAQ,QAAQ,GAExIC,EAAM,IAAID,EAAQ,QAAQ,EAC1BE,EAASF,EAASF,EAAK,IAAI,EAEnC,CACJ,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{stringBodyPattern as t,unescapeString as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{stringBodyPattern as t,unescapeString as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{parseMappingSource as i}from"./ExpressionParser.js";import{locationOf as a}from"./SourceLine.js";import{parseStructuredValue as o,tryParseStructuredMapping as s}from"./StructuredBlockParser.js";const c=`(?:([A-Za-z_]\\w*)|"(${t})")\\.(\\w+(?:\\.\\w+)*)`,l=r(`^exposure\\s+for\\s+([A-Za-z_]\\w*)$`),u=r(`^instance\\s+([A-Za-z_]\\w*)$`),d=r(`^property\\s+${c}(?:\\s+label\\s+"(${t})")?(?:\\s+operations\\s+([\\w-]+(?:\\s*,\\s*[\\w-]+)*))?(?:\\s+fields\\s+(\\w+(?:\\s*,\\s*\\w+)*))?(?:\\s+reexposes\\s+([A-Za-z_]\\w*))?$`),f=r(`^set\\s+${c}\\s*=\\s*(.+)$`),p=r(`^set\\s+${c}(?:\\s+(none|empty))?$`),m=r(`^items\\s+${c}$`),h=r(`^item\\s+(?:([A-Za-z_][\\w-]*)|"(${t})")$`),g=r(`^([A-Za-z_]\\w*)\\s*=\\s*(.+)$`),_=[`add`,`remove`,`reorder`,`edit-fields`],reference=(e,t)=>e[t]??n(e[t+1]),list=e=>e.trim()===`none`?[]:e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0);function parseExposure(t,n){let r=l.exec(n.content);r===null&&t.error(e.InvalidExposureDeclaration,`Invalid exposure declaration '${n.content}' - expected 'exposure for <Owner>'`,a(n));let i=[];for(let e=t.peekChild(n.indent);e!==void 0;e=t.peekChild(n.indent)){t.reader.takeSignificant();let n=parseExposedProperty(t,e);n!==void 0&&i.push(n)}return{kind:`ExposureSyntax`,owner:r?.[1]??n.content,properties:i,location:a(n)}}function parseInstance(t,n){let r=u.exec(n.content);r===null&&t.error(e.InvalidInstanceContribution,`Invalid instance declaration '${n.content}' - expected 'instance <Screen or Template>'`,a(n));let i=[];for(let e=t.peekChild(n.indent);e!==void 0;e=t.peekChild(n.indent)){t.reader.takeSignificant();let n=parseContribution(t,e);n!==void 0&&i.push(n)}return{kind:`InstanceContributionsSyntax`,instance:r?.[1]??n.content,contributions:i,location:a(n)}}function parseExposedProperty(t,r){let i=d.exec(r.content);if(i===null){t.error(e.InvalidExposureDeclaration,`Invalid exposed property '${r.content}' - expected 'property <component>.<path> [label "<text>"] [operations <add|remove|reorder|edit-fields>, ...] [fields <field>, ...] [reexposes <Owner>]'`,a(r));return}let o=i[5]===void 0?[]:list(i[5]),s=o.find(e=>!_.includes(e));if(s!==void 0)t.error(e.InvalidExposureDeclaration,`Unknown collection operation '${s}' - expected add, remove, reorder, edit-fields or none`,a(r));else return{kind:`ExposedPropertySyntax`,component:reference(i,1),path:i[3],label:i[4]===void 0?null:n(i[4]),isCollection:i[5]!==void 0,operations:o,restrictsFields:i[6]!==void 0,editableFields:i[6]===void 0?[]:list(i[6]),reExposes:i[7]??null,location:a(r)}}function parseContribution(t,n){let r=f.exec(n.content);if(r!==null)return t.skipBlock(n.indent),{kind:`InstanceContributionSyntax`,component:reference(r,1),path:r[3],value:i(r[4],a(n),t),items:[],location:a(n)};let s=p.exec(n.content);if(s!==null)return{kind:`InstanceContributionSyntax`,component:reference(s,1),path:s[3],value:o(t,n,s[4]?.trim()),items:[],location:a(n)};let c=m.exec(n.content);if(c!==null){let e=[];for(let r=t.peekChild(n.indent);r!==void 0;r=t.peekChild(n.indent)){t.reader.takeSignificant();let n=parseItem(t,r);n!==void 0&&e.push(n)}return{kind:`InstanceContributionSyntax`,component:reference(c,1),path:c[3],value:null,items:e,location:a(n)}}t.error(e.InvalidInstanceContribution,`Invalid instance contribution '${n.content}' - expected 'set <component>.<path> = <value>' or 'items <component>.<path>'`,a(n)),t.skipBlock(n.indent)}function parseItem(t,n){let r=h.exec(n.content);if(r===null){t.error(e.InvalidInstanceContribution,`Invalid contributed item '${n.content}' - expected 'item <id>'`,a(n)),t.skipBlock(n.indent);return}let o=[];for(let r=t.peekChild(n.indent);r!==void 0;r=t.peekChild(n.indent)){t.reader.takeSignificant();let n=g.exec(r.content),c=n===null?s(t,r):void 0;c===void 0?n===null?(t.error(e.InvalidInstanceContribution,`Invalid item value '${r.content}' - expected '<field> = <value>'`,a(r)),t.skipBlock(r.indent)):o.push({kind:`ContributedItemValueSyntax`,field:n[1],value:i(n[2],a(r),t),location:a(r)}):o.push({kind:`ContributedItemValueSyntax`,field:c.property,value:c.source,location:a(r)})}return{kind:`ContributedItemSyntax`,id:reference(r,1),values:o,location:a(n)}}export{parseExposure,parseInstance};
|
|
2
2
|
//# sourceMappingURL=CompositionParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompositionParser.js","names":["component","stringBodyPattern","exposureHeader","pattern","instanceHeader","exposedProperty","setPattern","setBlockPattern","itemsPattern","itemPattern","itemValuePattern","operations","match","group","unescapeString","text","entry","header","context","DiagnosticCodes","locationOf","properties","line","property","contributions","contribution","granted","unknown","operation","set","parseMappingSource","setBlock","parseStructuredValue","items","parsed","child","item","values","value","structured","tryParseStructuredMapping"],"sources":["../../../../../../Compiler/Parsing/CompositionParser.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { ContributedItemSyntax, ContributedItemValueSyntax, ExposedPropertySyntax, ExposureSyntax, InstanceContributionSyntax, InstanceContributionsSyntax } from '../Syntax/CompositionSyntax';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { pattern } from '../Text/patterns';\nimport { parseMappingSource } from './ExpressionParser';\nimport { ParserContext } from './ParserContext';\nimport { locationOf, SourceLine } from './SourceLine';\nimport { parseStructuredValue, StructuredMarker, tryParseStructuredMapping } from './StructuredBlockParser';\n\nconst component = `(?:([A-Za-z_]\\\\w*)|\"(${stringBodyPattern})\")\\\\.(\\\\w+(?:\\\\.\\\\w+)*)`;\nconst exposureHeader = pattern('^exposure\\\\s+for\\\\s+([A-Za-z_]\\\\w*)$');\nconst instanceHeader = pattern('^instance\\\\s+([A-Za-z_]\\\\w*)$');\nconst exposedProperty = pattern(`^property\\\\s+${component}(?:\\\\s+label\\\\s+\"(${stringBodyPattern})\")?(?:\\\\s+operations\\\\s+([\\\\w-]+(?:\\\\s*,\\\\s*[\\\\w-]+)*))?(?:\\\\s+fields\\\\s+(\\\\w+(?:\\\\s*,\\\\s*\\\\w+)*))?(?:\\\\s+reexposes\\\\s+([A-Za-z_]\\\\w*))?$`);\nconst setPattern = pattern(`^set\\\\s+${component}\\\\s*=\\\\s*(.+)$`);\nconst setBlockPattern = pattern(`^set\\\\s+${component}(?:\\\\s+(none|empty))?$`);\nconst itemsPattern = pattern(`^items\\\\s+${component}$`);\nconst itemPattern = pattern(`^item\\\\s+(?:([A-Za-z_][\\\\w-]*)|\"(${stringBodyPattern})\")$`);\nconst itemValuePattern = pattern('^([A-Za-z_]\\\\w*)\\\\s*=\\\\s*(.+)$');\nconst operations = ['add', 'remove', 'reorder', 'edit-fields'];\nconst exposedPropertyShape = '\\'property <component>.<path> [label \"<text>\"] [operations <add|remove|reorder|edit-fields>, ...] [fields <field>, ...] [reexposes <Owner>]\\'';\n\nconst reference = (match: RegExpExecArray, group: number): string => match[group] ?? unescapeString(match[group + 1]);\nconst list = (text: string): string[] => text.trim() === 'none' ? [] : text.split(',').map(entry => entry.trim()).filter(entry => entry.length > 0);\n\n// 'exposure for <Owner>' - the port of the C# CompositionParser.ParseExposure.\nexport function parseExposure(context: ParserContext, header: SourceLine): ExposureSyntax {\n const match = exposureHeader.exec(header.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidExposureDeclaration, `Invalid exposure declaration '${header.content}' - expected 'exposure for <Owner>'`, locationOf(header));\n }\n const properties: ExposedPropertySyntax[] = [];\n for (let line = context.peekChild(header.indent); line !== undefined; line = context.peekChild(header.indent)) {\n context.reader.takeSignificant();\n const property = parseExposedProperty(context, line);\n if (property !== undefined) properties.push(property);\n }\n return { kind: 'ExposureSyntax', owner: match?.[1] ?? header.content, properties, location: locationOf(header) };\n}\n\n// 'instance <Instance>' - the port of the C# CompositionParser.ParseInstance.\nexport function parseInstance(context: ParserContext, header: SourceLine): InstanceContributionsSyntax {\n const match = instanceHeader.exec(header.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidInstanceContribution, `Invalid instance declaration '${header.content}' - expected 'instance <Screen or Template>'`, locationOf(header));\n }\n const contributions: InstanceContributionSyntax[] = [];\n for (let line = context.peekChild(header.indent); line !== undefined; line = context.peekChild(header.indent)) {\n context.reader.takeSignificant();\n const contribution = parseContribution(context, line);\n if (contribution !== undefined) contributions.push(contribution);\n }\n return { kind: 'InstanceContributionsSyntax', instance: match?.[1] ?? header.content, contributions, location: locationOf(header) };\n}\n\nfunction parseExposedProperty(context: ParserContext, line: SourceLine): ExposedPropertySyntax | undefined {\n const match = exposedProperty.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidExposureDeclaration, `Invalid exposed property '${line.content}' - expected ${exposedPropertyShape}`, locationOf(line));\n return undefined;\n }\n const granted = match[5] === undefined ? [] : list(match[5]);\n const unknown = granted.find(operation => !operations.includes(operation));\n if (unknown !== undefined) {\n context.error(DiagnosticCodes.InvalidExposureDeclaration, `Unknown collection operation '${unknown}' - expected add, remove, reorder, edit-fields or none`, locationOf(line));\n return undefined;\n }\n return {\n kind: 'ExposedPropertySyntax',\n component: reference(match, 1),\n path: match[3],\n label: match[4] === undefined ? null : unescapeString(match[4]),\n isCollection: match[5] !== undefined,\n operations: granted,\n restrictsFields: match[6] !== undefined,\n editableFields: match[6] === undefined ? [] : list(match[6]),\n reExposes: match[7] ?? null,\n location: locationOf(line)\n };\n}\n\nfunction parseContribution(context: ParserContext, line: SourceLine): InstanceContributionSyntax | undefined {\n const set = setPattern.exec(line.content);\n if (set !== null) {\n context.skipBlock(line.indent);\n return { kind: 'InstanceContributionSyntax', component: reference(set, 1), path: set[3], value: parseMappingSource(set[4], locationOf(line), context), items: [], location: locationOf(line) };\n }\n const setBlock = setBlockPattern.exec(line.content);\n if (setBlock !== null) {\n return { kind: 'InstanceContributionSyntax', component: reference(setBlock, 1), path: setBlock[3], value: parseStructuredValue(context, line, setBlock[4]?.trim() as StructuredMarker), items: [], location: locationOf(line) };\n }\n const items = itemsPattern.exec(line.content);\n if (items !== null) {\n const parsed: ContributedItemSyntax[] = [];\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const item = parseItem(context, child);\n if (item !== undefined) parsed.push(item);\n }\n return { kind: 'InstanceContributionSyntax', component: reference(items, 1), path: items[3], value: null, items: parsed, location: locationOf(line) };\n }\n context.error(DiagnosticCodes.InvalidInstanceContribution, `Invalid instance contribution '${line.content}' - expected 'set <component>.<path> = <value>' or 'items <component>.<path>'`, locationOf(line));\n context.skipBlock(line.indent);\n return undefined;\n}\n\nfunction parseItem(context: ParserContext, line: SourceLine): ContributedItemSyntax | undefined {\n const match = itemPattern.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidInstanceContribution, `Invalid contributed item '${line.content}' - expected 'item <id>'`, locationOf(line));\n context.skipBlock(line.indent);\n return undefined;\n }\n const values: ContributedItemValueSyntax[] = [];\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const value = itemValuePattern.exec(child.content);\n const structured = value === null ? tryParseStructuredMapping(context, child) : undefined;\n if (structured !== undefined) {\n values.push({ kind: 'ContributedItemValueSyntax', field: structured.property, value: structured.source, location: locationOf(child) });\n continue;\n }\n if (value === null) {\n context.error(DiagnosticCodes.InvalidInstanceContribution, `Invalid item value '${child.content}' - expected '<field> = <value>'`, locationOf(child));\n context.skipBlock(child.indent);\n continue;\n }\n values.push({ kind: 'ContributedItemValueSyntax', field: value[1], value: parseMappingSource(value[2], locationOf(child), context), location: locationOf(child) });\n }\n return { kind: 'ContributedItemSyntax', id: reference(match, 1), values, location: locationOf(line) };\n}\n"],"mappings":"icAYA,MAAMA,EAAY,wBAAwBC,EAAkB,0BACtDC,EAAiBC,EAAQ,sCAAsC,EAC/DC,EAAiBD,EAAQ,+BAA+B,EACxDE,EAAkBF,EAAQ,gBAAgBH,EAAU,oBAAoBC,EAAkB,2IAA2I,EACrOK,EAAaH,EAAQ,WAAWH,EAAU,eAAe,EACzDO,EAAkBJ,EAAQ,WAAWH,EAAU,uBAAuB,EACtEQ,EAAeL,EAAQ,aAAaH,EAAU,EAAE,EAChDS,EAAcN,EAAQ,oCAAoCF,EAAkB,KAAK,EACjFS,EAAmBP,EAAQ,gCAAgC,EAC3DQ,EAAa,CAAC,MAAO,SAAU,UAAW,aAAa,EAGvD,WAAa,EAAwB,IAA0BC,EAAMC,IAAUC,EAAeF,EAAMC,EAAQ,EAAE,EAC9G,KAAQ,GAA2BE,EAAK,KAAK,IAAM,OAAS,CAAC,EAAIA,EAAK,MAAM,GAAG,CAAC,CAAC,IAAI,GAASC,EAAM,KAAK,CAAC,CAAC,CAAC,OAAO,GAASA,EAAM,OAAS,CAAC,EAGlJ,SAAgB,cAAc,EAAwB,EAAoC,CACtF,IAAMJ,EAAQV,EAAe,KAAKe,EAAO,OAAO,EAC5CL,IAAU,MACVM,EAAQ,MAAMC,EAAgB,2BAA4B,iCAAiCF,EAAO,QAAQ,qCAAsCG,EAAWH,CAAM,CAAC,EAEtK,IAAMI,EAAsC,CAAC,EAC7C,IAAK,IAAIC,EAAOJ,EAAQ,UAAUD,EAAO,MAAM,EAAGK,IAAS,IAAA,GAAW,EAAOJ,EAAQ,UAAUD,EAAO,MAAM,EAAG,CAC3GC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A8B,MAAOE,EAAW,SAAU,MAAOA,EAAW,OAAQ,SAAUnB,EAAWe,CAAK,CAAE,CAAC,CAS7I,CACA,MAAO,CAAE,KAAM,wBAAyB,GAAI,UAAUvB,EAAO,CAAC,EAAG,SAAQ,SAAUQ,EAAWE,CAAI,CAAE,CACxG"}
|
|
1
|
+
{"version":3,"file":"CompositionParser.js","names":["component","stringBodyPattern","exposureHeader","pattern","instanceHeader","exposedProperty","setPattern","setBlockPattern","itemsPattern","itemPattern","itemValuePattern","operations","match","group","unescapeString","text","entry","header","context","DiagnosticCodes","locationOf","properties","line","property","contributions","contribution","granted","unknown","operation","set","parseMappingSource","setBlock","parseStructuredValue","items","parsed","child","item","values","value","structured","tryParseStructuredMapping"],"sources":["../../../../../../Compiler/Parsing/CompositionParser.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { ContributedItemSyntax, ContributedItemValueSyntax, ExposedPropertySyntax, ExposureSyntax, InstanceContributionSyntax, InstanceContributionsSyntax } from '../Syntax/CompositionSyntax';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { pattern } from '../Text/patterns';\nimport { parseMappingSource } from './ExpressionParser';\nimport { ParserContext } from './ParserContext';\nimport { locationOf, SourceLine } from './SourceLine';\nimport { parseStructuredValue, StructuredMarker, tryParseStructuredMapping } from './StructuredBlockParser';\n\nconst component = `(?:([A-Za-z_]\\\\w*)|\"(${stringBodyPattern})\")\\\\.(\\\\w+(?:\\\\.\\\\w+)*)`;\nconst exposureHeader = pattern('^exposure\\\\s+for\\\\s+([A-Za-z_]\\\\w*)$');\nconst instanceHeader = pattern('^instance\\\\s+([A-Za-z_]\\\\w*)$');\nconst exposedProperty = pattern(`^property\\\\s+${component}(?:\\\\s+label\\\\s+\"(${stringBodyPattern})\")?(?:\\\\s+operations\\\\s+([\\\\w-]+(?:\\\\s*,\\\\s*[\\\\w-]+)*))?(?:\\\\s+fields\\\\s+(\\\\w+(?:\\\\s*,\\\\s*\\\\w+)*))?(?:\\\\s+reexposes\\\\s+([A-Za-z_]\\\\w*))?$`);\nconst setPattern = pattern(`^set\\\\s+${component}\\\\s*=\\\\s*(.+)$`);\nconst setBlockPattern = pattern(`^set\\\\s+${component}(?:\\\\s+(none|empty))?$`);\nconst itemsPattern = pattern(`^items\\\\s+${component}$`);\nconst itemPattern = pattern(`^item\\\\s+(?:([A-Za-z_][\\\\w-]*)|\"(${stringBodyPattern})\")$`);\nconst itemValuePattern = pattern('^([A-Za-z_]\\\\w*)\\\\s*=\\\\s*(.+)$');\nconst operations = ['add', 'remove', 'reorder', 'edit-fields'];\nconst exposedPropertyShape = '\\'property <component>.<path> [label \"<text>\"] [operations <add|remove|reorder|edit-fields>, ...] [fields <field>, ...] [reexposes <Owner>]\\'';\n\nconst reference = (match: RegExpExecArray, group: number): string => match[group] ?? unescapeString(match[group + 1]);\nconst list = (text: string): string[] => text.trim() === 'none' ? [] : text.split(',').map(entry => entry.trim()).filter(entry => entry.length > 0);\n\n// 'exposure for <Owner>' - the port of the C# CompositionParser.ParseExposure.\nexport function parseExposure(context: ParserContext, header: SourceLine): ExposureSyntax {\n const match = exposureHeader.exec(header.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidExposureDeclaration, `Invalid exposure declaration '${header.content}' - expected 'exposure for <Owner>'`, locationOf(header));\n }\n const properties: ExposedPropertySyntax[] = [];\n for (let line = context.peekChild(header.indent); line !== undefined; line = context.peekChild(header.indent)) {\n context.reader.takeSignificant();\n const property = parseExposedProperty(context, line);\n if (property !== undefined) properties.push(property);\n }\n return { kind: 'ExposureSyntax', owner: match?.[1] ?? header.content, properties, location: locationOf(header) };\n}\n\n// 'instance <Instance>' - the port of the C# CompositionParser.ParseInstance.\nexport function parseInstance(context: ParserContext, header: SourceLine): InstanceContributionsSyntax {\n const match = instanceHeader.exec(header.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidInstanceContribution, `Invalid instance declaration '${header.content}' - expected 'instance <Screen or Template>'`, locationOf(header));\n }\n const contributions: InstanceContributionSyntax[] = [];\n for (let line = context.peekChild(header.indent); line !== undefined; line = context.peekChild(header.indent)) {\n context.reader.takeSignificant();\n const contribution = parseContribution(context, line);\n if (contribution !== undefined) contributions.push(contribution);\n }\n return { kind: 'InstanceContributionsSyntax', instance: match?.[1] ?? header.content, contributions, location: locationOf(header) };\n}\n\nfunction parseExposedProperty(context: ParserContext, line: SourceLine): ExposedPropertySyntax | undefined {\n const match = exposedProperty.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidExposureDeclaration, `Invalid exposed property '${line.content}' - expected ${exposedPropertyShape}`, locationOf(line));\n return undefined;\n }\n const granted = match[5] === undefined ? [] : list(match[5]);\n const unknown = granted.find(operation => !operations.includes(operation));\n if (unknown !== undefined) {\n context.error(DiagnosticCodes.InvalidExposureDeclaration, `Unknown collection operation '${unknown}' - expected add, remove, reorder, edit-fields or none`, locationOf(line));\n return undefined;\n }\n return {\n kind: 'ExposedPropertySyntax',\n component: reference(match, 1),\n path: match[3],\n label: match[4] === undefined ? null : unescapeString(match[4]),\n isCollection: match[5] !== undefined,\n operations: granted,\n restrictsFields: match[6] !== undefined,\n editableFields: match[6] === undefined ? [] : list(match[6]),\n reExposes: match[7] ?? null,\n location: locationOf(line)\n };\n}\n\nfunction parseContribution(context: ParserContext, line: SourceLine): InstanceContributionSyntax | undefined {\n const set = setPattern.exec(line.content);\n if (set !== null) {\n context.skipBlock(line.indent);\n return { kind: 'InstanceContributionSyntax', component: reference(set, 1), path: set[3], value: parseMappingSource(set[4], locationOf(line), context), items: [], location: locationOf(line) };\n }\n const setBlock = setBlockPattern.exec(line.content);\n if (setBlock !== null) {\n return { kind: 'InstanceContributionSyntax', component: reference(setBlock, 1), path: setBlock[3], value: parseStructuredValue(context, line, setBlock[4]?.trim() as StructuredMarker), items: [], location: locationOf(line) };\n }\n const items = itemsPattern.exec(line.content);\n if (items !== null) {\n const parsed: ContributedItemSyntax[] = [];\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const item = parseItem(context, child);\n if (item !== undefined) parsed.push(item);\n }\n return { kind: 'InstanceContributionSyntax', component: reference(items, 1), path: items[3], value: null, items: parsed, location: locationOf(line) };\n }\n context.error(DiagnosticCodes.InvalidInstanceContribution, `Invalid instance contribution '${line.content}' - expected 'set <component>.<path> = <value>' or 'items <component>.<path>'`, locationOf(line));\n context.skipBlock(line.indent);\n return undefined;\n}\n\nfunction parseItem(context: ParserContext, line: SourceLine): ContributedItemSyntax | undefined {\n const match = itemPattern.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidInstanceContribution, `Invalid contributed item '${line.content}' - expected 'item <id>'`, locationOf(line));\n context.skipBlock(line.indent);\n return undefined;\n }\n const values: ContributedItemValueSyntax[] = [];\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const value = itemValuePattern.exec(child.content);\n const structured = value === null ? tryParseStructuredMapping(context, child) : undefined;\n if (structured !== undefined) {\n values.push({ kind: 'ContributedItemValueSyntax', field: structured.property, value: structured.source, location: locationOf(child) });\n continue;\n }\n if (value === null) {\n context.error(DiagnosticCodes.InvalidInstanceContribution, `Invalid item value '${child.content}' - expected '<field> = <value>'`, locationOf(child));\n context.skipBlock(child.indent);\n continue;\n }\n values.push({ kind: 'ContributedItemValueSyntax', field: value[1], value: parseMappingSource(value[2], locationOf(child), context), location: locationOf(child) });\n }\n return { kind: 'ContributedItemSyntax', id: reference(match, 1), values, location: locationOf(line) };\n}\n"],"mappings":"A,icAYA,MAAMA,EAAY,wBAAwBC,EAAkB,0BACtDC,EAAiBC,EAAQ,sCAAsC,EAC/DC,EAAiBD,EAAQ,+BAA+B,EACxDE,EAAkBF,EAAQ,gBAAgBH,EAAU,oBAAoBC,EAAkB,2IAA2I,EACrOK,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OAAO,EAC3C,GAAIV,IAAU,KAAM,CAChBM,EAAQ,MAAMC,EAAgB,4BAA6B,6BAA6BG,EAAK,QAAQ,0BAA2BF,EAAWE,CAAI,CAAC,EAChJJ,EAAQ,UAAUI,EAAK,MAAM,EAC7B,MACJ,CACA,IAAMe,EAAuC,CAAC,EAC9C,IAAK,IAAIF,EAAQjB,EAAQ,UAAUI,EAAK,MAAM,EAAGa,IAAU,IAAA,GAAW,EAAQjB,EAAQ,UAAUI,EAAK,MAAM,EAAG,CAC1GJ,EAAQ,OAAO,gBAAgB,EAC/B,IAAMoB,EAAQ5B,EAAiB,KAAKyB,EAAM,OAAO,EAC3CI,EAAaD,IAAU,KAAOE,EAA0BtB,EAASiB,CAAK,EAAI,IAAA,GAC5EI,IAAe,IAAA,GAIfD,IAAU,MACVpB,EAAQ,MAAMC,EAAgB,4BAA6B,uBAAuBgB,EAAM,QAAQ,kCAAmCf,EAAWe,CAAK,CAAC,EACpJjB,EAAQ,UAAUiB,EAAM,MAAM,GAGlCE,EAAO,KAAK,CAAE,KAAM,6BAA8B,MAAOC,EAAM,GAAI,MAAOR,EAAmBQ,EAAM,GAAIlB,EAAWe,CAAK,EAAGjB,CAAO,EAAG,SAAUE,EAAWe,CAAK,CAAE,CAAC,EAR7JE,EAAO,KAAK,CAAE,KAAM,6BAA8B,MAAOE,EAAW,SAAU,MAAOA,EAAW,OAAQ,SAAUnB,EAAWe,CAAK,CAAE,CAAC,CAS7I,CACA,MAAO,CAAE,KAAM,wBAAyB,GAAI,UAAUvB,EAAO,CAAC,EAAG,SAAQ,SAAUQ,EAAWE,CAAI,CAAE,CACxG,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{stringBodyPattern as t,unescapeString as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{locationOf as i}from"./SourceLine.js";const a=[`racialOrEthnicOrigin`,`politicalOpinions`,`religiousOrPhilosophicalBeliefs`,`tradeUnionMembership`,`genetic`,`biometric`,`health`,`sexLifeOrSexualOrientation`],o=r(`^(@?[a-z_]\\w*)\\s+(reason|scope|special|criminal)(?:\\s+(.*))?$`),s=r(`^"(${t})"$`);function complianceWireName(e){let t=e.replace(/^@/,``);return t===`personal`?`pii`:t===`secret`?`sensitive`:t}function canonicalComplianceName(e){let t=complianceWireName(e);return t===`sensitive`?`secret`:t}function parseComplianceMarkers(t,n,r,a){let o=a.trim().split(/\s+/).filter(e=>e.length>0);reportLegacy(t,n,o);let s=[],c=/* @__PURE__ */ new Map,l=!1;for(let a of o){let o=complianceWireName(a);
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{stringBodyPattern as t,unescapeString as n}from"../Text/StringLiteral.js";import{pattern as r}from"../Text/patterns.js";import{locationOf as i}from"./SourceLine.js";const a=[`racialOrEthnicOrigin`,`politicalOpinions`,`religiousOrPhilosophicalBeliefs`,`tradeUnionMembership`,`genetic`,`biometric`,`health`,`sexLifeOrSexualOrientation`],o=r(`^(@?[a-z_]\\w*)\\s+(reason|scope|special|criminal)(?:\\s+(.*))?$`),s=r(`^"(${t})"$`);function complianceWireName(e){let t=e.replace(/^@/,``);return t===`personal`?`pii`:t===`secret`?`sensitive`:t}function canonicalComplianceName(e){let t=complianceWireName(e);return t===`sensitive`?`secret`:t}function parseComplianceMarkers(t,n,r,a){let o=a.trim().split(/\s+/).filter(e=>e.length>0);reportLegacy(t,n,o);let s=[],c=/* @__PURE__ */ new Map,l=!1;for(let a of o){let o=complianceWireName(a);[`pii`,`sensitive`].includes(o)&&a!==`@personal`&&a!==`@secret`||t.error(e.UnknownComplianceMarker,`Unknown concept marker '${a}' - expected pii, personal or secret`,i(n));let u=c.get(o);if(u!==void 0){if(!l){let o=canonicalComplianceName(a),s=u===a?``:` - '${a===o?u:a}' is the same marker as '${o}'`;t.warning(e.DuplicateComplianceMarker,`Concept '${r}' repeats the '${o}' marker${s} - remove the duplicate`,i(n)),l=!0}}else c.set(o,a),s.push({kind:`ConceptAttributeSyntax`,name:o,reason:null,scope:null,specialCategory:null,criminal:!1,location:i(n)})}return s}function parseComplianceDirective(t,r,c,l){let u=o.exec(r.content);if(u===null)return!1;let[,d,f]=u,p=u[3]??``,m=complianceWireName(d),h=canonicalComplianceName(d);if(reportLegacy(t,r,[d]),![`pii`,`sensitive`].includes(m)||d===`@personal`||d===`@secret`)return t.error(e.UnknownComplianceMarker,`Unknown concept marker '${d}' - expected pii, personal or secret`,i(r)),!0;let g=l.findIndex(e=>e.name===m);if(g<0)return t.error(e.AttributeReasonWithoutAttribute,`Concept '${c}' declares '${h} ${f}' without the marker - write 'concept ${c} : <Type> ${h}'`,i(r)),!0;let _=l[g];switch(f){case`reason`:{let a=s.exec(p);return a===null?(t.error(e.UnknownConceptDirective,`Invalid '${h} reason' - expected '${h} reason "<text>"'`,i(r)),!0):_.reason===null?(l[g]={..._,reason:n(a[1])},!0):(t.error(e.DuplicateAttributeReason,`Concept '${c}' already declares a reason for '${h}' - at most one is allowed`,i(r)),!0)}case`scope`:return m!==`sensitive`||![`subject`,`namespace`,`global`].includes(p)?(t.error(e.InvalidSecretScope,`Invalid '${h} scope ${p}' - scope belongs to secret and must be subject, namespace or global`,i(r)),!0):_.scope==null?(l[g]={..._,scope:p},l.some(e=>e.name===`pii`)&&t.warning(e.SecretScopeIgnoredForPii,`Concept '${c}' is pii secret - secret scope is ignored because only Chronicle [PII] renders`,i(r)),!0):(t.error(e.DuplicateSecretScope,`Concept '${c}' already declares secret scope - at most one is allowed`,i(r)),!0);case`special`:case`criminal`:return m!==`pii`||(f===`special`?!a.includes(p):p.length>0)?(t.error(e.InvalidPersonalDataQualifier,`Invalid '${h} ${f}${p.length>0?` ${p}`:``}' - expected 'pii criminal' or 'pii special <category>' with category ${a.join(`, `)}`,i(r)),!0):f===`special`&&_.specialCategory!=null?(t.error(e.DuplicateSpecialCategory,`Concept '${c}' already declares pii special - at most one is allowed`,i(r)),!0):(l[g]=f===`special`?{..._,specialCategory:p}:{..._,criminal:!0},!0);default:return!1}}function reportLegacy(t,n,r){r.some(e=>[`@pii`,`sensitive`,`@sensitive`].includes(e))&&t.information(e.LegacyComplianceMarker,`Legacy compliance spelling - use bare pii for personal data and secret for operational secrets; reason text is preserved`,i(n))}export{canonicalComplianceName,complianceWireName,parseComplianceDirective,parseComplianceMarkers,a as specialCategories};
|
|
2
2
|
//# sourceMappingURL=ConceptComplianceParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConceptComplianceParser.js","names":["specialCategories","directivePattern","pattern","reasonPattern","stringBodyPattern","name","marker","markers","text","context","line","attributes","firstMarkers","reported","DiagnosticCodes","locationOf","first","canonical","alias","concept","match","setting","value","index","attribute","reason","unescapeString"],"sources":["../../../../../../Compiler/Parsing/ConceptComplianceParser.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { ConceptAttributeSyntax } from '../Syntax/Declarations';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { pattern } from '../Text/patterns';\nimport { ParserContext } from './ParserContext';\nimport { locationOf, SourceLine } from './SourceLine';\n\nexport const specialCategories = ['racialOrEthnicOrigin', 'politicalOpinions', 'religiousOrPhilosophicalBeliefs', 'tradeUnionMembership', 'genetic', 'biometric', 'health', 'sexLifeOrSexualOrientation'];\nconst directivePattern = pattern('^(@?[a-z_]\\\\w*)\\\\s+(reason|scope|special|criminal)(?:\\\\s+(.*))?$');\nconst reasonPattern = pattern(`^\"(${stringBodyPattern})\"$`);\n\nexport function complianceWireName(marker: string): string {\n const name = marker.replace(/^@/, '');\n return name === 'personal' ? 'pii' : name === 'secret' ? 'sensitive' : name;\n}\n\nexport function canonicalComplianceName(marker: string): string {\n const name = complianceWireName(marker);\n return name === 'sensitive' ? 'secret' : name;\n}\n\nexport function parseComplianceMarkers(context: ParserContext, line: SourceLine, concept: string, text: string): ConceptAttributeSyntax[] {\n const markers = text.trim().split(/\\s+/).filter(marker => marker.length > 0);\n reportLegacy(context, line, markers);\n const attributes: ConceptAttributeSyntax[] = [];\n const firstMarkers = new Map<string, string>();\n let reported = false;\n for (const marker of markers) {\n const name = complianceWireName(marker);\n if (!['pii', 'sensitive'].includes(name) || marker === '@personal' || marker === '@secret') {\n context.error(DiagnosticCodes.UnknownComplianceMarker, `Unknown concept marker '${marker}' - expected pii, personal or secret`, locationOf(line));\n }\n const first = firstMarkers.get(name);\n if (first !== undefined) {\n if (!reported) {\n const canonical = canonicalComplianceName(marker);\n const alias = first === marker ? '' : ` - '${marker === canonical ? first : marker}' is the same marker as '${canonical}'`;\n context.warning(DiagnosticCodes.DuplicateComplianceMarker, `Concept '${concept}' repeats the '${canonical}' marker${alias} - remove the duplicate`, locationOf(line));\n reported = true;\n }\n continue;\n }\n firstMarkers.set(name, marker);\n attributes.push({ kind: 'ConceptAttributeSyntax', name, reason: null, scope: null, specialCategory: null, criminal: false, location: locationOf(line) });\n }\n return attributes;\n}\n\nexport function parseComplianceDirective(context: ParserContext, line: SourceLine, concept: string, attributes: ConceptAttributeSyntax[]): boolean {\n const match = directivePattern.exec(line.content);\n if (match === null) return false;\n const [, marker, setting] = match;\n const value = match[3] ?? '';\n const name = complianceWireName(marker);\n const canonical = canonicalComplianceName(marker);\n reportLegacy(context, line, [marker]);\n if (!['pii', 'sensitive'].includes(name) || marker === '@personal' || marker === '@secret') {\n context.error(DiagnosticCodes.UnknownComplianceMarker, `Unknown concept marker '${marker}' - expected pii, personal or secret`, locationOf(line));\n return true;\n }\n const index = attributes.findIndex(attribute => attribute.name === name);\n if (index < 0) {\n context.error(DiagnosticCodes.AttributeReasonWithoutAttribute, `Concept '${concept}' declares '${canonical} ${setting}' without the marker - write 'concept ${concept} : <Type> ${canonical}'`, locationOf(line));\n return true;\n }\n const attribute = attributes[index];\n switch (setting) {\n case 'reason': {\n const reason = reasonPattern.exec(value);\n if (reason === null) {\n context.error(DiagnosticCodes.UnknownConceptDirective, `Invalid '${canonical} reason' - expected '${canonical} reason \"<text>\"'`, locationOf(line));\n return true;\n }\n if (attribute.reason !== null) {\n context.error(DiagnosticCodes.DuplicateAttributeReason, `Concept '${concept}' already declares a reason for '${canonical}' - at most one is allowed`, locationOf(line));\n return true;\n }\n attributes[index] = { ...attribute, reason: unescapeString(reason[1]) };\n return true;\n }\n case 'scope':\n if (name !== 'sensitive' || !['subject', 'namespace', 'global'].includes(value)) {\n context.error(DiagnosticCodes.InvalidSecretScope, `Invalid '${canonical} scope ${value}' - scope belongs to secret and must be subject, namespace or global`, locationOf(line));\n return true;\n }\n if (attribute.scope != null) {\n context.error(DiagnosticCodes.DuplicateSecretScope, `Concept '${concept}' already declares secret scope - at most one is allowed`, locationOf(line));\n return true;\n }\n attributes[index] = { ...attribute, scope: value };\n if (attributes.some(attribute => attribute.name === 'pii')) {\n context.warning(DiagnosticCodes.SecretScopeIgnoredForPii, `Concept '${concept}' is pii secret - secret scope is ignored because only Chronicle [PII] renders`, locationOf(line));\n }\n return true;\n case 'special':\n case 'criminal':\n if (name !== 'pii' || (setting === 'special' ? !specialCategories.includes(value) : value.length > 0)) {\n context.error(DiagnosticCodes.InvalidPersonalDataQualifier, `Invalid '${canonical} ${setting}${value.length > 0 ? ` ${value}` : ''}' - expected 'pii criminal' or 'pii special <category>' with category ${specialCategories.join(', ')}`, locationOf(line));\n return true;\n }\n if (setting === 'special' && attribute.specialCategory != null) {\n context.error(DiagnosticCodes.DuplicateSpecialCategory, `Concept '${concept}' already declares pii special - at most one is allowed`, locationOf(line));\n return true;\n }\n attributes[index] = setting === 'special' ? { ...attribute, specialCategory: value } : { ...attribute, criminal: true };\n return true;\n default:\n return false;\n }\n}\n\nfunction reportLegacy(context: ParserContext, line: SourceLine, markers: readonly string[]): void {\n if (markers.some(marker => ['@pii', 'sensitive', '@sensitive'].includes(marker))) {\n context.information(DiagnosticCodes.LegacyComplianceMarker, 'Legacy compliance spelling - use bare pii for personal data and secret for operational secrets; reason text is preserved', locationOf(line));\n }\n}\n"],"mappings":"qSAUA,MAAaA,EAAoB,CAAC,uBAAwB,oBAAqB,kCAAmC,uBAAwB,UAAW,YAAa,SAAU,4BAA4B,EAClMC,EAAmBC,EAAQ,kEAAkE,EAC7FC,EAAgBD,EAAQ,MAAME,EAAkB,IAAI,EAE1D,SAAgB,mBAAmB,EAAwB,CACvD,IAAMC,EAAOC,EAAO,QAAQ,KAAM,EAAE,EACpC,OAAOD,IAAS,WAAa,MAAQA,IAAS,SAAW,YAAcA,CAC3E,CAEA,SAAgB,wBAAwB,EAAwB,CAC5D,IAAMA,EAAO,mBAAmBC,CAAM,EACtC,OAAOD,IAAS,YAAc,SAAWA,CAC7C,CAEA,SAAgB,uBAAuB,EAAwB,EAAkB,EAAiB,EAAwC,CACtI,IAAME,EAAUC,EAAK,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,GAAUF,EAAO,OAAS,CAAC,EAC3E,aAAaG,EAASC,EAAMH,CAAO,EACnC,IAAMI,EAAuC,CAAC,EACxCC,kBAAe,IAAI,IACrBC,EAAW,GACf,IAAK,IAAMP,KAAUC,EAAS,CAC1B,IAAMF,EAAO,mBAAmBC,CAAM,GAClC,CAAC,CAAC,MAAO,WAAW,CAAC,CAAC,SAASD,CAAI,GAAKC,IAAW,aAAeA,IAAW,YAC7EG,EAAQ,MAAMK,EAAgB,wBAAyB,2BAA2BR,EAAO,sCAAuCS,EAAWL,CAAI,CAAC,EAEpJ,IAAMM,EAAQJ,EAAa,IAAIP,CAAI,EACnC,GAAIW,IAAU,IAAA,GACV,IAAI,CAACH,EAAU,CACX,IAAMI,EAAY,wBAAwBX,CAAM,EAC1CY,EAAQF,IAAUV,EAAS,GAAK,OAAOA,IAAWW,EAAYD,EAAQV,EAAO,2BAA2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X,QACI,MAAO,EACf,CACJ,CAEA,SAAS,aAAa,EAAwB,EAAkB,EAAkC,CAC1FjB,EAAQ,KAAK,GAAU,CAAC,OAAQ,YAAa,YAAY,CAAC,CAAC,SAASD,CAAM,CAAC,GAC3EG,EAAQ,YAAYK,EAAgB,uBAAwB,2HAA4HC,EAAWL,CAAI,CAAC,CAEhN"}
|
|
1
|
+
{"version":3,"file":"ConceptComplianceParser.js","names":["specialCategories","directivePattern","pattern","reasonPattern","stringBodyPattern","name","marker","markers","text","context","line","attributes","firstMarkers","reported","DiagnosticCodes","locationOf","first","canonical","alias","concept","match","setting","value","index","attribute","reason","unescapeString"],"sources":["../../../../../../Compiler/Parsing/ConceptComplianceParser.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { ConceptAttributeSyntax } from '../Syntax/Declarations';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { pattern } from '../Text/patterns';\nimport { ParserContext } from './ParserContext';\nimport { locationOf, SourceLine } from './SourceLine';\n\nexport const specialCategories = ['racialOrEthnicOrigin', 'politicalOpinions', 'religiousOrPhilosophicalBeliefs', 'tradeUnionMembership', 'genetic', 'biometric', 'health', 'sexLifeOrSexualOrientation'];\nconst directivePattern = pattern('^(@?[a-z_]\\\\w*)\\\\s+(reason|scope|special|criminal)(?:\\\\s+(.*))?$');\nconst reasonPattern = pattern(`^\"(${stringBodyPattern})\"$`);\n\nexport function complianceWireName(marker: string): string {\n const name = marker.replace(/^@/, '');\n return name === 'personal' ? 'pii' : name === 'secret' ? 'sensitive' : name;\n}\n\nexport function canonicalComplianceName(marker: string): string {\n const name = complianceWireName(marker);\n return name === 'sensitive' ? 'secret' : name;\n}\n\nexport function parseComplianceMarkers(context: ParserContext, line: SourceLine, concept: string, text: string): ConceptAttributeSyntax[] {\n const markers = text.trim().split(/\\s+/).filter(marker => marker.length > 0);\n reportLegacy(context, line, markers);\n const attributes: ConceptAttributeSyntax[] = [];\n const firstMarkers = new Map<string, string>();\n let reported = false;\n for (const marker of markers) {\n const name = complianceWireName(marker);\n if (!['pii', 'sensitive'].includes(name) || marker === '@personal' || marker === '@secret') {\n context.error(DiagnosticCodes.UnknownComplianceMarker, `Unknown concept marker '${marker}' - expected pii, personal or secret`, locationOf(line));\n }\n const first = firstMarkers.get(name);\n if (first !== undefined) {\n if (!reported) {\n const canonical = canonicalComplianceName(marker);\n const alias = first === marker ? '' : ` - '${marker === canonical ? first : marker}' is the same marker as '${canonical}'`;\n context.warning(DiagnosticCodes.DuplicateComplianceMarker, `Concept '${concept}' repeats the '${canonical}' marker${alias} - remove the duplicate`, locationOf(line));\n reported = true;\n }\n continue;\n }\n firstMarkers.set(name, marker);\n attributes.push({ kind: 'ConceptAttributeSyntax', name, reason: null, scope: null, specialCategory: null, criminal: false, location: locationOf(line) });\n }\n return attributes;\n}\n\nexport function parseComplianceDirective(context: ParserContext, line: SourceLine, concept: string, attributes: ConceptAttributeSyntax[]): boolean {\n const match = directivePattern.exec(line.content);\n if (match === null) return false;\n const [, marker, setting] = match;\n const value = match[3] ?? '';\n const name = complianceWireName(marker);\n const canonical = canonicalComplianceName(marker);\n reportLegacy(context, line, [marker]);\n if (!['pii', 'sensitive'].includes(name) || marker === '@personal' || marker === '@secret') {\n context.error(DiagnosticCodes.UnknownComplianceMarker, `Unknown concept marker '${marker}' - expected pii, personal or secret`, locationOf(line));\n return true;\n }\n const index = attributes.findIndex(attribute => attribute.name === name);\n if (index < 0) {\n context.error(DiagnosticCodes.AttributeReasonWithoutAttribute, `Concept '${concept}' declares '${canonical} ${setting}' without the marker - write 'concept ${concept} : <Type> ${canonical}'`, locationOf(line));\n return true;\n }\n const attribute = attributes[index];\n switch (setting) {\n case 'reason': {\n const reason = reasonPattern.exec(value);\n if (reason === null) {\n context.error(DiagnosticCodes.UnknownConceptDirective, `Invalid '${canonical} reason' - expected '${canonical} reason \"<text>\"'`, locationOf(line));\n return true;\n }\n if (attribute.reason !== null) {\n context.error(DiagnosticCodes.DuplicateAttributeReason, `Concept '${concept}' already declares a reason for '${canonical}' - at most one is allowed`, locationOf(line));\n return true;\n }\n attributes[index] = { ...attribute, reason: unescapeString(reason[1]) };\n return true;\n }\n case 'scope':\n if (name !== 'sensitive' || !['subject', 'namespace', 'global'].includes(value)) {\n context.error(DiagnosticCodes.InvalidSecretScope, `Invalid '${canonical} scope ${value}' - scope belongs to secret and must be subject, namespace or global`, locationOf(line));\n return true;\n }\n if (attribute.scope != null) {\n context.error(DiagnosticCodes.DuplicateSecretScope, `Concept '${concept}' already declares secret scope - at most one is allowed`, locationOf(line));\n return true;\n }\n attributes[index] = { ...attribute, scope: value };\n if (attributes.some(attribute => attribute.name === 'pii')) {\n context.warning(DiagnosticCodes.SecretScopeIgnoredForPii, `Concept '${concept}' is pii secret - secret scope is ignored because only Chronicle [PII] renders`, locationOf(line));\n }\n return true;\n case 'special':\n case 'criminal':\n if (name !== 'pii' || (setting === 'special' ? !specialCategories.includes(value) : value.length > 0)) {\n context.error(DiagnosticCodes.InvalidPersonalDataQualifier, `Invalid '${canonical} ${setting}${value.length > 0 ? ` ${value}` : ''}' - expected 'pii criminal' or 'pii special <category>' with category ${specialCategories.join(', ')}`, locationOf(line));\n return true;\n }\n if (setting === 'special' && attribute.specialCategory != null) {\n context.error(DiagnosticCodes.DuplicateSpecialCategory, `Concept '${concept}' already declares pii special - at most one is allowed`, locationOf(line));\n return true;\n }\n attributes[index] = setting === 'special' ? { ...attribute, specialCategory: value } : { ...attribute, criminal: true };\n return true;\n default:\n return false;\n }\n}\n\nfunction reportLegacy(context: ParserContext, line: SourceLine, markers: readonly string[]): void {\n if (markers.some(marker => ['@pii', 'sensitive', '@sensitive'].includes(marker))) {\n context.information(DiagnosticCodes.LegacyComplianceMarker, 'Legacy compliance spelling - use bare pii for personal data and secret for operational secrets; reason text is preserved', locationOf(line));\n }\n}\n"],"mappings":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AAQ,YAAYK,EAAgB,uBAAwB,2HAA4HC,EAAWL,CAAI,CAAC,CAEhN,C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";var ConditionDepthBudget=class{context;location;#e=/* @__PURE__ */ new WeakMap;#t=0;exceeded=!1;constructor(e,t){this.context=e,this.location=t}enter(){return this.#t===128?this.#n():(this.#t++,!0)}leave(){this.#t--}build(e,t){let n=1+Math.max(...e.map(e=>this.#e.get(e)??1));if(!this.allowsDepth(n))return null;let r=t();return this.#e.set(r,n),r}allowsDepth(e){return e<=128||this.#n()}#n(){return this.exceeded||=(this.context.error(e.ConditionDepthExceeded,`Condition nesting or expression depth exceeds the supported limit of 128.`,this.location),!0),!1}};export{ConditionDepthBudget};
|
|
2
|
+
//# sourceMappingURL=ConditionDepthBudget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionDepthBudget.js","names":["context","location","#nesting","#refuse","depth","children","#depths","child","node","create","DiagnosticCodes"],"sources":["../../../../../../Compiler/Parsing/ConditionDepthBudget.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { ParserContext } from './ParserContext';\n\n// Private construction metadata: leaves have depth one; grouping does not add a syntax node.\nexport class ConditionDepthBudget {\n readonly #depths = new WeakMap<object, number>();\n #nesting = 0;\n exceeded = false;\n\n constructor(private readonly context: ParserContext, private readonly location: SourceLocation) {}\n\n enter(): boolean {\n if (this.#nesting === 128) return this.#refuse();\n this.#nesting++;\n return true;\n }\n\n leave(): void { this.#nesting--; }\n\n build<T extends object>(children: readonly object[], create: () => T): T | null {\n const depth = 1 + Math.max(...children.map(child => this.#depths.get(child) ?? 1));\n if (!this.allowsDepth(depth)) return null;\n const node = create();\n this.#depths.set(node, depth);\n return node;\n }\n\n allowsDepth(depth: number): boolean {\n return depth <= 128 || this.#refuse();\n }\n\n #refuse(): false {\n if (!this.exceeded) {\n this.context.error(DiagnosticCodes.ConditionDepthExceeded, 'Condition nesting or expression depth exceeds the supported limit of 128.', this.location);\n this.exceeded = true;\n }\n return false;\n }\n}\n"],"mappings":"A,yHAQA,IAAa,qBAAb,KAAkC,CAKD,QAAyC,SAJtE,mBAAmB,IAAI,QACvB,GAAW,EACX,SAAW,GAEX,YAAY,EAAyC,EAA2C,CAAnE,KAAA,QAAAA,EAAyC,KAAA,SAAAC,CAA2B,CAEjG,OAAiB,CAGb,OAFI,KAAKC,KAAa,IAAY,KAAKC,GAAQ,GAC/C,KAAKD,KACE,GACX,CAEA,OAAc,CAAE,KAAKA,IAAY,CAEjC,MAAwB,EAA6B,EAA2B,CAC5E,IAAME,EAAQ,EAAI,KAAK,IAAI,GAAGC,EAAS,IAAI,GAAS,KAAKC,GAAQ,IAAIC,CAAK,GAAK,CAAC,CAAC,EACjF,GAAI,CAAC,KAAK,YAAYH,CAAK,EAAG,OAAO,KACrC,IAAMI,EAAOC,EAAO,EAEpB,OADA,KAAKH,GAAQ,IAAIE,EAAMJ,CAAK,EACrBI,CACX,CAEA,YAAY,EAAwB,CAChC,OAAOJ,GAAS,KAAO,KAAKD,GAAQ,CACxC,CAEA,IAAiB,CAKb,MAJA,CAEI,KAAK,YADL,KAAK,QAAQ,MAAMO,EAAgB,uBAAwB,4EAA6E,KAAK,QAAQ,EACrI,IAEb,EACX,CACJ,E"}
|