@cratis/screenplay-language 5.4.0 → 5.5.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/compiler/Parsing/CommandParser.js +1 -1
- package/dist/bundles/compiler/Parsing/CommandParser.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/ScreenplayCompiler.js +1 -1
- package/dist/bundles/compiler/ScreenplayCompiler.js.map +1 -1
- package/dist/bundles/compiler/index.js +1 -1
- package/dist/bundles/completion-items.js +19 -18
- 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/hover-content.js +4 -4
- package/dist/bundles/hover-content.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/tokens.js +1 -1
- package/dist/bundles/tokens.js.map +1 -1
- package/dist/completion-items.d.ts +2 -0
- package/dist/completion-items.d.ts.map +1 -1
- package/dist/completion-planner.d.ts.map +1 -1
- package/dist/hover-content.d.ts.map +1 -1
- package/dist/keyword-docs.d.ts.map +1 -1
- package/dist/tokens.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -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","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","misplacedRuleHintForConcept","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 { misplacedRuleHintForConcept } from './MisplacedRuleHint';\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>\"'${misplacedRuleHintForConcept(child.content)}`, 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,gxEA2DA,MAAMA,EAAgBC,EAAQ,kDAAkD,EAC1EC,EAAkBD,EAAQ,oDAAoDE,EAAkB,IAAI,EACpGC,EAAg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K,MAAM,EAAG,CAC1GpC,EAAQ,OAAO,gBAAgB,EAC/B,IAAMqC,EAAUC,EAAU4D,EAAM,OAAO,EACvC,GAAI7D,IAAY,cACZ,EAAO+D,EAAiBpG,EAASkG,EAAOiB,EAAM,eAAe,OAC1D,GAAI9E,IAAY,SAAU,CAC7B,IAAMK,EAAQhD,EAAwB,KAAKwG,EAAM,OAAO,EACpDxD,IAAU,KACV1C,EAAQ,MAAMwC,EAAgB,0BAA2B,mBAAmB0D,EAAM,QAAQ,8EAA+EzD,EAAWyD,CAAK,CAAC,EAE1L,EAASxD,EAAM,EAEvB,MAAWL,IAAY,WACnB,EAAW4E,EAAgBjH,EAASkG,EAAO,WAAY,IAAK,IAAKY,EAAU,EAAI,GAAKA,EAC7EzE,IAAY,OACnB,EAAO4E,EAAgBjH,EAASkG,EAAO,OAAQ,QAAS,SAAUa,EAAM,EAAK,GAAKA,GAElF/G,EAAQ,MAAMwC,EAAgB,wBAAyB,eAAeH,EAAQ,wEAAyEI,EAAWyD,CAAK,CAAC,EACxKlG,EAAQ,UAAUkG,EAAM,MAAM,EAEtC,CAKA,OAJIiB,IAAS,MAAQL,IAAa,MAC9B9G,EAAQ,MAAMwC,EAAgB,0BAA2B,oEAAqEC,EAAWL,CAAI,CAAC,EACvI,MAEJ,CAAE,KAAM,mBAAoB,OAAQ8E,EAAY,GAAkC,OAAM,SAAQ,EAAGJ,EAAS,GAAI,EAAGA,EAAS,GAAI,MAAOC,IAAS,KAAO,KAAOA,EAAK,GAAI,OAAQA,IAAS,KAAO,KAAOA,EAAK,GAAI,SAAUtE,EAAWL,CAAI,CAAE,CACrP,C"}
|
|
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","state","placement","line","moduleBody","ModuleBody","featureBody","FeatureBody","keyword","name","preambleRules","misplacedReactionIdentity","bodyRules","isFileImport","parseEventSource","parseSystem","parseStateMachine","parseWorkflow","parseType","isDocumentPlacement","parseModule","parseSeed","parsePurpose","parseApplicationContext","parseIdentity","parseExposure","parseInstance","firstWord","preamble","rule","candidate","alreadyDeclared","DiagnosticCodes","locationOf","match","unescapeString","parseFileImport","origin","isBlankPublicEventOrigin","parseExample","stickyNote","policy","parsePolicy","previous","data","parseTriggerDeclaration","collectInputUses","parseUiProfile","value","key","values","modules","root","commandReadMode","timeZone","applicationContext","reactionProductionMode","identity","stateMachines","workflows","exposures","stickyNotes","instanceContributions","recordAuthoredDocument","modulePattern","describePlacement","word","hint","expected","moduleBodyExpected","featureBodyExpected","feature","innermost","index","start","existing","sawOtherConstruct","inFence","startOf","type","attributeText","attributes","parseComplianceMarkers","members","EnumerationMembers","generation","declaredGeneration","description","validations","child","memberName","parseDescription","isFileDirective","parsed","parseValidate","parseGeneration","parseComplianceDirective","unescapeIdentifier","misplacedRuleHintForConcept","valueNumbers","policies","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 { misplacedRuleHintForConcept } from './MisplacedRuleHint';\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 state = createRootState(placement);\n for (let line = context.reader.peekSignificant(); line !== undefined; line = context.reader.peekSignificant()) {\n context.reader.takeSignificant();\n dispatchRoot(context, line, state);\n }\n return buildApplication(context, state);\n}\n\n// What the root loop gathers while it reads the lines of a document.\ninterface RootState {\n readonly placement: PlayPlacement;\n readonly moduleBody: ModuleBody | undefined;\n readonly featureBody: FeatureBody | undefined;\n readonly placedBody: ModuleBody | FeatureBody | undefined;\n identity: IdentitySyntax | null;\n applicationContext: ApplicationContextSyntax | null;\n reactionProductionMode: ReactionProductionMode | null;\n sawReactionBatches: boolean;\n commandReadMode: CommandReadMode | null;\n timeZone: TimeZoneSyntax | null;\n sawTimeZone: boolean;\n sawCommandReads: boolean;\n domain: DomainSyntax | null;\n sawOtherConstruct: boolean;\n readonly imports: ImportSyntax[];\n readonly fileImports: FileImportSyntax[];\n readonly concepts: ConceptSyntax[];\n readonly types: TypeSyntax[];\n readonly systems: SystemSyntax[];\n readonly stateMachines: StateMachineSyntax[];\n readonly workflows: WorkflowSyntax[];\n readonly eventSources: EventSourceSyntax[];\n readonly modules: ModuleSyntax[];\n readonly personas: PersonaSyntax[];\n readonly stickyNotes: StickyNoteSyntax[];\n readonly policies: PolicySyntax[];\n readonly purposes: PurposeSyntax[];\n readonly seeds: SeedSyntax[];\n readonly examples: SpecificationExampleSyntax[];\n readonly declaredTriggers: NonNullable<ApplicationSyntax['declaredTriggers']>[number][];\n readonly exposures: ExposureSyntax[];\n readonly instanceContributions: InstanceContributionsSyntax[];\n}\n\ninterface RootRule {\n readonly matches: (keyword: string, line: SourceLine, state: RootState) => boolean;\n readonly parse: (context: ParserContext, line: SourceLine, state: RootState) => void;\n}\n\nfunction createRootState(placement: PlayPlacement): RootState {\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 return {\n placement, moduleBody, featureBody, placedBody: moduleBody ?? featureBody,\n identity: null, applicationContext: null, reactionProductionMode: null, sawReactionBatches: false, commandReadMode: null,\n timeZone: null, sawTimeZone: false, sawCommandReads: false, domain: null, sawOtherConstruct: false,\n imports: [], fileImports: [], concepts: [], types: [], systems: [], stateMachines: [], workflows: [], eventSources: [], modules: [],\n personas: [], stickyNotes: [], policies: [], purposes: [], seeds: [], examples: [], declaredTriggers: [], exposures: [], instanceContributions: []\n };\n}\n\nconst isKeyword = (name: string) => (keyword: string): boolean => keyword === name;\n\n// The directives that open a document, tried before the bookkeeping that counts a construct as declared.\nconst preambleRules: readonly RootRule[] = [\n { matches: (keyword, line) => keyword === 'command' && /^command\\s+reads(?:\\s|$)/.test(line.content), parse: parseRootCommandReads },\n { matches: (keyword, line) => keyword === 'time' && /^time\\s+zone(?:\\s|$)/.test(line.content), parse: parseRootTimeZone },\n { matches: isKeyword('reaction'), parse: parseRootReactionBatches },\n { matches: isKeyword('runs'), parse: (context, line) => { misplacedReactionIdentity(context, line); } },\n { matches: isKeyword('domain'), parse: parseRootDomain }\n];\n\n// The rest of the root constructs in the order they are tried; a line none of them takes goes to the placed body, then to the unexpected top level report.\nconst bodyRules: readonly RootRule[] = [\n { matches: (keyword, line) => keyword === 'import' && isFileImport(line.content), parse: parseRootFileImport },\n { matches: isKeyword('import'), parse: parseRootImport },\n { matches: isKeyword('example'), parse: parseRootExample },\n { matches: isKeyword('eventsource'), parse: (context, line, state) => { state.eventSources.push(parseEventSource(context, line)); } },\n { matches: isKeyword('system'), parse: (context, line, state) => { state.systems.push(parseSystem(context, line)); } },\n { matches: isKeyword('statemachine'), parse: (context, line, state) => { state.stateMachines.push(parseStateMachine(context, line)); } },\n { matches: isKeyword('workflow'), parse: (context, line, state) => { state.workflows.push(parseWorkflow(context, line)); } },\n { matches: isKeyword('concept'), parse: (context, line, state) => { state.concepts.push(parseConcept(context, line)); } },\n { matches: isKeyword('type'), parse: (context, line, state) => { state.types.push(parseType(context, line)); } },\n { matches: (keyword, _, state) => keyword === 'module' && !isDocumentPlacement(state.placement), parse: (context, line, state) => parseModuleInPlacedFile(context, line, state.placement, state.moduleBody) },\n { matches: isKeyword('module'), parse: (context, line, state) => { state.modules.push(parseModule(context, line)); } },\n { matches: isKeyword('persona'), parse: (context, line, state) => { state.personas.push(parsePersona(context, line)); } },\n { matches: isKeyword('sticky'), parse: parseRootStickyNote },\n { matches: isKeyword('seed'), parse: (context, line, state) => { state.seeds.push(parseSeed(context.valueContext, line)); } },\n { matches: (keyword, _, state) => keyword === 'purpose' && state.placedBody !== undefined, parse: (context, line, state) => { state.placedBody?.tryParse(context, line); } },\n { matches: isKeyword('purpose'), parse: (context, line, state) => { state.purposes.push(parsePurpose(context, line)); } },\n { matches: isKeyword('context'), parse: (context, line, state) => { state.applicationContext = parseApplicationContext(context, line, state.applicationContext, state.placement); } },\n { matches: isKeyword('identity'), parse: (context, line, state) => { state.identity = parseIdentity(context, line, state.identity); } },\n { matches: isKeyword('policy'), parse: parseRootPolicy },\n { matches: isKeyword('exposure'), parse: (context, line, state) => { state.exposures.push(parseExposure(context, line)); } },\n { matches: isKeyword('instance'), parse: (context, line, state) => { state.instanceContributions.push(parseInstance(context, line)); } },\n { matches: isKeyword('trigger'), parse: parseRootTrigger },\n { matches: keyword => opaqueTopLevel.has(keyword), parse: parseRootOpaque }\n];\n\nfunction dispatchRoot(context: ParserContext, line: SourceLine, state: RootState): void {\n const keyword = firstWord(line.content);\n const preamble = preambleRules.find(rule => rule.matches(keyword, line, state));\n if (preamble !== undefined) {\n preamble.parse(context, line, state);\n return;\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 state.sawOtherConstruct ||= declaresConstruct(keyword, line, state.placement);\n context.authoredDeclarations ||= keyword !== 'import' && declaresConstruct(keyword, line, state.placement);\n const rule = bodyRules.find(candidate => candidate.matches(keyword, line, state));\n if (rule !== undefined) {\n rule.parse(context, line, state);\n } else if (state.placedBody?.tryParse(context, line) !== true) {\n reportUnexpectedTopLevel(context, line, state.placement);\n }\n}\n\nfunction isRepeatedOrMisplaced(alreadyDeclared: boolean, state: RootState): boolean {\n return alreadyDeclared || !isDocumentPlacement(state.placement);\n}\n\nfunction parseRootCommandReads(context: ParserContext, line: SourceLine, state: RootState): void {\n if (isRepeatedOrMisplaced(state.sawCommandReads, state) || !/^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 state.commandReadMode = CommandReadMode.Protected;\n }\n state.sawCommandReads = true;\n}\n\nfunction parseRootTimeZone(context: ParserContext, line: SourceLine, state: RootState): void {\n const match = timeZonePattern.exec(line.content);\n context.skipBlock(line.indent);\n if (isRepeatedOrMisplaced(state.sawTimeZone, state) || 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 state.timeZone = { kind: 'TimeZoneSyntax', id: unescapeString(match[2]), configurable: match[1] !== undefined, location: locationOf(line) };\n }\n state.sawTimeZone = true;\n}\n\nfunction parseRootReactionBatches(context: ParserContext, line: SourceLine, state: RootState): void {\n if (isRepeatedOrMisplaced(state.sawReactionBatches, state) || !/^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 state.reactionProductionMode = ReactionProductionMode.Atomic;\n }\n state.sawReactionBatches = true;\n}\n\nfunction parseRootDomain(context: ParserContext, line: SourceLine, state: RootState): void {\n context.authoredDeclarations = true;\n state.domain = parseDomain(context, line, state.domain, state.sawOtherConstruct);\n}\n\nfunction parseRootFileImport(context: ParserContext, line: SourceLine, state: RootState): void {\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 (state.placedBody !== undefined) {\n state.placedBody.tryParse(context, line);\n } else {\n parseFileImport(context, line, state.fileImports);\n }\n}\n\nfunction parseRootImport(context: ParserContext, line: SourceLine, state: RootState): void {\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 return;\n }\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 state.imports.push({ kind: 'ImportSyntax', qualifiedName: match[1], origin, visibility: origin === null ? EventVisibility.Private : EventVisibility.Public, location: locationOf(line) });\n}\n\nfunction parseRootExample(context: ParserContext, line: SourceLine, state: RootState): void {\n if (state.placedBody !== undefined) state.placedBody.tryParse(context, line);\n else state.examples.push(parseExample(context, line));\n}\n\nfunction parseRootStickyNote(context: ParserContext, line: SourceLine, state: RootState): void {\n const stickyNote = parseStickyNote(context, line);\n if (stickyNote !== null) state.stickyNotes.push(stickyNote);\n}\n\nfunction parseRootPolicy(context: ParserContext, line: SourceLine, state: RootState): void {\n const policy = parsePolicy(context, line);\n if (state.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 state.policies.push(policy);\n}\n\nfunction parseRootTrigger(context: ParserContext, line: SourceLine, state: RootState): void {\n const data = parseTriggerDeclaration(context, line);\n const name = /^trigger\\s+([A-Za-z_]\\w*)$/.exec(line.content)?.[1];\n if (name !== undefined) state.declaredTriggers.push({ name, data });\n}\n\nfunction parseRootOpaque(context: ParserContext, line: SourceLine): void {\n const keyword = firstWord(line.content);\n if (keyword === 'behavior' || keyword === 'layout') collectInputUses(context, line);\n else if (keyword === 'ui') parseUiProfile(context, line);\n else context.skipOpaqueBlock(line.indent);\n}\n\n// A property the syntax only carries when it was declared.\nfunction presentOnly<K extends string, V>(key: K, value: V | null): { [P in K]?: V } {\n return (value === null ? {} : { [key]: value }) as { [P in K]?: V };\n}\n\n// A list the syntax only carries when something was declared in it.\nfunction nonEmptyOnly<K extends string, V>(key: K, values: V[]): { [P in K]?: V[] } {\n return (values.length > 0 ? { [key]: values } : {}) as { [P in K]?: V[] };\n}\n\nfunction buildApplication(context: ParserContext, state: RootState): ApplicationSyntax {\n const { placement, moduleBody, featureBody, modules } = state;\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 { commandReadMode, timeZone, applicationContext, reactionProductionMode, identity, domain, imports, concepts, types, systems, stateMachines, workflows, eventSources, examples, personas, policies, purposes, seeds, declaredTriggers, fileImports, exposures, stickyNotes, instanceContributions } = state;\n const root: ApplicationSyntax = { kind: 'ApplicationSyntax', ...presentOnly('commandReadMode', commandReadMode), ...presentOnly('timeZone', timeZone), ...presentOnly('context', applicationContext), ...presentOnly('reactionProductionMode', reactionProductionMode), ...presentOnly('identity', identity), sourceOptions: context.sourceOptions, domain, imports, concepts, types, systems, ...nonEmptyOnly('stateMachines', stateMachines), ...nonEmptyOnly('workflows', workflows), eventSources, examples, modules, personas, policies, purposes, seeds, declaredTriggers, fileImports, ...nonEmptyOnly('exposures', exposures), ...nonEmptyOnly('stickyNotes', stickyNotes), ...nonEmptyOnly('instanceContributions', 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>\"'${misplacedRuleHintForConcept(child.content)}`, 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,qwEA2DA,MAAMA,EAAgBC,EAAQ,kDAAkD,EAC1EC,EAAkBD,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,GAAoBT,EAAQ,0EAA0E,EACtGU,GAA0BV,EAAQ,sCAAsC,EACxEW,GAAmB,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,mBAAe,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,EAAQ,gBAAgBC,CAAS,EACvC,IAAK,IAAIC,EAAOJ,EAAQ,OAAO,gBAAgB,EAAGI,IAAS,IAAA,GAAW,EAAOJ,EAAQ,OAAO,gBAAgB,EACxGA,EAAQ,OAAO,gBAAgB,EAC/B,aAAaA,EAASI,EAAMF,CAAK,EAErC,OAAO,iBAAiBF,EAASE,CAAK,CAC1C,CA2CA,SAAS,gBAAgB,EAAqC,CAC1D,IAAMG,EAAaF,EAAU,SAAW,EAAI,IAAIG,EAAWH,EAAU,EAAE,EAAI,IAAA,GACrEI,EAAcJ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AAQ,MAAMiC,EAAgB,wBAAyB,eAAexB,EAAQ,wEAAyEyB,EAAWwD,CAAK,CAAC,EACxK1F,EAAQ,UAAU0F,EAAM,MAAM,EAEtC,CAKA,OAJIkB,IAAS,MAAQL,IAAa,MAC9BvG,EAAQ,MAAMiC,EAAgB,0BAA2B,oEAAqEC,EAAW9B,CAAI,CAAC,EACvI,MAEJ,CAAE,KAAM,mBAAoB,OAAQuG,EAAY,GAAkC,OAAM,SAAQ,EAAGJ,EAAS,GAAI,EAAGA,EAAS,GAAI,MAAOC,IAAS,KAAO,KAAOA,EAAK,GAAI,OAAQA,IAAS,KAAO,KAAOA,EAAK,GAAI,SAAUtE,EAAW9B,CAAI,CAAE,CACrP,C"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../_virtual/_virtual/_rolldown/runtime.js";import{validateIdentity as e}from"./Parsing/IdentityValidator.js";import{validateApplicationHandlers as t}from"./Parsing/CommandHandlerValidator.js";import{recordStructuralInteractions as n}from"./Parsing/StructuralInteractionSites.js";import{validateSpecificationCases as r}from"./Parsing/SpecificationCaseValidator.js";import{expandSpecificationExamples as i,validateSpecificationExampleTypes as a}from"./Parsing/SpecificationCommandExamples.js";import{productionDestinationDiagnostics as o}from"./Diagnostics/ProductionDestinationDiagnostics.js";import{validateConstraintProperties as s}from"./Parsing/ConstraintPropertyValidator.js";import{validateDependencyDeclarations as c}from"./Dependencies/DeclaredDependencyTargets.js";import{DeclaredDependencies as l}from"./Dependencies/DeclaredDependencies.js";import{documentPlacement as u}from"./Files/PlayPlacement.js";import{discoverImports as d}from"./Parsing/ImportDiscovery.js";import{interactionAncestry as f}from"./Parsing/InteractionAlternatives.js";import{validateResponses as p}from"./Parsing/ResponseValidator.js";import{validatePublicEventUsage as m}from"./Parsing/PublicEventUsageValidator.js";import{sourceContext as h}from"./Parsing/SourceOptionsParser.js";import{validateInlineEvents as g}from"./Parsing/InlineEventValidator.js";import{validateOperations as _}from"./Parsing/OperationValidator.js";import{CommandStreamCandidates as v}from"./Parsing/CommandStreamCandidates.js";import{validateEventSources as y}from"./Parsing/EventSourceValidator.js";import{validateProjectionTargets as b}from"./Parsing/ProjectionTargetValidator.js";import{validateIdentifierCompliance as x}from"./Parsing/IdentifierComplianceValidator.js";import{validateEventSubjects as S}from"./Parsing/EventSubjectValidator.js";import{validateReadModelKeys as C}from"./Parsing/ReadModelKeyValidator.js";import{validateReadModelMemberTypes as w}from"./Parsing/ReadModelMemberTypeValidator.js";import{validateReactionRefusals as T}from"./Parsing/ReactionRefusalValidator.js";import{validateSpecificationRedelivery as E}from"./Parsing/SpecificationRedeliveryValidator.js";import{validateGuardedActions as D}from"./Parsing/GuardedActionValidator.js";import{validatePersonaCallers as O}from"./Parsing/PersonaCallerValidator.js";import{validatePurposes as k}from"./Parsing/PurposeValidator.js";import{parseApplication as A}from"./Parsing/ScreenplayParser.js";import{splitLines as j}from"./Parsing/SourceLineSplitter.js";import"./Parsing/ProjectionParser.js";import"./Parsing/CaptureParser.js";import"./Parsing/SpecificationParser.js";import"./Parsing/SpecificationExampleParser.js";import{timelineOrderDiagnostics as M}from"./Files/TimelineOrder.js";function parseForAuthoring(d,N,P=u,F=!0,I,L){let R=j(d,!1,N),z=h(R,N,L);z.scope=P,z.interactionAncestors=f(R),z.streamCandidates=I??v.capture([R],P,L);let B=A(z,R,P);if(n(B,z),F){t(B,z),e(B,z),k(B,z),g(B,z),s(B,z),_(B,z),m(B,z),r(B,z),a(B,z,!0);let n=i(B);p(n,z),y(B,z),b(B,z),x(n,z),S(B,z),C(B,z),w(B,z),T(B,z),E(B,z),D(B,z),O(B,z),B=c(B,z),l.validate(B,z);for(let e of o(B))z.information(e.code,e.message,e.location);for(let e of M(B))z.information(e.code,e.message,e.location)}return{value:B,diagnostics:z.diagnostics,triggerData:z.triggerData,inputUses:z.inputUses,continuationValues:z.continuationValues,guardedInteractions:z.guardedInteractions,interactionBehaviors:z.interactionBehaviors,interactionUses:z.interactionUses,success:!z.diagnostics.some(e=>e.severity===`error`)}}function discoverImports(e,t,n){let r=j(e,!1,t);return d(h(r,t,n))}export{discoverImports,parseForAuthoring};
|
|
1
|
+
import"../_virtual/_virtual/_rolldown/runtime.js";import{validateIdentity as e}from"./Parsing/IdentityValidator.js";import{validateApplicationHandlers as t}from"./Parsing/CommandHandlerValidator.js";import{recordStructuralInteractions as n}from"./Parsing/StructuralInteractionSites.js";import{validateSpecificationCases as r}from"./Parsing/SpecificationCaseValidator.js";import{expandSpecificationExamples as i,validateSpecificationExampleTypes as a}from"./Parsing/SpecificationCommandExamples.js";import{productionDestinationDiagnostics as o}from"./Diagnostics/ProductionDestinationDiagnostics.js";import{validateConstraintProperties as s}from"./Parsing/ConstraintPropertyValidator.js";import{validateDependencyDeclarations as c}from"./Dependencies/DeclaredDependencyTargets.js";import{DeclaredDependencies as l}from"./Dependencies/DeclaredDependencies.js";import{documentPlacement as u}from"./Files/PlayPlacement.js";import{discoverImports as d}from"./Parsing/ImportDiscovery.js";import{interactionAncestry as f}from"./Parsing/InteractionAlternatives.js";import{validateResponses as p}from"./Parsing/ResponseValidator.js";import{validatePublicEventUsage as m}from"./Parsing/PublicEventUsageValidator.js";import{sourceContext as h}from"./Parsing/SourceOptionsParser.js";import{validateInlineEvents as g}from"./Parsing/InlineEventValidator.js";import{validateOperations as _}from"./Parsing/OperationValidator.js";import{CommandStreamCandidates as v}from"./Parsing/CommandStreamCandidates.js";import{validateEventSources as y}from"./Parsing/EventSourceValidator.js";import{validateProjectionTargets as b}from"./Parsing/ProjectionTargetValidator.js";import{validateIdentifierCompliance as x}from"./Parsing/IdentifierComplianceValidator.js";import{validateEventSubjects as S}from"./Parsing/EventSubjectValidator.js";import{validateReadModelKeys as C}from"./Parsing/ReadModelKeyValidator.js";import{validateReadModelMemberTypes as w}from"./Parsing/ReadModelMemberTypeValidator.js";import{validateReactionRefusals as T}from"./Parsing/ReactionRefusalValidator.js";import{validateSpecificationRedelivery as E}from"./Parsing/SpecificationRedeliveryValidator.js";import{validateGuardedActions as D}from"./Parsing/GuardedActionValidator.js";import{validatePersonaCallers as O}from"./Parsing/PersonaCallerValidator.js";import{validatePurposes as k}from"./Parsing/PurposeValidator.js";import{parseApplication as A}from"./Parsing/ScreenplayParser.js";import{splitLines as j}from"./Parsing/SourceLineSplitter.js";import"./Parsing/ProjectionParser.js";import"./Parsing/CaptureParser.js";import"./Parsing/SpecificationParser.js";import"./Parsing/SpecificationExampleParser.js";import{timelineOrderDiagnostics as M}from"./Files/TimelineOrder.js";function parse(e,t,n=u){let{value:r,diagnostics:i,success:a}=parseForAuthoring(e,t,n);return{value:r,diagnostics:i,success:a}}function parseForAuthoring(d,N,P=u,F=!0,I,L){let R=j(d,!1,N),z=h(R,N,L);z.scope=P,z.interactionAncestors=f(R),z.streamCandidates=I??v.capture([R],P,L);let B=A(z,R,P);if(n(B,z),F){t(B,z),e(B,z),k(B,z),g(B,z),s(B,z),_(B,z),m(B,z),r(B,z),a(B,z,!0);let n=i(B);p(n,z),y(B,z),b(B,z),x(n,z),S(B,z),C(B,z),w(B,z),T(B,z),E(B,z),D(B,z),O(B,z),B=c(B,z),l.validate(B,z);for(let e of o(B))z.information(e.code,e.message,e.location);for(let e of M(B))z.information(e.code,e.message,e.location)}return{value:B,diagnostics:z.diagnostics,triggerData:z.triggerData,inputUses:z.inputUses,continuationValues:z.continuationValues,guardedInteractions:z.guardedInteractions,interactionBehaviors:z.interactionBehaviors,interactionUses:z.interactionUses,success:!z.diagnostics.some(e=>e.severity===`error`)}}function discoverImports(e,t,n){let r=j(e,!1,t);return d(h(r,t,n))}export{discoverImports,parse,parseForAuthoring};
|
|
2
2
|
//# sourceMappingURL=ScreenplayCompiler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenplayCompiler.js","names":["discoverImportsIn","discoverImports$1","documentPlacement","lines","splitLines","source","path","context","sourceContext","languages","placement","interactionAncestry","streamCandidates","CommandStreamCandidates","value","parseApplication","recordStructuralInteractions","validateResponseContracts","validateApplicationHandlers","validateIdentity","validatePurposes","validateInlineEvents","validateConstraintProperties","validateOperations","validatePublicEventUsage","validateSpecificationCases","validateSpecificationExampleTypes","effective","expandSpecificationExamples","validateResponses","validateEventSources","validateProjectionTargets","validateIdentifierCompliance","validateEventSubjects","validateReadModelKeys","validateReadModelMemberTypes","validateReactionRefusals","validateSpecificationRedelivery","validateGuardedActions","validatePersonaCallers","validateDependencyDeclarations","DeclaredDependencies","diagnostic","productionDestinationDiagnostics","timelineOrderDiagnostics"],"sources":["../../../../../Compiler/ScreenplayCompiler.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 { validateIdentity } from './Parsing/IdentityValidator';\nimport { validateApplicationHandlers } from './Parsing/CommandHandlerValidator';\nimport { recordStructuralInteractions } from './Parsing/StructuralInteractionSites';\nimport { Diagnostic } from './Diagnostics/Diagnostic';\nimport { validateSpecificationCases } from './Parsing/SpecificationCaseValidator';\nimport { expandSpecificationExamples, validateSpecificationExampleTypes } from './Parsing/SpecificationCommandExamples';\nimport { productionDestinationDiagnostics } from './Diagnostics/ProductionDestinationDiagnostics';\nimport { validateConstraintProperties } from './Parsing/ConstraintPropertyValidator';\nimport { validateDependencyDeclarations } from './Dependencies/DeclaredDependencyTargets';\nimport { DeclaredDependencies } from './Dependencies/DeclaredDependencies';\nimport { documentPlacement, PlayPlacement } from './Files/PlayPlacement';\nimport { DiscoveredImport, discoverImports as discoverImportsIn } from './Parsing/ImportDiscovery';\nimport { ContinuationValueUse } from './Parsing/ContinuationValueUse';\nimport { InputUse } from './Parsing/InputUses';\nimport { GuardedInteractionBinding, interactionAncestry } from './Parsing/InteractionAlternatives';\nimport { validateResponses } from './Parsing/ResponseValidator';\nimport { validatePublicEventUsage } from './Parsing/PublicEventUsageValidator';\nimport { sourceContext } from './Parsing/SourceOptionsParser';\nimport { validateInlineEvents } from './Parsing/InlineEventValidator';\nimport { validateOperations } from './Parsing/OperationValidator';\nimport { CommandStreamCandidates } from './Parsing/CommandStreamCandidates';\nimport { validateEventSources } from './Parsing/EventSourceValidator';\nimport { validateProjectionTargets } from './Parsing/ProjectionTargetValidator';\nimport { validateIdentifierCompliance } from './Parsing/IdentifierComplianceValidator';\nimport { validateEventSubjects } from './Parsing/EventSubjectValidator';\nimport { validateReadModelKeys } from './Parsing/ReadModelKeyValidator';\nimport { validateReadModelMemberTypes } from './Parsing/ReadModelMemberTypeValidator';\nimport { validateReactionRefusals } from './Parsing/ReactionRefusalValidator';\nimport { validateSpecificationRedelivery } from './Parsing/SpecificationRedeliveryValidator';\nimport { validateGuardedActions } from './Parsing/GuardedActionValidator';\nimport { validatePersonaCallers } from './Parsing/PersonaCallerValidator';\nimport { validatePurposes } from './Parsing/PurposeValidator';\nimport { parseApplication } from './Parsing/ScreenplayParser';\nimport { splitLines } from './Parsing/SourceLineSplitter';\nimport { PropertySyntax } from './Syntax/Declarations';\nimport { ApplicationSyntax } from './Syntax/Structure';\nimport { ApplicationSyntaxVisitor } from './Syntax/Visitors';\nimport { ProjectionSyntax } from './Syntax/Projections';\nimport { CaptureSyntax } from './Syntax/Captures';\nimport { SpecificationExampleSyntax, SpecificationSyntax } from './Syntax/Specifications';\nimport { SyntaxNode } from './Syntax/SyntaxNode';\nimport { ParserContext } from './Parsing/ParserContext';\nimport { parseProjection } from './Parsing/ProjectionParser';\nimport { parseCapture } from './Parsing/CaptureParser';\nimport { parseSpecification } from './Parsing/SpecificationParser';\nimport { parseExample } from './Parsing/SpecificationExampleParser';\nimport { firstWord } from './Parsing/LineText';\nimport { SourceLine, locationOf } from './Parsing/SourceLine';\nimport { DiagnosticCodes } from './Diagnostics/DiagnosticCodes';\nimport { timelineOrderDiagnostics } from './Files/TimelineOrder';\n\n// What compiling produced: the syntax tree, and the diagnostics found on the way. A tree is always\n// produced, so a document with errors still shows everything that could be read.\nexport interface CompilationResult<T> {\n readonly value: T;\n readonly diagnostics: readonly Diagnostic[];\n readonly success: boolean;\n}\n\n// Parses one .play document - the TypeScript counterpart of the C# ScreenplayCompiler.Parse. The path, when\n// given, is carried on every source location so a folder of documents can be merged and still point back\n// at the file each node came from. A placement says the document's top level belongs to the module or\n// feature an import placed it in: that module and feature are in the tree, marked as placements, holding what\n// the document declares at its top level.\nexport function parse(source: string, path?: string, placement: PlayPlacement = documentPlacement): CompilationResult<ApplicationSyntax> {\n const { value, diagnostics, success } = parseForAuthoring(source, path, placement);\n return { value, diagnostics, success };\n}\n\n// Additive authoring view: do not widen TypeRefSyntax or the cross-compiler SyntaxJson projection.\nexport function parseForAuthoring(source: string, path?: string, placement: PlayPlacement = documentPlacement, validateResponseContracts = true, streamCandidates?: CommandStreamCandidates, languages?: ReadonlySet<string>): CompilationResult<ApplicationSyntax> & { readonly triggerData: readonly PropertySyntax[]; readonly inputUses: readonly InputUse[]; readonly continuationValues: readonly ContinuationValueUse[]; readonly guardedInteractions: readonly GuardedInteractionBinding[]; readonly interactionBehaviors: ParserContext['interactionBehaviors']; readonly interactionUses: ParserContext['interactionUses'] } {\n const lines = splitLines(source, false, path);\n const context = sourceContext(lines, path, languages);\n context.scope = placement;\n context.interactionAncestors = interactionAncestry(lines);\n context.streamCandidates = streamCandidates ?? CommandStreamCandidates.capture([lines], placement, languages);\n let value = parseApplication(context, lines, placement);\n recordStructuralInteractions(value, context);\n // Folder assembly validates declaration-dependent contracts once against the merged inventory.\n if (validateResponseContracts) {\n validateApplicationHandlers(value, context);\n validateIdentity(value, context);\n validatePurposes(value, context);\n validateInlineEvents(value, context);\n validateConstraintProperties(value, context);\n validateOperations(value, context);\n validatePublicEventUsage(value, context);\n validateSpecificationCases(value, context);\n validateSpecificationExampleTypes(value, context, true);\n const effective = expandSpecificationExamples(value);\n validateResponses(effective, context);\n validateEventSources(value, context);\n validateProjectionTargets(value, context);\n validateIdentifierCompliance(effective, context);\n validateEventSubjects(value, context);\n validateReadModelKeys(value, context);\n validateReadModelMemberTypes(value, context);\n validateReactionRefusals(value, context);\n validateSpecificationRedelivery(value, context);\n validateGuardedActions(value, context);\n validatePersonaCallers(value, context);\n value = validateDependencyDeclarations(value, context);\n DeclaredDependencies.validate(value, context);\n for (const diagnostic of productionDestinationDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n for (const diagnostic of timelineOrderDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n }\n return {\n value,\n diagnostics: context.diagnostics,\n triggerData: context.triggerData,\n inputUses: context.inputUses,\n continuationValues: context.continuationValues,\n guardedInteractions: context.guardedInteractions,\n interactionBehaviors: context.interactionBehaviors,\n interactionUses: context.interactionUses,\n success: !context.diagnostics.some(diagnostic => diagnostic.severity === 'error'),\n };\n}\n\n/** Checks public boundaries on programmatically authored or decoded assembled syntax. */\nexport function publicEventDiagnostics(application: ApplicationSyntax): readonly Diagnostic[] {\n const context = sourceContext([], application.location.path);\n validatePublicEventUsage(application, context);\n return context.diagnostics;\n}\n\n// Parses a document and hands its syntax tree to a visitor - the counterpart of the C#\n// ScreenplayCompiler.Compile<T>(source, visitor). The visitor runs even when there are errors, over\n// everything that could be read.\nexport function compile<T>(source: string, visitor: ApplicationSyntaxVisitor<T>, path?: string): CompilationResult<T> {\n const parsed = parse(source, path);\n return { value: visitor.visit(parsed.value), diagnostics: parsed.diagnostics, success: parsed.success };\n}\n\n// Finds the files a document imports and where in it each import is written - each import with the module\n// and feature names around it, outermost first. Diagnostics are not collected; parsing the document reports them.\nexport function discoverImports(source: string, path?: string, languages?: ReadonlySet<string>): DiscoveredImport[] {\n const lines = splitLines(source, false, path);\n return discoverImportsIn(sourceContext(lines, path, languages));\n}\n\n// Additive entry points preserve the caller's registry; none can select numeric mode externally.\nexport function parseWithLanguages(source: string, languages: ReadonlySet<string>, path?: string, placement: PlayPlacement = documentPlacement): CompilationResult<ApplicationSyntax> {\n const { value, diagnostics, success } = parseForAuthoring(source, path, placement, true, undefined, languages);\n return { value, diagnostics, success };\n}\n\nexport function parseProjectionSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly ProjectionSyntax[]> {\n return parseSourceFamily(source, 'projection', parseProjection, path, languages);\n}\n\nexport function parseCaptureSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly CaptureSyntax[]> {\n return parseSourceFamily(source, 'capture', parseCapture, path, languages);\n}\n\nexport function parseSpecificationSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly SpecificationSyntax[]> {\n return parseSourceFamily(source, 'specification', parseSpecification, path, languages);\n}\n\nfunction parseSourceFamily<T extends SyntaxNode>(source: string, keyword: string, read: (context: ParserContext, line: SourceLine) => T, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly T[]> {\n const context = sourceContext(splitLines(source, true, path), path, languages, true);\n const value: T[] = [];\n const examples: SpecificationExampleSyntax[] = [];\n for (let line = context.reader.peekSignificant(); line !== undefined; line = context.reader.peekSignificant()) {\n context.reader.takeSignificant();\n if (keyword === 'specification' && firstWord(line.content) === 'example') examples.push(parseExample(context, line));\n else if (line.content.startsWith(keyword)) value.push(read(context, line));\n else {\n context.error(DiagnosticCodes.UnknownTopLevelConstruct, `Expected '${keyword}', got '${line.content}'`, locationOf(line));\n context.skipOpaqueBlock(line.indent);\n }\n }\n if (context.sourceOptions.numericMode === 'exact' && value.length === 0 && context.diagnostics.length === 0) {\n const code = keyword === 'projection' ? DiagnosticCodes.ProjectionDocumentWithoutProjection : keyword === 'capture' ? DiagnosticCodes.CaptureDocumentWithoutCapture : DiagnosticCodes.SpecificationDocumentWithoutSpecification;\n context.error(code, `Document must contain at least one ${keyword}`, context.start);\n }\n const roots = keyword === 'specification' && examples.length > 0 ? value.map(node => ({ ...node, examples })) : value;\n if (keyword === 'specification') {\n const application = parseApplication(sourceContext([], path, languages), [], documentPlacement);\n validateSpecificationCases({ ...application, examples }, context, roots as unknown as SpecificationSyntax[]);\n }\n return { value: roots, diagnostics: context.diagnostics, success: !context.diagnostics.some(diagnostic => diagnostic.severity === 'error') };\n}\n"],"mappings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AMA,EAAW,QAASA,EAAW,QAAQ,EAC9I,IAAK,IAAMA,KAAcE,EAAyB9B,CAAK,EAAGP,EAAQ,YAAYmC,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,CAC1I,CACA,MAAO,CACH,QACA,YAAanC,EAAQ,YACrB,YAAaA,EAAQ,YACrB,UAAWA,EAAQ,UACnB,mBAAoBA,EAAQ,mBAC5B,oBAAqBA,EAAQ,oBAC7B,qBAAsBA,EAAQ,qBAC9B,gBAAiBA,EAAQ,gBACzB,QAAS,CAACA,EAAQ,YAAY,KAAK,GAAcmC,EAAW,WAAa,OAAO,CACpF,CACJ,CAmBA,SAAgB,gBAAgB,EAAgB,EAAe,EAAqD,CAChH,IAAMvC,EAAQC,EAAWC,EAAQ,GAAOC,CAAI,EAC5C,OAAON,EAAkBQ,EAAcL,EAAOG,EAAMG,CAAS,CAAC,CAClE,C"}
|
|
1
|
+
{"version":3,"file":"ScreenplayCompiler.js","names":["discoverImportsIn","discoverImports$1","documentPlacement","source","path","placement","lines","splitLines","context","sourceContext","languages","interactionAncestry","streamCandidates","CommandStreamCandidates","value","parseApplication","recordStructuralInteractions","validateResponseContracts","validateApplicationHandlers","validateIdentity","validatePurposes","validateInlineEvents","validateConstraintProperties","validateOperations","validatePublicEventUsage","validateSpecificationCases","validateSpecificationExampleTypes","effective","expandSpecificationExamples","validateResponses","validateEventSources","validateProjectionTargets","validateIdentifierCompliance","validateEventSubjects","validateReadModelKeys","validateReadModelMemberTypes","validateReactionRefusals","validateSpecificationRedelivery","validateGuardedActions","validatePersonaCallers","validateDependencyDeclarations","DeclaredDependencies","diagnostic","productionDestinationDiagnostics","timelineOrderDiagnostics"],"sources":["../../../../../Compiler/ScreenplayCompiler.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 { validateIdentity } from './Parsing/IdentityValidator';\nimport { validateApplicationHandlers } from './Parsing/CommandHandlerValidator';\nimport { recordStructuralInteractions } from './Parsing/StructuralInteractionSites';\nimport { Diagnostic } from './Diagnostics/Diagnostic';\nimport { validateSpecificationCases } from './Parsing/SpecificationCaseValidator';\nimport { expandSpecificationExamples, validateSpecificationExampleTypes } from './Parsing/SpecificationCommandExamples';\nimport { productionDestinationDiagnostics } from './Diagnostics/ProductionDestinationDiagnostics';\nimport { validateConstraintProperties } from './Parsing/ConstraintPropertyValidator';\nimport { validateDependencyDeclarations } from './Dependencies/DeclaredDependencyTargets';\nimport { DeclaredDependencies } from './Dependencies/DeclaredDependencies';\nimport { documentPlacement, PlayPlacement } from './Files/PlayPlacement';\nimport { DiscoveredImport, discoverImports as discoverImportsIn } from './Parsing/ImportDiscovery';\nimport { ContinuationValueUse } from './Parsing/ContinuationValueUse';\nimport { InputUse } from './Parsing/InputUses';\nimport { GuardedInteractionBinding, interactionAncestry } from './Parsing/InteractionAlternatives';\nimport { validateResponses } from './Parsing/ResponseValidator';\nimport { validatePublicEventUsage } from './Parsing/PublicEventUsageValidator';\nimport { sourceContext } from './Parsing/SourceOptionsParser';\nimport { validateInlineEvents } from './Parsing/InlineEventValidator';\nimport { validateOperations } from './Parsing/OperationValidator';\nimport { CommandStreamCandidates } from './Parsing/CommandStreamCandidates';\nimport { validateEventSources } from './Parsing/EventSourceValidator';\nimport { validateProjectionTargets } from './Parsing/ProjectionTargetValidator';\nimport { validateIdentifierCompliance } from './Parsing/IdentifierComplianceValidator';\nimport { validateEventSubjects } from './Parsing/EventSubjectValidator';\nimport { validateReadModelKeys } from './Parsing/ReadModelKeyValidator';\nimport { validateReadModelMemberTypes } from './Parsing/ReadModelMemberTypeValidator';\nimport { validateReactionRefusals } from './Parsing/ReactionRefusalValidator';\nimport { validateSpecificationRedelivery } from './Parsing/SpecificationRedeliveryValidator';\nimport { validateGuardedActions } from './Parsing/GuardedActionValidator';\nimport { validatePersonaCallers } from './Parsing/PersonaCallerValidator';\nimport { validatePurposes } from './Parsing/PurposeValidator';\nimport { parseApplication } from './Parsing/ScreenplayParser';\nimport { splitLines } from './Parsing/SourceLineSplitter';\nimport { PropertySyntax } from './Syntax/Declarations';\nimport { ApplicationSyntax } from './Syntax/Structure';\nimport { ApplicationSyntaxVisitor } from './Syntax/Visitors';\nimport { ProjectionSyntax } from './Syntax/Projections';\nimport { CaptureSyntax } from './Syntax/Captures';\nimport { SpecificationExampleSyntax, SpecificationSyntax } from './Syntax/Specifications';\nimport { SyntaxNode } from './Syntax/SyntaxNode';\nimport { ParserContext } from './Parsing/ParserContext';\nimport { parseProjection } from './Parsing/ProjectionParser';\nimport { parseCapture } from './Parsing/CaptureParser';\nimport { parseSpecification } from './Parsing/SpecificationParser';\nimport { parseExample } from './Parsing/SpecificationExampleParser';\nimport { firstWord } from './Parsing/LineText';\nimport { SourceLine, locationOf } from './Parsing/SourceLine';\nimport { DiagnosticCodes } from './Diagnostics/DiagnosticCodes';\nimport { timelineOrderDiagnostics } from './Files/TimelineOrder';\n\n// What compiling produced: the syntax tree, and the diagnostics found on the way. A tree is always\n// produced, so a document with errors still shows everything that could be read.\nexport interface CompilationResult<T> {\n readonly value: T;\n readonly diagnostics: readonly Diagnostic[];\n readonly success: boolean;\n}\n\n// Parses one .play document - the TypeScript counterpart of the C# ScreenplayCompiler.Parse. The path, when\n// given, is carried on every source location so a folder of documents can be merged and still point back\n// at the file each node came from. A placement says the document's top level belongs to the module or\n// feature an import placed it in: that module and feature are in the tree, marked as placements, holding what\n// the document declares at its top level.\nexport function parse(source: string, path?: string, placement: PlayPlacement = documentPlacement): CompilationResult<ApplicationSyntax> {\n const { value, diagnostics, success } = parseForAuthoring(source, path, placement);\n return { value, diagnostics, success };\n}\n\n// Additive authoring view: do not widen TypeRefSyntax or the cross-compiler SyntaxJson projection.\nexport function parseForAuthoring(source: string, path?: string, placement: PlayPlacement = documentPlacement, validateResponseContracts = true, streamCandidates?: CommandStreamCandidates, languages?: ReadonlySet<string>): CompilationResult<ApplicationSyntax> & { readonly triggerData: readonly PropertySyntax[]; readonly inputUses: readonly InputUse[]; readonly continuationValues: readonly ContinuationValueUse[]; readonly guardedInteractions: readonly GuardedInteractionBinding[]; readonly interactionBehaviors: ParserContext['interactionBehaviors']; readonly interactionUses: ParserContext['interactionUses'] } {\n const lines = splitLines(source, false, path);\n const context = sourceContext(lines, path, languages);\n context.scope = placement;\n context.interactionAncestors = interactionAncestry(lines);\n context.streamCandidates = streamCandidates ?? CommandStreamCandidates.capture([lines], placement, languages);\n let value = parseApplication(context, lines, placement);\n recordStructuralInteractions(value, context);\n // Folder assembly validates declaration-dependent contracts once against the merged inventory.\n if (validateResponseContracts) {\n validateApplicationHandlers(value, context);\n validateIdentity(value, context);\n validatePurposes(value, context);\n validateInlineEvents(value, context);\n validateConstraintProperties(value, context);\n validateOperations(value, context);\n validatePublicEventUsage(value, context);\n validateSpecificationCases(value, context);\n validateSpecificationExampleTypes(value, context, true);\n const effective = expandSpecificationExamples(value);\n validateResponses(effective, context);\n validateEventSources(value, context);\n validateProjectionTargets(value, context);\n validateIdentifierCompliance(effective, context);\n validateEventSubjects(value, context);\n validateReadModelKeys(value, context);\n validateReadModelMemberTypes(value, context);\n validateReactionRefusals(value, context);\n validateSpecificationRedelivery(value, context);\n validateGuardedActions(value, context);\n validatePersonaCallers(value, context);\n value = validateDependencyDeclarations(value, context);\n DeclaredDependencies.validate(value, context);\n for (const diagnostic of productionDestinationDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n for (const diagnostic of timelineOrderDiagnostics(value)) context.information(diagnostic.code, diagnostic.message, diagnostic.location);\n }\n return {\n value,\n diagnostics: context.diagnostics,\n triggerData: context.triggerData,\n inputUses: context.inputUses,\n continuationValues: context.continuationValues,\n guardedInteractions: context.guardedInteractions,\n interactionBehaviors: context.interactionBehaviors,\n interactionUses: context.interactionUses,\n success: !context.diagnostics.some(diagnostic => diagnostic.severity === 'error'),\n };\n}\n\n/** Checks public boundaries on programmatically authored or decoded assembled syntax. */\nexport function publicEventDiagnostics(application: ApplicationSyntax): readonly Diagnostic[] {\n const context = sourceContext([], application.location.path);\n validatePublicEventUsage(application, context);\n return context.diagnostics;\n}\n\n// Parses a document and hands its syntax tree to a visitor - the counterpart of the C#\n// ScreenplayCompiler.Compile<T>(source, visitor). The visitor runs even when there are errors, over\n// everything that could be read.\nexport function compile<T>(source: string, visitor: ApplicationSyntaxVisitor<T>, path?: string): CompilationResult<T> {\n const parsed = parse(source, path);\n return { value: visitor.visit(parsed.value), diagnostics: parsed.diagnostics, success: parsed.success };\n}\n\n// Finds the files a document imports and where in it each import is written - each import with the module\n// and feature names around it, outermost first. Diagnostics are not collected; parsing the document reports them.\nexport function discoverImports(source: string, path?: string, languages?: ReadonlySet<string>): DiscoveredImport[] {\n const lines = splitLines(source, false, path);\n return discoverImportsIn(sourceContext(lines, path, languages));\n}\n\n// Additive entry points preserve the caller's registry; none can select numeric mode externally.\nexport function parseWithLanguages(source: string, languages: ReadonlySet<string>, path?: string, placement: PlayPlacement = documentPlacement): CompilationResult<ApplicationSyntax> {\n const { value, diagnostics, success } = parseForAuthoring(source, path, placement, true, undefined, languages);\n return { value, diagnostics, success };\n}\n\nexport function parseProjectionSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly ProjectionSyntax[]> {\n return parseSourceFamily(source, 'projection', parseProjection, path, languages);\n}\n\nexport function parseCaptureSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly CaptureSyntax[]> {\n return parseSourceFamily(source, 'capture', parseCapture, path, languages);\n}\n\nexport function parseSpecificationSource(source: string, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly SpecificationSyntax[]> {\n return parseSourceFamily(source, 'specification', parseSpecification, path, languages);\n}\n\nfunction parseSourceFamily<T extends SyntaxNode>(source: string, keyword: string, read: (context: ParserContext, line: SourceLine) => T, path?: string, languages?: ReadonlySet<string>): CompilationResult<readonly T[]> {\n const context = sourceContext(splitLines(source, true, path), path, languages, true);\n const value: T[] = [];\n const examples: SpecificationExampleSyntax[] = [];\n for (let line = context.reader.peekSignificant(); line !== undefined; line = context.reader.peekSignificant()) {\n context.reader.takeSignificant();\n if (keyword === 'specification' && firstWord(line.content) === 'example') examples.push(parseExample(context, line));\n else if (line.content.startsWith(keyword)) value.push(read(context, line));\n else {\n context.error(DiagnosticCodes.UnknownTopLevelConstruct, `Expected '${keyword}', got '${line.content}'`, locationOf(line));\n context.skipOpaqueBlock(line.indent);\n }\n }\n if (context.sourceOptions.numericMode === 'exact' && value.length === 0 && context.diagnostics.length === 0) {\n const code = keyword === 'projection' ? DiagnosticCodes.ProjectionDocumentWithoutProjection : keyword === 'capture' ? DiagnosticCodes.CaptureDocumentWithoutCapture : DiagnosticCodes.SpecificationDocumentWithoutSpecification;\n context.error(code, `Document must contain at least one ${keyword}`, context.start);\n }\n const roots = keyword === 'specification' && examples.length > 0 ? value.map(node => ({ ...node, examples })) : value;\n if (keyword === 'specification') {\n const application = parseApplication(sourceContext([], path, languages), [], documentPlacement);\n validateSpecificationCases({ ...application, examples }, context, roots as unknown as SpecificationSyntax[]);\n }\n return { value: roots, diagnostics: context.diagnostics, success: !context.diagnostics.some(diagnostic => diagnostic.severity === 'error') };\n}\n"],"mappings":"A,yqFAmEA,SAAgB,MAAM,EAAgB,EAAe,EAA2BE,EAAyD,CACrI,GAAM,CAAE,QAAO,cAAa,WAAY,kBAAkBC,EAAQC,EAAMC,CAAS,EACjF,MAAO,CAAE,QAAO,cAAa,SAAQ,CACzC,CAGA,SAAgB,kBAAkB,EAAgB,EAAe,EAA2BH,EAAmB,EAA4B,GAAM,EAA4C,EAA0a,CACnmB,IAAMI,EAAQC,EAAWJ,EAAQ,GAAOC,CAAI,EACtCI,EAAUC,EAAcH,EAAOF,EAAMM,CAAS,EACpD,EAAQ,MAAQL,EAChB,EAAQ,qBAAuBM,EAAoBL,CAAK,EACxD,EAAQ,iBAAmBM,GAAoBC,EAAwB,QAAQ,CAACP,CAAK,EAAGD,EAAWK,CAAS,EAC5G,IAAII,EAAQC,EAAiBP,EAASF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AO,CACpF,CACJ,CAmBA,SAAgB,gBAAgB,EAAgB,EAAe,EAAqD,CAChH,IAAMpC,EAAQC,EAAWJ,EAAQ,GAAOC,CAAI,EAC5C,OAAOJ,EAAkBS,EAAcH,EAAOF,EAAMM,CAAS,CAAC,CAClE,C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DiagnosticCodes as e}from"./Diagnostics/DiagnosticCodes.js";import"./Parsing/checkPortableMatchPattern.js";import{unescapeString as t}from"./Text/StringLiteral.js";import{pattern as n}from"./Text/patterns.js";import{sourceLocation as r}from"./Diagnostics/SourceLocation.js";import{eventDeclarations as i}from"./Syntax/EventDeclarations.js";import{operationDeclarations as a}from"./Syntax/Operations.js";import{AuthoringProductionResolver as o}from"./Syntax/AuthoringProductionResolver.js";import{dependencySourcesOf as s}from"./Syntax/DependencySources.js";import{ScreenplaySyntaxWalker as c}from"./Syntax/ScreenplaySyntaxWalker.js";import{isExactNumberToken as l,parseExactNumber as u}from"./Syntax/ExactNumber.js";import{diagnosticKeyword as d,diagnosticText as f}from"./Diagnostics/DiagnosticArgument.js";import{EventSourceCatalog as p}from"./Syntax/EventSourceCatalog.js";import{implicitDestination as m,requiresExplicitDestinations as h}from"./Syntax/ProductionDestinations.js";import{InvalidExactNumber as g,canonicalExactText as _,exactIsIntegral as v}from"./Syntax/ExactMathFacts.js";import{responseCommandResolver as y}from"./Parsing/ResponseCommandResolver.js";import{synthesizePersonaCaller as b}from"./Syntax/PersonaCallers.js";import"./Syntax/SpecificationCaseOrigin.js";import{applyQuickFixEdits as x,isQuickFixDiagnostic as S,legacyOptionalTypeLength as C,prepareQuickFixes as w}from"./Authoring/QuickFixes.js";import{DeclaredDependencyTargets as T}from"./Dependencies/DeclaredDependencyTargets.js";import{describePlacement as E,documentPlacement as D,isDocumentPlacement as O,isWithinOrSame as k,samePlacement as A}from"./Files/PlayPlacement.js";import"./Syntax/InvalidSyntaxJson.js";import"./Syntax/SourceOptions.js";import"./Completeness/ModelCompleteness.js";import{eventBodyReservedWords as j}from"./Text/ReservedWords.js";import{sliceTypes as M}from"./Syntax/Structure.js";import{consumedEvents as N,eventsSourceKind as P,fromSetting as F,isEventsSource as I}from"./Syntax/CaptureEventsSource.js";import{hasWildcard as L,matchesPlayPattern as R,normalizePlayPath as z,resolvePlayPattern as B,staticFolderOf as V}from"./Files/PlayGlob.js";import"./Dependencies/index.js";import{dependencyKinds as H}from"./Dependencies/DependencyKind.js";import{InvalidDependencyQuery as U}from"./Dependencies/InvalidDependencyQuery.js";import{SliceReferenceCollector as W,buildingReadModelReferences as G,referenceClassifications as K,sliceReferences as q}from"./Dependencies/SliceReferences.js";import{stronglyConnectedGroups as J}from"./Dependencies/StronglyConnectedGroups.js";import{DependencyGraph as Y}from"./Dependencies/DependencyGraph.js";import{streamIdFailureMessage as X,tryFormatInteger as Z,tryFormatText as Q,tryFormatUuidText as $}from"./Syntax/StreamIdFormatter.js";import"./Syntax/index.js";import{discoverImports as ee,parseForAuthoring as
|
|
1
|
+
import{DiagnosticCodes as e}from"./Diagnostics/DiagnosticCodes.js";import"./Parsing/checkPortableMatchPattern.js";import{unescapeString as t}from"./Text/StringLiteral.js";import{pattern as n}from"./Text/patterns.js";import{sourceLocation as r}from"./Diagnostics/SourceLocation.js";import{eventDeclarations as i}from"./Syntax/EventDeclarations.js";import{operationDeclarations as a}from"./Syntax/Operations.js";import{AuthoringProductionResolver as o}from"./Syntax/AuthoringProductionResolver.js";import{dependencySourcesOf as s}from"./Syntax/DependencySources.js";import{ScreenplaySyntaxWalker as c}from"./Syntax/ScreenplaySyntaxWalker.js";import{isExactNumberToken as l,parseExactNumber as u}from"./Syntax/ExactNumber.js";import{diagnosticKeyword as d,diagnosticText as f}from"./Diagnostics/DiagnosticArgument.js";import{EventSourceCatalog as p}from"./Syntax/EventSourceCatalog.js";import{implicitDestination as m,requiresExplicitDestinations as h}from"./Syntax/ProductionDestinations.js";import{InvalidExactNumber as g,canonicalExactText as _,exactIsIntegral as v}from"./Syntax/ExactMathFacts.js";import{responseCommandResolver as y}from"./Parsing/ResponseCommandResolver.js";import{synthesizePersonaCaller as b}from"./Syntax/PersonaCallers.js";import"./Syntax/SpecificationCaseOrigin.js";import{applyQuickFixEdits as x,isQuickFixDiagnostic as S,legacyOptionalTypeLength as C,prepareQuickFixes as w}from"./Authoring/QuickFixes.js";import{DeclaredDependencyTargets as T}from"./Dependencies/DeclaredDependencyTargets.js";import{describePlacement as E,documentPlacement as D,isDocumentPlacement as O,isWithinOrSame as k,samePlacement as A}from"./Files/PlayPlacement.js";import"./Syntax/InvalidSyntaxJson.js";import"./Syntax/SourceOptions.js";import"./Completeness/ModelCompleteness.js";import{eventBodyReservedWords as j}from"./Text/ReservedWords.js";import{sliceTypes as M}from"./Syntax/Structure.js";import{consumedEvents as N,eventsSourceKind as P,fromSetting as F,isEventsSource as I}from"./Syntax/CaptureEventsSource.js";import{hasWildcard as L,matchesPlayPattern as R,normalizePlayPath as z,resolvePlayPattern as B,staticFolderOf as V}from"./Files/PlayGlob.js";import"./Dependencies/index.js";import{dependencyKinds as H}from"./Dependencies/DependencyKind.js";import{InvalidDependencyQuery as U}from"./Dependencies/InvalidDependencyQuery.js";import{SliceReferenceCollector as W,buildingReadModelReferences as G,referenceClassifications as K,sliceReferences as q}from"./Dependencies/SliceReferences.js";import{stronglyConnectedGroups as J}from"./Dependencies/StronglyConnectedGroups.js";import{DependencyGraph as Y}from"./Dependencies/DependencyGraph.js";import{streamIdFailureMessage as X,tryFormatInteger as Z,tryFormatText as Q,tryFormatUuidText as $}from"./Syntax/StreamIdFormatter.js";import"./Syntax/index.js";import{discoverImports as ee,parse as te,parseForAuthoring as ne}from"./ScreenplayCompiler.js";import"./ScreenActionSubjects.js";import{EventSourceReadConfidence as re}from"./Syntax/EventSourceReadConfidence.js";import"./Parsing/SpecificationCommandExamples.js";import{inMemoryDocumentSource as ie}from"./Files/PlayDocumentSource.js";import{isSourceStreamName as ae,isSourceStreamTypeName as oe,sourceStreamPattern as se}from"./Text/SourceStreamNames.js";import"./Files/AuthoredOrder.js";import"./Files/OrderingRoot.js";import"./Syntax/SyntaxJson.js";import"./Files/TimelineOrder.js";import{mergeDocuments as ce}from"./Files/PlayFolderMerge.js";import{assembleApplication as le,compileApplication as ue,parsePlacedDocuments as de}from"./Files/PlayApplicationAssembly.js";import{resolveImports as fe}from"./Files/PlayImports.js";export{o as AuthoringProductionResolver,T as DeclaredDependencyTargets,Y as DependencyGraph,e as DiagnosticCodes,p as EventSourceCatalog,re as EventSourceReadConfidence,U as InvalidDependencyQuery,g as InvalidExactNumber,c as ScreenplaySyntaxWalker,W as SliceReferenceCollector,x as applyQuickFixEdits,le as assembleApplication,G as buildingReadModelReferences,_ as canonicalExactText,ue as compileApplication,N as consumedEvents,H as dependencyKinds,s as dependencySourcesOf,E as describePlacement,d as diagnosticKeyword,f as diagnosticText,ee as discoverImports,D as documentPlacement,j as eventBodyReservedWords,i as eventDeclarations,P as eventsSourceKind,v as exactIsIntegral,F as fromSetting,L as hasWildcard,m as implicitDestination,ie as inMemoryDocumentSource,O as isDocumentPlacement,I as isEventsSource,l as isExactNumberToken,S as isQuickFixDiagnostic,ae as isSourceStreamName,oe as isSourceStreamTypeName,k as isWithinOrSame,C as legacyOptionalTypeLength,R as matchesPlayPattern,ce as mergeDocuments,z as normalizePlayPath,a as operationDeclarations,te as parse,u as parseExactNumber,ne as parseForAuthoring,de as parsePlacedDocuments,n as pattern,w as prepareQuickFixes,K as referenceClassifications,h as requiresExplicitDestinations,fe as resolveImports,B as resolvePlayPattern,y as responseCommandResolver,A as samePlacement,q as sliceReferences,M as sliceTypes,r as sourceLocation,se as sourceStreamPattern,V as staticFolderOf,X as streamIdFailureMessage,J as stronglyConnectedGroups,b as synthesizePersonaCaller,Z as tryFormatInteger,Q as tryFormatText,$ as tryFormatUuidText,t as unescapeString};
|