@cratis/screenplay-language 5.2.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 +2 -0
- package/dist/bundles/compiler/Parsing/ApplicationContextParser.js.map +1 -0
- 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 +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 +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 +18 -17
- 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 +1 -1
- package/dist/bundles/keyword-docs.js.map +1 -1
- package/dist/bundles/language.js +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 +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 +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/completion-items.d.ts +1 -0
- package/dist/completion-items.d.ts.map +1 -1
- package/dist/completion-planner.d.ts.map +1 -1
- package/dist/diagnostic-codes.d.ts +6 -0
- package/dist/diagnostic-codes.d.ts.map +1 -1
- package/dist/keyword-docs.d.ts.map +1 -1
- package/dist/language.d.ts.map +1 -1
- package/dist/scope-items.d.ts.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenplayParser.js","names":["domainPattern","pattern","timeZonePattern","stringBodyPattern","importPattern","conceptPattern","enumValuePattern","personaPattern","personaPolicyPattern","personaGoalPattern","stickyNotePattern","stickyNoteColourPattern","tabIndentPattern","primitiveTypes","opaqueTopLevel","bodyKeywords","documentPlacement","context","lines","moduleBody","placement","ModuleBody","featureBody","FeatureBody","placedBody","identity","reactionProductionMode","sawReactionBatches","commandReadMode","timeZone","sawTimeZone","sawCommandReads","domain","imports","fileImports","concepts","types","systems","stateMachines","workflows","eventSources","modules","personas","stickyNotes","policies","purposes","seeds","examples","declaredTriggers","exposures","instanceContributions","sawOtherConstruct","line","keyword","firstWord","isDocumentPlacement","DiagnosticCodes","locationOf","match","unescapeString","misplacedReactionIdentity","isFileImport","parseFileImport","origin","isBlankPublicEventOrigin","parseExample","parseEventSource","parseSystem","parseStateMachine","parseWorkflow","parseType","parseModule","stickyNote","parseSeed","parsePurpose","parseIdentity","policy","parsePolicy","previous","parseExposure","parseInstance","data","parseTriggerDeclaration","name","collectInputUses","parseUiProfile","root","recordAuthoredDocument","modulePattern","describePlacement","word","hint","expected","moduleBodyExpected","featureBodyExpected","feature","innermost","index","start","existing","inFence","startOf","type","attributeText","attributes","parseComplianceMarkers","values","members","EnumerationMembers","generation","declaredGeneration","description","validations","child","memberName","parseDescription","isFileDirective","parsed","parseValidate","parseGeneration","parseComplianceDirective","unescapeIdentifier","valueNumbers","goals","position","size","goal","parseCanvasPair","canvasMatch","text","colour"],"sources":["../../../../../../Compiler/Parsing/ScreenplayParser.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 { CommandReadMode } from '../Syntax/CommandReadMode';\nimport { ReactionProductionMode } from '../Syntax/ReactionProductionMode';\nimport { EnumerationMembers } from './EnumerationMembers';\nimport { GenerationSyntax } from '../Syntax/GenerationSyntax';\nimport { parseGeneration } from './GenerationParser';\nimport { IdentitySyntax } from '../Syntax/IdentitySyntax';\nimport { parseIdentity } from './IdentityParser';\nimport { misplacedReactionIdentity } from './ReactionIdentityParser';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { recordAuthoredDocument } from '../Syntax/SourceOptions';\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { describePlacement, documentPlacement, isDocumentPlacement, PlayPlacement } from '../Files/PlayPlacement';\nimport { PersonaSyntax, StickyNoteSyntax } from '../Syntax/Authorization';\nimport { ConceptSyntax, DomainSyntax, ImportSyntax, TypeSyntax } from '../Syntax/Declarations';\nimport { SpecificationExampleSyntax } from '../Syntax/Specifications';\nimport { TimeZoneSyntax } from '../Syntax/Calendar';\nimport { ApplicationSyntax, FeatureSyntax, FileImportSyntax, ModuleSyntax } from '../Syntax/Structure';\nimport { parseTriggerDeclaration } from './TriggerDataParser';\nimport { pattern } from '../Text/patterns';\nimport { parseComplianceDirective, parseComplianceMarkers } from './ConceptComplianceParser';\nimport { parseType } from './DeclarationParsers';\nimport { ValidateSyntax } from '../Syntax/Commands';\nimport { parseValidate } from './CommandParser';\nimport { parseDescription } from './DescriptionParser';\nimport { FeatureBody, featureBodyExpected } from './FeatureBody';\nimport { isFileImport, parseFileImport } from './FileImportParser';\nimport { isFileDirective } from './FileReferences';\nimport { collectInputUses } from './InputUses';\nimport { firstWord, unescapeIdentifier } from './LineText';\nimport { ModuleBody, moduleBodyExpected, modulePattern, parseModule } from './ModuleBody';\nimport { ParserContext } from './ParserContext';\nimport { PolicySyntax } from '../Syntax/Policies';\nimport { parsePolicy } from './PolicyParser';\nimport { PurposeSyntax } from '../Syntax/Purposes';\nimport { parsePurpose } from './PurposeParser';\nimport { SeedSyntax } from '../Syntax/Seeds';\nimport { parseSeed } from './SeedParser';\nimport { parseSystem } from './OperationParser';\nimport { parseStateMachine } from './StateMachineParser';\nimport { parseWorkflow } from './WorkflowParser';\nimport { StateMachineSyntax, WorkflowSyntax } from '../Syntax/Lifecycles';\nimport { EventVisibility } from '../Syntax/EventVisibility';\nimport { isBlankPublicEventOrigin } from '../Syntax/PublicEventInvariants';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { SystemSyntax } from '../Syntax/Operations';\nimport { EventSourceSyntax } from '../Syntax/EventSources';\nimport { parseCanvasPair } from './CanvasPlacement';\nimport { parseEventSource } from './EventSourceParser';\nimport { parseExposure, parseInstance } from './CompositionParser';\nimport { ExposureSyntax, InstanceContributionsSyntax } from '../Syntax/CompositionSyntax';\nimport { parseExample } from './SpecificationExampleParser';\nimport { parseUiProfile } from './UiProfileLegacyLayout';\nimport { locationOf, SourceLine, startOf } from './SourceLine';\n\nconst domainPattern = pattern('^domain\\\\s+([A-Za-z_]\\\\w*(?:\\\\.[A-Za-z_]\\\\w*)*)$');\nconst timeZonePattern = pattern(`^time\\\\s+zone\\\\s+(configurable\\\\s+default\\\\s+)?\"(${stringBodyPattern})\"$`);\nconst importPattern = pattern(`^import\\\\s+([\\\\w.]+)(?:\\\\s+from\\\\s+\"(?<origin>${stringBodyPattern})\")?$`);\nconst conceptPattern = pattern('^concept\\\\s+(\\\\w+)\\\\s*:\\\\s*(\\\\w+)((?:\\\\s+@?\\\\w+)*)$');\nconst enumValuePattern = pattern('^@?[a-z_]\\\\w*$');\nconst personaPattern = pattern('^persona\\\\s+([A-Za-z_]\\\\w*)$');\nconst personaPolicyPattern = pattern('^policy\\\\s+([A-Za-z_]\\\\w*)$');\nconst personaGoalPattern = pattern(`^goal\\\\s+\"(${stringBodyPattern})\"$`);\nconst stickyNotePattern = pattern('^sticky\\\\s+note\\\\s+on\\\\s+(personas|eventsources|givencontexts|seeddata)$');\nconst stickyNoteColourPattern = pattern('^colour\\\\s+(yellow|pink|green|blue)$');\nconst tabIndentPattern = /^[ ]*\\t/;\nconst primitiveTypes = ['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'];\n\n// Top-level, module and feature constructs the C# compiler knows that this compiler does not model. They\n// are skipped whole, not reported.\nconst opaqueTopLevel = new Set(['policy', 'authentication', 'onboarding', 'seed', 'ui', 'theme', 'trigger', 'layout', 'behavior', 'sample']);\n\n// What belongs in a module or feature body; at the top level of a whole document it gets a hint saying so.\nconst bodyKeywords = new Set(['slice', 'feature', 'description', 'documentation', 'authorize', 'screen', 'dialog', 'form', 'contribute', 'on', 'uses']);\n\n// Parses one document into its application syntax - the port of the C# ScreenplayParser. The placement says\n// where the document's top level belongs: the application, unless an import placed it in a module or feature.\nexport function parseApplication(context: ParserContext, lines: readonly SourceLine[], placement: PlayPlacement = documentPlacement): ApplicationSyntax {\n context.deferIdentityValidation = true;\n warnOnTabIndentation(context, lines);\n const moduleBody = placement.length === 1 ? new ModuleBody(placement[0]) : undefined;\n const featureBody = placement.length > 1 ? new FeatureBody(placement[placement.length - 1]) : undefined;\n const placedBody = moduleBody ?? featureBody;\n let identity: IdentitySyntax | null = null;\n let reactionProductionMode: ReactionProductionMode | null = null;\n let sawReactionBatches = false;\n let commandReadMode: CommandReadMode | null = null;\n let timeZone: TimeZoneSyntax | null = null;\n let sawTimeZone = false;\n let sawCommandReads = false;\n let domain: DomainSyntax | null = null;\n const imports: ImportSyntax[] = [];\n const fileImports: FileImportSyntax[] = [];\n const concepts: ConceptSyntax[] = [];\n const types: TypeSyntax[] = [];\n const systems: SystemSyntax[] = [];\n const stateMachines: StateMachineSyntax[] = [];\n const workflows: WorkflowSyntax[] = [];\n const eventSources: EventSourceSyntax[] = [];\n const modules: ModuleSyntax[] = [];\n const personas: PersonaSyntax[] = [];\n const stickyNotes: StickyNoteSyntax[] = [];\n const policies: PolicySyntax[] = [];\n const purposes: PurposeSyntax[] = [];\n const seeds: SeedSyntax[] = [];\n const examples: SpecificationExampleSyntax[] = [];\n const declaredTriggers: NonNullable<ApplicationSyntax['declaredTriggers']>[number][] = [];\n const exposures: ExposureSyntax[] = [];\n const instanceContributions: InstanceContributionsSyntax[] = [];\n let sawOtherConstruct = false;\n for (let line = context.reader.peekSignificant(); line !== undefined; line = context.reader.peekSignificant()) {\n context.reader.takeSignificant();\n const keyword = firstWord(line.content);\n if (keyword === 'command' && /^command\\s+reads(?:\\s|$)/.test(line.content)) {\n if (sawCommandReads || !isDocumentPlacement(placement) || !/^command\\s+reads\\s+protected$/.test(line.content)) {\n context.error(DiagnosticCodes.InvalidCommandReadsDeclaration, \"Declare 'command reads protected' once at the application root.\", locationOf(line));\n } else {\n commandReadMode = CommandReadMode.Protected;\n }\n sawCommandReads = true;\n continue;\n }\n if (keyword === 'time' && /^time\\s+zone(?:\\s|$)/.test(line.content)) {\n const match = timeZonePattern.exec(line.content);\n context.skipBlock(line.indent);\n if (sawTimeZone || !isDocumentPlacement(placement) || match === null) {\n context.error(DiagnosticCodes.InvalidTimeZoneDeclaration, \"Declare 'time zone \\\"<id>\\\"' or 'time zone configurable default \\\"<id>\\\"' once at the application root.\", locationOf(line));\n } else {\n timeZone = { kind: 'TimeZoneSyntax', id: unescapeString(match[2]), configurable: match[1] !== undefined, location: locationOf(line) };\n }\n sawTimeZone = true;\n continue;\n }\n if (keyword === 'reaction') {\n if (sawReactionBatches || !isDocumentPlacement(placement) || !/^reaction\\s+batches\\s+atomic$/.test(line.content)) {\n context.error(DiagnosticCodes.InvalidReactionBatchesDeclaration, \"Declare 'reaction batches atomic' once at the application root.\", locationOf(line));\n } else {\n reactionProductionMode = ReactionProductionMode.Atomic;\n }\n sawReactionBatches = true;\n continue;\n }\n if (keyword === 'runs') {\n misplacedReactionIdentity(context, line);\n continue;\n }\n if (keyword === 'domain') {\n context.authoredDeclarations = true;\n domain = parseDomain(context, line, domain, sawOtherConstruct);\n continue;\n }\n // The C# parser asks whether anything was declared before the domain, so an import it rejected,\n // a file import and an unknown construct do not count.\n sawOtherConstruct ||= declaresConstruct(keyword, line, placement);\n context.authoredDeclarations ||= keyword !== 'import' && declaresConstruct(keyword, line, placement);\n if (keyword === 'import' && isFileImport(line.content)) {\n // A top level import belongs to whatever the document's top level is - the application, or the\n // module or feature the document was itself imported into.\n if (placedBody !== undefined) {\n placedBody.tryParse(context, line);\n } else {\n parseFileImport(context, line, fileImports);\n }\n } else if (keyword === 'import') {\n const match = importPattern.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidImportDeclaration, `Invalid import '${line.content}' - expected 'import <Qualified.Name> [from \"<origin>\"]'`, locationOf(line));\n } else {\n const origin = match.groups?.origin === undefined ? null : unescapeString(match.groups.origin);\n if (origin !== null && isBlankPublicEventOrigin(origin)) {\n context.error(DiagnosticCodes.InvalidImportDeclaration, 'An import origin must be a nonblank quoted string', locationOf(line));\n }\n imports.push({ kind: 'ImportSyntax', qualifiedName: match[1], origin, visibility: origin === null ? EventVisibility.Private : EventVisibility.Public, location: locationOf(line) });\n }\n } else if (keyword === 'example') {\n if (placedBody !== undefined) placedBody.tryParse(context, line);\n else examples.push(parseExample(context, line));\n } else if (keyword === 'eventsource') {\n eventSources.push(parseEventSource(context, line));\n } else if (keyword === 'system') {\n systems.push(parseSystem(context, line));\n } else if (keyword === 'statemachine') {\n stateMachines.push(parseStateMachine(context, line));\n } else if (keyword === 'workflow') {\n workflows.push(parseWorkflow(context, line));\n } else if (keyword === 'concept') {\n concepts.push(parseConcept(context, line));\n } else if (keyword === 'type') {\n types.push(parseType(context, line));\n } else if (keyword === 'module' && !isDocumentPlacement(placement)) {\n parseModuleInPlacedFile(context, line, placement, moduleBody);\n } else if (keyword === 'module') {\n modules.push(parseModule(context, line));\n } else if (keyword === 'persona') {\n personas.push(parsePersona(context, line));\n } else if (keyword === 'sticky') {\n const stickyNote = parseStickyNote(context, line);\n if (stickyNote !== null) stickyNotes.push(stickyNote);\n } else if (keyword === 'seed') {\n seeds.push(parseSeed(context.valueContext, line));\n } else if (keyword === 'purpose' && placedBody !== undefined) {\n placedBody.tryParse(context, line);\n } else if (keyword === 'purpose') {\n purposes.push(parsePurpose(context, line));\n } else if (keyword === 'identity') {\n identity = parseIdentity(context, line, identity);\n } else if (keyword === 'policy') {\n const policy = parsePolicy(context, line);\n if (policies.some(previous => previous.name === policy.name)) {\n context.error(DiagnosticCodes.DuplicateDeclaration, `Duplicate declaration of policy '${policy.name}' - policy names must be unique`, policy.location);\n }\n policies.push(policy);\n } else if (keyword === 'exposure') {\n exposures.push(parseExposure(context, line));\n } else if (keyword === 'instance') {\n instanceContributions.push(parseInstance(context, line));\n } else if (keyword === 'trigger') {\n const data = parseTriggerDeclaration(context, line);\n const name = /^trigger\\s+([A-Za-z_]\\w*)$/.exec(line.content)?.[1];\n if (name !== undefined) declaredTriggers.push({ name, data });\n } else if (opaqueTopLevel.has(keyword)) {\n if (keyword === 'behavior' || keyword === 'layout') collectInputUses(context, line);\n else if (keyword === 'ui') parseUiProfile(context, line);\n else context.skipOpaqueBlock(line.indent);\n } else if (placedBody?.tryParse(context, line) !== true) {\n reportUnexpectedTopLevel(context, line, placement);\n }\n }\n if (moduleBody !== undefined) {\n modules.unshift(moduleBody.build(context.start, true));\n } else if (featureBody !== undefined) {\n modules.unshift(place(placement, featureBody.build(context.start, true), context.start));\n }\n const root: ApplicationSyntax = { kind: 'ApplicationSyntax', ...(commandReadMode === null ? {} : { commandReadMode }), ...(timeZone === null ? {} : { timeZone }), ...(reactionProductionMode === null ? {} : { reactionProductionMode }), ...(identity === null ? {} : { identity }), sourceOptions: context.sourceOptions, domain, imports, concepts, types, systems, ...(stateMachines.length > 0 ? { stateMachines } : {}), ...(workflows.length > 0 ? { workflows } : {}), eventSources, examples, modules, personas, policies, purposes, seeds, declaredTriggers, fileImports, ...(exposures.length > 0 ? { exposures } : {}), ...(stickyNotes.length > 0 ? { stickyNotes } : {}), ...(instanceContributions.length > 0 ? { instanceContributions } : {}), location: context.start };\n if (context.authoredDeclarations) recordAuthoredDocument(root);\n return root;\n}\n\nfunction declaresConstruct(keyword: string, line: SourceLine, placement: PlayPlacement): boolean {\n if (keyword === 'import') {\n return importPattern.test(line.content);\n }\n if (keyword === 'module') {\n return isDocumentPlacement(placement);\n }\n if (keyword === 'identity') return line.content === 'identity';\n return keyword === 'purpose' || keyword === 'example' || keyword === 'exposure' || keyword === 'instance' || keyword === 'eventsource' || keyword === 'system' || keyword === 'statemachine' || keyword === 'workflow' || keyword === 'concept' || keyword === 'type' || keyword === 'persona' || keyword === 'sticky' || opaqueTopLevel.has(keyword);\n}\n\nfunction parseModuleInPlacedFile(context: ParserContext, line: SourceLine, placement: PlayPlacement, moduleBody: ModuleBody | undefined): void {\n const name = modulePattern.exec(line.content)?.[1] ?? '';\n\n // Restating the module a file is placed in says nothing new, so its body simply joins the placement.\n if (moduleBody !== undefined && name === placement[0]) {\n context.authoredDeclarations = true;\n moduleBody.parseChildren(context, line);\n return;\n }\n context.error(DiagnosticCodes.ModuleInPlacedFile,\n `This file is imported into ${describePlacement(placement)}, so it cannot declare module '${name}' - import it at the top level of a document instead`, locationOf(line));\n context.skipBlock(line.indent);\n}\n\nfunction reportUnexpectedTopLevel(context: ParserContext, line: SourceLine, placement: PlayPlacement): void {\n const word = firstWord(line.content);\n if (!isDocumentPlacement(placement)) {\n const expected = placement.length === 1 ? moduleBodyExpected : featureBodyExpected;\n context.error(DiagnosticCodes.UnexpectedInPlacedFile,\n `Unexpected '${word}' in a file imported into ${describePlacement(placement)} - expected an application declaration or ${expected}`, locationOf(line));\n } else {\n const hint = bodyKeywords.has(word)\n ? ` - '${word}' belongs in a module or feature; wrap it in one, or import this file from inside one`\n : ' - expected domain, import, concept, type, policy, persona, sticky note, authentication, onboarding, identity, module, seed, trigger, behavior, ui profile, theme, sample data or layout';\n context.error(DiagnosticCodes.UnknownTopLevelConstruct, `Unexpected '${word}' at the top level${hint}`, locationOf(line));\n }\n context.skipBlock(line.indent);\n}\n\n// Wraps the feature a file is placed in in the features and module around it, each marked as a placement.\nfunction place(placement: PlayPlacement, innermost: FeatureSyntax, start: SourceLocation): ModuleSyntax {\n let feature = innermost;\n for (let index = placement.length - 2; index >= 1; index--) {\n feature = {\n kind: 'FeatureSyntax', name: placement[index], description: null, authorize: null,\n features: [feature], slices: [], fileImports: [], isPlacement: true, location: start,\n };\n }\n return {\n kind: 'ModuleSyntax', name: placement[0], description: null, authorize: null,\n features: [feature], fileImports: [], isPlacement: true, location: start,\n };\n}\n\nfunction parseDomain(context: ParserContext, line: SourceLine, existing: DomainSyntax | null, sawOtherConstruct: boolean): DomainSyntax | null {\n const match = domainPattern.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidDomainDeclaration, `Invalid domain declaration '${line.content}' - expected 'domain <Qualified.Name>'`, locationOf(line));\n return existing;\n }\n if (existing !== null) {\n context.error(DiagnosticCodes.DuplicateDomain, 'The document already declares a domain - a document can have at most one', locationOf(line));\n return existing;\n }\n if (sawOtherConstruct) {\n context.error(DiagnosticCodes.DomainNotFirst, '\\'domain\\' must be declared before any other construct', locationOf(line));\n }\n return { kind: 'DomainSyntax', name: match[1], location: locationOf(line) };\n}\n\nfunction warnOnTabIndentation(context: ParserContext, lines: readonly SourceLine[]): void {\n let inFence = false;\n for (const line of lines) {\n if (line.raw.trimStart().startsWith('```')) {\n inFence = !inFence;\n continue;\n }\n if (!inFence && tabIndentPattern.test(line.raw)) {\n context.warning(DiagnosticCodes.TabIndentation, 'Screenplay is indentation based - use spaces, not tabs', startOf(line));\n }\n }\n}\n\nfunction parseConcept(context: ParserContext, line: SourceLine): ConceptSyntax {\n const match = conceptPattern.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidConceptDeclaration, `Invalid concept declaration '${line.content}' - expected 'concept <Name> : <Type>'`, locationOf(line));\n context.skipBlock(line.indent);\n return { kind: 'ConceptSyntax', name: firstWord(line.content), type: '', attributes: [], values: [], location: locationOf(line) };\n }\n const [, name, type, attributeText] = match;\n const attributes = parseComplianceMarkers(context, line, name, attributeText);\n if (type !== 'Enum' && !primitiveTypes.includes(type)) {\n context.error(DiagnosticCodes.UnknownPrimitiveType, `Unknown primitive type '${type}' - expected ${primitiveTypes.join(', ')} or Enum`, locationOf(line));\n }\n const values: string[] = [];\n const members = new EnumerationMembers();\n let generation: GenerationSyntax | null = null;\n let declaredGeneration = false;\n let description: string | null = null;\n const validations: ValidateSyntax[] = [];\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const memberName = type === 'Enum' ? members.tryNumbered(context, child) : undefined;\n if (memberName !== undefined) {\n values.push(memberName);\n } else if (firstWord(child.content) === 'description' && (type !== 'Enum' || child.content !== 'description' || context.peekChild(child.indent)?.content.startsWith('```') === true)) {\n description = parseDescription(context, child, description, `Concept '${name}'`);\n } else if (isFileDirective(child)) {\n continue;\n } else if (firstWord(child.content) === 'validate') {\n if (type === 'Enum' && child.content === 'validate' && context.peekChild(child.indent) === undefined) {\n context.warning(DiagnosticCodes.ValidateReadAsEnumerationBlock,\n `'validate' in enumeration concept '${name}' declares an empty validate block, not a value named 'validate' - write '@validate' for the value`,\n locationOf(child));\n }\n const parsed = parseValidate(context, child, 'concept', name);\n if (parsed !== undefined) validations.push(parsed);\n } else if (firstWord(child.content) === 'generate' && !(type === 'Enum' && child.content === 'generate')) {\n if (declaredGeneration) context.error(DiagnosticCodes.DuplicateGeneration, `Concept '${name}' declares generation more than once.`, locationOf(child));\n const parsed = parseGeneration(context, child, type);\n if (!declaredGeneration) generation = parsed;\n declaredGeneration = true;\n } else if (parseComplianceDirective(context, child, name, attributes)) {\n // Compliance directives are modeled by their original concept marker.\n } else if (type === 'Enum' && enumValuePattern.test(child.content)) {\n values.push(unescapeIdentifier(child.content));\n } else if (type === 'Enum') {\n context.error(DiagnosticCodes.InvalidEnumerationValue, `Invalid enum value '${child.content}' - expected an identifier`, locationOf(child));\n } else {\n context.error(DiagnosticCodes.UnknownConceptDirective, `Unexpected '${child.content}' in concept body - expected validate, generate, 'file <path>' or '<attribute> reason \"<text>\"'`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n const valueNumbers = members.finish(context, line, values.length);\n return { kind: 'ConceptSyntax', name, type, attributes, values, validations, description, ...(generation === null ? {} : { generation }), ...(valueNumbers === undefined ? {} : { valueNumbers }), location: locationOf(line) };\n}\n\n// 'persona <Name>' with an optional description and the policies it holds - the port of the C# ParsePersona.\nfunction parsePersona(context: ParserContext, line: SourceLine): PersonaSyntax {\n const name = personaPattern.exec(line.content)?.[1] ?? '';\n if (name === '') {\n context.error(DiagnosticCodes.InvalidPersonaDeclaration, `Invalid persona declaration '${line.content}' - expected 'persona <Name>'`, locationOf(line));\n }\n let description: string | null = null;\n const policies: string[] = [];\n const goals: string[] = [];\n let position: readonly [number, number] | null = null;\n let size: readonly [number, number] | 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 if (keyword === 'description') {\n description = parseDescription(context, child, description, `Persona '${name}'`);\n } else if (keyword === 'goal') {\n const goal = personaGoalPattern.exec(child.content);\n if (goal === null) {\n context.error(DiagnosticCodes.InvalidPersonaDeclaration, `Invalid goal '${child.content}' - expected 'goal \"<text>\"'`, locationOf(child));\n } else {\n goals.push(unescapeString(goal[1]));\n }\n } else if (keyword === 'position') {\n position = parseCanvasPair(context, child, 'position', 'x', 'y', position, true) ?? position;\n } else if (keyword === 'size') {\n size = parseCanvasPair(context, child, 'size', 'width', 'height', size, false) ?? size;\n } else if (keyword === 'policy') {\n const policy = personaPolicyPattern.exec(child.content);\n if (policy === null) {\n context.error(DiagnosticCodes.InvalidPersonaPolicyReference, `Invalid policy reference '${child.content}' - expected 'policy <Name>'`, locationOf(child));\n } else {\n policies.push(policy[1]);\n }\n } else {\n context.error(DiagnosticCodes.UnknownPersonaDirective, `Unexpected '${keyword}' in persona body - expected description, goal, policy, position or size`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n return {\n kind: 'PersonaSyntax', name, description, policies,\n ...(goals.length > 0 ? { goals } : {}),\n ...(position === null ? {} : { x: position[0], y: position[1] }),\n ...(size === null ? {} : { width: size[0], height: size[1] }),\n location: locationOf(line),\n };\n}\n\n// 'sticky note on <canvas>' with the text it carries, an optional colour and where it sits on that canvas - the port of the C# ParseStickyNote.\nfunction parseStickyNote(context: ParserContext, line: SourceLine): StickyNoteSyntax | null {\n const canvasMatch = stickyNotePattern.exec(line.content);\n if (canvasMatch === null) {\n context.error(DiagnosticCodes.InvalidPersonaDeclaration, `Invalid sticky note declaration '${line.content}' - expected 'sticky note on personas', 'sticky note on eventsources', 'sticky note on givencontexts' or 'sticky note on seeddata'`, locationOf(line));\n context.skipBlock(line.indent);\n return null;\n }\n let text: string | null = null;\n let colour: string | null = null;\n let position: readonly [number, number] | null = null;\n let size: readonly [number, number] | 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 if (keyword === 'description') {\n text = parseDescription(context, child, text, 'A sticky note');\n } else if (keyword === 'colour') {\n const match = stickyNoteColourPattern.exec(child.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidPersonaDeclaration, `Invalid colour '${child.content}' - expected 'colour yellow', 'colour pink', 'colour green' or 'colour blue'`, locationOf(child));\n } else {\n colour = match[1];\n }\n } else if (keyword === 'position') {\n position = parseCanvasPair(context, child, 'position', 'x', 'y', position, true) ?? position;\n } else if (keyword === 'size') {\n size = parseCanvasPair(context, child, 'size', 'width', 'height', size, false) ?? size;\n } else {\n context.error(DiagnosticCodes.UnknownPersonaDirective, `Unexpected '${keyword}' in sticky note body - expected description, colour, position or size`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n if (text === null || position === null) {\n context.error(DiagnosticCodes.InvalidPersonaDeclaration, 'A sticky note needs a description (the text on it) and a position', locationOf(line));\n return null;\n }\n return { kind: 'StickyNoteSyntax', canvas: canvasMatch[1] as StickyNoteSyntax['canvas'], text, colour, x: position[0], y: position[1], width: size === null ? null : size[0], height: size === null ? null : size[1], location: locationOf(line) };\n}\n\n"],"mappings":"goEAyDA,MAAMA,EAAgBC,EAAQ,kDAAkD,EAC1EC,GAAkBD,EAAQ,oDAAoDE,EAAkB,IAAI,EACpGC,EAAgBH,EAAQ,iDAAiDE,EAAkB,MAAM,EACjGE,EAAiBJ,EAAQ,qDAAqD,EAC9EK,EAAmBL,EAAQ,gBAAgB,EAC3CM,EAAiBN,EAAQ,8BAA8B,EACvDO,EAAuBP,EAAQ,6BAA6B,EAC5DQ,EAAqBR,EAAQ,cAAcE,EAAkB,IAAI,EACjEO,EAAoBT,EAAQ,0EAA0E,EACtGU,EAA0BV,EAAQ,sCAAsC,EACxEW,EAAmB,UACnBC,EAAiB,CAAC,OAAQ,SAAU,MAAO,UAAW,OAAQ,OAAQ,UAAU,EAIhFC,kBAAiB,IAAI,IAAI,CAAC,SAAU,iBAAkB,aAAc,OAAQ,KAAM,QAAS,UAAW,SAAU,WAAY,QAAQ,CAAC,EAGrIC,kBAAe,IAAI,IAAI,CAAC,QAAS,UAAW,cAAe,gBAAiB,YAAa,SAAU,SAAU,OAAQ,aAAc,KAAM,MAAM,CAAC,EAItJ,SAAgB,iB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EJ,CAAE,KAAM,mBAAoB,OAAQ4E,EAAY,GAAkC,OAAM,SAAQ,EAAGJ,EAAS,GAAI,EAAGA,EAAS,GAAI,MAAOC,IAAS,KAAO,KAAOA,EAAK,GAAI,OAAQA,IAAS,KAAO,KAAOA,EAAK,GAAI,SAAUpE,EAAWL,CAAI,CAAE,CACrP"}
|
|
1
|
+
{"version":3,"file":"ScreenplayParser.js","names":["domainPattern","pattern","timeZonePattern","stringBodyPattern","importPattern","conceptPattern","enumValuePattern","personaPattern","personaPolicyPattern","personaGoalPattern","stickyNotePattern","stickyNoteColourPattern","tabIndentPattern","primitiveTypes","opaqueTopLevel","bodyKeywords","documentPlacement","context","lines","moduleBody","placement","ModuleBody","featureBody","FeatureBody","placedBody","identity","applicationContext","reactionProductionMode","sawReactionBatches","commandReadMode","timeZone","sawTimeZone","sawCommandReads","domain","imports","fileImports","concepts","types","systems","stateMachines","workflows","eventSources","modules","personas","stickyNotes","policies","purposes","seeds","examples","declaredTriggers","exposures","instanceContributions","sawOtherConstruct","line","keyword","firstWord","isDocumentPlacement","DiagnosticCodes","locationOf","match","unescapeString","misplacedReactionIdentity","isFileImport","parseFileImport","origin","isBlankPublicEventOrigin","parseExample","parseEventSource","parseSystem","parseStateMachine","parseWorkflow","parseType","parseModule","stickyNote","parseSeed","parsePurpose","parseApplicationContext","parseIdentity","policy","parsePolicy","previous","parseExposure","parseInstance","data","parseTriggerDeclaration","name","collectInputUses","parseUiProfile","root","recordAuthoredDocument","modulePattern","describePlacement","word","hint","expected","moduleBodyExpected","featureBodyExpected","feature","innermost","index","start","existing","inFence","startOf","type","attributeText","attributes","parseComplianceMarkers","values","members","EnumerationMembers","generation","declaredGeneration","description","validations","child","memberName","parseDescription","isFileDirective","parsed","parseValidate","parseGeneration","parseComplianceDirective","unescapeIdentifier","valueNumbers","goals","position","size","goal","parseCanvasPair","canvasMatch","text","colour"],"sources":["../../../../../../Compiler/Parsing/ScreenplayParser.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 { CommandReadMode } from '../Syntax/CommandReadMode';\nimport { ReactionProductionMode } from '../Syntax/ReactionProductionMode';\nimport { EnumerationMembers } from './EnumerationMembers';\nimport { GenerationSyntax } from '../Syntax/GenerationSyntax';\nimport { parseGeneration } from './GenerationParser';\nimport { IdentitySyntax } from '../Syntax/IdentitySyntax';\nimport { parseIdentity } from './IdentityParser';\nimport { parseApplicationContext } from './ApplicationContextParser';\nimport { misplacedReactionIdentity } from './ReactionIdentityParser';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { recordAuthoredDocument } from '../Syntax/SourceOptions';\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { describePlacement, documentPlacement, isDocumentPlacement, PlayPlacement } from '../Files/PlayPlacement';\nimport { PersonaSyntax, StickyNoteSyntax } from '../Syntax/Authorization';\nimport { ConceptSyntax, DomainSyntax, ImportSyntax, TypeSyntax } from '../Syntax/Declarations';\nimport { SpecificationExampleSyntax } from '../Syntax/Specifications';\nimport { TimeZoneSyntax } from '../Syntax/Calendar';\nimport { ApplicationContextSyntax, ApplicationSyntax, FeatureSyntax, FileImportSyntax, ModuleSyntax } from '../Syntax/Structure';\nimport { parseTriggerDeclaration } from './TriggerDataParser';\nimport { pattern } from '../Text/patterns';\nimport { parseComplianceDirective, parseComplianceMarkers } from './ConceptComplianceParser';\nimport { parseType } from './DeclarationParsers';\nimport { ValidateSyntax } from '../Syntax/Commands';\nimport { parseValidate } from './CommandParser';\nimport { parseDescription } from './DescriptionParser';\nimport { FeatureBody, featureBodyExpected } from './FeatureBody';\nimport { isFileImport, parseFileImport } from './FileImportParser';\nimport { isFileDirective } from './FileReferences';\nimport { collectInputUses } from './InputUses';\nimport { firstWord, unescapeIdentifier } from './LineText';\nimport { ModuleBody, moduleBodyExpected, modulePattern, parseModule } from './ModuleBody';\nimport { ParserContext } from './ParserContext';\nimport { PolicySyntax } from '../Syntax/Policies';\nimport { parsePolicy } from './PolicyParser';\nimport { PurposeSyntax } from '../Syntax/Purposes';\nimport { parsePurpose } from './PurposeParser';\nimport { SeedSyntax } from '../Syntax/Seeds';\nimport { parseSeed } from './SeedParser';\nimport { parseSystem } from './OperationParser';\nimport { parseStateMachine } from './StateMachineParser';\nimport { parseWorkflow } from './WorkflowParser';\nimport { StateMachineSyntax, WorkflowSyntax } from '../Syntax/Lifecycles';\nimport { EventVisibility } from '../Syntax/EventVisibility';\nimport { isBlankPublicEventOrigin } from '../Syntax/PublicEventInvariants';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { SystemSyntax } from '../Syntax/Operations';\nimport { EventSourceSyntax } from '../Syntax/EventSources';\nimport { parseCanvasPair } from './CanvasPlacement';\nimport { parseEventSource } from './EventSourceParser';\nimport { parseExposure, parseInstance } from './CompositionParser';\nimport { ExposureSyntax, InstanceContributionsSyntax } from '../Syntax/CompositionSyntax';\nimport { parseExample } from './SpecificationExampleParser';\nimport { parseUiProfile } from './UiProfileLegacyLayout';\nimport { locationOf, SourceLine, startOf } from './SourceLine';\n\nconst domainPattern = pattern('^domain\\\\s+([A-Za-z_]\\\\w*(?:\\\\.[A-Za-z_]\\\\w*)*)$');\nconst timeZonePattern = pattern(`^time\\\\s+zone\\\\s+(configurable\\\\s+default\\\\s+)?\"(${stringBodyPattern})\"$`);\nconst importPattern = pattern(`^import\\\\s+([\\\\w.]+)(?:\\\\s+from\\\\s+\"(?<origin>${stringBodyPattern})\")?$`);\nconst conceptPattern = pattern('^concept\\\\s+(\\\\w+)\\\\s*:\\\\s*(\\\\w+)((?:\\\\s+@?\\\\w+)*)$');\nconst enumValuePattern = pattern('^@?[a-z_]\\\\w*$');\nconst personaPattern = pattern('^persona\\\\s+([A-Za-z_]\\\\w*)$');\nconst personaPolicyPattern = pattern('^policy\\\\s+([A-Za-z_]\\\\w*)$');\nconst personaGoalPattern = pattern(`^goal\\\\s+\"(${stringBodyPattern})\"$`);\nconst stickyNotePattern = pattern('^sticky\\\\s+note\\\\s+on\\\\s+(personas|eventsources|givencontexts|seeddata)$');\nconst stickyNoteColourPattern = pattern('^colour\\\\s+(yellow|pink|green|blue)$');\nconst tabIndentPattern = /^[ ]*\\t/;\nconst primitiveTypes = ['Uuid', 'String', 'Int', 'Decimal', 'Bool', 'Date', 'DateTime'];\n\n// Top-level, module and feature constructs the C# compiler knows that this compiler does not model. They\n// are skipped whole, not reported.\nconst opaqueTopLevel = new Set(['policy', 'authentication', 'onboarding', 'seed', 'ui', 'theme', 'trigger', 'layout', 'behavior', 'sample']);\n\n// What belongs in a module or feature body; at the top level of a whole document it gets a hint saying so.\nconst bodyKeywords = new Set(['slice', 'feature', 'description', 'documentation', 'authorize', 'screen', 'dialog', 'form', 'contribute', 'on', 'uses']);\n\n// Parses one document into its application syntax - the port of the C# ScreenplayParser. The placement says\n// where the document's top level belongs: the application, unless an import placed it in a module or feature.\nexport function parseApplication(context: ParserContext, lines: readonly SourceLine[], placement: PlayPlacement = documentPlacement): ApplicationSyntax {\n context.deferIdentityValidation = true;\n warnOnTabIndentation(context, lines);\n const moduleBody = placement.length === 1 ? new ModuleBody(placement[0]) : undefined;\n const featureBody = placement.length > 1 ? new FeatureBody(placement[placement.length - 1]) : undefined;\n const placedBody = moduleBody ?? featureBody;\n let identity: IdentitySyntax | null = null;\n let applicationContext: ApplicationContextSyntax | null = null;\n let reactionProductionMode: ReactionProductionMode | null = null;\n let sawReactionBatches = false;\n let commandReadMode: CommandReadMode | null = null;\n let timeZone: TimeZoneSyntax | null = null;\n let sawTimeZone = false;\n let sawCommandReads = false;\n let domain: DomainSyntax | null = null;\n const imports: ImportSyntax[] = [];\n const fileImports: FileImportSyntax[] = [];\n const concepts: ConceptSyntax[] = [];\n const types: TypeSyntax[] = [];\n const systems: SystemSyntax[] = [];\n const stateMachines: StateMachineSyntax[] = [];\n const workflows: WorkflowSyntax[] = [];\n const eventSources: EventSourceSyntax[] = [];\n const modules: ModuleSyntax[] = [];\n const personas: PersonaSyntax[] = [];\n const stickyNotes: StickyNoteSyntax[] = [];\n const policies: PolicySyntax[] = [];\n const purposes: PurposeSyntax[] = [];\n const seeds: SeedSyntax[] = [];\n const examples: SpecificationExampleSyntax[] = [];\n const declaredTriggers: NonNullable<ApplicationSyntax['declaredTriggers']>[number][] = [];\n const exposures: ExposureSyntax[] = [];\n const instanceContributions: InstanceContributionsSyntax[] = [];\n let sawOtherConstruct = false;\n for (let line = context.reader.peekSignificant(); line !== undefined; line = context.reader.peekSignificant()) {\n context.reader.takeSignificant();\n const keyword = firstWord(line.content);\n if (keyword === 'command' && /^command\\s+reads(?:\\s|$)/.test(line.content)) {\n if (sawCommandReads || !isDocumentPlacement(placement) || !/^command\\s+reads\\s+protected$/.test(line.content)) {\n context.error(DiagnosticCodes.InvalidCommandReadsDeclaration, \"Declare 'command reads protected' once at the application root.\", locationOf(line));\n } else {\n commandReadMode = CommandReadMode.Protected;\n }\n sawCommandReads = true;\n continue;\n }\n if (keyword === 'time' && /^time\\s+zone(?:\\s|$)/.test(line.content)) {\n const match = timeZonePattern.exec(line.content);\n context.skipBlock(line.indent);\n if (sawTimeZone || !isDocumentPlacement(placement) || match === null) {\n context.error(DiagnosticCodes.InvalidTimeZoneDeclaration, \"Declare 'time zone \\\"<id>\\\"' or 'time zone configurable default \\\"<id>\\\"' once at the application root.\", locationOf(line));\n } else {\n timeZone = { kind: 'TimeZoneSyntax', id: unescapeString(match[2]), configurable: match[1] !== undefined, location: locationOf(line) };\n }\n sawTimeZone = true;\n continue;\n }\n if (keyword === 'reaction') {\n if (sawReactionBatches || !isDocumentPlacement(placement) || !/^reaction\\s+batches\\s+atomic$/.test(line.content)) {\n context.error(DiagnosticCodes.InvalidReactionBatchesDeclaration, \"Declare 'reaction batches atomic' once at the application root.\", locationOf(line));\n } else {\n reactionProductionMode = ReactionProductionMode.Atomic;\n }\n sawReactionBatches = true;\n continue;\n }\n if (keyword === 'runs') {\n misplacedReactionIdentity(context, line);\n continue;\n }\n if (keyword === 'domain') {\n context.authoredDeclarations = true;\n domain = parseDomain(context, line, domain, sawOtherConstruct);\n continue;\n }\n // The C# parser asks whether anything was declared before the domain, so an import it rejected,\n // a file import and an unknown construct do not count.\n sawOtherConstruct ||= declaresConstruct(keyword, line, placement);\n context.authoredDeclarations ||= keyword !== 'import' && declaresConstruct(keyword, line, placement);\n if (keyword === 'import' && isFileImport(line.content)) {\n // A top level import belongs to whatever the document's top level is - the application, or the\n // module or feature the document was itself imported into.\n if (placedBody !== undefined) {\n placedBody.tryParse(context, line);\n } else {\n parseFileImport(context, line, fileImports);\n }\n } else if (keyword === 'import') {\n const match = importPattern.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidImportDeclaration, `Invalid import '${line.content}' - expected 'import <Qualified.Name> [from \"<origin>\"]'`, locationOf(line));\n } else {\n const origin = match.groups?.origin === undefined ? null : unescapeString(match.groups.origin);\n if (origin !== null && isBlankPublicEventOrigin(origin)) {\n context.error(DiagnosticCodes.InvalidImportDeclaration, 'An import origin must be a nonblank quoted string', locationOf(line));\n }\n imports.push({ kind: 'ImportSyntax', qualifiedName: match[1], origin, visibility: origin === null ? EventVisibility.Private : EventVisibility.Public, location: locationOf(line) });\n }\n } else if (keyword === 'example') {\n if (placedBody !== undefined) placedBody.tryParse(context, line);\n else examples.push(parseExample(context, line));\n } else if (keyword === 'eventsource') {\n eventSources.push(parseEventSource(context, line));\n } else if (keyword === 'system') {\n systems.push(parseSystem(context, line));\n } else if (keyword === 'statemachine') {\n stateMachines.push(parseStateMachine(context, line));\n } else if (keyword === 'workflow') {\n workflows.push(parseWorkflow(context, line));\n } else if (keyword === 'concept') {\n concepts.push(parseConcept(context, line));\n } else if (keyword === 'type') {\n types.push(parseType(context, line));\n } else if (keyword === 'module' && !isDocumentPlacement(placement)) {\n parseModuleInPlacedFile(context, line, placement, moduleBody);\n } else if (keyword === 'module') {\n modules.push(parseModule(context, line));\n } else if (keyword === 'persona') {\n personas.push(parsePersona(context, line));\n } else if (keyword === 'sticky') {\n const stickyNote = parseStickyNote(context, line);\n if (stickyNote !== null) stickyNotes.push(stickyNote);\n } else if (keyword === 'seed') {\n seeds.push(parseSeed(context.valueContext, line));\n } else if (keyword === 'purpose' && placedBody !== undefined) {\n placedBody.tryParse(context, line);\n } else if (keyword === 'purpose') {\n purposes.push(parsePurpose(context, line));\n } else if (keyword === 'context') {\n applicationContext = parseApplicationContext(context, line, applicationContext, placement);\n } else if (keyword === 'identity') {\n identity = parseIdentity(context, line, identity);\n } else if (keyword === 'policy') {\n const policy = parsePolicy(context, line);\n if (policies.some(previous => previous.name === policy.name)) {\n context.error(DiagnosticCodes.DuplicateDeclaration, `Duplicate declaration of policy '${policy.name}' - policy names must be unique`, policy.location);\n }\n policies.push(policy);\n } else if (keyword === 'exposure') {\n exposures.push(parseExposure(context, line));\n } else if (keyword === 'instance') {\n instanceContributions.push(parseInstance(context, line));\n } else if (keyword === 'trigger') {\n const data = parseTriggerDeclaration(context, line);\n const name = /^trigger\\s+([A-Za-z_]\\w*)$/.exec(line.content)?.[1];\n if (name !== undefined) declaredTriggers.push({ name, data });\n } else if (opaqueTopLevel.has(keyword)) {\n if (keyword === 'behavior' || keyword === 'layout') collectInputUses(context, line);\n else if (keyword === 'ui') parseUiProfile(context, line);\n else context.skipOpaqueBlock(line.indent);\n } else if (placedBody?.tryParse(context, line) !== true) {\n reportUnexpectedTopLevel(context, line, placement);\n }\n }\n if (moduleBody !== undefined) {\n modules.unshift(moduleBody.build(context.start, true));\n } else if (featureBody !== undefined) {\n modules.unshift(place(placement, featureBody.build(context.start, true), context.start));\n }\n const root: ApplicationSyntax = { kind: 'ApplicationSyntax', ...(commandReadMode === null ? {} : { commandReadMode }), ...(timeZone === null ? {} : { timeZone }), ...(applicationContext === null ? {} : { context: applicationContext }), ...(reactionProductionMode === null ? {} : { reactionProductionMode }), ...(identity === null ? {} : { identity }), sourceOptions: context.sourceOptions, domain, imports, concepts, types, systems, ...(stateMachines.length > 0 ? { stateMachines } : {}), ...(workflows.length > 0 ? { workflows } : {}), eventSources, examples, modules, personas, policies, purposes, seeds, declaredTriggers, fileImports, ...(exposures.length > 0 ? { exposures } : {}), ...(stickyNotes.length > 0 ? { stickyNotes } : {}), ...(instanceContributions.length > 0 ? { instanceContributions } : {}), location: context.start };\n if (context.authoredDeclarations) recordAuthoredDocument(root);\n return root;\n}\n\nfunction declaresConstruct(keyword: string, line: SourceLine, placement: PlayPlacement): boolean {\n if (keyword === 'import') {\n return importPattern.test(line.content);\n }\n if (keyword === 'module') {\n return isDocumentPlacement(placement);\n }\n if (keyword === 'identity') return line.content === 'identity';\n if (keyword === 'context') return line.content === 'context';\n return keyword === 'purpose' || keyword === 'example' || keyword === 'exposure' || keyword === 'instance' || keyword === 'eventsource' || keyword === 'system' || keyword === 'statemachine' || keyword === 'workflow' || keyword === 'concept' || keyword === 'type' || keyword === 'persona' || keyword === 'sticky' || opaqueTopLevel.has(keyword);\n}\n\nfunction parseModuleInPlacedFile(context: ParserContext, line: SourceLine, placement: PlayPlacement, moduleBody: ModuleBody | undefined): void {\n const name = modulePattern.exec(line.content)?.[1] ?? '';\n\n // Restating the module a file is placed in says nothing new, so its body simply joins the placement.\n if (moduleBody !== undefined && name === placement[0]) {\n context.authoredDeclarations = true;\n moduleBody.parseChildren(context, line);\n return;\n }\n context.error(DiagnosticCodes.ModuleInPlacedFile,\n `This file is imported into ${describePlacement(placement)}, so it cannot declare module '${name}' - import it at the top level of a document instead`, locationOf(line));\n context.skipBlock(line.indent);\n}\n\nfunction reportUnexpectedTopLevel(context: ParserContext, line: SourceLine, placement: PlayPlacement): void {\n const word = firstWord(line.content);\n if (!isDocumentPlacement(placement)) {\n const expected = placement.length === 1 ? moduleBodyExpected : featureBodyExpected;\n context.error(DiagnosticCodes.UnexpectedInPlacedFile,\n `Unexpected '${word}' in a file imported into ${describePlacement(placement)} - expected an application declaration or ${expected}`, locationOf(line));\n } else {\n const hint = bodyKeywords.has(word)\n ? ` - '${word}' belongs in a module or feature; wrap it in one, or import this file from inside one`\n : ' - expected domain, import, concept, type, policy, persona, sticky note, authentication, onboarding, identity, context, module, seed, trigger, behavior, ui profile, theme, sample data or layout';\n context.error(DiagnosticCodes.UnknownTopLevelConstruct, `Unexpected '${word}' at the top level${hint}`, locationOf(line));\n }\n context.skipBlock(line.indent);\n}\n\n// Wraps the feature a file is placed in in the features and module around it, each marked as a placement.\nfunction place(placement: PlayPlacement, innermost: FeatureSyntax, start: SourceLocation): ModuleSyntax {\n let feature = innermost;\n for (let index = placement.length - 2; index >= 1; index--) {\n feature = {\n kind: 'FeatureSyntax', name: placement[index], description: null, authorize: null,\n features: [feature], slices: [], fileImports: [], isPlacement: true, location: start,\n };\n }\n return {\n kind: 'ModuleSyntax', name: placement[0], description: null, authorize: null,\n features: [feature], fileImports: [], isPlacement: true, location: start,\n };\n}\n\nfunction parseDomain(context: ParserContext, line: SourceLine, existing: DomainSyntax | null, sawOtherConstruct: boolean): DomainSyntax | null {\n const match = domainPattern.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidDomainDeclaration, `Invalid domain declaration '${line.content}' - expected 'domain <Qualified.Name>'`, locationOf(line));\n return existing;\n }\n if (existing !== null) {\n context.error(DiagnosticCodes.DuplicateDomain, 'The document already declares a domain - a document can have at most one', locationOf(line));\n return existing;\n }\n if (sawOtherConstruct) {\n context.error(DiagnosticCodes.DomainNotFirst, '\\'domain\\' must be declared before any other construct', locationOf(line));\n }\n return { kind: 'DomainSyntax', name: match[1], location: locationOf(line) };\n}\n\nfunction warnOnTabIndentation(context: ParserContext, lines: readonly SourceLine[]): void {\n let inFence = false;\n for (const line of lines) {\n if (line.raw.trimStart().startsWith('```')) {\n inFence = !inFence;\n continue;\n }\n if (!inFence && tabIndentPattern.test(line.raw)) {\n context.warning(DiagnosticCodes.TabIndentation, 'Screenplay is indentation based - use spaces, not tabs', startOf(line));\n }\n }\n}\n\nfunction parseConcept(context: ParserContext, line: SourceLine): ConceptSyntax {\n const match = conceptPattern.exec(line.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidConceptDeclaration, `Invalid concept declaration '${line.content}' - expected 'concept <Name> : <Type>'`, locationOf(line));\n context.skipBlock(line.indent);\n return { kind: 'ConceptSyntax', name: firstWord(line.content), type: '', attributes: [], values: [], location: locationOf(line) };\n }\n const [, name, type, attributeText] = match;\n const attributes = parseComplianceMarkers(context, line, name, attributeText);\n if (type !== 'Enum' && !primitiveTypes.includes(type)) {\n context.error(DiagnosticCodes.UnknownPrimitiveType, `Unknown primitive type '${type}' - expected ${primitiveTypes.join(', ')} or Enum`, locationOf(line));\n }\n const values: string[] = [];\n const members = new EnumerationMembers();\n let generation: GenerationSyntax | null = null;\n let declaredGeneration = false;\n let description: string | null = null;\n const validations: ValidateSyntax[] = [];\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n const memberName = type === 'Enum' ? members.tryNumbered(context, child) : undefined;\n if (memberName !== undefined) {\n values.push(memberName);\n } else if (firstWord(child.content) === 'description' && (type !== 'Enum' || child.content !== 'description' || context.peekChild(child.indent)?.content.startsWith('```') === true)) {\n description = parseDescription(context, child, description, `Concept '${name}'`);\n } else if (isFileDirective(child)) {\n continue;\n } else if (firstWord(child.content) === 'validate') {\n if (type === 'Enum' && child.content === 'validate' && context.peekChild(child.indent) === undefined) {\n context.warning(DiagnosticCodes.ValidateReadAsEnumerationBlock,\n `'validate' in enumeration concept '${name}' declares an empty validate block, not a value named 'validate' - write '@validate' for the value`,\n locationOf(child));\n }\n const parsed = parseValidate(context, child, 'concept', name);\n if (parsed !== undefined) validations.push(parsed);\n } else if (firstWord(child.content) === 'generate' && !(type === 'Enum' && child.content === 'generate')) {\n if (declaredGeneration) context.error(DiagnosticCodes.DuplicateGeneration, `Concept '${name}' declares generation more than once.`, locationOf(child));\n const parsed = parseGeneration(context, child, type);\n if (!declaredGeneration) generation = parsed;\n declaredGeneration = true;\n } else if (parseComplianceDirective(context, child, name, attributes)) {\n // Compliance directives are modeled by their original concept marker.\n } else if (type === 'Enum' && enumValuePattern.test(child.content)) {\n values.push(unescapeIdentifier(child.content));\n } else if (type === 'Enum') {\n context.error(DiagnosticCodes.InvalidEnumerationValue, `Invalid enum value '${child.content}' - expected an identifier`, locationOf(child));\n } else {\n context.error(DiagnosticCodes.UnknownConceptDirective, `Unexpected '${child.content}' in concept body - expected validate, generate, 'file <path>' or '<attribute> reason \"<text>\"'`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n const valueNumbers = members.finish(context, line, values.length);\n return { kind: 'ConceptSyntax', name, type, attributes, values, validations, description, ...(generation === null ? {} : { generation }), ...(valueNumbers === undefined ? {} : { valueNumbers }), location: locationOf(line) };\n}\n\n// 'persona <Name>' with an optional description and the policies it holds - the port of the C# ParsePersona.\nfunction parsePersona(context: ParserContext, line: SourceLine): PersonaSyntax {\n const name = personaPattern.exec(line.content)?.[1] ?? '';\n if (name === '') {\n context.error(DiagnosticCodes.InvalidPersonaDeclaration, `Invalid persona declaration '${line.content}' - expected 'persona <Name>'`, locationOf(line));\n }\n let description: string | null = null;\n const policies: string[] = [];\n const goals: string[] = [];\n let position: readonly [number, number] | null = null;\n let size: readonly [number, number] | 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 if (keyword === 'description') {\n description = parseDescription(context, child, description, `Persona '${name}'`);\n } else if (keyword === 'goal') {\n const goal = personaGoalPattern.exec(child.content);\n if (goal === null) {\n context.error(DiagnosticCodes.InvalidPersonaDeclaration, `Invalid goal '${child.content}' - expected 'goal \"<text>\"'`, locationOf(child));\n } else {\n goals.push(unescapeString(goal[1]));\n }\n } else if (keyword === 'position') {\n position = parseCanvasPair(context, child, 'position', 'x', 'y', position, true) ?? position;\n } else if (keyword === 'size') {\n size = parseCanvasPair(context, child, 'size', 'width', 'height', size, false) ?? size;\n } else if (keyword === 'policy') {\n const policy = personaPolicyPattern.exec(child.content);\n if (policy === null) {\n context.error(DiagnosticCodes.InvalidPersonaPolicyReference, `Invalid policy reference '${child.content}' - expected 'policy <Name>'`, locationOf(child));\n } else {\n policies.push(policy[1]);\n }\n } else {\n context.error(DiagnosticCodes.UnknownPersonaDirective, `Unexpected '${keyword}' in persona body - expected description, goal, policy, position or size`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n return {\n kind: 'PersonaSyntax', name, description, policies,\n ...(goals.length > 0 ? { goals } : {}),\n ...(position === null ? {} : { x: position[0], y: position[1] }),\n ...(size === null ? {} : { width: size[0], height: size[1] }),\n location: locationOf(line),\n };\n}\n\n// 'sticky note on <canvas>' with the text it carries, an optional colour and where it sits on that canvas - the port of the C# ParseStickyNote.\nfunction parseStickyNote(context: ParserContext, line: SourceLine): StickyNoteSyntax | null {\n const canvasMatch = stickyNotePattern.exec(line.content);\n if (canvasMatch === null) {\n context.error(DiagnosticCodes.InvalidPersonaDeclaration, `Invalid sticky note declaration '${line.content}' - expected 'sticky note on personas', 'sticky note on eventsources', 'sticky note on givencontexts' or 'sticky note on seeddata'`, locationOf(line));\n context.skipBlock(line.indent);\n return null;\n }\n let text: string | null = null;\n let colour: string | null = null;\n let position: readonly [number, number] | null = null;\n let size: readonly [number, number] | 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 if (keyword === 'description') {\n text = parseDescription(context, child, text, 'A sticky note');\n } else if (keyword === 'colour') {\n const match = stickyNoteColourPattern.exec(child.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidPersonaDeclaration, `Invalid colour '${child.content}' - expected 'colour yellow', 'colour pink', 'colour green' or 'colour blue'`, locationOf(child));\n } else {\n colour = match[1];\n }\n } else if (keyword === 'position') {\n position = parseCanvasPair(context, child, 'position', 'x', 'y', position, true) ?? position;\n } else if (keyword === 'size') {\n size = parseCanvasPair(context, child, 'size', 'width', 'height', size, false) ?? size;\n } else {\n context.error(DiagnosticCodes.UnknownPersonaDirective, `Unexpected '${keyword}' in sticky note body - expected description, colour, position or size`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n if (text === null || position === null) {\n context.error(DiagnosticCodes.InvalidPersonaDeclaration, 'A sticky note needs a description (the text on it) and a position', locationOf(line));\n return null;\n }\n return { kind: 'StickyNoteSyntax', canvas: canvasMatch[1] as StickyNoteSyntax['canvas'], text, colour, x: position[0], y: position[1], width: size === null ? null : size[0], height: size === null ? null : size[1], location: locationOf(line) };\n}\n\n"],"mappings":"A,0sEA0DA,MAAMA,EAAgBC,EAAQ,kDAAkD,EAC1EC,GAAkBD,EAAQ,oDAAoDE,EAAkB,IAAI,EACpGC,EAAgBH,EAAQ,iDAAiDE,EAAkB,MAAM,EACjGE,EAAiBJ,EAAQ,qDAAqD,EAC9EK,EAAmBL,EAAQ,gBAAgB,EAC3CM,EAAiBN,EAAQ,8BAA8B,EACvDO,EAAuBP,EAAQ,6BAA6B,EAC5DQ,EAAqBR,EAAQ,cAAcE,EAAkB,IAAI,EACjEO,EAAoBT,EAAQ,0EAA0E,EACtGU,EAA0BV,EAAQ,sCAAsC,EACxEW,EAAmB,UACnBC,EAAiB,CAAC,OAAQ,SAAU,MAAO,UAAW,OAAQ,OAAQ,UAAU,EAIhFC,kBAAiB,IAAI,IAAI,CAAC,SAAU,iBAAkB,aAAc,OAAQ,KAAM,QAAS,UAAW,SAAU,WAAY,QAAQ,CAAC,EAGrIC,kBAAe,IAAI,IAAI,CAAC,QAAS,UAAW,cAAe,gBAAiB,YAAa,SAAU,SAAU,OAAQ,aAAc,KAAM,MAAM,CAAC,EAItJ,SAAgB,iBAAiB,EAAwB,EAA8B,EAA2BC,EAAsC,CACpJ,EAAQ,wBAA0B,GAClC,qBAAqBC,EAASC,CAAK,EACnC,IAAMC,EAAaC,EAAU,SAAW,EAAI,IAAIC,GAAWD,EAAU,EAAE,EAAI,IAAA,GACrEE,EAAcF,EAAU,OAAS,EAAI,IA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,KAAM,mBAAoB,OAAQ6E,EAAY,GAAkC,OAAM,SAAQ,EAAGJ,EAAS,GAAI,EAAGA,EAAS,GAAI,MAAOC,IAAS,KAAO,KAAOA,EAAK,GAAI,OAAQA,IAAS,KAAO,KAAOA,EAAK,GAAI,SAAUrE,EAAWL,CAAI,CAAE,CACrP,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{nativePattern 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{nativePattern as r}from"../Text/patterns.js";import{parseCanvasPair as i}from"./CanvasPlacement.js";import{parseModeledMappingSource as a}from"./ExpressionParser.js";import{firstWord as o}from"./LineText.js";import{locationOf as s}from"./SourceLine.js";import{tryParseStructuredMapping as c}from"./StructuredBlockParser.js";const l=RegExp(`^seed(?:\\s+"(${t})")?$`,`u`),u=RegExp(`^for\\s+"(${t})"$`,`u`),d=r(`^[A-Z]\\w*$`),f=r(`^([\\w.]+)\\s*=(?!=|>)\\s*(.+)$`);function parseSeed(t,r){let p=[];t=t.valueContext;let m=l.exec(r.content);if(m===null)return t.error(e.InvalidSeedDeclaration,`Invalid seed declaration '${r.content}' - expected 'seed' or 'seed "<name>"'`,s(r)),t.skipOpaqueBlock(r.indent),{kind:`SeedSyntax`,groups:p,location:s(r)};let h=null;for(let l=t.peekChild(r.indent);l!==void 0;l=t.peekChild(r.indent)){if(t.reader.takeSignificant(),o(l.content)===`position`){h=i(t,l,`position`,`x`,`y`,h,!0)??h;continue}let r=u.exec(l.content);if(r===null){t.error(e.InvalidSeedGroup,`Invalid seed group '${l.content}' - expected 'for "<event source id>"'`,s(l)),t.skipOpaqueBlock(l.indent);continue}let m=[];for(let n=t.peekChild(l.indent);n!==void 0;n=t.peekChild(l.indent)){if(t.reader.takeSignificant(),!d.test(n.content)){t.error(e.InvalidSeedEvent,`Invalid seed event '${n.content}' - expected an event type name`,s(n)),t.skipOpaqueBlock(n.indent);continue}let r=[];for(let i=t.peekChild(n.indent);i!==void 0;i=t.peekChild(n.indent)){t.reader.takeSignificant();let n=f.exec(i.content),o=n===null?c(t,i):void 0;n===null?o===void 0?t.error(e.InvalidSeedPropertyAssignment,`Invalid property assignment '${i.content}' - expected '<property> = <value>'`,s(i)):r.push(o):r.push({kind:`PropertyMappingSyntax`,property:n[1],source:a(n[2],s(i),t),location:s(i)})}m.push({kind:`SeedEventSyntax`,event:n.content,properties:r,location:s(n)})}p.push({kind:`SeedGroupSyntax`,eventSourceId:n(r[1]),events:m,location:s(l)})}return{kind:`SeedSyntax`,groups:p,...m[1]===void 0?{}:{name:n(m[1])},...h===null?{}:{x:h[0],y:h[1]},location:s(r)}}export{parseSeed};
|
|
2
2
|
//# sourceMappingURL=SeedParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SeedParser.js","names":["pattern","parseMappingSource","headerPattern","stringBodyPattern","forPattern","eventPattern","nativePattern","mappingPattern","groups","context","headerMatch","header","DiagnosticCodes","locationOf","position","group","firstWord","parseCanvasPair","match","events","event","properties","property","mapped","structured","tryParseStructuredMapping","parseModeledMappingSource","unescapeString"],"sources":["../../../../../../Compiler/Parsing/SeedParser.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 { PropertyMappingSyntax } from '../Syntax/Expressions';\nimport { SeedEventSyntax, SeedGroupSyntax, SeedSyntax } from '../Syntax/Seeds';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { nativePattern as pattern } from '../Text/patterns';\nimport { parseCanvasPair } from './CanvasPlacement';\nimport { parseModeledMappingSource as parseMappingSource } from './ExpressionParser';\nimport { firstWord } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { locationOf, SourceLine } from './SourceLine';\nimport { tryParseStructuredMapping } from './StructuredBlockParser';\n\nconst headerPattern = new RegExp(`^seed(?:\\\\s+\"(${stringBodyPattern})\")?$`, 'u');\nconst forPattern = new RegExp(`^for\\\\s+\"(${stringBodyPattern})\"$`, 'u');\nconst eventPattern = pattern('^[A-Z]\\\\w*$');\nconst mappingPattern = pattern('^([\\\\w.]+)\\\\s*=(?!=|>)\\\\s*(.+)$');\n\nexport function parseSeed(context: ParserContext, header: SourceLine): SeedSyntax {\n const groups: SeedGroupSyntax[] = [];\n context = context.valueContext;\n const headerMatch = headerPattern.exec(header.content);\n if (headerMatch === null) {\n context.error(DiagnosticCodes.InvalidSeedDeclaration, `Invalid seed declaration '${header.content}' - expected 'seed' or 'seed \"<name>\"'`, locationOf(header));\n context.skipOpaqueBlock(header.indent);\n return { kind: 'SeedSyntax', groups, location: locationOf(header) };\n }\n let position: readonly [number, number] | null = null;\n for (let group = context.peekChild(header.indent); group !== undefined; group = context.peekChild(header.indent)) {\n context.reader.takeSignificant();\n if (firstWord(group.content) === 'position') {\n position = parseCanvasPair(context, group, 'position', 'x', 'y', position, true) ?? position;\n continue;\n }\n const match = forPattern.exec(group.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidSeedGroup, `Invalid seed group '${group.content}' - expected 'for \"<event source id>\"'`, locationOf(group));\n context.skipOpaqueBlock(group.indent);\n continue;\n }\n const events: SeedEventSyntax[] = [];\n for (let event = context.peekChild(group.indent); event !== undefined; event = context.peekChild(group.indent)) {\n context.reader.takeSignificant();\n if (!eventPattern.test(event.content)) {\n context.error(DiagnosticCodes.InvalidSeedEvent, `Invalid seed event '${event.content}' - expected an event type name`, locationOf(event));\n context.skipOpaqueBlock(event.indent);\n continue;\n }\n const properties: PropertyMappingSyntax[] = [];\n for (let property = context.peekChild(event.indent); property !== undefined; property = context.peekChild(event.indent)) {\n context.reader.takeSignificant();\n const mapped = mappingPattern.exec(property.content);\n const structured = mapped === null ? tryParseStructuredMapping(context, property) : undefined;\n if (mapped !== null) properties.push({ kind: 'PropertyMappingSyntax', property: mapped[1], source: parseMappingSource(mapped[2], locationOf(property), context), location: locationOf(property) });\n else if (structured !== undefined) properties.push(structured);\n else context.error(DiagnosticCodes.InvalidSeedPropertyAssignment, `Invalid property assignment '${property.content}' - expected '<property> = <value>'`, locationOf(property));\n }\n events.push({ kind: 'SeedEventSyntax', event: event.content, properties, location: locationOf(event) });\n }\n groups.push({ kind: 'SeedGroupSyntax', eventSourceId: unescapeString(match[1]), events, location: locationOf(group) });\n }\n return { kind: 'SeedSyntax', groups, ...(headerMatch[1] === undefined ? {} : { name: unescapeString(headerMatch[1]) }), ...(position === null ? {} : { x: position[0], y: position[1] }), location: locationOf(header) };\n}\n"],"mappings":"qhBAeA,MAAME,EAAoB,OAAO,iBAAiBC,EAAkB,OAAQ,GAAG,EACzEC,EAAiB,OAAO,aAAaD,EAAkB,KAAM,GAAG,EAChEE,EAAeL,EAAQ,aAAa,EACpCO,EAAiBP,EAAQ,iCAAiC,EAEhE,SAAgB,UAAU,EAAwB,EAAgC,CAC9E,IAAMQ,EAA4B,CAAC,EACnC,EAAUC,EAAQ,aAClB,IAAMC,EAAcR,EAAc,KAAKS,EAAO,OAAO,EACrD,GAAID,IAAgB,KAGhB,OAFAD,EAAQ,MAAMG,EAAgB,uBAAwB,6BAA6BD,EAAO,QAAQ,wCAAyCE,EAAWF,CAAM,CAAC,EAC7JF,EAAQ,gBAAgBE,EAAO,MAAM,EAC9B,CAAE,KAAM,aAAc,SAAQ,SAAUE,EAAWF,CAAM,CAAE,EAEtE,IAAIG,EAA6C,KACjD,IAAK,IAAIC,EAAQN,EAAQ,UAAUE,EAAO,MAAM,EAAGI,IAAU,IAAA,GAAW,EAAQN,EAAQ,UAAUE,EAAO,MAAM,EAAG,CAE9G,GADAF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O,GAAIV,EAAWS,CAAQ,EAAGb,CAAO,EAAG,SAAUI,EAAWS,CAAQ,CAAE,CAAC,CAGrM,CACAH,EAAO,KAAK,CAAE,KAAM,kBAAmB,MAAOC,EAAM,QAAS,aAAY,SAAUP,EAAWO,CAAK,CAAE,CAAC,CAC1G,CACAZ,EAAO,KAAK,CAAE,KAAM,kBAAmB,cAAemB,EAAeT,EAAM,EAAE,EAAG,SAAQ,SAAUL,EAAWE,CAAK,CAAE,CAAC,CACzH,CACA,MAAO,CAAE,KAAM,aAAc,SAAQ,GAAIL,EAAY,KAAO,IAAA,GAAY,CAAC,EAAI,CAAE,KAAMiB,EAAejB,EAAY,EAAE,CAAE,EAAI,GAAII,IAAa,KAAO,CAAC,EAAI,CAAE,EAAGA,EAAS,GAAI,EAAGA,EAAS,EAAG,EAAI,SAAUD,EAAWF,CAAM,CAAE,CAC3N"}
|
|
1
|
+
{"version":3,"file":"SeedParser.js","names":["pattern","parseMappingSource","headerPattern","stringBodyPattern","forPattern","eventPattern","nativePattern","mappingPattern","groups","context","headerMatch","header","DiagnosticCodes","locationOf","position","group","firstWord","parseCanvasPair","match","events","event","properties","property","mapped","structured","tryParseStructuredMapping","parseModeledMappingSource","unescapeString"],"sources":["../../../../../../Compiler/Parsing/SeedParser.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 { PropertyMappingSyntax } from '../Syntax/Expressions';\nimport { SeedEventSyntax, SeedGroupSyntax, SeedSyntax } from '../Syntax/Seeds';\nimport { stringBodyPattern, unescapeString } from '../Text/StringLiteral';\nimport { nativePattern as pattern } from '../Text/patterns';\nimport { parseCanvasPair } from './CanvasPlacement';\nimport { parseModeledMappingSource as parseMappingSource } from './ExpressionParser';\nimport { firstWord } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { locationOf, SourceLine } from './SourceLine';\nimport { tryParseStructuredMapping } from './StructuredBlockParser';\n\nconst headerPattern = new RegExp(`^seed(?:\\\\s+\"(${stringBodyPattern})\")?$`, 'u');\nconst forPattern = new RegExp(`^for\\\\s+\"(${stringBodyPattern})\"$`, 'u');\nconst eventPattern = pattern('^[A-Z]\\\\w*$');\nconst mappingPattern = pattern('^([\\\\w.]+)\\\\s*=(?!=|>)\\\\s*(.+)$');\n\nexport function parseSeed(context: ParserContext, header: SourceLine): SeedSyntax {\n const groups: SeedGroupSyntax[] = [];\n context = context.valueContext;\n const headerMatch = headerPattern.exec(header.content);\n if (headerMatch === null) {\n context.error(DiagnosticCodes.InvalidSeedDeclaration, `Invalid seed declaration '${header.content}' - expected 'seed' or 'seed \"<name>\"'`, locationOf(header));\n context.skipOpaqueBlock(header.indent);\n return { kind: 'SeedSyntax', groups, location: locationOf(header) };\n }\n let position: readonly [number, number] | null = null;\n for (let group = context.peekChild(header.indent); group !== undefined; group = context.peekChild(header.indent)) {\n context.reader.takeSignificant();\n if (firstWord(group.content) === 'position') {\n position = parseCanvasPair(context, group, 'position', 'x', 'y', position, true) ?? position;\n continue;\n }\n const match = forPattern.exec(group.content);\n if (match === null) {\n context.error(DiagnosticCodes.InvalidSeedGroup, `Invalid seed group '${group.content}' - expected 'for \"<event source id>\"'`, locationOf(group));\n context.skipOpaqueBlock(group.indent);\n continue;\n }\n const events: SeedEventSyntax[] = [];\n for (let event = context.peekChild(group.indent); event !== undefined; event = context.peekChild(group.indent)) {\n context.reader.takeSignificant();\n if (!eventPattern.test(event.content)) {\n context.error(DiagnosticCodes.InvalidSeedEvent, `Invalid seed event '${event.content}' - expected an event type name`, locationOf(event));\n context.skipOpaqueBlock(event.indent);\n continue;\n }\n const properties: PropertyMappingSyntax[] = [];\n for (let property = context.peekChild(event.indent); property !== undefined; property = context.peekChild(event.indent)) {\n context.reader.takeSignificant();\n const mapped = mappingPattern.exec(property.content);\n const structured = mapped === null ? tryParseStructuredMapping(context, property) : undefined;\n if (mapped !== null) properties.push({ kind: 'PropertyMappingSyntax', property: mapped[1], source: parseMappingSource(mapped[2], locationOf(property), context), location: locationOf(property) });\n else if (structured !== undefined) properties.push(structured);\n else context.error(DiagnosticCodes.InvalidSeedPropertyAssignment, `Invalid property assignment '${property.content}' - expected '<property> = <value>'`, locationOf(property));\n }\n events.push({ kind: 'SeedEventSyntax', event: event.content, properties, location: locationOf(event) });\n }\n groups.push({ kind: 'SeedGroupSyntax', eventSourceId: unescapeString(match[1]), events, location: locationOf(group) });\n }\n return { kind: 'SeedSyntax', groups, ...(headerMatch[1] === undefined ? {} : { name: unescapeString(headerMatch[1]) }), ...(position === null ? {} : { x: position[0], y: position[1] }), location: locationOf(header) };\n}\n"],"mappings":"A,qhBAeA,MAAME,EAAoB,OAAO,iBAAiBC,EAAkB,OAAQ,GAAG,EACzEC,EAAiB,OAAO,aAAaD,EAAkB,KAAM,GAAG,EAChEE,EAAeL,EAAQ,aAAa,EACpCO,EAAiBP,EAAQ,iCAAiC,EAEhE,SAAgB,UAAU,EAAwB,EAAgC,CAC9E,IAAMQ,EAA4B,CAAC,EACnC,EAAUC,EAAQ,aAClB,IAAMC,EAAcR,EAAc,KAAKS,EAAO,OAAO,EACrD,GAAID,IAAgB,KAGhB,OAFAD,EAAQ,MAAMG,EAAgB,uBAAwB,6BAA6BD,EAAO,QAAQ,wCAAyCE,EAAWF,CAAM,CAAC,EAC7JF,EAAQ,gBAAgBE,EAAO,MAAM,EAC9B,CAAE,KAAM,aAAc,SAAQ,SAAUE,EAAWF,CAAM,CAAE,EAEtE,IAAIG,EAA6C,KACjD,IAAK,IAAIC,EAAQN,EAAQ,UAAUE,EAAO,MAAM,EAAGI,IAAU,IAAA,GAAW,EAAQN,EAAQ,UAAUE,EAAO,MAAM,EAAG,CAE9G,GADAF,EAAQ,OAAO,gBAAgB,EAC3BO,EAAUD,EAAM,OAAO,IAAM,WAAY,CACzC,EAAWE,EAAgBR,EAASM,EAAO,WAAY,IAAK,IAAKD,EAAU,EAAI,GAAKA,EACpF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S,aAAY,SAAUP,EAAWO,CAAK,CAAE,CAAC,CAC1G,CACAZ,EAAO,KAAK,CAAE,KAAM,kBAAmB,cAAemB,EAAeT,EAAM,EAAE,EAAG,SAAQ,SAAUL,EAAWE,CAAK,CAAE,CAAC,CACzH,CACA,MAAO,CAAE,KAAM,aAAc,SAAQ,GAAIL,EAAY,KAAO,IAAA,GAAY,CAAC,EAAI,CAAE,KAAMiB,EAAejB,EAAY,EAAE,CAAE,EAAI,GAAII,IAAa,KAAO,CAAC,EAAI,CAAE,EAAGA,EAAS,GAAI,EAAGA,EAAS,EAAG,EAAI,SAAUD,EAAWF,CAAM,CAAE,CAC3N,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{sliceTypes as t}from"../Syntax/Structure.js";import{pattern as n}from"../Text/patterns.js";import{parseCapture as r}from"./CaptureParser.js";import{parseCommand as i}from"./CommandParser.js";import{dependencySources as a}from"../Syntax/DependencySources.js";import{captureReducer as o}from"./DependencySourceParser.js";import{parseConstraint as s}from"./ConstraintParser.js";import{parseEvent as c,parseReadModel as l}from"./DeclarationParsers.js";import{parseDescription as u}from"./DescriptionParser.js";import{parsePurposeReference as d}from"./PurposeParser.js";import{parseDocumentation as f}from"./DocumentationParser.js";import{isFileDirective as p}from"./FileReferences.js";import{firstWord as m}from"./LineText.js";import{parseOperation as h}from"./OperationParser.js";import{parseProjection as g}from"./ProjectionParser.js";import{parseQuery as _}from"./QueryParser.js";import{parseReaction as v}from"./ReactionParser.js";import{misplacedReactionIdentity as y}from"./ReactionIdentityParser.js";import{parseScreen as b}from"./ScreenParser.js";import{parseExample as x}from"./SpecificationExampleParser.js";import{parseSpecification as S}from"./SpecificationParser.js";import{locationOf as C}from"./SourceLine.js";const w=n(`^slice\\s+([A-Za-z]\\w*)\\s+([A-Za-z_]\\w*)$`),T=/* @__PURE__ */ new Set([`reducer`]);function parseSlice(n,E){let D=w.exec(E.content),O=`StateChange`,k=``;D===null?n.error(e.InvalidSliceDeclaration,`Invalid slice declaration '${E.content}' - expected 'slice <Type> <Name>'`,C(E)):(k=D[2],t.includes(D[1])?O=D[1]:n.error(e.UnknownSliceType,`Unknown slice type '${D[1]}' - expected StateChange, StateView, Automation or Translate`,C(E)));let A=n.scope;n.scope=[...A,k];let j=null,M=!1,N=null,P=null,F=[],I=[],L=[],R=[],z=[],B=[],V=[],H=[],U=[],W=[],G=[],K=[],q=[],J=[];for(let t=n.peekChild(E.indent);t!==void 0;t=n.peekChild(E.indent)){if(n.reader.takeSignificant(),p(t))continue;let a=t.content.split(/[ \t]/,1)[0],w=a===`public`||a===`direction`?a:m(t.content);if(w===`description`)N=u(n,t,N,`Slice '${k}'`);else if(w===`documentation`)P=f(n,t,P,`Slice '${k}'`);else if(w===`purpose`)d(n,t,G);else if(w===`operation`)I.push(h(n,t).operation);else if(w===`direction`){let r=/^direction\s+(inbound|outbound)$/.exec(t.content);M||O!==`Translate`||r===null?n.error(e.InvalidSliceDeclaration,`Declare direction inbound or direction outbound once, inside a Translate slice only`,C(t)):j=r[1]===`inbound`?`Inbound`:`Outbound`,M=!0}else w===`event`||w===`public`?F.push(c(n,t)):w===`command`?L.push(i(n,t)):w===`query`?R.push(_(n,t)):w===`projection`?z.push(g(n,t)):w===`capture`?V.push(r(n,t)):w===`runs`?y(n,t):w===`reaction`?B.push(v(n,t)):w===`constraint`?H.push(s(n,t)):w===`example`?W.push(x(n,t)):w===`specification`?U.push(S(n,t)):w===`readmodel`?K.push(l(n,t)):w===`screen`?q.push(b(n,t)):T.has(w)?(J.push(o(n,t)),n.skipOpaqueBlock(t.indent)):(n.warning(e.UnknownSliceDirective,`Unknown construct '${w}' in slice '${k}'`,C(t)),n.skipBlock(t.indent))}n.scope=A;let Y={kind:`SliceSyntax`,type:O,name:k,direction:j,description:N,documentation:P,examples:W,purposes:G,events:F,operations:I,commands:L,queries:R,projections:z,captures:V,reactions:B,constraints:H,specifications:U,readModels:K,screens:q,location:C(E)};return a.set(Y,{reducers:J}),Y}export{parseSlice};
|
|
2
2
|
//# sourceMappingURL=SliceParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SliceParser.js","names":["header","pattern","opaqueMembers","match","line","type","name","context","DiagnosticCodes","locationOf","sliceTypes","previous","direction","hasDirection","description","documentation","events","operations","commands","queries","projections","reactions","captures","constraints","specifications","examples","purposes","readModels","screens","reducers","child","isFileDirective","metadataWord","keyword","firstWord","parseDescription","parseDocumentation","parsePurposeReference","parseOperation","directionMatch","parseEvent","parseCommand","parseQuery","parseProjection","parseCapture","misplacedReactionIdentity","parseReaction","parseConstraint","parseExample","parseSpecification","parseReadModel","parseScreen","captureReducer","syntax","dependencySources"],"sources":["../../../../../../Compiler/Parsing/SliceParser.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 { CaptureSyntax } from '../Syntax/Captures';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { ConstraintSyntax } from '../Syntax/Constraints';\nimport { EventSyntax, ReadModelSyntax } from '../Syntax/Declarations';\nimport { ProjectionSyntax } from '../Syntax/Projections';\nimport { QuerySyntax } from '../Syntax/Queries';\nimport { ReactionSyntax } from '../Syntax/Reactions';\nimport { ScreenSyntax } from '../Syntax/Screens';\nimport { SpecificationExampleSyntax, SpecificationSyntax } from '../Syntax/Specifications';\nimport { SliceSyntax, SliceType, sliceTypes } from '../Syntax/Structure';\nimport { pattern } from '../Text/patterns';\nimport { TranslationDirection } from '../Syntax/TranslationDirection';\nimport { parseCapture } from './CaptureParser';\nimport { parseCommand } from './CommandParser';\nimport { dependencySources, ReducerSyntax } from '../Syntax/DependencySources';\nimport { captureReducer } from './DependencySourceParser';\nimport { parseConstraint } from './ConstraintParser';\nimport { parseEvent, parseReadModel } from './DeclarationParsers';\nimport { parseDescription } from './DescriptionParser';\nimport { PurposeReferenceSyntax } from '../Syntax/Purposes';\nimport { parsePurposeReference } from './PurposeParser';\nimport { parseDocumentation } from './DocumentationParser';\nimport { isFileDirective } from './FileReferences';\nimport { firstWord } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { parseOperation } from './OperationParser';\nimport { OperationSyntax } from '../Syntax/Operations';\nimport { parseProjection } from './ProjectionParser';\nimport { parseQuery } from './QueryParser';\nimport { parseReaction } from './ReactionParser';\nimport { misplacedReactionIdentity } from './ReactionIdentityParser';\nimport { parseScreen } from './ScreenParser';\nimport { parseExample } from './SpecificationExampleParser';\nimport { parseSpecification } from './SpecificationParser';\nimport { locationOf, SourceLine } from './SourceLine';\n\nconst header = pattern('^slice\\\\s+([A-Za-z]\\\\w*)\\\\s+([A-Za-z_]\\\\w*)$');\n\n// Slice members the C# compiler knows that this compiler does not model yet. They are skipped whole rather\n// than reported - the C# compiler and the editor diagnostics remain the authority on whether they are valid.\nconst opaqueMembers = new Set(['reducer']);\n\nexport function parseSlice(context: ParserContext, line: SourceLine): SliceSyntax {\n const match = header.exec(line.content);\n let type: SliceType = 'StateChange';\n let name = '';\n if (match === null) {\n context.error(DiagnosticCodes.InvalidSliceDeclaration, `Invalid slice declaration '${line.content}' - expected 'slice <Type> <Name>'`, locationOf(line));\n } else {\n name = match[2];\n if ((sliceTypes as readonly string[]).includes(match[1])) {\n type = match[1] as SliceType;\n } else {\n context.error(DiagnosticCodes.UnknownSliceType, `Unknown slice type '${match[1]}' - expected StateChange, StateView, Automation or Translate`, locationOf(line));\n }\n }\n const previous = context.scope;\n context.scope = [...previous, name];\n let direction: TranslationDirection | null = null;\n let hasDirection = false;\n let description: string | null = null;\n let documentation: string | null = null;\n const events: EventSyntax[] = [];\n const operations: OperationSyntax[] = [];\n const commands: CommandSyntax[] = [];\n const queries: QuerySyntax[] = [];\n const projections: ProjectionSyntax[] = [];\n const reactions: ReactionSyntax[] = [];\n const captures: CaptureSyntax[] = [];\n const constraints: ConstraintSyntax[] = [];\n const specifications: SpecificationSyntax[] = [];\n const examples: SpecificationExampleSyntax[] = [];\n const purposes: PurposeReferenceSyntax[] = [];\n const readModels: ReadModelSyntax[] = [];\n const screens: ScreenSyntax[] = [];\n const reducers: ReducerSyntax[] = [];\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n if (isFileDirective(child)) {\n continue;\n }\n const metadataWord = child.content.split(/[ \\t]/, 1)[0];\n const keyword = metadataWord === 'public' || metadataWord === 'direction' ? metadataWord : firstWord(child.content);\n if (keyword === 'description') {\n description = parseDescription(context, child, description, `Slice '${name}'`);\n } else if (keyword === 'documentation') {\n documentation = parseDocumentation(context, child, documentation, `Slice '${name}'`);\n } else if (keyword === 'purpose') {\n parsePurposeReference(context, child, purposes);\n } else if (keyword === 'operation') {\n operations.push(parseOperation(context, child).operation);\n } else if (keyword === 'direction') {\n const directionMatch = /^direction\\s+(inbound|outbound)$/.exec(child.content);\n if (hasDirection || type !== 'Translate' || directionMatch === null) {\n context.error(DiagnosticCodes.InvalidSliceDeclaration, 'Declare direction inbound or direction outbound once, inside a Translate slice only', locationOf(child));\n } else {\n direction = directionMatch[1] === 'inbound' ? TranslationDirection.Inbound : TranslationDirection.Outbound;\n }\n hasDirection = true;\n } else if (keyword === 'event' || keyword === 'public') {\n events.push(parseEvent(context, child));\n } else if (keyword === 'command') {\n commands.push(parseCommand(context, child));\n } else if (keyword === 'query') {\n queries.push(parseQuery(context, child));\n } else if (keyword === 'projection') {\n projections.push(parseProjection(context, child));\n } else if (keyword === 'capture') {\n captures.push(parseCapture(context, child));\n } else if (keyword === 'runs') {\n misplacedReactionIdentity(context, child);\n } else if (keyword === 'reaction') {\n reactions.push(parseReaction(context, child));\n } else if (keyword === 'constraint') {\n constraints.push(parseConstraint(context, child));\n } else if (keyword === 'example') {\n examples.push(parseExample(context, child));\n } else if (keyword === 'specification') {\n specifications.push(parseSpecification(context, child));\n } else if (keyword === 'readmodel') {\n readModels.push(parseReadModel(context, child));\n } else if (keyword === 'screen') {\n screens.push(parseScreen(context, child));\n } else if (opaqueMembers.has(keyword)) {\n reducers.push(captureReducer(context, child));\n context.skipOpaqueBlock(child.indent);\n } else {\n context.warning(DiagnosticCodes.UnknownSliceDirective, `Unknown construct '${keyword}' in slice '${name}'`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n context.scope = previous;\n const syntax: SliceSyntax = {\n kind: 'SliceSyntax', type, name, direction, description, documentation, examples, purposes, events, operations, commands, queries, projections, captures, reactions, constraints, specifications, readModels, screens,\n location: locationOf(line),\n };\n dependencySources.set(syntax, { reducers });\n return syntax;\n}\n"],"mappings":"q0CAwCA,MAAMA,EAASC,EAAQ,8CAA8C,EAI/DC,kBAAgB,IAAI,IAAI,CAAC,SAAS,CAAC,EAEzC,SAAgB,WAAW,EAAwB,EAA+B,CAC9E,IAAMC,EAAQH,EAAO,KAAKI,EAAK,OAAO,EAClCC,EAAkB,cAClBC,EAAO,GACPH,IAAU,KACVI,EAAQ,MAAMC,EAAgB,wBAAyB,8BAA8BJ,EAAK,QAAQ,oCAAqCK,EAAWL,CAAI,CAAC,GAEvJ,EAAOD,EAAM,GACRO,EAAiC,SAASP,EAAM,EAAE,EACnD,EAAOA,EAAM,GAEbI,EAAQ,MAAMC,EAAgB,iBAAkB,uBAAuBL,EAAM,GAAG,8DAA+DM,EAAWL,CAAI,CAAC,GAGvK,IAAMO,EAAWJ,EAAQ,MACzB,EAAQ,MAAQ,CAAC,GAAGI,EAAUL,CAAI,EAClC,IAAIM,EAAyC,KACzCC,EAAe,GACfC,EAA6B,KAC7BC,EAA+B,KAC7BC,EAAwB,CAAC,EACzBC,EAAgC,CAAC,EACjCC,EAA4B,CAAC,EAC7BC,EAAyB,CAAC,EAC1BC,EAAkC,CAAC,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AAKuB,EAAWnC,EAASuB,CAAK,CAAC,EAChCG,IAAY,aACnBb,EAAY,KAAKuB,EAAgBpC,EAASuB,CAAK,CAAC,EACzCG,IAAY,UACnBX,EAAS,KAAKsB,EAAarC,EAASuB,CAAK,CAAC,EACnCG,IAAY,OACnBY,EAA0BtC,EAASuB,CAAK,EACjCG,IAAY,WACnBZ,EAAU,KAAKyB,EAAcvC,EAASuB,CAAK,CAAC,EACrCG,IAAY,aACnBV,EAAY,KAAKwB,EAAgBxC,EAASuB,CAAK,CAAC,EACzCG,IAAY,UACnBR,EAAS,KAAKuB,EAAazC,EAASuB,CAAK,CAAC,EACnCG,IAAY,gBACnBT,EAAe,KAAKyB,EAAmB1C,EAASuB,CAAK,CAAC,EAC/CG,IAAY,YACnBN,EAAW,KAAKuB,EAAe3C,EAASuB,CAAK,CAAC,EACvCG,IAAY,SACnBL,EAAQ,KAAKuB,EAAY5C,EAASuB,CAAK,CAAC,EACjC5B,EAAc,IAAI+B,CAAO,GAChCJ,EAAS,KAAKuB,EAAe7C,EAASuB,CAAK,CAAC,EAC5CvB,EAAQ,gBAAgBuB,EAAM,MAAM,IAEpCvB,EAAQ,QAAQC,EAAgB,sBAAuB,sBAAsByB,EAAQ,cAAc3B,EAAK,GAAIG,EAAWqB,CAAK,CAAC,EAC7HvB,EAAQ,UAAUuB,EAAM,MAAM,EAEtC,CACA,EAAQ,MAAQnB,EAChB,IAAM0C,EAAsB,CACxB,KAAM,cAAe,OAAM,OAAM,YAAW,cAAa,gBAAe,WAAU,WAAU,SAAQ,aAAY,WAAU,UAAS,cAAa,WAAU,YAAW,cAAa,iBAAgB,aAAY,UAC9M,SAAU5C,EAAWL,CAAI,CAC7B,EAEA,OADAkD,EAAkB,IAAID,EAAQ,CAAE,UAAS,CAAC,EACnCA,CACX"}
|
|
1
|
+
{"version":3,"file":"SliceParser.js","names":["header","pattern","opaqueMembers","match","line","type","name","context","DiagnosticCodes","locationOf","sliceTypes","previous","direction","hasDirection","description","documentation","events","operations","commands","queries","projections","reactions","captures","constraints","specifications","examples","purposes","readModels","screens","reducers","child","isFileDirective","metadataWord","keyword","firstWord","parseDescription","parseDocumentation","parsePurposeReference","parseOperation","directionMatch","parseEvent","parseCommand","parseQuery","parseProjection","parseCapture","misplacedReactionIdentity","parseReaction","parseConstraint","parseExample","parseSpecification","parseReadModel","parseScreen","captureReducer","syntax","dependencySources"],"sources":["../../../../../../Compiler/Parsing/SliceParser.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 { CaptureSyntax } from '../Syntax/Captures';\nimport { CommandSyntax } from '../Syntax/Commands';\nimport { ConstraintSyntax } from '../Syntax/Constraints';\nimport { EventSyntax, ReadModelSyntax } from '../Syntax/Declarations';\nimport { ProjectionSyntax } from '../Syntax/Projections';\nimport { QuerySyntax } from '../Syntax/Queries';\nimport { ReactionSyntax } from '../Syntax/Reactions';\nimport { ScreenSyntax } from '../Syntax/Screens';\nimport { SpecificationExampleSyntax, SpecificationSyntax } from '../Syntax/Specifications';\nimport { SliceSyntax, SliceType, sliceTypes } from '../Syntax/Structure';\nimport { pattern } from '../Text/patterns';\nimport { TranslationDirection } from '../Syntax/TranslationDirection';\nimport { parseCapture } from './CaptureParser';\nimport { parseCommand } from './CommandParser';\nimport { dependencySources, ReducerSyntax } from '../Syntax/DependencySources';\nimport { captureReducer } from './DependencySourceParser';\nimport { parseConstraint } from './ConstraintParser';\nimport { parseEvent, parseReadModel } from './DeclarationParsers';\nimport { parseDescription } from './DescriptionParser';\nimport { PurposeReferenceSyntax } from '../Syntax/Purposes';\nimport { parsePurposeReference } from './PurposeParser';\nimport { parseDocumentation } from './DocumentationParser';\nimport { isFileDirective } from './FileReferences';\nimport { firstWord } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { parseOperation } from './OperationParser';\nimport { OperationSyntax } from '../Syntax/Operations';\nimport { parseProjection } from './ProjectionParser';\nimport { parseQuery } from './QueryParser';\nimport { parseReaction } from './ReactionParser';\nimport { misplacedReactionIdentity } from './ReactionIdentityParser';\nimport { parseScreen } from './ScreenParser';\nimport { parseExample } from './SpecificationExampleParser';\nimport { parseSpecification } from './SpecificationParser';\nimport { locationOf, SourceLine } from './SourceLine';\n\nconst header = pattern('^slice\\\\s+([A-Za-z]\\\\w*)\\\\s+([A-Za-z_]\\\\w*)$');\n\n// Slice members the C# compiler knows that this compiler does not model yet. They are skipped whole rather\n// than reported - the C# compiler and the editor diagnostics remain the authority on whether they are valid.\nconst opaqueMembers = new Set(['reducer']);\n\nexport function parseSlice(context: ParserContext, line: SourceLine): SliceSyntax {\n const match = header.exec(line.content);\n let type: SliceType = 'StateChange';\n let name = '';\n if (match === null) {\n context.error(DiagnosticCodes.InvalidSliceDeclaration, `Invalid slice declaration '${line.content}' - expected 'slice <Type> <Name>'`, locationOf(line));\n } else {\n name = match[2];\n if ((sliceTypes as readonly string[]).includes(match[1])) {\n type = match[1] as SliceType;\n } else {\n context.error(DiagnosticCodes.UnknownSliceType, `Unknown slice type '${match[1]}' - expected StateChange, StateView, Automation or Translate`, locationOf(line));\n }\n }\n const previous = context.scope;\n context.scope = [...previous, name];\n let direction: TranslationDirection | null = null;\n let hasDirection = false;\n let description: string | null = null;\n let documentation: string | null = null;\n const events: EventSyntax[] = [];\n const operations: OperationSyntax[] = [];\n const commands: CommandSyntax[] = [];\n const queries: QuerySyntax[] = [];\n const projections: ProjectionSyntax[] = [];\n const reactions: ReactionSyntax[] = [];\n const captures: CaptureSyntax[] = [];\n const constraints: ConstraintSyntax[] = [];\n const specifications: SpecificationSyntax[] = [];\n const examples: SpecificationExampleSyntax[] = [];\n const purposes: PurposeReferenceSyntax[] = [];\n const readModels: ReadModelSyntax[] = [];\n const screens: ScreenSyntax[] = [];\n const reducers: ReducerSyntax[] = [];\n for (let child = context.peekChild(line.indent); child !== undefined; child = context.peekChild(line.indent)) {\n context.reader.takeSignificant();\n if (isFileDirective(child)) {\n continue;\n }\n const metadataWord = child.content.split(/[ \\t]/, 1)[0];\n const keyword = metadataWord === 'public' || metadataWord === 'direction' ? metadataWord : firstWord(child.content);\n if (keyword === 'description') {\n description = parseDescription(context, child, description, `Slice '${name}'`);\n } else if (keyword === 'documentation') {\n documentation = parseDocumentation(context, child, documentation, `Slice '${name}'`);\n } else if (keyword === 'purpose') {\n parsePurposeReference(context, child, purposes);\n } else if (keyword === 'operation') {\n operations.push(parseOperation(context, child).operation);\n } else if (keyword === 'direction') {\n const directionMatch = /^direction\\s+(inbound|outbound)$/.exec(child.content);\n if (hasDirection || type !== 'Translate' || directionMatch === null) {\n context.error(DiagnosticCodes.InvalidSliceDeclaration, 'Declare direction inbound or direction outbound once, inside a Translate slice only', locationOf(child));\n } else {\n direction = directionMatch[1] === 'inbound' ? TranslationDirection.Inbound : TranslationDirection.Outbound;\n }\n hasDirection = true;\n } else if (keyword === 'event' || keyword === 'public') {\n events.push(parseEvent(context, child));\n } else if (keyword === 'command') {\n commands.push(parseCommand(context, child));\n } else if (keyword === 'query') {\n queries.push(parseQuery(context, child));\n } else if (keyword === 'projection') {\n projections.push(parseProjection(context, child));\n } else if (keyword === 'capture') {\n captures.push(parseCapture(context, child));\n } else if (keyword === 'runs') {\n misplacedReactionIdentity(context, child);\n } else if (keyword === 'reaction') {\n reactions.push(parseReaction(context, child));\n } else if (keyword === 'constraint') {\n constraints.push(parseConstraint(context, child));\n } else if (keyword === 'example') {\n examples.push(parseExample(context, child));\n } else if (keyword === 'specification') {\n specifications.push(parseSpecification(context, child));\n } else if (keyword === 'readmodel') {\n readModels.push(parseReadModel(context, child));\n } else if (keyword === 'screen') {\n screens.push(parseScreen(context, child));\n } else if (opaqueMembers.has(keyword)) {\n reducers.push(captureReducer(context, child));\n context.skipOpaqueBlock(child.indent);\n } else {\n context.warning(DiagnosticCodes.UnknownSliceDirective, `Unknown construct '${keyword}' in slice '${name}'`, locationOf(child));\n context.skipBlock(child.indent);\n }\n }\n context.scope = previous;\n const syntax: SliceSyntax = {\n kind: 'SliceSyntax', type, name, direction, description, documentation, examples, purposes, events, operations, commands, queries, projections, captures, reactions, constraints, specifications, readModels, screens,\n location: locationOf(line),\n };\n dependencySources.set(syntax, { reducers });\n return syntax;\n}\n"],"mappings":"A,q0CAwCA,MAAMA,EAASC,EAAQ,8CAA8C,EAI/DC,kBAAgB,IAAI,IAAI,CAAC,SAAS,CAAC,EAEzC,SAAgB,WAAW,EAAwB,EAA+B,CAC9E,IAAMC,EAAQH,EAAO,KAAKI,EAAK,OAAO,EAClCC,EAAkB,cAClBC,EAAO,GACPH,IAAU,KACVI,EAAQ,MAAMC,EAAgB,wBAAyB,8BAA8BJ,EAAK,QAAQ,oCAAqCK,EAAWL,CAAI,CAAC,GAEvJ,EAAOD,EAAM,GACRO,EAAiC,SAASP,EAAM,EAAE,EACnD,EAAOA,EAAM,GAEbI,EAAQ,MAAMC,EAAgB,iBAAkB,uBAAuBL,EAAM,GAAG,8DAA+DM,EAAWL,CAAI,CAAC,GAGvK,IAAMO,EAAWJ,EAAQ,MACzB,EAAQ,MAAQ,CAAC,GAAGI,EAAUL,CAAI,EAClC,IAAIM,EAAyC,KACzCC,EAAe,GACfC,EAA6B,KAC7BC,EAA+B,KAC7BC,EAAwB,CAAC,EACzBC,EAAgC,CAAC,EACjCC,EAA4B,CAAC,EAC7BC,EAAyB,CAAC,EAC1BC,EAAkC,CAAC,EACnCC,EAA8B,CAAC,EAC/BC,EAA4B,CAAC,EAC7BC,EAAkC,CAAC,EACnCC,EAAwC,CAAC,EACzCC,EAAyC,CAAC,EAC1CC,EAAqC,CAAC,EACtCC,EAAgC,CAAC,EACjCC,EAA0B,CAAC,EAC3BC,EAA4B,CAAC,EACnC,IAAK,IAAIC,EAAQvB,EAAQ,UAAUH,EAAK,MAAM,EAAG0B,IAAU,IAAA,GAAW,EAAQvB,EAAQ,UAAUH,EAAK,MAAM,EAAG,CAE1G,GADAG,EAAQ,OAAO,g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IAAY,UACnBR,EAAS,KAAKuB,EAAazC,EAASuB,CAAK,CAAC,EACnCG,IAAY,gBACnBT,EAAe,KAAKyB,EAAmB1C,EAASuB,CAAK,CAAC,EAC/CG,IAAY,YACnBN,EAAW,KAAKuB,EAAe3C,EAASuB,CAAK,CAAC,EACvCG,IAAY,SACnBL,EAAQ,KAAKuB,EAAY5C,EAASuB,CAAK,CAAC,EACjC5B,EAAc,IAAI+B,CAAO,GAChCJ,EAAS,KAAKuB,EAAe7C,EAASuB,CAAK,CAAC,EAC5CvB,EAAQ,gBAAgBuB,EAAM,MAAM,IAEpCvB,EAAQ,QAAQC,EAAgB,sBAAuB,sBAAsByB,EAAQ,cAAc3B,EAAK,GAAIG,EAAWqB,CAAK,CAAC,EAC7HvB,EAAQ,UAAUuB,EAAM,MAAM,EAEtC,CACA,EAAQ,MAAQnB,EAChB,IAAM0C,EAAsB,CACxB,KAAM,cAAe,OAAM,OAAM,YAAW,cAAa,gBAAe,WAAU,WAAU,SAAQ,aAAY,WAAU,UAAS,cAAa,WAAU,YAAW,cAAa,iBAAgB,aAAY,UAC9M,SAAU5C,EAAWL,CAAI,CAC7B,EAEA,OADAkD,EAAkB,IAAID,EAAQ,CAAE,UAAS,CAAC,EACnCA,CACX,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceLine.js","names":["line","sourceLocation"],"sources":["../../../../../../Compiler/Parsing/SourceLine.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, sourceLocation } from '../Diagnostics/SourceLocation';\n\n// One physical line of a document: its raw text, how far it is indented and what is left once comments and\n// trailing whitespace are gone. The offside rule reads nesting from the indent alone.\nexport interface SourceLine {\n readonly number: number;\n readonly raw: string;\n readonly indent: number;\n readonly content: string;\n readonly contentOffset?: number;\n readonly path?: string;\n readonly startOffset: number;\n}\n\nexport const isBlank = (line: SourceLine): boolean => line.content.length === 0;\n\n// The location of the line's first significant character.\nexport const locationOf = (line: SourceLine): SourceLocation => sourceLocation(line.number, line.indent + (line.contentOffset ?? 0) + 1, line.path);\n\n// The location of the line's first column, whatever its indent.\nexport const startOf = (line: SourceLine): SourceLocation => sourceLocation(line.number, 1, line.path);\n"],"mappings":"uHAiBA,MAAa,QAAW,GAA8BA,EAAK,QAAQ,SAAW,EAGjE,WAAc,GAAqCC,EAAeD,EAAK,OAAQA,EAAK,QAAUA,EAAK,eAAiB,GAAK,EAAGA,EAAK,IAAI,EAGrI,QAAW,GAAqCC,EAAeD,EAAK,OAAQ,EAAGA,EAAK,IAAI"}
|
|
1
|
+
{"version":3,"file":"SourceLine.js","names":["line","sourceLocation"],"sources":["../../../../../../Compiler/Parsing/SourceLine.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, sourceLocation } from '../Diagnostics/SourceLocation';\n\n// One physical line of a document: its raw text, how far it is indented and what is left once comments and\n// trailing whitespace are gone. The offside rule reads nesting from the indent alone.\nexport interface SourceLine {\n readonly number: number;\n readonly raw: string;\n readonly indent: number;\n readonly content: string;\n readonly contentOffset?: number;\n readonly path?: string;\n readonly startOffset: number;\n}\n\nexport const isBlank = (line: SourceLine): boolean => line.content.length === 0;\n\n// The location of the line's first significant character.\nexport const locationOf = (line: SourceLine): SourceLocation => sourceLocation(line.number, line.indent + (line.contentOffset ?? 0) + 1, line.path);\n\n// The location of the line's first column, whatever its indent.\nexport const startOf = (line: SourceLine): SourceLocation => sourceLocation(line.number, 1, line.path);\n"],"mappings":"A,uHAiBA,MAAa,QAAW,GAA8BA,EAAK,QAAQ,SAAW,EAGjE,WAAc,GAAqCC,EAAeD,EAAK,OAAQA,EAAK,QAAUA,EAAK,eAAiB,GAAK,EAAGA,EAAK,IAAI,EAGrI,QAAW,GAAqCC,EAAeD,EAAK,OAAQ,EAAGA,EAAK,IAAI,E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceLineSplitter.js","names":["dependencyPrefix","dotNetWhitespace","dependencyTrailingWhitespace","result","number","offset","raw","source","line","indent","body","hashComments","content","path","inString","inTemplate","index","text","current","comment"],"sources":["../../../../../../Compiler/Parsing/SourceLineSplitter.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 { dotNetWhitespace } from '../Text/patterns';\nimport { SourceLine } from './SourceLine';\n\nconst dependencyPrefix = new RegExp(`^depends${dotNetWhitespace}+on(?:${dotNetWhitespace}|$)`, 'u');\nconst dependencyTrailingWhitespace = new RegExp(`${dotNetWhitespace}+$`, 'u');\n\n// Splits a document into lines the way the C# SourceLineSplitter does: a line's indent is its leading\n// whitespace, and its content is what follows with any comment and trailing whitespace removed. A comment\n// starts at '//' (or '#' in the sub-languages that use it) outside a string or a template literal.\nexport function splitLines(source: string, hashComments = false, path?: string): SourceLine[] {\n const result: SourceLine[] = [];\n let number = 0;\n let offset = 0;\n for (const raw of source.split('\\n')) {\n number++;\n const line = raw.endsWith('\\r') ? raw.replace(/\\r+$/, '') : raw;\n const indent = line.length - line.trimStart().length;\n const body = stripComment(line.substring(indent), hashComments);\n // Dependency grammar follows .NET's whitespace exactly, including NEL but not FEFF.\n const content = dependencyPrefix.test(body) ? body.replace(dependencyTrailingWhitespace, '') : body.trimEnd();\n result.push(path === undefined\n ? { number, raw: line, indent, content, startOffset: offset }\n : { number, raw: line, indent, content, path, startOffset: offset });\n offset += raw.length + 1;\n }\n return result;\n}\n\n// The index a comment starts at in the text, or -1 when it has none.\nexport function commentStart(text: string, hashComments = false): number {\n let inString = false;\n let inTemplate = false;\n for (let index = 0; index < text.length; index++) {\n const current = text[index];\n if (current === '\\\\' && inString && index + 1 < text.length) {\n index++;\n } else if (current === '\"' && !inTemplate) {\n inString = !inString;\n } else if (current === '`' && !inString) {\n inTemplate = !inTemplate;\n } else if (!inString && !inTemplate) {\n if (current === '/' && index + 1 < text.length && text[index + 1] === '/') {\n return index;\n }\n if (hashComments && current === '#') {\n return index;\n }\n }\n }\n return -1;\n}\n\nfunction stripComment(text: string, hashComments: boolean): string {\n const comment = commentStart(text, hashComments);\n return comment < 0 ? text : text.substring(0, comment);\n}\n"],"mappings":"4GAMA,MAAMA,EAAuB,OAAO,WAAWC,EAAiB,QAAQA,EAAiB,KAAM,GAAG,EAC5FC,EAAmC,OAAO,GAAGD,EAAiB,IAAK,GAAG,EAK5E,SAAgB,WAAW,EAAgB,EAAe,GAAO,EAA6B,CAC1F,IAAME,EAAuB,CAAC,EAC1BC,EAAS,EACTC,EAAS,EACb,IAAK,IAAMC,KAAOC,EAAO,MAAM;CAAI,EAAG,CAClC,IACA,IAAMC,EAAOF,EAAI,SAAS,IAAI,EAAIA,EAAI,QAAQ,OAAQ,EAAE,EAAIA,EACtDG,EAASD,EAAK,OAASA,EAAK,UAAU,CAAC,CAAC,OACxCE,EAAO,aAAaF,EAAK,UAAUC,CAAM,EAAGE,CAAY,EAExDC,EAAUZ,EAAiB,KAAKU,CAAI,EAAIA,EAAK,QAAQR,EAA8B,EAAE,EAAIQ,EAAK,QAAQ,EAC5GP,EAAO,KAAKU,IAAS,IAAA,GACf,CAAE,SAAQ,IAAKL,EAAM,SAAQ,UAAS,YAAaH,CAAO,EAC1D,CAAE,SAAQ,IAAKG,EAAM,SAAQ,UAAS,OAAM,YAAaH,CAAO,CAAC,EACvE,GAAUC,EAAI,OAAS,CAC3B,CACA,OAAOH,CACX,CAGA,SAAgB,aAAa,EAAc,EAAe,GAAe,CACrE,IAAIW,EAAW,GACXC,EAAa,GACjB,IAAK,IAAIC,EAAQ,EAAGA,EAAQC,EAAK,OAAQ,IAAS,CAC9C,IAAMC,EAAUD,EAAKD,GACrB,GAAIE,IAAY,MAAQJ,GAAYE,EAAQ,EAAIC,EAAK,OACjD,SACG,GAAIC,IAAY,KAAO,CAACH,EAC3B,EAAW,CAACD,OACT,GAAII,IAAY,KAAO,CAACJ,EAC3B,EAAa,CAACC,OACX,GAAI,CAACD,GAAY,CAACC,IACjBG,IAAY,KAAOF,EAAQ,EAAIC,EAAK,QAAUA,EAAKD,EAAQ,KAAO,KAGlEL,GAAgBO,IAAY,KAC5B,OAAOF,CAGnB,CACA,MAAO,EACX,CAEA,SAAS,aAAa,EAAc,EAA+B,CAC/D,IAAMG,EAAU,aAAaF,EAAMN,CAAY,EAC/C,OAAOQ,EAAU,EAAIF,EAAOA,EAAK,UAAU,EAAGE,CAAO,CACzD"}
|
|
1
|
+
{"version":3,"file":"SourceLineSplitter.js","names":["dependencyPrefix","dotNetWhitespace","dependencyTrailingWhitespace","result","number","offset","raw","source","line","indent","body","hashComments","content","path","inString","inTemplate","index","text","current","comment"],"sources":["../../../../../../Compiler/Parsing/SourceLineSplitter.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 { dotNetWhitespace } from '../Text/patterns';\nimport { SourceLine } from './SourceLine';\n\nconst dependencyPrefix = new RegExp(`^depends${dotNetWhitespace}+on(?:${dotNetWhitespace}|$)`, 'u');\nconst dependencyTrailingWhitespace = new RegExp(`${dotNetWhitespace}+$`, 'u');\n\n// Splits a document into lines the way the C# SourceLineSplitter does: a line's indent is its leading\n// whitespace, and its content is what follows with any comment and trailing whitespace removed. A comment\n// starts at '//' (or '#' in the sub-languages that use it) outside a string or a template literal.\nexport function splitLines(source: string, hashComments = false, path?: string): SourceLine[] {\n const result: SourceLine[] = [];\n let number = 0;\n let offset = 0;\n for (const raw of source.split('\\n')) {\n number++;\n const line = raw.endsWith('\\r') ? raw.replace(/\\r+$/, '') : raw;\n const indent = line.length - line.trimStart().length;\n const body = stripComment(line.substring(indent), hashComments);\n // Dependency grammar follows .NET's whitespace exactly, including NEL but not FEFF.\n const content = dependencyPrefix.test(body) ? body.replace(dependencyTrailingWhitespace, '') : body.trimEnd();\n result.push(path === undefined\n ? { number, raw: line, indent, content, startOffset: offset }\n : { number, raw: line, indent, content, path, startOffset: offset });\n offset += raw.length + 1;\n }\n return result;\n}\n\n// The index a comment starts at in the text, or -1 when it has none.\nexport function commentStart(text: string, hashComments = false): number {\n let inString = false;\n let inTemplate = false;\n for (let index = 0; index < text.length; index++) {\n const current = text[index];\n if (current === '\\\\' && inString && index + 1 < text.length) {\n index++;\n } else if (current === '\"' && !inTemplate) {\n inString = !inString;\n } else if (current === '`' && !inString) {\n inTemplate = !inTemplate;\n } else if (!inString && !inTemplate) {\n if (current === '/' && index + 1 < text.length && text[index + 1] === '/') {\n return index;\n }\n if (hashComments && current === '#') {\n return index;\n }\n }\n }\n return -1;\n}\n\nfunction stripComment(text: string, hashComments: boolean): string {\n const comment = commentStart(text, hashComments);\n return comment < 0 ? text : text.substring(0, comment);\n}\n"],"mappings":"A,4GAMA,MAAMA,EAAuB,OAAO,WAAWC,EAAiB,QAAQA,EAAiB,KAAM,GAAG,EAC5FC,EAAmC,OAAO,GAAGD,EAAiB,IAAK,GAAG,EAK5E,SAAgB,WAAW,EAAgB,EAAe,GAAO,EAA6B,CAC1F,IAAME,EAAuB,CAAC,EAC1BC,EAAS,EACTC,EAAS,EACb,IAAK,IAAMC,KAAOC,EAAO,MAAM;CAAI,EAAG,CAClC,IACA,IAAMC,EAAOF,EAAI,SAAS,IAAI,EAAIA,EAAI,QAAQ,OAAQ,EAAE,EAAIA,EACtDG,EAASD,EAAK,OAASA,EAAK,UAAU,CAAC,CAAC,OACxCE,EAAO,aAAaF,EAAK,UAAUC,CAAM,EAAGE,CAAY,EAExDC,EAAUZ,EAAiB,KAAKU,CAAI,EAAIA,EAAK,QAAQR,EAA8B,EAAE,EAAIQ,EAAK,QAAQ,EAC5GP,EAAO,KAAKU,IAAS,IAAA,GACf,CAAE,SAAQ,IAAKL,EAAM,SAAQ,UAAS,YAAaH,CAAO,EAC1D,CAAE,SAAQ,IAAKG,EAAM,SAAQ,UAAS,OAAM,YAAaH,CAAO,CAAC,EACvE,GAAUC,EAAI,OAAS,CAC3B,CACA,OAAOH,CACX,CAGA,SAAgB,aAAa,EAAc,EAAe,GAAe,CACrE,IAAIW,EAAW,GACXC,EAAa,GACjB,IAAK,IAAIC,EAAQ,EAAGA,EAAQC,EAAK,OAAQ,IAAS,CAC9C,IAAMC,EAAUD,EAAKD,GACrB,GAAIE,IAAY,MAAQJ,GAAYE,EAAQ,EAAIC,EAAK,OACjD,SACG,GAAIC,IAAY,KAAO,CAACH,EAC3B,EAAW,CAACD,OACT,GAAII,IAAY,KAAO,CAACJ,EAC3B,EAAa,CAACC,OACX,GAAI,CAACD,GAAY,CAACC,IACjBG,IAAY,KAAOF,EAAQ,EAAIC,EAAK,QAAUA,EAAKD,EAAQ,KAAO,KAGlEL,GAAgBO,IAAY,KAC5B,OAAOF,CAGnB,CACA,MAAO,EACX,CAEA,SAAS,aAAa,EAAc,EAA+B,CAC/D,IAAMG,EAAU,aAAaF,EAAMN,CAAY,EAC/C,OAAOQ,EAAU,EAAIF,EAAOA,EAAK,UAAU,EAAGE,CAAO,CACzD,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{exactSourceOptions as t,legacySourceOptions as n}from"../Syntax/SourceOptions.js";import{LineReader as r}from"./LineReader.js";import{isClosingCodeFence as i}from"./ImplementationParser.js";import{firstWord as a}from"./LineText.js";import{ParserContext as o}from"./ParserContext.js";import{locationOf as s}from"./SourceLine.js";import{commentStart as c}from"./SourceLineSplitter.js";function sourceContext(l,u,d,f=!1){let p=[],m=[],h=n,g=!1,_=!1,v=!1,y=/* @__PURE__ */ new Map,b=new o(new r([]),u,d).languages;for(let n of l){let r=n;if(r.number===1&&r.raw.startsWith(``)){let e=r.raw.substring(1),t=e.length-e.trimStart().length,n=c(e.substring(t),f);r={...r,indent:t,contentOffset:1,content:(n<0?e.substring(t):e.substring(t,t+n)).trimEnd()}}if(v)i(r)&&(v=!1),p.push(r);else if(r.content.startsWith("```")&&(["```","```text","```markdown"].includes(r.content)||b.has(r.content.substring(3)))&&(v=!0),!v&&r.indent===0&&a(r.content)===`numbers`){let n=r.content===`numbers exact`?g?e.DuplicateNumericDirective:_?e.LateNumericDirective:void 0:e.InvalidNumericDirective;n===void 0?h=t:(m.push({severity:`error`,code:n,message:`Expected one 'numbers exact' preamble before domain, imports and declarations.`,location:s(r)}),h=Object.freeze({numericMode:`invalid`})),g=!0,p.push({...r,content:``})}else!v&&r.indent>0&&/^numbers(\s+(exact|legacy))?$/.test(r.content)&&y.set(r.number,{severity:`error`,code:e.InvalidNumericDirective,message:`Expected 'numbers exact' only as the document preamble, not inside a body.`,location:s(r)}),_||=r.content.trim().length>0,p.push(r)}let x=new o(new r(g?p:l),u,d);return x.sourceOptions=h,x.nestedNumericDirectives=y,m.forEach(e=>x.error(e.code,e.message,e.location)),x}export{sourceContext};
|
|
2
2
|
//# sourceMappingURL=SourceOptionsParser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SourceOptionsParser.js","names":["prepared","diagnostics","options","legacySourceOptions","seen","contentSeen","inFence","nested","registry","ParserContext","LineReader","path","languages","original","lines","line","raw","indent","comment","commentStart","hashComments","isClosingCodeFence","firstWord","code","DiagnosticCodes","exactSourceOptions","locationOf","context","diagnostic"],"sources":["../../../../../../Compiler/Parsing/SourceOptionsParser.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 { Diagnostic } from '../Diagnostics/Diagnostic';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { exactSourceOptions, legacySourceOptions, NumericMode, SourceOptions } from '../Syntax/SourceOptions';\nimport { LineReader } from './LineReader';\nimport { isClosingCodeFence } from './ImplementationParser';\nimport { firstWord } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { locationOf, SourceLine } from './SourceLine';\nimport { commentStart } from './SourceLineSplitter';\n\n// Establishes options before entering any value grammar. This mirrors the C# physical-file prepass;\n// fences and property owners are not reinterpreted as numeric directives.\nexport function sourceContext(lines: readonly SourceLine[], path?: string, languages?: ReadonlySet<string>, hashComments = false): ParserContext {\n const prepared: SourceLine[] = [];\n const diagnostics: Diagnostic[] = [];\n let options: SourceOptions = legacySourceOptions;\n let seen = false;\n let contentSeen = false;\n let inFence = false;\n const nested = new Map<number, Diagnostic>();\n const registry = new ParserContext(new LineReader([]), path, languages).languages;\n for (const original of lines) {\n let line = original;\n if (line.number === 1 && line.raw.startsWith('\\uFEFF')) {\n const raw = line.raw.substring(1);\n const indent = raw.length - raw.trimStart().length;\n const comment = commentStart(raw.substring(indent), hashComments);\n line = { ...line, indent, contentOffset: 1, content: (comment < 0 ? raw.substring(indent) : raw.substring(indent, indent + comment)).trimEnd() };\n }\n if (inFence) {\n if (isClosingCodeFence(line)) inFence = false;\n prepared.push(line);\n continue;\n }\n if (line.content.startsWith('```') && (['```', '```text', '```markdown'].includes(line.content) || registry.has(line.content.substring(3)))) inFence = true;\n if (!inFence && line.indent === 0 && firstWord(line.content) === 'numbers') {\n const code = line.content !== 'numbers exact' ? DiagnosticCodes.InvalidNumericDirective : seen ? DiagnosticCodes.DuplicateNumericDirective : contentSeen ? DiagnosticCodes.LateNumericDirective : undefined;\n if (code !== undefined) {\n diagnostics.push({ severity: 'error', code, message: \"Expected one 'numbers exact' preamble before domain, imports and declarations.\", location: locationOf(line) });\n options = Object.freeze({ numericMode: 'invalid' as NumericMode });\n } else options = exactSourceOptions;\n seen = true;\n prepared.push({ ...line, content: '' });\n continue;\n }\n // A directive-shaped line below the top level is never a valid option, whichever construct owns the block.\n if (!inFence && line.indent > 0 && /^numbers(\\s+(exact|legacy))?$/.test(line.content)) nested.set(line.number, { severity: 'error', code: DiagnosticCodes.InvalidNumericDirective, message: \"Expected 'numbers exact' only as the document preamble, not inside a body.\", location: locationOf(line) });\n contentSeen ||= line.content.trim().length > 0;\n prepared.push(line);\n }\n const context = new ParserContext(new LineReader(seen ? prepared : lines), path, languages);\n context.sourceOptions = options;\n // Reported when reading ends, once every property owner has claimed the lines it models as fields.\n context.nestedNumericDirectives = nested;\n diagnostics.forEach(diagnostic => context.error(diagnostic.code, diagnostic.message, diagnostic.location));\n return context;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"SourceOptionsParser.js","names":["prepared","diagnostics","options","legacySourceOptions","seen","contentSeen","inFence","nested","registry","ParserContext","LineReader","path","languages","original","lines","line","raw","indent","comment","commentStart","hashComments","isClosingCodeFence","firstWord","code","DiagnosticCodes","exactSourceOptions","locationOf","context","diagnostic"],"sources":["../../../../../../Compiler/Parsing/SourceOptionsParser.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 { Diagnostic } from '../Diagnostics/Diagnostic';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { exactSourceOptions, legacySourceOptions, NumericMode, SourceOptions } from '../Syntax/SourceOptions';\nimport { LineReader } from './LineReader';\nimport { isClosingCodeFence } from './ImplementationParser';\nimport { firstWord } from './LineText';\nimport { ParserContext } from './ParserContext';\nimport { locationOf, SourceLine } from './SourceLine';\nimport { commentStart } from './SourceLineSplitter';\n\n// Establishes options before entering any value grammar. This mirrors the C# physical-file prepass;\n// fences and property owners are not reinterpreted as numeric directives.\nexport function sourceContext(lines: readonly SourceLine[], path?: string, languages?: ReadonlySet<string>, hashComments = false): ParserContext {\n const prepared: SourceLine[] = [];\n const diagnostics: Diagnostic[] = [];\n let options: SourceOptions = legacySourceOptions;\n let seen = false;\n let contentSeen = false;\n let inFence = false;\n const nested = new Map<number, Diagnostic>();\n const registry = new ParserContext(new LineReader([]), path, languages).languages;\n for (const original of lines) {\n let line = original;\n if (line.number === 1 && line.raw.startsWith('\\uFEFF')) {\n const raw = line.raw.substring(1);\n const indent = raw.length - raw.trimStart().length;\n const comment = commentStart(raw.substring(indent), hashComments);\n line = { ...line, indent, contentOffset: 1, content: (comment < 0 ? raw.substring(indent) : raw.substring(indent, indent + comment)).trimEnd() };\n }\n if (inFence) {\n if (isClosingCodeFence(line)) inFence = false;\n prepared.push(line);\n continue;\n }\n if (line.content.startsWith('```') && (['```', '```text', '```markdown'].includes(line.content) || registry.has(line.content.substring(3)))) inFence = true;\n if (!inFence && line.indent === 0 && firstWord(line.content) === 'numbers') {\n const code = line.content !== 'numbers exact' ? DiagnosticCodes.InvalidNumericDirective : seen ? DiagnosticCodes.DuplicateNumericDirective : contentSeen ? DiagnosticCodes.LateNumericDirective : undefined;\n if (code !== undefined) {\n diagnostics.push({ severity: 'error', code, message: \"Expected one 'numbers exact' preamble before domain, imports and declarations.\", location: locationOf(line) });\n options = Object.freeze({ numericMode: 'invalid' as NumericMode });\n } else options = exactSourceOptions;\n seen = true;\n prepared.push({ ...line, content: '' });\n continue;\n }\n // A directive-shaped line below the top level is never a valid option, whichever construct owns the block.\n if (!inFence && line.indent > 0 && /^numbers(\\s+(exact|legacy))?$/.test(line.content)) nested.set(line.number, { severity: 'error', code: DiagnosticCodes.InvalidNumericDirective, message: \"Expected 'numbers exact' only as the document preamble, not inside a body.\", location: locationOf(line) });\n contentSeen ||= line.content.trim().length > 0;\n prepared.push(line);\n }\n const context = new ParserContext(new LineReader(seen ? prepared : lines), path, languages);\n context.sourceOptions = options;\n // Reported when reading ends, once every property owner has claimed the lines it models as fields.\n context.nestedNumericDirectives = nested;\n diagnostics.forEach(diagnostic => context.error(diagnostic.code, diagnostic.message, diagnostic.location));\n return context;\n}\n"],"mappings":"A,+fAeA,SAAgB,cAAc,EAA8B,EAAe,EAAiC,EAAe,GAAsB,CAC7I,IAAMA,EAAyB,CAAC,EAC1BC,EAA4B,CAAC,EAC/BC,EAAyBC,EACzBC,EAAO,GACPC,EAAc,GACdC,EA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AS,GAAK,gCAAgC,KAAKA,EAAK,OAAO,GAAGR,EAAO,IAAIQ,EAAK,OAAQ,CAAE,SAAU,QAAS,KAAMS,EAAgB,wBAAyB,QAAS,6EAA8E,SAAUE,EAAWX,CAAI,CAAE,CAAC,EACtS,IAAgBA,EAAK,QAAQ,KAAK,CAAC,CAAC,OAAS,EAC7Cf,EAAS,KAAKe,CAAI,CACtB,CACA,IAAMY,EAAU,IAAIlB,EAAc,IAAIC,EAAWN,EAAOJ,EAAWc,CAAK,EAAGH,EAAMC,CAAS,EAK1F,MAJA,GAAQ,cAAgBV,EAExB,EAAQ,wBAA0BK,EAClCN,EAAY,QAAQ,GAAc0B,EAAQ,MAAMC,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,CAAC,EAClGD,CACX,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../../_virtual/_virtual/_rolldown/runtime.js";import{
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{diagnosticText as e}from"../Diagnostics/DiagnosticArgument.js";import{DiagnosticCodes as t}from"../Diagnostics/DiagnosticCodes.js";import{pattern as n}from"../Text/patterns.js";import{parseMappingSource as r}from"./ExpressionParser.js";import{parseProperty as i}from"./PropertyLineParser.js";import{locationOf as a}from"./SourceLine.js";import{parseConcrete as o}from"./SpecificationResponseParser.js";import{tryParseStructuredMapping as s}from"./StructuredBlockParser.js";const c=n(`^case\\s+([A-Za-z_]\\w*)(?:\\s+(?<property>[\\w.]+)\\s*=(?!=|>)\\s*(?<value>.+))?$`),l=n(`^([\\w.]+)\\s*=(?!=|>)\\s*(.+)$`),u=n(`^case\\.([a-z_]\\w*)$`);function containsCaseReference(e){return/\bcase\.[a-z_]\w*/.test(e.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/g,``))}function parseSpecificationValue(e,n,i,a=!1){if(!e.startsWith(`case.`))return containsCaseReference(e)&&i.error(t.InvalidSpecificationCaseReference,`A case reference fills a whole value position; it cannot occur inside a structured value or expression.`,n),r(e,n,i,a);let o=u.exec(e);return o===null&&i.error(t.InvalidSpecificationCaseReference,`A case reference fills a whole value position: 'case.<parameter>'.`,n),{kind:`CaseValueExpressionSyntax`,parameter:o?.[1]??e.substring(5),location:n}}function parseParameter(e,n){let r=n.content.indexOf(` `)+1,o=r>0?i(e,{...n,content:n.content.substring(r),indent:n.indent+r}):void 0;if(o===void 0||o.isGenerated||o.isIdentifier)return e.error(t.InvalidSpecificationParameter,`Expected 'parameter <name> <Type>', with optional collection and optional modifiers.`,a(n)),e.skipOpaqueBlock(n.indent),null;let s=e.peekChild(n.indent);return s!==void 0&&(e.error(t.InvalidSpecificationParameter,`A parameter has no body or default.`,a(s)),e.skipOpaqueBlock(n.indent)),{kind:`SpecificationParameterSyntax`,name:o.name,type:o.type,location:a(n)}}function parseCase(n,r){let i=c.exec(r.content);if(i===null)return n.error(t.InvalidSpecificationCase,`Expected 'case <Name>' with at most one inline parameter assignment.`,a(r)),n.skipOpaqueBlock(r.indent),null;let u=[],d=r.content.indexOf(i.groups?.property??``,r.content.indexOf(i[1],4)+i[1].length),add=(i,s,c)=>{let l=a(c),f={...l,column:l.column+c.content.indexOf(s,c.content.indexOf(`=`)+1)};if(s.startsWith(`case.`)){n.error(t.InvalidSpecificationCaseValue,`A case assigns concrete values, not case references.`,f,e(`text`,s));return}let p=o(n,s,f,t.InvalidSpecificationCaseValue);p!==null&&u.push({kind:`PropertyMappingSyntax`,property:i,source:p,location:c===r?{...l,column:l.column+d}:l})};i.groups?.property!==void 0&&add(i.groups.property,i.groups.value,r);for(let o=n.peekChild(r.indent);o!==void 0;o=n.peekChild(r.indent)){n.reader.takeSignificant();let r=l.exec(o.content),c=r===null?s(n,o):void 0;if(c!==void 0){u.push(c);continue}if(r===null){n.error(t.InvalidSpecificationCaseAssignment,`Expected '<parameter> = <concrete value>' in a case.`,a(o)),n.skipOpaqueBlock(o.indent);continue}add(r[1],r[2],o);let d=n.peekChild(o.indent);d!==void 0&&(n.error(t.InvalidSpecificationCaseValue,`A case value must fit on one line.`,a(d),{...e(`case`,i[1]),...e(`parameter`,r[1]),...e(`text`,d.content)}),n.skipOpaqueBlock(o.indent))}return{kind:`SpecificationCaseSyntax`,name:i[1],values:u,location:a(r)}}function caseReferences(e){return Array.isArray(e)?e.flatMap(caseReferences):typeof e!=`object`||!e?[]:`kind`in e&&e.kind===`CaseValueExpressionSyntax`?[e]:Object.values(e).flatMap(caseReferences)}function validateTable(e,n){let r=e.parameters??[],i=e.cases??[];r.length===0!=(i.length===0)&&n.error(t.IncompleteSpecificationTable,`A specification table requires parameters and at least one case.`,e.location),r.forEach((e,i)=>{r.slice(0,i).some(t=>t.name===e.name)&&n.error(t.DuplicateSpecificationParameter,`Parameter '${e.name}' is declared more than once.`,e.location)}),i.forEach((e,a)=>{i.slice(0,a).some(t=>t.name===e.name)&&n.error(t.DuplicateSpecificationCase,`Case '${e.name}' is declared more than once.`,e.location);for(let i of e.values.filter(e=>!r.some(t=>t.name===e.property)))n.error(t.InvalidSpecificationCaseAssignment,`Case '${e.name}' assigns undeclared parameter '${i.property}'.`,i.location);for(let i of r.filter(t=>e.values.filter(e=>e.property===t.name).length!==1))n.error(t.InvalidSpecificationCaseAssignment,`Case '${e.name}' must assign parameter '${i.name}' exactly once.`,e.location)});let a=caseReferences(e);for(let e of a)i.length!==0&&r.some(t=>t.name===e.parameter)||n.error(t.InvalidSpecificationCaseReference,`Case reference '${e.parameter}' requires a declared parameter in a specification table.`,e.location);for(let e of r.filter(e=>!a.some(t=>t.parameter===e.name)))n.warning(t.UnusedSpecificationParameter,`Parameter '${e.name}' is never referenced.`,e.location);for(let r of caseReferences(e.whenRedelivered))n.error(t.InvalidSpecificationCaseReference,`Case references are not permitted in redelivery locators.`,r.location)}function substituteCase(e,t,n=/* @__PURE__ */ new WeakMap){if(typeof e==`object`&&e&&n.has(e))return n.get(e);if(Array.isArray(e)){let r=e.map(e=>substituteCase(e,t,n));return n.set(e,r),r}if(typeof e!=`object`||!e||!(`kind`in e))return e;if(e.kind===`CaseValueExpressionSyntax`){let n=e.parameter;return t.values.find(e=>e.property===n)?.source??e}let r=Object.fromEntries(Object.entries(e).map(([e,r])=>[e,substituteCase(r,t,n)]));if(e.kind===`SpecificationErrorSyntax`&&`caseValue`in e&&e.caseValue!==void 0){let e=r.caseValue;r.name=e.kind===`LiteralExpressionSyntax`?e.value:null,delete r.caseValue}return n.set(e,r),r}export{caseReferences,containsCaseReference,parseCase,parseParameter,parseSpecificationValue,substituteCase,validateTable};
|
|
2
2
|
//# sourceMappingURL=SpecificationCaseParser.js.map
|