@cratis/screenplay-language 4.218.1 → 4.219.0
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/code-actions.js +1 -1
- package/dist/bundles/code-actions.js.map +1 -1
- package/dist/bundles/compiler/Authoring/QuickFixes.js +1 -1
- package/dist/bundles/compiler/Authoring/QuickFixes.js.map +1 -1
- package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js +7 -0
- package/dist/bundles/compiler/Authoring/TimelineQuickFixContext.js.map +1 -0
- package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js +5 -0
- package/dist/bundles/compiler/Authoring/TimelineQuickFixImports.js.map +1 -0
- package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js +2 -0
- package/dist/bundles/compiler/Authoring/TimelineQuickFixes.js.map +1 -0
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js +1 -1
- package/dist/bundles/compiler/Diagnostics/DiagnosticCodes.js.map +1 -1
- package/dist/bundles/compiler/Files/AuthoredOrder.js +1 -1
- package/dist/bundles/compiler/Files/AuthoredOrder.js.map +1 -1
- package/dist/bundles/compiler/Files/OrderingRoot.js +2 -1
- package/dist/bundles/compiler/Files/OrderingRoot.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js +1 -1
- package/dist/bundles/compiler/Files/PlayApplicationAssembly.js.map +1 -1
- package/dist/bundles/compiler/Files/PlayDocumentSource.js +2 -0
- package/dist/bundles/compiler/Files/PlayDocumentSource.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayGlob.js +2 -0
- package/dist/bundles/compiler/Files/PlayGlob.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayImports.js +2 -1
- package/dist/bundles/compiler/Files/PlayImports.js.map +1 -0
- package/dist/bundles/compiler/Files/PlayPlacement.js +1 -1
- package/dist/bundles/compiler/Files/PlayPlacement.js.map +1 -1
- package/dist/bundles/compiler/Files/TimelineOrder.js +1 -1
- package/dist/bundles/compiler/Files/TimelineOrder.js.map +1 -1
- package/dist/bundles/compiler/Parsing/ImportDiscovery.js +2 -1
- package/dist/bundles/compiler/Parsing/ImportDiscovery.js.map +1 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguity.js +2 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguity.js.map +1 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityCharacters.js +2 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityCharacters.js.map +1 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityGraph.js +2 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityGraph.js.map +1 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityParser.js +2 -0
- package/dist/bundles/compiler/Parsing/MatchAmbiguityParser.js.map +1 -0
- package/dist/bundles/compiler/Parsing/MatchOperandValidation.js +1 -1
- package/dist/bundles/compiler/Parsing/MatchOperandValidation.js.map +1 -1
- package/dist/bundles/compiler/Parsing/hasExponentialMatchAmbiguity.js +2 -0
- package/dist/bundles/compiler/Parsing/hasExponentialMatchAmbiguity.js.map +1 -0
- package/dist/bundles/compiler/Parsing/trimMatchAmbiguityGraph.js +2 -0
- package/dist/bundles/compiler/Parsing/trimMatchAmbiguityGraph.js.map +1 -0
- 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/diagnostic-codes.js +1 -1
- package/dist/bundles/diagnostic-codes.js.map +1 -1
- package/dist/bundles/validation.js +1 -1
- package/dist/bundles/validation.js.map +1 -1
- package/dist/code-actions.d.ts +2 -2
- package/dist/code-actions.d.ts.map +1 -1
- package/dist/diagnostic-codes.d.ts +1 -0
- package/dist/diagnostic-codes.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import"./FileImportParser.js";import"./FeatureBody.js";import"./ModuleBody.js";
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{firstWord as e}from"./LineText.js";import{isDocumentPlacement as t}from"../Files/PlayPlacement.js";import{tryParseFileImport as n}from"./FileImportParser.js";import{parseFeature as r}from"./FeatureBody.js";import{parseModule as i}from"./ModuleBody.js";function placementFrom(e,n){let{scope:r}=e;return r.length===0?n:e.startsAtModule?t(n)?r:n.length===1&&n[0]===r[0]?[...n,...r.slice(1)]:void 0:t(n)?void 0:[...n,...r]}function discoverImports(t){let a=[];for(let o=t.reader.peekSignificant();o!==void 0;o=t.reader.peekSignificant()){t.reader.takeSignificant();let s=e(o.content),c=s===`import`?n(o):void 0;if(c!==void 0)a.push({scope:[],startsAtModule:!1,fileImport:c});else if(s===`module`){let e=i(t,o);a.push(...e.fileImports.map(t=>({scope:[e.name],startsAtModule:!0,fileImport:t}))),a.push(...e.features.flatMap(t=>importsIn(t,[e.name],!0)))}else s===`feature`?a.push(...importsIn(r(t,o),[],!1)):t.skipOpaqueBlock(o.indent)}return a}function importsIn(e,t,n){let r=[...t,e.name];return[...e.fileImports.map(e=>({scope:r,startsAtModule:n,fileImport:e})),...e.features.flatMap(e=>importsIn(e,r,n))]}export{discoverImports,placementFrom};
|
|
2
|
+
//# sourceMappingURL=ImportDiscovery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImportDiscovery.js","names":["discovered","scope","document","isDocumentPlacement","found","line","context","keyword","firstWord","fileImport","tryParseFileImport","module","parseModule","each","feature","parseFeature","outer","nested","startsAtModule"],"sources":["../../../../../../Compiler/Parsing/ImportDiscovery.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 { isDocumentPlacement, PlayPlacement } from '../Files/PlayPlacement';\nimport { FeatureSyntax, FileImportSyntax } from '../Syntax/Structure';\nimport { parseFeature } from './FeatureBody';\nimport { tryParseFileImport } from './FileImportParser';\nimport { firstWord } from './LineText';\nimport { parseModule } from './ModuleBody';\nimport { ParserContext } from './ParserContext';\n\n// A file import, together with the module and feature names around it in the document, outermost first, and\n// whether the outermost name is a 'module' written at the document's top level rather than a 'feature'. The\n// port of the C# DiscoveredFileImport.\nexport interface DiscoveredImport {\n readonly scope: readonly string[];\n readonly startsAtModule: boolean;\n readonly fileImport: FileImportSyntax;\n}\n\n// Where an import places what it imports, given where the document holding it is placed - undefined when the\n// import cannot place anything from there. A top level 'feature' only means something once the document is\n// placed in a module, so until then its imports place nothing - the document reports the misplaced feature\n// itself if it never is. A top level 'module' is the module's own declaration in a whole document, a\n// restatement that joins the placement in a document placed in that module, and nothing anywhere else.\nexport function placementFrom(discovered: DiscoveredImport, document: PlayPlacement): PlayPlacement | undefined {\n const { scope } = discovered;\n if (scope.length === 0) return document;\n if (!discovered.startsAtModule) return isDocumentPlacement(document) ? undefined : [...document, ...scope];\n if (isDocumentPlacement(document)) return scope;\n return document.length === 1 && document[0] === scope[0] ? [...document, ...scope.slice(1)] : undefined;\n}\n\n// Finds the files a document imports and where in it each import is written, without settling where the\n// document itself belongs - the port of the C# ScreenplayParser.DiscoverImports. Where a file belongs depends\n// on what imports it, and what it imports depends on where the imports are written in it, so this reads the\n// module and feature structure of any file, whether its top level is the application's or the body of a\n// module or feature it will later be placed in. The context's diagnostics are not the document's.\nexport function discoverImports(context: ParserContext): DiscoveredImport[] {\n const found: DiscoveredImport[] = [];\n for (let line = context.reader.peekSignificant(); line !== undefined; line = context.reader.peekSignificant()) {\n context.reader.takeSignificant();\n const keyword = firstWord(line.content);\n const fileImport = keyword === 'import' ? tryParseFileImport(line) : undefined;\n if (fileImport !== undefined) {\n found.push({ scope: [], startsAtModule: false, fileImport });\n } else if (keyword === 'module') {\n const module = parseModule(context, line);\n found.push(...module.fileImports.map(each => ({ scope: [module.name], startsAtModule: true, fileImport: each })));\n found.push(...module.features.flatMap(feature => importsIn(feature, [module.name], true)));\n } else if (keyword === 'feature') {\n found.push(...importsIn(parseFeature(context, line), [], false));\n } else {\n context.skipOpaqueBlock(line.indent);\n }\n }\n return found;\n}\n\nfunction importsIn(feature: FeatureSyntax, outer: readonly string[], startsAtModule: boolean): DiscoveredImport[] {\n const scope = [...outer, feature.name];\n return [\n ...feature.fileImports.map(fileImport => ({ scope, startsAtModule, fileImport })),\n ...feature.features.flatMap(nested => importsIn(nested, scope, startsAtModule)),\n ];\n}\n"],"mappings":"wTAyBA,SAAgB,cAAc,EAA8B,EAAoD,CAC5G,GAAM,CAAE,SAAUA,EAIlB,OAHIC,EAAM,SAAW,EAAUC,EAC1BF,EAAW,eACZG,EAAoBD,CAAQ,EAAUD,EACnCC,EAAS,SAAW,GAAKA,EAAS,KAAOD,EAAM,GAAK,CAAC,GAAGC,EAAU,GAAGD,EAAM,MAAM,CAAC,CAAC,EAAI,IAAA,GAFvDE,EAAoBD,CAAQ,EAAI,IAAA,GAAY,CAAC,GAAGA,EAAU,GAAGD,CAAK,CAG7G,CAOA,SAAgB,gBAAgB,EAA4C,CACxE,IAAMG,EAA4B,CAAC,EACnC,IAAK,IAAIC,EAAOC,EAAQ,OAAO,gBAAgB,EAAGD,IAAS,IAAA,GAAW,EAAOC,EAAQ,OAAO,gBAAgB,EAAG,CAC3GA,EAAQ,OAAO,gBAAgB,EAC/B,IAAMC,EAAUC,EAAUH,EAAK,OAAO,EAChCI,EAAaF,IAAY,SAAWG,EAAmBL,CAAI,EAAI,IAAA,GACrE,GAAII,IAAe,IAAA,GACfL,EAAM,KAAK,CAAE,MAAO,CAAC,EAAG,eAAgB,GAAO,YAAW,CAAC,OACxD,GAAIG,IAAY,SAAU,CAC7B,IAAMI,EAASC,EAAYN,EAASD,CAAI,EACxCD,EAAM,KAAK,GAAGO,EAAO,YAAY,IAAI,IAAS,CAAE,MAAO,CAACA,EAAO,IAAI,EAAG,eAAgB,GAAM,WAAYE,CAAK,EAAE,CAAC,EAChHT,EAAM,KAAK,GAAGO,EAAO,SAAS,QAAQ,GAAW,UAAUG,EAAS,CAACH,EAAO,IAAI,EAAG,EAAI,CAAC,CAAC,CAC7F,MAAWJ,IAAY,UACnBH,EAAM,KAAK,GAAG,UAAUW,EAAaT,EAASD,CAAI,EAAG,CAAC,EAAG,EAAK,CAAC,EAE/DC,EAAQ,gBAAgBD,EAAK,MAAM,CAE3C,CACA,OAAOD,CACX,CAEA,SAAS,UAAU,EAAwB,EAA0B,EAA6C,CAC9G,IAAMH,EAAQ,CAAC,GAAGe,EAAOF,EAAQ,IAAI,EACrC,MAAO,CACH,GAAGA,EAAQ,YAAY,IAAI,IAAe,CAAE,QAAO,iBAAgB,YAAW,EAAE,EAChF,GAAGA,EAAQ,SAAS,QAAQ,GAAU,UAAUG,EAAQhB,EAAOiB,CAAc,CAAC,CAClF,CACJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{MatchAmbiguityGraph as e}from"./MatchAmbiguityGraph.js";import{hasExponentialMatchAmbiguity as t}from"./hasExponentialMatchAmbiguity.js";import{MatchAmbiguityParser as n}from"./MatchAmbiguityParser.js";import{trimMatchAmbiguityGraph as r}from"./trimMatchAmbiguityGraph.js";function descendants(e){return[e,...e.children.flatMap(descendants)]}function unwrap(e){for(;[`group`,`concat`,`alternate`].includes(e.kind)&&e.children.length===1;)e=e.children[0];return e}function rewrite(e,t){if(e.minimum>1)return;let n=unwrap(e.children[0]),r=e.minimum;if(n.kind===`repeat`&&n.maximum===null&&n.minimum<=1)r*=n.minimum,n=unwrap(n.children[0]);else if(n.kind===`alternate`&&n.children.length===2){let e=unwrap(n.children[0]),r=unwrap(n.children[1]);if(e.kind!==`characters`||t.slice(e.offset,e.offset+e.length)!==t.slice(r.offset,r.offset+r.length))return;n=e}else return;let i=t.slice(n.offset,n.offset+n.length);return(n.kind===`characters`?i:`(?:${i})`)+(r===0?`*`:`+`)}var i=class MatchAmbiguity{offset;length;subexpression;suggestion;constructor(e,t,n,r){this.offset=e,this.length=t,this.subexpression=n,this.suggestion=r}get description(){return`Match subexpression '${this.subexpression}' at offset ${this.offset} is exponentially ambiguous and can cause excessive browser backtracking.${this.suggestion===void 0?``:` Use '${this.suggestion}' instead.`}`}static find(i){let a=new n(i).parse(),o=new e(a);if(o.exhausted)return;let s=r(o),c=descendants(a).filter(e=>e.kind===`repeat`&&e.maximum===null).sort((e,t)=>e.length-t.length||e.offset-t.offset);for(let e of c){if(t(o,e,s))return new MatchAmbiguity(e.offset,e.length,i.slice(e.offset,e.offset+e.length),rewrite(e,i));if(o.exhausted)return}}};export{i as MatchAmbiguity};
|
|
2
|
+
//# sourceMappingURL=MatchAmbiguity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchAmbiguity.js","names":["node","body","minimum","left","right","pattern","text","MatchAmbiguity","offset","length","subexpression","suggestion","expression","MatchAmbiguityParser","graph","MatchAmbiguityGraph","live","trimMatchAmbiguityGraph","candidates","candidate","hasExponentialMatchAmbiguity"],"sources":["../../../../../../Compiler/Parsing/MatchAmbiguity.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 { hasExponentialMatchAmbiguity } from './hasExponentialMatchAmbiguity';\nimport { MatchAmbiguityGraph } from './MatchAmbiguityGraph';\nimport { MatchAmbiguityNode } from './MatchAmbiguityNode';\nimport { MatchAmbiguityParser } from './MatchAmbiguityParser';\nimport { trimMatchAmbiguityGraph } from './trimMatchAmbiguityGraph';\n\nfunction descendants(node: MatchAmbiguityNode): MatchAmbiguityNode[] { return [node, ...node.children.flatMap(descendants)]; }\nfunction unwrap(node: MatchAmbiguityNode): MatchAmbiguityNode {\n while (['group', 'concat', 'alternate'].includes(node.kind) && node.children.length === 1) node = node.children[0];\n return node;\n}\nfunction rewrite(node: MatchAmbiguityNode, pattern: string): string | undefined {\n if (node.minimum > 1) return undefined;\n let body = unwrap(node.children[0]);\n let minimum = node.minimum;\n if (body.kind === 'repeat' && body.maximum === null && body.minimum <= 1) {\n minimum *= body.minimum;\n body = unwrap(body.children[0]);\n } else if (body.kind === 'alternate' && body.children.length === 2) {\n const left = unwrap(body.children[0]);\n const right = unwrap(body.children[1]);\n // Restrict this shortcut to one character token; a compound body may stay ambiguous.\n if (left.kind !== 'characters' || pattern.slice(left.offset, left.offset + left.length) !== pattern.slice(right.offset, right.offset + right.length)) return undefined;\n body = left;\n } else return undefined;\n const text = pattern.slice(body.offset, body.offset + body.length);\n return (body.kind === 'characters' ? text : `(?:${text})`) + (minimum === 0 ? '*' : '+');\n}\n\n/** Finding for an admitted pattern; analysis budget exhaustion produces no finding. */\nexport class MatchAmbiguity {\n constructor(readonly offset: number, readonly length: number, readonly subexpression: string, readonly suggestion: string | undefined) { }\n get description(): string {\n return `Match subexpression '${this.subexpression}' at offset ${this.offset} is exponentially ambiguous and can cause excessive browser backtracking.${this.suggestion === undefined ? '' : ` Use '${this.suggestion}' instead.`}`;\n }\n static find(pattern: string): MatchAmbiguity | undefined {\n const expression = new MatchAmbiguityParser(pattern).parse();\n const graph = new MatchAmbiguityGraph(expression);\n if (graph.exhausted) return undefined;\n const live = trimMatchAmbiguityGraph(graph);\n const candidates = descendants(expression).filter(node => node.kind === 'repeat' && node.maximum === null).sort((left, right) => left.length - right.length || left.offset - right.offset);\n for (const candidate of candidates) {\n if (hasExponentialMatchAmbiguity(graph, candidate, live)) return new MatchAmbiguity(candidate.offset, candidate.length, pattern.slice(candidate.offset, candidate.offset + candidate.length), rewrite(candidate, pattern));\n if (graph.exhausted) return undefined;\n }\n return undefined;\n }\n}\n"],"mappings":"6UASA,SAAS,YAAY,EAAgD,CAAE,MAAO,CAACA,EAAM,GAAGA,EAAK,SAAS,QAAQ,WAAW,CAAC,CAAG,CAC7H,SAAS,OAAO,EAA8C,CAC1D,KAAO,CAAC,QAAS,SAAU,WAAW,CAAC,CAAC,SAASA,EAAK,IAAI,GAAKA,EAAK,SAAS,SAAW,GAAG,EAAOA,EAAK,SAAS,GAChH,OAAOA,CACX,CACA,SAAS,Q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CAAU,CAAC,CAAC,OAAO,GAAQZ,EAAK,OAAS,UAAYA,EAAK,UAAY,IAAI,CAAC,CAAC,MAAM,EAAM,IAAUG,EAAK,OAASC,EAAM,QAAUD,EAAK,OAASC,EAAM,MAAM,EACzL,IAAK,IAAMe,KAAaD,EAAY,CAChC,GAAIE,EAA6BN,EAAOK,EAAWH,CAAI,EAAG,OAAO,IAAI,eAAeG,EAAU,OAAQA,EAAU,OAAQd,EAAQ,MAAMc,EAAU,OAAQA,EAAU,OAASA,EAAU,MAAM,EAAG,QAAQA,EAAWd,CAAO,CAAC,EACzN,GAAIS,EAAM,UAAW,MACzB,CAEJ,CACJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";function complement(e){let t=[...e].sort((e,t)=>e[0]-t[0]),n=[],r=0;for(let[e,i]of t)r<e&&n.push([r,e-1]),r=Math.max(r,i+1);return r<=65535&&n.push([r,65535]),n}function matchAmbiguityCharacters(e){if(e===`.`)return complement([[10,10],[13,13],[8232,8233]]);let t=+(e[0]===`[`),n=t===1&&e[t]===`^`;n&&t++;let r=e[0]===`[`?e.length-1:e.length;function item(){let n=e[t++];if(n!==`\\`)return[[n.charCodeAt(0),n.charCodeAt(0)]];let r=e[t++];if(`dDwWsS`.includes(r)){let e=r.toLowerCase()===`d`?[[48,57]]:r.toLowerCase()===`w`?[[48,57],[65,90],[95,95],[97,122]]:[[9,13],[32,32],[160,160],[5760,5760],[8192,8202],[8232,8233],[8239,8239],[8287,8287],[12288,12288],[65279,65279]];return r===r.toUpperCase()?complement(e):e}if(r===`x`||r===`u`){let n=r===`x`?2:4,i=parseInt(e.slice(t,t+n),16);return t+=n,[[i,i]]}let i={t:9,n:10,r:13,f:12,v:11,0:0}[r]??r.charCodeAt(0);return[[i,i]]}let i=[];for(;t<r;){let n=item();e[0]===`[`&&e[t]===`-`&&t+1<r&&(t++,n=[[n[0][0],item()[0][0]]]),i.push(...n)}return n?complement(i):i}export{matchAmbiguityCharacters};
|
|
2
|
+
//# sourceMappingURL=MatchAmbiguityCharacters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchAmbiguityCharacters.js","names":["ordered","ranges","left","right","result","next","first","last","token","offset","negated","end","character","escape","width","code"],"sources":["../../../../../../Compiler/Parsing/MatchAmbiguityCharacters.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\nfunction complement(ranges: [number, number][]): [number, number][] {\n const ordered = [...ranges].sort((left, right) => left[0] - right[0]);\n const result: [number, number][] = [];\n let next = 0;\n for (const [first, last] of ordered) {\n if (next < first) result.push([next, first - 1]);\n next = Math.max(next, last + 1);\n }\n if (next <= 65535) result.push([next, 65535]);\n return result;\n}\n\n/** UTF-16 sets for already-admitted literal, escape, dot and class tokens. */\nexport function matchAmbiguityCharacters(token: string): [number, number][] {\n if (token === '.') return complement([[10, 10], [13, 13], [0x2028, 0x2029]]);\n let offset = token[0] === '[' ? 1 : 0;\n const negated = offset === 1 && token[offset] === '^';\n if (negated) offset++;\n const end = token[0] === '[' ? token.length - 1 : token.length;\n function item(): [number, number][] {\n const character = token[offset++];\n if (character !== '\\\\') return [[character.charCodeAt(0), character.charCodeAt(0)]];\n const escape = token[offset++];\n if ('dDwWsS'.includes(escape)) {\n const ranges: [number, number][] = escape.toLowerCase() === 'd' ? [[48, 57]] : escape.toLowerCase() === 'w' ? [[48, 57], [65, 90], [95, 95], [97, 122]] : [[9, 13], [32, 32], [160, 160], [0x1680, 0x1680], [0x2000, 0x200a], [0x2028, 0x2029], [0x202f, 0x202f], [0x205f, 0x205f], [0x3000, 0x3000], [0xfeff, 0xfeff]];\n return escape === escape.toUpperCase() ? complement(ranges) : ranges;\n }\n if (escape === 'x' || escape === 'u') {\n const width = escape === 'x' ? 2 : 4;\n const code = parseInt(token.slice(offset, offset + width), 16);\n offset += width;\n return [[code, code]];\n }\n const literals: Record<string, number> = { t: 9, n: 10, r: 13, f: 12, v: 11, '0': 0 };\n const code = literals[escape] ?? escape.charCodeAt(0);\n return [[code, code]];\n }\n const ranges: [number, number][] = [];\n while (offset < end) {\n let left = item();\n if (token[0] === '[' && token[offset] === '-' && offset + 1 < end) {\n offset++;\n left = [[left[0][0], item()[0][0]]];\n }\n ranges.push(...left);\n }\n return negated ? complement(ranges) : ranges;\n}\n"],"mappings":"qDAGA,SAAS,WAAW,EAAgD,CAChE,IAAMA,EAAU,CAAC,GAAGC,CAAM,CAAC,CAAC,MAAM,EAAM,IAAUC,EAAK,GAAKC,EAAM,EAAE,EAC9DC,EAA6B,CAAC,EAChCC,EAAO,EACX,IAAK,GAAM,CAACC,EAAOC,KAASP,EACpBK,EAAOC,GAAOF,EAAO,KAAK,CAACC,EAAMC,EAAQ,CAAC,CAAC,EAC/C,EAAO,KAAK,IAAID,EAAME,EAAO,CAAC,EAGlC,OADIF,GAAQ,OAAOD,EAAO,KAAK,CAACC,EAAM,KAAK,CAAC,EACrCD,CACX,CAGA,SAAgB,yBAAyB,EAAmC,CACxE,GAAII,IAAU,IAAK,OAAO,WAAW,CAAC,CAAC,GAAI,EAAE,EAAG,CAAC,GAAI,EAAE,EAAG,CAAC,KAAQ,IAAM,CAAC,CAAC,EAC3E,IAAIC,EAAS,IAAM,KAAO,KACpBC,EAAUD,IAAW,GAAKD,EAAMC,KAAY,IAC9CC,GAAS,IACb,IAAMC,EAAMH,EAAM,KAAO,IAAMA,EAAM,OAAS,EAAIA,EAAM,OACxD,SAAS,MAA2B,CAChC,IAAMI,EAAYJ,EAAM,KACxB,GAAII,IAAc,KAAM,MAAO,CAAC,CAACA,EAAU,WAAW,CAAC,EAAGA,EAAU,WAAW,CAAC,CAAC,CAAC,EAClF,IAAMC,EAASL,EAAM,KACrB,GAAI,SAAS,SAASK,CAAM,EAAG,CAC3B,IAAMZ,EAA6BY,EAAO,YAAY,IAAM,IAAM,CAAC,CAAC,GAAI,EAAE,CAAC,EAAIA,EAA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,empty=(e=1)=>({nullable:e,first:/* @__PURE__ */ new Map,last:/* @__PURE__ */ new Map}),add=(e,t)=>Math.min(2,e+t);function sum(e,t,n=1){let r=new Map(e);if(n>0)for(let[e,i]of t)r.set(e,add(r.get(e)??0,i*n));return r}var MatchAmbiguityGraph=class{positions=[{kind:`empty`,offset:0,length:0,children:[],minimum:0,maximum:0,characters:[]}];edges=[];root;exhausted=!1;work=0;constructor(e){this.root=this.build(e)}build(e){if(this.exhausted)return empty(0);if(++this.work>5e5)return this.exhausted=!0,empty(0);if([`characters`,`start`,`end`].includes(e.kind)){if(this.positions.length>256)return this.exhausted=!0,empty(0);let t=this.positions.length;return this.positions.push(e),{nullable:0,first:/* @__PURE__ */ new Map([[t,1]]),last:/* @__PURE__ */ new Map([[t,1]])}}if(e.kind===`group`)return this.build(e.children[0]);if(e.kind===`repeat`)return this.repeat(e);let t=empty(e.kind===`alternate`?0:1);for(let n of e.children){let r=this.build(n);t=e.kind===`alternate`?{nullable:add(t.nullable,r.nullable),first:sum(t.first,r.first),last:sum(t.last,r.last)}:this.concat(t,r,e)}return t}repeat(e){if(e.maximum!==null)return this.boundedRepeat(e,e.maximum);let t=empty();for(let n=0;n<e.minimum&&!this.exhausted;n++)t=this.concat(t,this.iteration(e,!0),e);let n=this.iteration(e,!1);return this.connect(n.last,n.first,e),this.concat(t,{...n,nullable:1},e)}boundedRepeat(e,t){let n=empty();for(let r=t-1;r>=0&&!this.exhausted;r--){let t=r<e.minimum;n=this.concat(this.iteration(e,t),n,e),t||(n={...n,nullable:1})}return n}iteration(e,t){let n=this.build(e.children[0]);return t?n:{...n,nullable:0}}concat(e,t,n){return this.connect(e.last,t.first,n),{nullable:Math.min(2,e.nullable*t.nullable),first:sum(e.first,t.first,e.nullable),last:sum(t.last,e.last,t.nullable)}}connect(e,t,n){for(let[r,i]of e)for(let[e,a]of t){if(++this.work>5e5){this.exhausted=!0;return}this.edges.push({source:r,target:e,count:Math.min(2,i*a),origin:n})}}};export{MatchAmbiguityGraph,e as matchAmbiguityWorkLimit};
|
|
2
|
+
//# sourceMappingURL=MatchAmbiguityGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchAmbiguityGraph.js","names":["matchAmbiguityWorkLimit","left","right","result","scale","position","count","expression","node","child","part","index","tail","maximum","required","body","origin","source","firstCount","target","lastCount"],"sources":["../../../../../../Compiler/Parsing/MatchAmbiguityGraph.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 { MatchAmbiguityNode } from './MatchAmbiguityNode';\nimport { MatchAmbiguityPositions } from './MatchAmbiguityPositions';\n\nexport const matchAmbiguityPositionLimit = 256;\nexport const matchAmbiguityWorkLimit = 500000;\nconst empty = (nullable = 1): MatchAmbiguityPositions => ({ nullable, first: new Map(), last: new Map() });\nconst add = (left: number, right: number) => Math.min(2, left + right);\nfunction sum(left: Map<number, number>, right: Map<number, number>, scale = 1): Map<number, number> {\n const result = new Map(left);\n if (scale > 0) for (const [position, count] of right) result.set(position, add(result.get(position) ?? 0, count * scale));\n return result;\n}\n\n/** Position multigraph, with derivation counts saturated at two. Never used for execution. */\nexport class MatchAmbiguityGraph {\n readonly positions: MatchAmbiguityNode[] = [{ kind: 'empty', offset: 0, length: 0, children: [], minimum: 0, maximum: 0, characters: [] }];\n readonly edges: { source: number; target: number; count: number; origin: MatchAmbiguityNode }[] = [];\n readonly root: MatchAmbiguityPositions;\n exhausted = false;\n work = 0;\n constructor(expression: MatchAmbiguityNode) { this.root = this.build(expression); }\n private build(node: MatchAmbiguityNode): MatchAmbiguityPositions {\n if (this.exhausted) return empty(0);\n if (++this.work > matchAmbiguityWorkLimit) { this.exhausted = true; return empty(0); }\n if (['characters', 'start', 'end'].includes(node.kind)) {\n if (this.positions.length > matchAmbiguityPositionLimit) { this.exhausted = true; return empty(0); }\n const position = this.positions.length;\n this.positions.push(node);\n return { nullable: 0, first: new Map([[position, 1]]), last: new Map([[position, 1]]) };\n }\n if (node.kind === 'group') return this.build(node.children[0]);\n if (node.kind === 'repeat') return this.repeat(node);\n let result = empty(node.kind === 'alternate' ? 0 : 1);\n for (const child of node.children) {\n const part = this.build(child);\n result = node.kind === 'alternate' ? { nullable: add(result.nullable, part.nullable), first: sum(result.first, part.first), last: sum(result.last, part.last) } : this.concat(result, part, node);\n }\n return result;\n }\n private repeat(node: MatchAmbiguityNode): MatchAmbiguityPositions {\n if (node.maximum !== null) return this.boundedRepeat(node, node.maximum);\n let result = empty();\n for (let index = 0; index < node.minimum && !this.exhausted; index++) {\n result = this.concat(result, this.iteration(node, true), node);\n }\n const tail = this.iteration(node, false);\n this.connect(tail.last, tail.first, node);\n return this.concat(result, { ...tail, nullable: 1 }, node);\n }\n private boundedRepeat(node: MatchAmbiguityNode, maximum: number): MatchAmbiguityPositions {\n let result = empty();\n // A prefix-closed suffix gives each count one path: b{0,2} is (b(b)?)?.\n for (let index = maximum - 1; index >= 0 && !this.exhausted; index--) {\n const required = index < node.minimum;\n result = this.concat(this.iteration(node, required), result, node);\n if (!required) result = { ...result, nullable: 1 };\n }\n return result;\n }\n private iteration(node: MatchAmbiguityNode, required: boolean): MatchAmbiguityPositions {\n const body = this.build(node.children[0]);\n // RepeatMatcher permits empty mandatory iterations, but rejects them once min is zero.\n // Preserve nonempty derivations (including empty prefixes); only the wrapper may skip.\n return required ? body : { ...body, nullable: 0 };\n }\n private concat(left: MatchAmbiguityPositions, right: MatchAmbiguityPositions, origin: MatchAmbiguityNode): MatchAmbiguityPositions {\n this.connect(left.last, right.first, origin);\n return { nullable: Math.min(2, left.nullable * right.nullable), first: sum(left.first, right.first, left.nullable), last: sum(right.last, left.last, right.nullable) };\n }\n private connect(left: Map<number, number>, right: Map<number, number>, origin: MatchAmbiguityNode): void {\n for (const [source, firstCount] of left) for (const [target, lastCount] of right) {\n if (++this.work > matchAmbiguityWorkLimit) { this.exhausted = true; return; }\n this.edges.push({ source, target, count: Math.min(2, firstCount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A,UAAkB,EAA0B,EAA4C,CACpF,IAAMY,EAAO,KAAK,MAAMP,EAAK,SAAS,EAAE,EAGxC,OAAOM,EAAWC,EAAO,CAAE,GAAGA,EAAM,SAAU,CAAE,CACpD,CACA,OAAe,EAA+B,EAAgC,EAAqD,CAE/H,OADA,KAAK,QAAQd,EAAK,KAAMC,EAAM,MAAOc,CAAM,EACpC,CAAE,SAAU,KAAK,IAAI,EAAGf,EAAK,SAAWC,EAAM,QAAQ,EAAG,MAAO,IAAID,EAAK,MAAOC,EAAM,MAAOD,EAAK,QAAQ,EAAG,KAAM,IAAIC,EAAM,KAAMD,EAAK,KAAMC,EAAM,QAAQ,CAAE,CACzK,CACA,QAAgB,EAA2B,EAA4B,EAAkC,CACrG,IAAK,GAAM,CAACe,EAAQC,KAAejB,EAAM,IAAK,GAAM,CAACkB,EAAQC,KAAclB,EAAO,CAC9E,GAAI,EAAE,KAAK,KAAA,IAAgC,CAAE,KAAK,UAAY,GAAM,MAAQ,CAC5E,KAAK,MAAM,KAAK,CAAE,SAAQ,SAAQ,MAAO,KAAK,IAAI,EAAGgB,EAAaE,CAAS,EAAG,QAAO,CAAC,CAC1F,CACJ,CACJ"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{matchAmbiguityCharacters as e}from"./MatchAmbiguityCharacters.js";var MatchAmbiguityParser=class{pattern;offset=0;constructor(e){this.pattern=e}parse(){return this.expression()}node(e,t,n=[]){return{kind:e,offset:t,length:this.offset-t,children:n,minimum:0,maximum:0,characters:[]}}expression(){let e=this.offset,t=[this.sequence()];for(;this.take(`|`);)t.push(this.sequence());return this.node(`alternate`,e,t)}sequence(){let e=this.offset,t=[];for(;this.offset<this.pattern.length&&!`)|`.includes(this.pattern[this.offset]);)t.push(this.quantified());return this.node(`concat`,e,t)}quantified(){let e=this.offset,t=this.atom(),n=0,r=null;if(!this.take(`*`)){if(this.take(`+`))n=1;else if(this.take(`?`))r=1;else if(this.take(`{`))n=this.number(),r=n,this.take(`,`)&&(r=this.pattern[this.offset]===`}`?null:this.number()),this.take(`}`);else return t}return this.take(`?`),{...this.node(`repeat`,e,[t]),minimum:n,maximum:r}}atom(){let t=this.offset,n=this.pattern[this.offset++];if(n===`(`){if(this.take(`?`)&&!this.take(`:`))for(;this.pattern[this.offset++]!==`>`;);let e=this.expression();return this.take(`)`),this.node(`group`,t,[e])}if(n===`[`){for(;this.pattern[this.offset]!==`]`;)this.pattern[this.offset++]===`\\`&&this.offset++;this.offset++}else if(n===`\\`){let e=this.pattern[this.offset++];this.offset+=e===`x`?2:e===`u`?4:0}return n===`^`||n===`$`?this.node(n===`^`?`start`:`end`,t):{...this.node(`characters`,t),characters:e(this.pattern.slice(t,this.offset))}}number(){let e=0;for(;this.offset<this.pattern.length&&this.pattern[this.offset]>=`0`&&this.pattern[this.offset]<=`9`;)e=Math.min(3001,e*10+Number(this.pattern[this.offset++]));return e}take(e){return this.offset===this.pattern.length||this.pattern[this.offset]!==e?!1:(this.offset++,!0)}};export{MatchAmbiguityParser};
|
|
2
|
+
//# sourceMappingURL=MatchAmbiguityParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MatchAmbiguityParser.js","names":["pattern","start","alternatives","children","atom","minimum","maximum","character","body","escape","matchAmbiguityCharacters","value"],"sources":["../../../../../../Compiler/Parsing/MatchAmbiguityParser.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 { matchAmbiguityCharacters } from './MatchAmbiguityCharacters';\nimport { MatchAmbiguityNode } from './MatchAmbiguityNode';\n\n/** Reads only admitted patterns; PortableMatchPattern remains the dialect authority. */\nexport class MatchAmbiguityParser {\n private offset = 0;\n constructor(private readonly pattern: string) { }\n parse(): MatchAmbiguityNode { return this.expression(); }\n private node(kind: string, start: number, children: MatchAmbiguityNode[] = []): MatchAmbiguityNode {\n return { kind, offset: start, length: this.offset - start, children, minimum: 0, maximum: 0, characters: [] };\n }\n private expression(): MatchAmbiguityNode {\n const start = this.offset;\n const alternatives = [this.sequence()];\n while (this.take('|')) alternatives.push(this.sequence());\n return this.node('alternate', start, alternatives);\n }\n private sequence(): MatchAmbiguityNode {\n const start = this.offset;\n const children: MatchAmbiguityNode[] = [];\n while (this.offset < this.pattern.length && !')|'.includes(this.pattern[this.offset])) children.push(this.quantified());\n return this.node('concat', start, children);\n }\n private quantified(): MatchAmbiguityNode {\n const start = this.offset;\n const atom = this.atom();\n let minimum = 0;\n let maximum: number | null = null;\n if (this.take('*')) { /* Zero or more. */ }\n else if (this.take('+')) minimum = 1;\n else if (this.take('?')) maximum = 1;\n else if (this.take('{')) {\n minimum = this.number();\n maximum = minimum;\n if (this.take(',')) maximum = this.pattern[this.offset] === '}' ? null : this.number();\n this.take('}');\n } else return atom;\n this.take('?');\n return { ...this.node('repeat', start, [atom]), minimum, maximum };\n }\n private atom(): MatchAmbiguityNode {\n const start = this.offset;\n const character = this.pattern[this.offset++];\n if (character === '(') {\n if (this.take('?') && !this.take(':')) while (this.pattern[this.offset++] !== '>') { /* Admitted group name. */ }\n const body = this.expression();\n this.take(')');\n return this.node('group', start, [body]);\n }\n if (character === '[') {\n while (this.pattern[this.offset] !== ']') if (this.pattern[this.offset++] === '\\\\') this.offset++;\n this.offset++;\n } else if (character === '\\\\') {\n const escape = this.pattern[this.offset++];\n this.offset += escape === 'x' ? 2 : escape === 'u' ? 4 : 0;\n }\n if (character === '^' || character === '$') return this.node(character === '^' ? 'start' : 'end', start);\n return { ...this.node('characters', start), characters: matchAmbiguityCharacters(this.pattern.slice(start, this.offset)) };\n }\n private number(): number {\n let value = 0;\n while (this.offset < this.pattern.length && this.pattern[this.offset] >= '0' && this.pattern[this.offset] <= '9') value = Math.min(3001, value * 10 + Number(this.pattern[this.offset++]));\n return value;\n }\n private take(character: string): boolean {\n if (this.offset === this.pattern.length || this.pattern[this.offset] !== character) return false;\n this.offset++;\n return true;\n }\n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from"../Diagnostics/DiagnosticCodes.js";import{emailMatchPattern as t,validateMatchPattern as n}from"./PortableMatchPattern.js";import{checkPortableMatchPattern as r}from"./checkPortableMatchPattern.js";function matchSubject(e,t,n,r){return t===`command`?{owner:{kind:`declaration`,value:{kind:`command`,path:[...e.scope,n]}},property:r}:{owner:{kind:`declaration`,value:{kind:`concept`,path:[n]}}}}function matchArguments(e,t,n){return{subject:e.owner,...e.property===void 0?{}:{property:{kind:`text`,value:e.property}},pattern:{kind:`text`,value:t},...n===void 0?{}:{offset:{kind:`index`,value:n}}}}function validateMatchOperand(
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import{DiagnosticCodes as e}from"../Diagnostics/DiagnosticCodes.js";import{emailMatchPattern as t,validateMatchPattern as n}from"./PortableMatchPattern.js";import{checkPortableMatchPattern as r}from"./checkPortableMatchPattern.js";import{MatchAmbiguity as i}from"./MatchAmbiguity.js";function matchSubject(e,t,n,r){return t===`command`?{owner:{kind:`declaration`,value:{kind:`command`,path:[...e.scope,n]}},property:r}:{owner:{kind:`declaration`,value:{kind:`concept`,path:[n]}}}}function matchArguments(e,t,n){return{subject:e.owner,...e.property===void 0?{}:{property:{kind:`text`,value:e.property}},pattern:{kind:`text`,value:t},...n===void 0?{}:{offset:{kind:`index`,value:n}}}}function validateMatchOperand(a,o,s,c,l){if(o.kind===`PathExpressionSyntax`&&o.path!==`email`){a.error(e.UnknownMatchPattern,`Named match pattern '${o.path}' is not defined; use 'email' or a quoted portable regular expression.`,s);return}let u=o.kind===`LiteralExpressionSyntax`&&typeof o.value==`string`?o.value:o.kind===`PathExpressionSyntax`?t:void 0;if(u===void 0)return;let d=r(u);if(d.replacement!==void 0){a.warning(e.DeprecatedStudioTextRulePattern,d.description,s,matchArguments(l,u));return}let f=n(u);if(f===void 0){let t=i.find(u);t!==void 0&&a.warning(e.AmbiguousMatchPattern,t.description,patternLocation(c,s,t.offset),matchArguments(l,u,t.offset));return}let p=`${f.construct} at offset ${f.offset}. ${f.suggestion??``}`.trimEnd();a.error(f.invalid?e.InvalidMatchPattern:e.PatternOutsidePortableMatchDialect,`Match pattern: ${p}`,patternLocation(c,s,f.offset),matchArguments(l,u,f.offset))}function patternLocation(e,t,n){let r=e.indexOf(`"`,t.column-1);if(r<0)return t;let i=r+1;for(let t=0;t<n&&i<e.length;t++,i++)e[i]===`\\`&&`\\"nrt`.includes(e[i+1]??`\0`)&&i++;return{...t,column:i+1}}export{matchSubject,validateMatchOperand};
|
|
2
2
|
//# sourceMappingURL=MatchOperandValidation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MatchOperandValidation.js","names":["owner","context","name","subject","pattern","offset","value","DiagnosticCodes","location","emailMatchPattern","check","checkPortableMatchPattern","issue","validateMatchPattern","
|
|
1
|
+
{"version":3,"file":"MatchOperandValidation.js","names":["owner","context","name","subject","pattern","offset","value","DiagnosticCodes","location","emailMatchPattern","check","checkPortableMatchPattern","issue","validateMatchPattern","ambiguity","MatchAmbiguity","raw","description","quote","decoded","patternOffset"],"sources":["../../../../../../Compiler/Parsing/MatchOperandValidation.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 { DiagnosticArgument } from '../Diagnostics/DiagnosticArgument';\nimport { DiagnosticArgumentKind } from '../Diagnostics/DiagnosticArgumentKind';\nimport { DiagnosticCodes } from '../Diagnostics/DiagnosticCodes';\nimport { SourceLocation } from '../Diagnostics/SourceLocation';\nimport { ExpressionSyntax } from '../Syntax/Expressions';\nimport { ParserContext } from './ParserContext';\nimport { MatchAmbiguity } from './MatchAmbiguity';\nimport { checkPortableMatchPattern } from './checkPortableMatchPattern';\nimport { emailMatchPattern, validateMatchPattern } from './PortableMatchPattern';\n\nexport interface MatchSubject {\n readonly owner: DiagnosticArgument;\n readonly property?: string;\n}\n\n// The command (module, features, slice, command) or concept that owns a match rule, as the C# binder names it.\nexport function matchSubject(context: ParserContext, owner: 'command' | 'concept', name: string, property: string): MatchSubject {\n return owner === 'command'\n ? { owner: { kind: DiagnosticArgumentKind.Declaration, value: { kind: 'command', path: [...context.scope, name] } }, property }\n : { owner: { kind: DiagnosticArgumentKind.Declaration, value: { kind: 'concept', path: [name] } } };\n}\n\nfunction matchArguments(subject: MatchSubject, pattern: string, offset?: number): Readonly<Record<string, DiagnosticArgument>> {\n return {\n subject: subject.owner,\n ...(subject.property === undefined ? {} : { property: { kind: DiagnosticArgumentKind.Text, value: subject.property } }),\n pattern: { kind: DiagnosticArgumentKind.Text, value: pattern },\n ...(offset === undefined ? {} : { offset: { kind: DiagnosticArgumentKind.Index, value: offset } }),\n };\n}\n\nexport function validateMatchOperand(context: ParserContext, value: ExpressionSyntax, location: SourceLocation, raw: string, subject: MatchSubject): void {\n if (value.kind === 'PathExpressionSyntax' && value.path !== 'email') {\n context.error(DiagnosticCodes.UnknownMatchPattern, `Named match pattern '${value.path}' is not defined; use 'email' or a quoted portable regular expression.`, location);\n return;\n }\n const pattern = value.kind === 'LiteralExpressionSyntax' && typeof value.value === 'string' ? value.value : value.kind === 'PathExpressionSyntax' ? emailMatchPattern : undefined;\n if (pattern === undefined) return;\n const check = checkPortableMatchPattern(pattern);\n if (check.replacement !== undefined) {\n context.warning(DiagnosticCodes.DeprecatedStudioTextRulePattern, check.description, location, matchArguments(subject, pattern));\n return;\n }\n const issue = validateMatchPattern(pattern);\n if (issue === undefined) {\n const ambiguity = MatchAmbiguity.find(pattern);\n if (ambiguity !== undefined) context.warning(DiagnosticCodes.AmbiguousMatchPattern, ambiguity.description, patternLocation(raw, location, ambiguity.offset), matchArguments(subject, pattern, ambiguity.offset));\n return;\n }\n const description = `${issue.construct} at offset ${issue.offset}. ${issue.suggestion ?? ''}`.trimEnd();\n context.error(issue.invalid ? DiagnosticCodes.InvalidMatchPattern : DiagnosticCodes.PatternOutsidePortableMatchDialect, `Match pattern: ${description}`, patternLocation(raw, location, issue.offset), matchArguments(subject, pattern, issue.offset));\n}\n\nfunction patternLocation(raw: string, location: SourceLocation, patternOffset: number): SourceLocation {\n const quote = raw.indexOf('\"', location.column - 1);\n if (quote < 0) return location;\n let offset = quote + 1;\n for (let decoded = 0; decoded < patternOffset && offset < raw.length; decoded++, offset++) {\n if (raw[offset] === '\\\\' && '\\\\\"nrt'.includes(raw[offset + 1] ?? '\\0')) offset++;\n }\n return { ...location, column: offset + 1 };\n}\n"],"mappings":"iVAmBA,SAAgB,aAAa,EAAwB,EAA8B,EAAc,EAAgC,CAC7H,OAAOA,IAAU,UACX,CAAE,MAAO,CAAE,KAAA,cAA0C,MAAO,CAAE,KAAM,UAAW,KAAM,CAAC,GAAGC,EAAQ,MAAOC,CAAI,CAAE,CAAE,EAAG,UAAS,EAC5H,CAAE,MAAO,CAAE,KAAA,cAA0C,MAAO,CAAE,KAAM,UAAW,KAAM,CAACA,CAAI,CAAE,CAAE,CAAE,CAC1G,CAEA,SAAS,eAAe,EAAuB,EAAiB,EAA+D,CAC3H,MAAO,CACH,QAASC,EAAQ,MACjB,GAAIA,EAAQ,WAAa,IAAA,GAAY,CAAC,EAAI,CAAE,SAAU,CAAE,KAAA,OAAmC,MAAOA,EAAQ,QAAS,CAAE,EACrH,QAAS,CAAE,KAAA,OAAmC,MAAOC,CAAQ,EAC7D,GAAIC,IAAW,IAAA,GAAY,CAAC,EAAI,CAAE,OAAQ,CAAE,KAAA,QAAoC,MAAOA,CAAO,CAAE,CACpG,CACJ,CAEA,SAAgB,qBAAqB,EAAwB,EAAyB,EAA0B,EAAa,EAA6B,CACtJ,GAAIC,EAAM,OAAS,wBAA0BA,EAAM,OAAS,QAAS,CACjEL,EAAQ,MAAMM,EAAgB,oBAAqB,wBAAwBD,EAAM,KAAK,wEAAyEE,CAAQ,EACvK,MACJ,CACA,IAAMJ,EAAUE,EAAM,OAAS,2BAA6B,OAAOA,EAAM,OAAU,SAAWA,EAAM,MAAQA,EAAM,OAAS,uBAAyBG,EAAoB,IAAA,GACxK,GAAIL,IAAY,IAAA,GAAW,OAC3B,IAAMM,EAAQC,EAA0BP,CAAO,EAC/C,GAAIM,EAAM,cAAgB,IAAA,GAAW,CACjCT,EAAQ,QAAQM,EAAgB,gCAAiCG,EAAM,YAAaF,EAAU,eAAeL,EAASC,CAAO,CAAC,EAC9H,MACJ,CACA,IAAMQ,EAAQC,EAAqBT,CAAO,EAC1C,GAAIQ,IAAU,IAAA,GAAW,CACrB,IAAME,EAAYC,EAAe,KAAKX,CAAO,EACzCU,IAAc,IAAA,IAAWb,EAAQ,QAAQM,EAAgB,sBAAuBO,EAAU,YAAa,gBAAgBE,EAAKR,EAAUM,EAAU,MAAM,EAAG,eAAeX,EAASC,EAASU,EAAU,MAAM,CAAC,EAC/M,MACJ,CACA,IAAMG,EAAc,GAAGL,EAAM,UAAU,aAAaA,EAAM,OAAO,IAAIA,EAAM,YAAc,KAAK,QAAQ,EACtGX,EAAQ,MAAMW,EAAM,QAAUL,EAAgB,oBAAsBA,EAAgB,mCAAoC,kBAAkBU,IAAe,gBAAgBD,EAAKR,EAAUI,EAAM,MAAM,EAAG,eAAeT,EAASC,EAASQ,EAAM,MAAM,CAAC,CACzP,CAEA,SAAS,gBAAgB,EAAa,EAA0B,EAAuC,CACnG,IAAMM,EAAQF,EAAI,QAAQ,IAAKR,EAAS,OAAS,CAAC,EAClD,GAAIU,EAAQ,EAAG,OAAOV,EACtB,IAAIH,EAASa,EAAQ,EACrB,IAAK,IAAIC,EAAU,EAAGA,EAAUC,GAAiBf,EAASW,EAAI,OAAQ,IAAW,IACzEA,EAAIX,KAAY,MAAQ,SAAS,SAASW,EAAIX,EAAS,IAAM,IAAI,GAAG,IAE5E,MAAO,CAAE,GAAGG,EAAU,OAAQH,EAAS,CAAE,CAC7C"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";import"./MatchAmbiguityGraph.js";function hasExponentialMatchAmbiguity(e,t,n){let r=e.positions.map(()=>/* @__PURE__ */ new Map);for(let i of e.edges.filter(e=>n.has(e.source)&&n.has(e.target)&&e.origin.offset>=t.offset&&e.origin.offset+e.origin.length<=t.offset+t.length))r[i.source].set(i.target,Math.min(2,(r[i.source].get(i.target)??0)+i.count));let i=/* @__PURE__ */ new Map;for(let t of n){let n=[[t,t,!1]],encode=(t,n,r)=>(t*e.positions.length+n)*2+Number(r),a=/* @__PURE__ */ new Set([encode(t,t,!1)]);for(let o=0;o<n.length;o++){let[s,c,l]=n[o];for(let[o,u]of r[s])for(let[d,f]of r[c]){if(++e.work>5e5)return e.exhausted=!0,!1;let r=Math.min(o,d),p=Math.max(o,d),m=r*e.positions.length+p,h=i.get(m);if(h===void 0&&(h=e.positions[o].characters.some(t=>e.positions[d].characters.some(e=>t[0]<=e[1]&&e[0]<=t[1])),i.set(m,h)),!h)continue;let g=l||s!==c||o!==d||u>1||f>1;if(o===t&&d===t&&g)return!0;let _=encode(r,p,g);a.has(_)||(a.add(_),n.push([r,p,g]))}}}return!1}export{hasExponentialMatchAmbiguity};
|
|
2
|
+
//# sourceMappingURL=hasExponentialMatchAmbiguity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasExponentialMatchAmbiguity.js","names":["following","graph","edge","live","owner","overlaps","origin","pending","left","right","different","visited","index","leftPosition","rightPosition","leftCount","rightCount","first","second","key","overlap","one","two","distinct","next"],"sources":["../../../../../../Compiler/Parsing/hasExponentialMatchAmbiguity.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 { MatchAmbiguityGraph, matchAmbiguityWorkLimit } from './MatchAmbiguityGraph';\nimport { MatchAmbiguityNode } from './MatchAmbiguityNode';\n\n/** Weber–Seidl EDA: a synchronized closed pair-path that uses distinct edges. */\nexport function hasExponentialMatchAmbiguity(graph: MatchAmbiguityGraph, owner: MatchAmbiguityNode, live: Set<number>): boolean {\n const following = graph.positions.map(() => new Map<number, number>());\n for (const edge of graph.edges.filter(edge => live.has(edge.source) && live.has(edge.target) && edge.origin.offset >= owner.offset && edge.origin.offset + edge.origin.length <= owner.offset + owner.length)) {\n following[edge.source].set(edge.target, Math.min(2, (following[edge.source].get(edge.target) ?? 0) + edge.count));\n }\n const overlaps = new Map<number, boolean>();\n for (const origin of live) {\n const pending: [number, number, boolean][] = [[origin, origin, false]];\n const encode = (left: number, right: number, different: boolean) => (left * graph.positions.length + right) * 2 + Number(different);\n const visited = new Set([encode(origin, origin, false)]);\n for (let index = 0; index < pending.length; index++) {\n const [leftPosition, rightPosition, different] = pending[index];\n for (const [left, leftCount] of following[leftPosition]) for (const [right, rightCount] of following[rightPosition]) {\n if (++graph.work > matchAmbiguityWorkLimit) { graph.exhausted = true; return false; }\n const first = Math.min(left, right);\n const second = Math.max(left, right);\n const key = first * graph.positions.length + second;\n let overlap = overlaps.get(key);\n if (overlap === undefined) {\n overlap = graph.positions[left].characters.some(one => graph.positions[right].characters.some(two => one[0] <= two[1] && two[0] <= one[1]));\n overlaps.set(key, overlap);\n }\n if (!overlap) continue;\n const distinct = different || leftPosition !== rightPosition || left !== right || leftCount > 1 || rightCount > 1;\n if (left === origin && right === origin && distinct) return true;\n const next = encode(first, second, distinct);\n if (!visited.has(next)) { visited.add(next); pending.push([first, second, distinct]); }\n }\n }\n }\n return false;\n}\n"],"mappings":"sFAOA,SAAgB,6BAA6B,EAA4B,EAA2B,EAA4B,CAC5H,IAAMA,EAAYC,EAAM,UAAU,wBAAU,IAAI,GAAqB,EACrE,IAAK,IAAMC,KAAQD,EAAM,MAAM,OAAO,GAAQE,EAAK,IAAID,EAAK,MAAM,GAAKC,EAAK,IAAID,EAAK,MAAM,GAAKA,EAAK,OAAO,QAAUE,EAAM,QAAUF,EAAK,OAAO,OAASA,EAAK,OAAO,QAAUE,EAAM,OAASA,EAAM,MAAM,EACxMJ,EAAUE,EAAK,OAAO,CAAC,IAAIA,EAAK,OAAQ,KAAK,IAAI,GAAIF,EAAUE,EAAK,OAAO,CAAC,IAAI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AAIa,CAAI,EAAGjB,EAAQ,KAAK,CAACU,EAAOC,EAAQK,CAAQ,CAAC,EACvF,CACJ,CACJ,CACA,MAAO,EACX"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import"../../_virtual/_virtual/_rolldown/runtime.js";function trimMatchAmbiguityGraph(e){let t=e.positions.map(()=>/* @__PURE__ */ new Set);for(let n of e.edges)t[n.source].add(n.target);for(let n of e.root.first.keys())t[0].add(n);let n=Array.from({length:e.positions.length*4},()=>/* @__PURE__ */ new Set),r=/* @__PURE__ */ new Set([0,1]),i=[0,1],a=/* @__PURE__ */ new Set;for(let o=0;o<i.length;o++){let s=i[o],c=Math.floor(s/4),l=s%4;(e.root.last.has(c)||c===0&&e.root.nullable>0)&&a.add(s);for(let a of t[c]){let t=e.positions[a];if(t.kind===`start`&&l&1||t.kind===`characters`&&(l&2||t.characters.length===0))continue;let o=t.kind===`end`?l|2:t.kind===`characters`?l|1:l,c=a*4+o;n[c].add(s),r.has(c)||(r.add(c),i.push(c))}}let o=new Set(a),s=[...a];for(let e=0;e<s.length;e++)for(let t of n[s[e]])o.has(t)||(o.add(t),s.push(t));return new Set(e.positions.map((e,t)=>t).filter(t=>e.positions[t].kind===`characters`&&r.has(t*4+1)&&o.has(t*4+1)))}export{trimMatchAmbiguityGraph};
|
|
2
|
+
//# sourceMappingURL=trimMatchAmbiguityGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trimMatchAmbiguityGraph.js","names":["following","graph","edge","position","reverse","reached","pending","finals","index","state","phase","target","node","nextPhase","next","live","backward","previous"],"sources":["../../../../../../Compiler/Parsing/trimMatchAmbiguityGraph.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 { MatchAmbiguityGraph } from './MatchAmbiguityGraph';\n\n/** Trim with zero-width assertions guarded by consumed-input and asserted-end flags. */\nexport function trimMatchAmbiguityGraph(graph: MatchAmbiguityGraph): Set<number> {\n const following = graph.positions.map(() => new Set<number>());\n for (const edge of graph.edges) following[edge.source].add(edge.target);\n for (const position of graph.root.first.keys()) following[0].add(position);\n const reverse = Array.from({ length: graph.positions.length * 4 }, () => new Set<number>());\n const reached = new Set([0, 1]);\n const pending = [0, 1];\n const finals = new Set<number>();\n for (let index = 0; index < pending.length; index++) {\n const state = pending[index];\n const position = Math.floor(state / 4);\n const phase = state % 4;\n if (graph.root.last.has(position) || (position === 0 && graph.root.nullable > 0)) finals.add(state);\n for (const target of following[position]) {\n const node = graph.positions[target];\n if (node.kind === 'start' && (phase & 1) !== 0) continue;\n if (node.kind === 'characters' && ((phase & 2) !== 0 || node.characters.length === 0)) continue;\n const nextPhase = node.kind === 'end' ? phase | 2 : node.kind === 'characters' ? phase | 1 : phase;\n const next = target * 4 + nextPhase;\n reverse[next].add(state);\n if (!reached.has(next)) { reached.add(next); pending.push(next); }\n }\n }\n const live = new Set(finals);\n const backward = [...finals];\n for (let index = 0; index < backward.length; index++) for (const previous of reverse[backward[index]]) {\n if (!live.has(previous)) { live.add(previous); backward.push(previous); }\n }\n return new Set(graph.positions.map((_, index) => index).filter(position => graph.positions[position].kind === 'characters' && reached.has(position * 4 + 1) && live.has(position * 4 + 1)));\n}\n"],"mappings":"qDAMA,SAAgB,wBAAwB,EAAyC,CAC7E,IAAMA,EAAYC,EAAM,UAAU,wBAAU,IAAI,GAAa,EAC7D,IAAK,IAAMC,KAAQD,EAAM,MAAOD,EAAUE,EAAK,OAAO,CAAC,IAAIA,EAAK,MAAM,EACtE,IAAK,IAAMC,KAAYF,EAAM,KAAK,MAAM,KAAK,EAAGD,EAAU,EAAE,CAAC,IAAIG,CAAQ,EACzE,IAAMC,EAAU,MAAM,KAAK,CAAE,OAAQH,EAAM,UAAU,OAAS,CAAE,sBAAS,IAAI,GAAa,EACpFI,kBAAU,IAAI,IAAI,CAAC,EAAG,CAAC,CAAC,EACxBC,EAAU,CAAC,EAAG,CAAC,EACfC,kBAA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time.js";import{splitLines as e}from"./Parsing/SourceLineSplitter.js";import{validateIdentity as t}from"./Parsing/IdentityValidator.js";import{validateApplicationHandlers as n}from"./Parsing/CommandHandlerValidator.js";import{recordStructuralInteractions as r}from"./Parsing/StructuralInteractionSites.js";import{expandSpecificationExamples as i,validateSpecificationExampleTypes as a}from"./Parsing/SpecificationCommandExamples.js";import{validateResponses as o}from"./Parsing/ResponseValidator.js";import{validateSpecificationCases as s}from"./Parsing/SpecificationCaseValidator.js";import{productionDestinationDiagnostics as c}from"./Diagnostics/ProductionDestinationDiagnostics.js";import{validateConstraintProperties as l}from"./Parsing/ConstraintPropertyValidator.js";import{validateDependencyDeclarations as u}from"./Dependencies/DeclaredDependencyTargets.js";import{documentPlacement as d}from"./Files/PlayPlacement.js";import{interactionAncestry as f}from"./Parsing/InteractionAlternatives.js";import"./Parsing/SpecificationParser.js";import"./Parsing/SpecificationExampleParser.js";import"./Parsing/CaptureParser.js";import"./Parsing/ProjectionParser.js";import"./Parsing/ImportDiscovery.js";import{DeclaredDependencies as
|
|
1
|
+
import"../_virtual/_virtual/_rolldown/runtime.js";import{splitLines as e}from"./Parsing/SourceLineSplitter.js";import{validateIdentity as t}from"./Parsing/IdentityValidator.js";import{validateApplicationHandlers as n}from"./Parsing/CommandHandlerValidator.js";import{recordStructuralInteractions as r}from"./Parsing/StructuralInteractionSites.js";import{expandSpecificationExamples as i,validateSpecificationExampleTypes as a}from"./Parsing/SpecificationCommandExamples.js";import{validateResponses as o}from"./Parsing/ResponseValidator.js";import{validateSpecificationCases as s}from"./Parsing/SpecificationCaseValidator.js";import{productionDestinationDiagnostics as c}from"./Diagnostics/ProductionDestinationDiagnostics.js";import{validateConstraintProperties as l}from"./Parsing/ConstraintPropertyValidator.js";import{validateDependencyDeclarations as u}from"./Dependencies/DeclaredDependencyTargets.js";import{documentPlacement as d}from"./Files/PlayPlacement.js";import{interactionAncestry as f}from"./Parsing/InteractionAlternatives.js";import"./Parsing/SpecificationParser.js";import"./Parsing/SpecificationExampleParser.js";import"./Parsing/CaptureParser.js";import"./Parsing/ProjectionParser.js";import{discoverImports as p}from"./Parsing/ImportDiscovery.js";import{DeclaredDependencies as m}from"./Dependencies/DeclaredDependencies.js";import{validatePublicEventUsage as h}from"./Parsing/PublicEventUsageValidator.js";import{sourceContext as g}from"./Parsing/SourceOptionsParser.js";import{validateInlineEvents as _}from"./Parsing/InlineEventValidator.js";import{validateOperations as v}from"./Parsing/OperationValidator.js";import{parseApplication as y}from"./Parsing/ScreenplayParser.js";import{CommandStreamCandidates as b}from"./Parsing/CommandStreamCandidates.js";import{validateEventSources as x}from"./Parsing/EventSourceValidator.js";import{validateProjectionTargets as S}from"./Parsing/ProjectionTargetValidator.js";import{validateIdentifierCompliance as C}from"./Parsing/IdentifierComplianceValidator.js";import{validateEventSubjects as w}from"./Parsing/EventSubjectValidator.js";import{validateReadModelKeys as T}from"./Parsing/ReadModelKeyValidator.js";import{validateReactionRefusals as E}from"./Parsing/ReactionRefusalValidator.js";import{validateSpecificationRedelivery as D}from"./Parsing/SpecificationRedeliveryValidator.js";import{validateGuardedActions as O}from"./Parsing/GuardedActionValidator.js";import{validatePersonaCallers as k}from"./Parsing/PersonaCallerValidator.js";import{validatePurposes as A}from"./Parsing/PurposeValidator.js";import{timelineOrderDiagnostics as j}from"./Files/TimelineOrder.js";function parseForAuthoring(p,M,N=d,P=!0,F,I){let L=e(p,!1,M),R=g(L,M,I);R.scope=N,R.interactionAncestors=f(L),R.streamCandidates=F??b.capture([L],N,I);let z=y(R,L,N);if(r(z,R),P){n(z,R),t(z,R),A(z,R),_(z,R),l(z,R),v(z,R),h(z,R),s(z,R),a(z,R,!0);let e=i(z);o(e,R),x(z,R),S(z,R),C(e,R),w(z,R),T(z,R),E(z,R),D(z,R),O(z,R),k(z,R),z=u(z,R),m.validate(z,R);for(let e of c(z))R.information(e.code,e.message,e.location);for(let e of j(z))R.information(e.code,e.message,e.location)}return{value:z,diagnostics:R.diagnostics,triggerData:R.triggerData,inputUses:R.inputUses,continuationValues:R.continuationValues,guardedInteractions:R.guardedInteractions,interactionBehaviors:R.interactionBehaviors,interactionUses:R.interactionUses,success:!R.diagnostics.some(e=>e.severity===`error`)}}function discoverImports(t,n,r){let i=e(t,!1,n);return p(g(i,n,r))}export{discoverImports,parseForAuthoring};
|
|
2
2
|
//# sourceMappingURL=ScreenplayCompiler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenplayCompiler.js","names":["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","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 { 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 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":"sjFAwEA,SAAgB,kBAAkB,EAAgB,EAAe,EAA2BA,EAAmB,EAA4B,GAAM,EAA4C,EAA0a,CACnmB,IAAMC,EAAQC,EAAWC,EAAQ,GAAOC,CAAI,EACtCC,EAAUC,EAAcL,EAAOG,EAAMG,CAAS,EACpD,EAAQ,MAAQC,EAChB,EAAQ,qBAAuBC,EAAoBR,CAAK,EACxD,EAAQ,iBAAmBS,GAAoBC,EAAwB,QAAQ,CAACV,CAAK,EAAGO,EAAWD,CAAS,EAC5G,IAAIK,EAAQC,EAAiBR,EAASJ,EAAOO,CAAS,EAGtD,GAFAM,EAA6BF,EAAOP,CAAO,EAEvCU,EAA2B,CAC3BC,EAA4BJ,EAAOP,CAAO,EAC1CY,EAAiBL,EAAOP,CAAO,EAC/Ba,EAAiBN,EAAOP,CAAO,EAC/Bc,EAAqBP,EAAOP,CAAO,EACnCe,EAA6BR,EAAOP,CAAO,EAC3CgB,EAAmBT,EAAOP,CAAO,EACjCiB,EAAyBV,EAAOP,CAAO,EACvCkB,EAA2BX,EAAOP,CAAO,EACzCmB,EAAkCZ,EAAOP,EAAS,EAAI,EACtD,IAAMoB,EAAYC,EAA4Bd,CAAK,EACnDe,EAAkBF,EAAWpB,CAAO,EACpCuB,EAAqBhB,EAAOP,CAAO,EACnCwB,EAA0BjB,EAAOP,CAAO,EACxCyB,EAA6BL,EAAWpB,CAAO,EAC/C0B,EAAsBnB,EAAOP,CAAO,EACpC2B,EAAsBpB,EAAOP,CAAO,EACpC4B,EAAyBrB,EAAOP,CAAO,EACvC6B,EAAgCtB,EAAOP,CAAO,EAC9C8B,EAAuBvB,EAAOP,CAAO,EACrC+B,EAAuBxB,EAAOP,CAAO,EACrC,EAAQgC,EAA+BzB,EAAOP,CAAO,EACrDiC,EAAqB,SAAS1B,EAAOP,CAAO,EAC5C,IAAK,IAAMkC,KAAcC,EAAiC5B,CAAK,EAAGP,EAAQ,YAAYkC,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,EAC9I,IAAK,IAAMA,KAAcE,EAAyB7B,CAAK,EAAGP,EAAQ,YAAYkC,EAAW,KAAMA,EAAW,QAASA,EAAW,QAAQ,CAC1I,CACA,MAAO,CACH,QACA,YAAalC,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,GAAckC,EAAW,WAAa,OAAO,CACpF,CACJ"}
|
|
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","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 { 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 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":"glFAwEA,SAAgB,kBAAkB,EAAgB,EAAe,EAA2BE,EAAmB,EAA4B,GAAM,EAA4C,EAA0a,CACnmB,IAAMC,EAAQC,EAAWC,EAAQ,GAAOC,CAAI,EACtCC,EAAUC,EAAcL,EAAOG,EAAMG,CAAS,EACpD,EAAQ,MAAQC,EAChB,EAAQ,qBAAuBC,EAAoBR,CAAK,EACxD,EAAQ,iBAAmBS,GAAoBC,EAAwB,QAAQ,CAACV,CAAK,EAAGO,EAAWD,CAAS,EAC5G,IAAIK,EAAQC,EAAiBR,EAASJ,EAAOO,CAAS,EAGtD,GAFAM,EAA6BF,EAAOP,CAAO,EAEvCU,EAA2B,CAC3BC,EAA4BJ,EAAOP,CAAO,EAC1CY,EAAiBL,EAA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AkBQ,EAAcL,EAAOG,EAAMG,CAAS,CAAC,CAClE"}
|
|
@@ -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"./Parsing/SpecificationCommandExamples.js";import{DeclaredDependencyTargets as x}from"./Dependencies/DeclaredDependencyTargets.js";import{describePlacement as S,documentPlacement as C,isDocumentPlacement as w}from"./Files/PlayPlacement.js";import"./Syntax/InvalidSyntaxJson.js";import"./Syntax/SourceOptions.js";import{isSourceStreamName 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"./Parsing/SpecificationCommandExamples.js";import{DeclaredDependencyTargets as x}from"./Dependencies/DeclaredDependencyTargets.js";import{describePlacement as S,documentPlacement as C,isDocumentPlacement as w,isWithinOrSame as T,samePlacement as E}from"./Files/PlayPlacement.js";import"./Syntax/InvalidSyntaxJson.js";import"./Syntax/SourceOptions.js";import{isSourceStreamName as D,isSourceStreamTypeName as O,sourceStreamPattern as k}from"./Text/SourceStreamNames.js";import{sliceTypes as A}from"./Syntax/Structure.js";import{consumedEvents as j,eventsSourceKind as M,fromSetting as N,isEventsSource as P}from"./Syntax/CaptureEventsSource.js";import{eventBodyReservedWords as F}from"./Text/ReservedWords.js";import{hasWildcard as I,matchesPlayPattern as L,normalizePlayPath as R,resolvePlayPattern as z,staticFolderOf as B}from"./Files/PlayGlob.js";import"./Files/AuthoredOrder.js";import{dependencyKinds as V}from"./Dependencies/DependencyKind.js";import{InvalidDependencyQuery as H}from"./Dependencies/InvalidDependencyQuery.js";import{SliceReferenceCollector as U,buildingReadModelReferences as W,referenceClassifications as G,sliceReferences as K}from"./Dependencies/SliceReferences.js";import{stronglyConnectedGroups as q}from"./Dependencies/StronglyConnectedGroups.js";import{DependencyGraph as J}from"./Dependencies/DependencyGraph.js";import{streamIdFailureMessage as Y,tryFormatInteger as X,tryFormatText as Z,tryFormatUuidText as Q}from"./Syntax/StreamIdFormatter.js";import{discoverImports as $,parseForAuthoring as ee}from"./ScreenplayCompiler.js";import{EventSourceReadConfidence as te}from"./Syntax/EventSourceReadConfidence.js";import"./Syntax/SyntaxJson.js";import{mergeDocuments as ne}from"./Files/PlayFolderMerge.js";import{inMemoryDocumentSource as re}from"./Files/PlayDocumentSource.js";import{resolveImports as ie}from"./Files/PlayImports.js";import"./Files/OrderingRoot.js";import{assembleApplication as ae,compileApplication as oe,parsePlacedDocuments as se}from"./Files/PlayApplicationAssembly.js";import{applyQuickFixEdits as ce,isQuickFixDiagnostic as le,legacyOptionalTypeLength as ue,prepareQuickFixes as de}from"./Authoring/QuickFixes.js";import"./Completeness/ModelCompleteness.js";import"./Dependencies/index.js";import"./Syntax/index.js";export{o as AuthoringProductionResolver,x as DeclaredDependencyTargets,J as DependencyGraph,e as DiagnosticCodes,p as EventSourceCatalog,te as EventSourceReadConfidence,H as InvalidDependencyQuery,g as InvalidExactNumber,c as ScreenplaySyntaxWalker,U as SliceReferenceCollector,ce as applyQuickFixEdits,ae as assembleApplication,W as buildingReadModelReferences,_ as canonicalExactText,oe as compileApplication,j as consumedEvents,V as dependencyKinds,s as dependencySourcesOf,S as describePlacement,d as diagnosticKeyword,f as diagnosticText,$ as discoverImports,C as documentPlacement,F as eventBodyReservedWords,i as eventDeclarations,M as eventsSourceKind,v as exactIsIntegral,N as fromSetting,I as hasWildcard,m as implicitDestination,re as inMemoryDocumentSource,w as isDocumentPlacement,P as isEventsSource,l as isExactNumberToken,le as isQuickFixDiagnostic,D as isSourceStreamName,O as isSourceStreamTypeName,T as isWithinOrSame,ue as legacyOptionalTypeLength,L as matchesPlayPattern,ne as mergeDocuments,R as normalizePlayPath,a as operationDeclarations,u as parseExactNumber,ee as parseForAuthoring,se as parsePlacedDocuments,n as pattern,de as prepareQuickFixes,G as referenceClassifications,h as requiresExplicitDestinations,ie as resolveImports,z as resolvePlayPattern,y as responseCommandResolver,E as samePlacement,K as sliceReferences,A as sliceTypes,r as sourceLocation,k as sourceStreamPattern,B as staticFolderOf,Y as streamIdFailureMessage,q as stronglyConnectedGroups,b as synthesizePersonaCaller,X as tryFormatInteger,Z as tryFormatText,Q as tryFormatUuidText,t as unescapeString};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e={unknownMatchPattern:`PLAY0366`,invalidMatchPattern:`PLAY0367`,patternOutsidePortableMatchDialect:`PLAY0699`,deprecatedStudioTextRulePattern:`PLAY0787`,repeatedSingularDeclarationAcrossFiles:`PLAY0172`,directionlessTranslationReactsToOwnCapture:`PLAY0694`,pendingIntentWithOtherHandler:`PLAY0698`,commandHandlerRequiresAttachment:`PLAY0800`,duplicateEventInProjectionScope:`PLAY0801`,reservedStoredName:`PLAY0802`,describedCommandNotImplemented:`PLAY0695`,describedCommandWithoutProductions:`PLAY0696`,describedCommandCardinalityNotAdmitted:`PLAY0697`,invalidExposureDeclaration:`PLAY0621`,unknownExposureOwner:`PLAY0622`,reExposureCycle:`PLAY0623`,reExposureBroken:`PLAY0624`,invalidInstanceContribution:`PLAY0625`,unknownContributionInstance:`PLAY0626`,contributionNotExposed:`PLAY0627`,contributionTypeMismatch:`PLAY0628`,unknownTemplateContentSlot:`PLAY0629`,unknownNavigationOutlet:`PLAY0630`,templateScopeMismatch:`PLAY0631`,incompatibleComponentPackage:`PLAY0632`,unknownNavigationDestination:`PLAY0654`,unknownScreenContributionPoint:`PLAY0655`,templateNestingCycle:`PLAY0656`,templateCategoryMissing:`PLAY0720`,invalidTemplateVersionRange:`PLAY0721`,unknownTemplateBlueprint:`PLAY0722`,mixedEnumerationNumbering:`PLAY0667`,duplicateEnumerationNumber:`PLAY0668`,enumerationNumberOutsideInt32:`PLAY0669`,malformedEnumerationNumber:`PLAY0670`,unpinnedStoredEnumeration:`PLAY0671`,invalidIdentityDeclaration:`PLAY0633`,duplicateIdentity:`PLAY0634`,invalidIdentityDetail:`PLAY0635`,unknownIdentitySource:`PLAY0636`,identityDetailWithoutSource:`PLAY0637`,identitySourceWithBody:`PLAY0638`,duplicateIdentityDetail:`PLAY0639`,builtInIdentityDetail:`PLAY0640`,unknownIdentityQuery:`PLAY0641`,invalidIdentityQuery:`PLAY0642`,identityQueryWithoutKey:`PLAY0643`,invalidIdentityQueryKey:`PLAY0644`,identityQueryAuthorizationDependency:`PLAY0645`,identityQueryTypeMismatch:`PLAY0646`,invalidReactionIdentity:`PLAY0647`,gatedInvocationWithoutIdentity:`PLAY0648`,unusedReactionIdentity:`PLAY0649`,unusedReactionRole:`PLAY0650`,unsatisfiedReactionIdentity:`PLAY0651`,reactionPrivilegeEscalation:`PLAY0652`,commandProducesPublicEvent:`PLAY0607`,publicEventRequiresOutboundTranslation:`PLAY0608`,outboundPublicEventCount:`PLAY0609`,foreignPublicEventConsumer:`PLAY0610`,outboundTranslationInput:`PLAY0611`,inboundTranslationOutput:`PLAY0612`,foreignPublicEventProduced:`PLAY0613`,publicTranslationRequiresDirection:`PLAY0614`,translationConstructDirection:`PLAY0615`,inboundTranslationInput:`PLAY0616`,outboundTranslationOutput:`PLAY0617`,eventTargetOutsideOutboundTranslation:`PLAY0618`,eventsSourceOutsideInboundTranslation:`PLAY0619`,invalidCaptureEventsSource:`PLAY0620`,captureEventsFromSeveralOrigins:`PLAY0687`,captureEventsKeyNotRequired:`PLAY0700`,captureEventsRecordFixture:`PLAY0701`,refutedGeneratedConceptRule:`PLAY0688`,unprovenGeneratedConceptRule:`PLAY0689`,invalidReadModelKey:`PLAY0660`,incompleteReadModelKey:`PLAY0661`,invalidReadModelKeyLookup:`PLAY0662`,productionRouteOutsideCommand:`PLAY0663`,redundantProductionRoute:`PLAY0664`,invalidObserverFilter:`PLAY0665`,observerFilterExcludesEveryProducer:`PLAY0666`,reducerIdentityMismatch:`PLAY0690`,generationSupportBudgetExceeded:`PLAY0691`,emptyGenerationSupport:`PLAY0692`,invalidReactionBatchesDeclaration:`PLAY0693`,invalidCommandReadsDeclaration:`PLAY0780`,invalidDescription:`PLAY0145`,emptyDescription:`PLAY0146`,duplicateDescription:`PLAY0147`,unknownConceptDirective:`PLAY0010`,attributeReasonWithoutAttribute:`PLAY0012`,duplicateAttributeReason:`PLAY0013`,duplicateComplianceMarker:`PLAY0653`,legacyComplianceMarker:`PLAY0565`,unknownComplianceMarker:`PLAY0566`,invalidSecretScope:`PLAY0567`,duplicateSecretScope:`PLAY0568`,secretScopeIgnoredForPii:`PLAY0569`,invalidPersonalDataQualifier:`PLAY0570`,duplicateSpecialCategory:`PLAY0571`,invalidPurposeDeclaration:`PLAY0596`,invalidPurposeVocabulary:`PLAY0597`,duplicatePurposeField:`PLAY0598`,duplicatePurposeDeclaration:`PLAY0599`,unknownPurpose:`PLAY0600`,purposeInterestMismatch:`PLAY0601`,personalDataWithoutPurpose:`PLAY0602`,specialDataWithoutCondition:`PLAY0603`,criminalDataWithoutAuthorization:`PLAY0604`,purposeWithoutBasis:`PLAY0605`,unusedPurpose:`PLAY0606`,duplicateEventSubject:`PLAY0590`,invalidSubjectType:`PLAY0591`,protectedSubjectType:`PLAY0592`,invalidSubjectOwner:`PLAY0593`,readModelSubjectNotSupported:`PLAY0594`,invalidSubjectModifierOrder:`PLAY0595`,conflictingScreenDataBinding:`PLAY0530`,screenDataQueryMismatch:`PLAY0531`,actionWithoutInputSurface:`PLAY0532`,commandWithoutInputSurface:`PLAY0533`,readModelFieldWithoutOrigin:`PLAY0534`,queryParameterNotHeldByView:`PLAY0535`,unconsumedEvent:`PLAY0536`,unreachableScreen:`PLAY0537`,invalidSpecificationCallerPersona:`PLAY0572`,unsynthesizablePersonaCaller:`PLAY0573`,personaWithoutGate:`PLAY0574`,gateWithoutPersona:`PLAY0575`,ambiguousPersonaCaller:`PLAY0576`,invalidSpecificationParameter:`PLAY0577`,invalidSpecificationCase:`PLAY0578`,duplicateSpecificationParameter:`PLAY0579`,duplicateSpecificationCase:`PLAY0580`,incompleteSpecificationTable:`PLAY0581`,invalidSpecificationCaseAssignment:`PLAY0582`,invalidSpecificationCaseValue:`PLAY0583`,invalidSpecificationCaseReference:`PLAY0584`,optionalSpecificationParameterTarget:`PLAY0585`,specificationCaseNameCollision:`PLAY0586`,incompatibleSpecificationParameterType:`PLAY0587`,unusedSpecificationParameter:`PLAY0588`,singularSpecificationTableExpansion:`PLAY0589`,invalidActionAlternative:`PLAY0341`,guardedActionWithoutAlternatives:`PLAY0342`,misplacedActionOtherwise:`PLAY0343`,unsupportedActionConditionOperand:`PLAY0344`,unknownActionSubjectField:`PLAY0345`,unresolvedActionSubject:`PLAY0346`,unreachableActionAlternative:`PLAY0347`,unknownActionArgumentProperty:`PLAY0348`,invalidRefusalBranch:`PLAY0538`,invalidRefusalBranchBody:`PLAY0539`,unreachableRefusalBranch:`PLAY0540`,invalidRefusalValue:`PLAY0541`,unknownRefusalConstraint:`PLAY0542`,unmatchedRedeliveredOccurrence:`PLAY0543`,unknownRedeliveryReaction:`PLAY0544`,invalidNoEventsExpectation:`PLAY0545`,indeterminateNegatedClaimTarget:`PLAY0546`,invalidAbsentReadModelStep:`PLAY0453`,unknownConstraintProperty:`PLAY0391`,invalidSpecificationExample:`PLAY0518`,duplicateSpecificationAssignment:`PLAY0519`,unknownReadModelProperty:`PLAY0514`,piiNotSupportedOnIdentifier:`PLAY0515`,invalidEventSourceDeclaration:`PLAY0503`,invalidCommandStream:`PLAY0504`,invalidSpecificationStream:`PLAY0547`,specificationStreamOnCommand:`PLAY0548`,invalidSpecificationStreamRoute:`PLAY0549`,invalidSpecificationStreamEventSource:`PLAY0550`,specificationStreamContradictsCommand:`PLAY0551`,ambiguousCommandStream:`PLAY0505`,unsupportedStreamIdType:`PLAY0506`,redundantSourceStreamId:`PLAY0507`,eventFromLaterSlice:`PLAY0516`,timelineCycleGroup:`PLAY0517`,invalidSpecificationExampleBody:`PLAY0526`,undeclaredDependency:`PLAY0552`,unusedDependencyDeclaration:`PLAY0553`,invalidDependencyTarget:`PLAY0554`,repeatedDependencyDeclaration:`PLAY0555`,mutualDependencyDeclarations:`PLAY0556`,authorizationRefusalWithoutIdentity:`PLAY0557`,invalidDocumentation:`PLAY0558`,conflictingDocumentationAcrossFiles:`PLAY0559`,unsupportedInteractionAlternatives:`PLAY0560`,mixedInteractionAlternatives:`PLAY0561`,interactionAlternativeWithoutActions:`PLAY0562`,inlineInteractionAlternative:`PLAY0563`,legacyInteractionWhere:`PLAY0564`,ambiguousReference:`PLAY0198`,invalidImplementationBlock:`PLAY0492`,invalidImplementationHint:`PLAY0493`,conflictingImplementationSources:`PLAY0494`,eventSourceIdInPayload:`PLAY0469`,explicitProducesTargetsRequired:`PLAY0470`,redundantEventId:`PLAY0471`,invalidEventId:`PLAY0472`,inlineEventCollision:`PLAY0473`,inlineEventOutsideCommand:`PLAY0474`,inlineEventGeneration:`PLAY0475`,reservedProductionMetadata:`PLAY0476`,invalidEventDocumentation:`PLAY0477`,tabIndentation:`PLAY0006`,unknownPrimitiveType:`PLAY0008`,mismatchedSpecificationQueryResult:`PLAY0465`,unknownSliceType:`PLAY0028`,duplicateCommandIdentifier:`PLAY0036`,unknownContextPath:`PLAY0153`,unknownContextCausedByProperty:`PLAY0154`,unknownContextIdentityProperty:`PLAY0155`,unclosedCodeBlock:`PLAY0164`,unknownType:`PLAY0165`,unknownEvent:`PLAY0166`,unknownPolicy:`PLAY0167`,duplicateDeclaration:`PLAY0168`,unknownEventContextMember:`PLAY0295`,unknownEventContextPath:`PLAY0296`,eventContextPathBelowCollection:`PLAY0297`,missingEventContextPath:`PLAY0298`,unresolvedDynamicKeySource:`PLAY0299`,invalidFileImport:`PLAY0454`,omittedProductionDestination:`PLAY0478`,legacyOptionalSuffix:`PLAY0479`,invalidOptionalModifierOrder:`PLAY0480`,optionalReadsNotSupported:`PLAY0481`,unavailableResponseExecution:`PLAY0268`,generatedPropertyOutsideCommand:`PLAY0482`,invalidGeneratedType:`PLAY0483`,invalidGeneratedModifierOrder:`PLAY0484`,generatedPropertyInput:`PLAY0485`,invalidCommandResponse:`PLAY0486`,invalidResponseSource:`PLAY0487`,duplicateResponseField:`PLAY0488`,invalidResponseShape:`PLAY0489`,invalidGeneratedFixture:`PLAY0490`,invalidReturnExpectation:`PLAY0491`,unknownGenerationStrategy:`PLAY0672`,invalidGenerationArgument:`PLAY0673`,invalidGenerationModifier:`PLAY0674`,duplicateGenerationModifier:`PLAY0675`,duplicateGeneration:`PLAY0676`,invalidGenerationPrimitive:`PLAY0677`,invalidGenerationPrefix:`PLAY0678`,invalidGenerationAlphabet:`PLAY0679`,invalidTypeIdPrefix:`PLAY0680`,generationSizeOutsideRange:`PLAY0681`,reservedSequenceGeneration:`PLAY0682`,lowGenerationEntropy:`PLAY0683`,lowGeneratedIdentifierEntropy:`PLAY0684`,responseNameUsedOnFailure:`PLAY0685`,eventIdPinNotCarriedToRenderers:`PLAY0686`};export{e as diagnosticCodes};
|
|
1
|
+
const e={unknownMatchPattern:`PLAY0366`,invalidMatchPattern:`PLAY0367`,patternOutsidePortableMatchDialect:`PLAY0699`,deprecatedStudioTextRulePattern:`PLAY0787`,repeatedSingularDeclarationAcrossFiles:`PLAY0172`,directionlessTranslationReactsToOwnCapture:`PLAY0694`,pendingIntentWithOtherHandler:`PLAY0698`,commandHandlerRequiresAttachment:`PLAY0800`,duplicateEventInProjectionScope:`PLAY0801`,reservedStoredName:`PLAY0802`,ambiguousMatchPattern:`PLAY0803`,describedCommandNotImplemented:`PLAY0695`,describedCommandWithoutProductions:`PLAY0696`,describedCommandCardinalityNotAdmitted:`PLAY0697`,invalidExposureDeclaration:`PLAY0621`,unknownExposureOwner:`PLAY0622`,reExposureCycle:`PLAY0623`,reExposureBroken:`PLAY0624`,invalidInstanceContribution:`PLAY0625`,unknownContributionInstance:`PLAY0626`,contributionNotExposed:`PLAY0627`,contributionTypeMismatch:`PLAY0628`,unknownTemplateContentSlot:`PLAY0629`,unknownNavigationOutlet:`PLAY0630`,templateScopeMismatch:`PLAY0631`,incompatibleComponentPackage:`PLAY0632`,unknownNavigationDestination:`PLAY0654`,unknownScreenContributionPoint:`PLAY0655`,templateNestingCycle:`PLAY0656`,templateCategoryMissing:`PLAY0720`,invalidTemplateVersionRange:`PLAY0721`,unknownTemplateBlueprint:`PLAY0722`,mixedEnumerationNumbering:`PLAY0667`,duplicateEnumerationNumber:`PLAY0668`,enumerationNumberOutsideInt32:`PLAY0669`,malformedEnumerationNumber:`PLAY0670`,unpinnedStoredEnumeration:`PLAY0671`,invalidIdentityDeclaration:`PLAY0633`,duplicateIdentity:`PLAY0634`,invalidIdentityDetail:`PLAY0635`,unknownIdentitySource:`PLAY0636`,identityDetailWithoutSource:`PLAY0637`,identitySourceWithBody:`PLAY0638`,duplicateIdentityDetail:`PLAY0639`,builtInIdentityDetail:`PLAY0640`,unknownIdentityQuery:`PLAY0641`,invalidIdentityQuery:`PLAY0642`,identityQueryWithoutKey:`PLAY0643`,invalidIdentityQueryKey:`PLAY0644`,identityQueryAuthorizationDependency:`PLAY0645`,identityQueryTypeMismatch:`PLAY0646`,invalidReactionIdentity:`PLAY0647`,gatedInvocationWithoutIdentity:`PLAY0648`,unusedReactionIdentity:`PLAY0649`,unusedReactionRole:`PLAY0650`,unsatisfiedReactionIdentity:`PLAY0651`,reactionPrivilegeEscalation:`PLAY0652`,commandProducesPublicEvent:`PLAY0607`,publicEventRequiresOutboundTranslation:`PLAY0608`,outboundPublicEventCount:`PLAY0609`,foreignPublicEventConsumer:`PLAY0610`,outboundTranslationInput:`PLAY0611`,inboundTranslationOutput:`PLAY0612`,foreignPublicEventProduced:`PLAY0613`,publicTranslationRequiresDirection:`PLAY0614`,translationConstructDirection:`PLAY0615`,inboundTranslationInput:`PLAY0616`,outboundTranslationOutput:`PLAY0617`,eventTargetOutsideOutboundTranslation:`PLAY0618`,eventsSourceOutsideInboundTranslation:`PLAY0619`,invalidCaptureEventsSource:`PLAY0620`,captureEventsFromSeveralOrigins:`PLAY0687`,captureEventsKeyNotRequired:`PLAY0700`,captureEventsRecordFixture:`PLAY0701`,refutedGeneratedConceptRule:`PLAY0688`,unprovenGeneratedConceptRule:`PLAY0689`,invalidReadModelKey:`PLAY0660`,incompleteReadModelKey:`PLAY0661`,invalidReadModelKeyLookup:`PLAY0662`,productionRouteOutsideCommand:`PLAY0663`,redundantProductionRoute:`PLAY0664`,invalidObserverFilter:`PLAY0665`,observerFilterExcludesEveryProducer:`PLAY0666`,reducerIdentityMismatch:`PLAY0690`,generationSupportBudgetExceeded:`PLAY0691`,emptyGenerationSupport:`PLAY0692`,invalidReactionBatchesDeclaration:`PLAY0693`,invalidCommandReadsDeclaration:`PLAY0780`,invalidDescription:`PLAY0145`,emptyDescription:`PLAY0146`,duplicateDescription:`PLAY0147`,unknownConceptDirective:`PLAY0010`,attributeReasonWithoutAttribute:`PLAY0012`,duplicateAttributeReason:`PLAY0013`,duplicateComplianceMarker:`PLAY0653`,legacyComplianceMarker:`PLAY0565`,unknownComplianceMarker:`PLAY0566`,invalidSecretScope:`PLAY0567`,duplicateSecretScope:`PLAY0568`,secretScopeIgnoredForPii:`PLAY0569`,invalidPersonalDataQualifier:`PLAY0570`,duplicateSpecialCategory:`PLAY0571`,invalidPurposeDeclaration:`PLAY0596`,invalidPurposeVocabulary:`PLAY0597`,duplicatePurposeField:`PLAY0598`,duplicatePurposeDeclaration:`PLAY0599`,unknownPurpose:`PLAY0600`,purposeInterestMismatch:`PLAY0601`,personalDataWithoutPurpose:`PLAY0602`,specialDataWithoutCondition:`PLAY0603`,criminalDataWithoutAuthorization:`PLAY0604`,purposeWithoutBasis:`PLAY0605`,unusedPurpose:`PLAY0606`,duplicateEventSubject:`PLAY0590`,invalidSubjectType:`PLAY0591`,protectedSubjectType:`PLAY0592`,invalidSubjectOwner:`PLAY0593`,readModelSubjectNotSupported:`PLAY0594`,invalidSubjectModifierOrder:`PLAY0595`,conflictingScreenDataBinding:`PLAY0530`,screenDataQueryMismatch:`PLAY0531`,actionWithoutInputSurface:`PLAY0532`,commandWithoutInputSurface:`PLAY0533`,readModelFieldWithoutOrigin:`PLAY0534`,queryParameterNotHeldByView:`PLAY0535`,unconsumedEvent:`PLAY0536`,unreachableScreen:`PLAY0537`,invalidSpecificationCallerPersona:`PLAY0572`,unsynthesizablePersonaCaller:`PLAY0573`,personaWithoutGate:`PLAY0574`,gateWithoutPersona:`PLAY0575`,ambiguousPersonaCaller:`PLAY0576`,invalidSpecificationParameter:`PLAY0577`,invalidSpecificationCase:`PLAY0578`,duplicateSpecificationParameter:`PLAY0579`,duplicateSpecificationCase:`PLAY0580`,incompleteSpecificationTable:`PLAY0581`,invalidSpecificationCaseAssignment:`PLAY0582`,invalidSpecificationCaseValue:`PLAY0583`,invalidSpecificationCaseReference:`PLAY0584`,optionalSpecificationParameterTarget:`PLAY0585`,specificationCaseNameCollision:`PLAY0586`,incompatibleSpecificationParameterType:`PLAY0587`,unusedSpecificationParameter:`PLAY0588`,singularSpecificationTableExpansion:`PLAY0589`,invalidActionAlternative:`PLAY0341`,guardedActionWithoutAlternatives:`PLAY0342`,misplacedActionOtherwise:`PLAY0343`,unsupportedActionConditionOperand:`PLAY0344`,unknownActionSubjectField:`PLAY0345`,unresolvedActionSubject:`PLAY0346`,unreachableActionAlternative:`PLAY0347`,unknownActionArgumentProperty:`PLAY0348`,invalidRefusalBranch:`PLAY0538`,invalidRefusalBranchBody:`PLAY0539`,unreachableRefusalBranch:`PLAY0540`,invalidRefusalValue:`PLAY0541`,unknownRefusalConstraint:`PLAY0542`,unmatchedRedeliveredOccurrence:`PLAY0543`,unknownRedeliveryReaction:`PLAY0544`,invalidNoEventsExpectation:`PLAY0545`,indeterminateNegatedClaimTarget:`PLAY0546`,invalidAbsentReadModelStep:`PLAY0453`,unknownConstraintProperty:`PLAY0391`,invalidSpecificationExample:`PLAY0518`,duplicateSpecificationAssignment:`PLAY0519`,unknownReadModelProperty:`PLAY0514`,piiNotSupportedOnIdentifier:`PLAY0515`,invalidEventSourceDeclaration:`PLAY0503`,invalidCommandStream:`PLAY0504`,invalidSpecificationStream:`PLAY0547`,specificationStreamOnCommand:`PLAY0548`,invalidSpecificationStreamRoute:`PLAY0549`,invalidSpecificationStreamEventSource:`PLAY0550`,specificationStreamContradictsCommand:`PLAY0551`,ambiguousCommandStream:`PLAY0505`,unsupportedStreamIdType:`PLAY0506`,redundantSourceStreamId:`PLAY0507`,eventFromLaterSlice:`PLAY0516`,timelineCycleGroup:`PLAY0517`,invalidSpecificationExampleBody:`PLAY0526`,undeclaredDependency:`PLAY0552`,unusedDependencyDeclaration:`PLAY0553`,invalidDependencyTarget:`PLAY0554`,repeatedDependencyDeclaration:`PLAY0555`,mutualDependencyDeclarations:`PLAY0556`,authorizationRefusalWithoutIdentity:`PLAY0557`,invalidDocumentation:`PLAY0558`,conflictingDocumentationAcrossFiles:`PLAY0559`,unsupportedInteractionAlternatives:`PLAY0560`,mixedInteractionAlternatives:`PLAY0561`,interactionAlternativeWithoutActions:`PLAY0562`,inlineInteractionAlternative:`PLAY0563`,legacyInteractionWhere:`PLAY0564`,ambiguousReference:`PLAY0198`,invalidImplementationBlock:`PLAY0492`,invalidImplementationHint:`PLAY0493`,conflictingImplementationSources:`PLAY0494`,eventSourceIdInPayload:`PLAY0469`,explicitProducesTargetsRequired:`PLAY0470`,redundantEventId:`PLAY0471`,invalidEventId:`PLAY0472`,inlineEventCollision:`PLAY0473`,inlineEventOutsideCommand:`PLAY0474`,inlineEventGeneration:`PLAY0475`,reservedProductionMetadata:`PLAY0476`,invalidEventDocumentation:`PLAY0477`,tabIndentation:`PLAY0006`,unknownPrimitiveType:`PLAY0008`,mismatchedSpecificationQueryResult:`PLAY0465`,unknownSliceType:`PLAY0028`,duplicateCommandIdentifier:`PLAY0036`,unknownContextPath:`PLAY0153`,unknownContextCausedByProperty:`PLAY0154`,unknownContextIdentityProperty:`PLAY0155`,unclosedCodeBlock:`PLAY0164`,unknownType:`PLAY0165`,unknownEvent:`PLAY0166`,unknownPolicy:`PLAY0167`,duplicateDeclaration:`PLAY0168`,unknownEventContextMember:`PLAY0295`,unknownEventContextPath:`PLAY0296`,eventContextPathBelowCollection:`PLAY0297`,missingEventContextPath:`PLAY0298`,unresolvedDynamicKeySource:`PLAY0299`,invalidFileImport:`PLAY0454`,omittedProductionDestination:`PLAY0478`,legacyOptionalSuffix:`PLAY0479`,invalidOptionalModifierOrder:`PLAY0480`,optionalReadsNotSupported:`PLAY0481`,unavailableResponseExecution:`PLAY0268`,generatedPropertyOutsideCommand:`PLAY0482`,invalidGeneratedType:`PLAY0483`,invalidGeneratedModifierOrder:`PLAY0484`,generatedPropertyInput:`PLAY0485`,invalidCommandResponse:`PLAY0486`,invalidResponseSource:`PLAY0487`,duplicateResponseField:`PLAY0488`,invalidResponseShape:`PLAY0489`,invalidGeneratedFixture:`PLAY0490`,invalidReturnExpectation:`PLAY0491`,unknownGenerationStrategy:`PLAY0672`,invalidGenerationArgument:`PLAY0673`,invalidGenerationModifier:`PLAY0674`,duplicateGenerationModifier:`PLAY0675`,duplicateGeneration:`PLAY0676`,invalidGenerationPrimitive:`PLAY0677`,invalidGenerationPrefix:`PLAY0678`,invalidGenerationAlphabet:`PLAY0679`,invalidTypeIdPrefix:`PLAY0680`,generationSizeOutsideRange:`PLAY0681`,reservedSequenceGeneration:`PLAY0682`,lowGenerationEntropy:`PLAY0683`,lowGeneratedIdentifierEntropy:`PLAY0684`,responseNameUsedOnFailure:`PLAY0685`,eventIdPinNotCarriedToRenderers:`PLAY0686`};export{e as diagnosticCodes};
|
|
2
2
|
//# sourceMappingURL=diagnostic-codes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic-codes.js","names":["diagnosticCodes"],"sources":["../../diagnostic-codes.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\n// The PLAY codes the editor reports. Every one of them mirrors a condition the compiler checks and\n// carries the compiler's own code for it, so the same problem is called the same thing whether it was\n// found by the CLI or by a squiggle - see Documentation/screenplay/diagnostics.md for the catalogue.\n//\n// A code is only ever added here for a condition the compiler can also report. The editor makes a few\n// structural checks the compiler does not - the capture and projection validators are where they live -\n// and those stay codeless deliberately: minting a PLAY number for something no compiler run can emit\n// would make the catalogue describe two different tools.\nexport const diagnosticCodes = {\n unknownMatchPattern: 'PLAY0366',\n invalidMatchPattern: 'PLAY0367',\n patternOutsidePortableMatchDialect: 'PLAY0699',\n deprecatedStudioTextRulePattern: 'PLAY0787',\n repeatedSingularDeclarationAcrossFiles: 'PLAY0172',\n directionlessTranslationReactsToOwnCapture: 'PLAY0694',\n pendingIntentWithOtherHandler: 'PLAY0698',\n commandHandlerRequiresAttachment: 'PLAY0800', // C# only\n duplicateEventInProjectionScope: 'PLAY0801',\n reservedStoredName: 'PLAY0802',\n describedCommandNotImplemented: 'PLAY0695', // C# only\n describedCommandWithoutProductions: 'PLAY0696', // C# only\n describedCommandCardinalityNotAdmitted: 'PLAY0697', // C# only\n invalidExposureDeclaration: 'PLAY0621',\n unknownExposureOwner: 'PLAY0622',\n reExposureCycle: 'PLAY0623',\n reExposureBroken: 'PLAY0624',\n invalidInstanceContribution: 'PLAY0625',\n unknownContributionInstance: 'PLAY0626',\n contributionNotExposed: 'PLAY0627',\n contributionTypeMismatch: 'PLAY0628',\n unknownTemplateContentSlot: 'PLAY0629',\n unknownNavigationOutlet: 'PLAY0630',\n templateScopeMismatch: 'PLAY0631',\n incompatibleComponentPackage: 'PLAY0632',\n unknownNavigationDestination: 'PLAY0654',\n unknownScreenContributionPoint: 'PLAY0655',\n templateNestingCycle: 'PLAY0656',\n templateCategoryMissing: 'PLAY0720',\n invalidTemplateVersionRange: 'PLAY0721',\n unknownTemplateBlueprint: 'PLAY0722',\n mixedEnumerationNumbering: 'PLAY0667',\n duplicateEnumerationNumber: 'PLAY0668',\n enumerationNumberOutsideInt32: 'PLAY0669',\n malformedEnumerationNumber: 'PLAY0670',\n unpinnedStoredEnumeration: 'PLAY0671',\n invalidIdentityDeclaration: 'PLAY0633',\n duplicateIdentity: 'PLAY0634',\n invalidIdentityDetail: 'PLAY0635',\n unknownIdentitySource: 'PLAY0636',\n identityDetailWithoutSource: 'PLAY0637',\n identitySourceWithBody: 'PLAY0638',\n duplicateIdentityDetail: 'PLAY0639',\n builtInIdentityDetail: 'PLAY0640',\n unknownIdentityQuery: 'PLAY0641',\n invalidIdentityQuery: 'PLAY0642',\n identityQueryWithoutKey: 'PLAY0643',\n invalidIdentityQueryKey: 'PLAY0644',\n identityQueryAuthorizationDependency: 'PLAY0645',\n identityQueryTypeMismatch: 'PLAY0646',\n invalidReactionIdentity: 'PLAY0647',\n gatedInvocationWithoutIdentity: 'PLAY0648',\n unusedReactionIdentity: 'PLAY0649',\n unusedReactionRole: 'PLAY0650',\n unsatisfiedReactionIdentity: 'PLAY0651',\n reactionPrivilegeEscalation: 'PLAY0652',\n // Preserve supplied C# whole-model diagnostics; these checks are not yet run by the editor.\n commandProducesPublicEvent: 'PLAY0607',\n publicEventRequiresOutboundTranslation: 'PLAY0608',\n outboundPublicEventCount: 'PLAY0609',\n foreignPublicEventConsumer: 'PLAY0610',\n outboundTranslationInput: 'PLAY0611',\n inboundTranslationOutput: 'PLAY0612',\n foreignPublicEventProduced: 'PLAY0613',\n publicTranslationRequiresDirection: 'PLAY0614',\n translationConstructDirection: 'PLAY0615',\n inboundTranslationInput: 'PLAY0616',\n outboundTranslationOutput: 'PLAY0617',\n eventTargetOutsideOutboundTranslation: 'PLAY0618',\n eventsSourceOutsideInboundTranslation: 'PLAY0619',\n invalidCaptureEventsSource: 'PLAY0620',\n captureEventsFromSeveralOrigins: 'PLAY0687',\n captureEventsKeyNotRequired: 'PLAY0700',\n captureEventsRecordFixture: 'PLAY0701',\n refutedGeneratedConceptRule: 'PLAY0688',\n unprovenGeneratedConceptRule: 'PLAY0689',\n invalidReadModelKey: 'PLAY0660',\n incompleteReadModelKey: 'PLAY0661',\n invalidReadModelKeyLookup: 'PLAY0662',\n productionRouteOutsideCommand: 'PLAY0663',\n redundantProductionRoute: 'PLAY0664',\n invalidObserverFilter: 'PLAY0665',\n observerFilterExcludesEveryProducer: 'PLAY0666',\n reducerIdentityMismatch: 'PLAY0690',\n generationSupportBudgetExceeded: 'PLAY0691',\n emptyGenerationSupport: 'PLAY0692',\n invalidReactionBatchesDeclaration: 'PLAY0693',\n invalidCommandReadsDeclaration: 'PLAY0780',\n invalidDescription: 'PLAY0145',\n emptyDescription: 'PLAY0146',\n duplicateDescription: 'PLAY0147',\n unknownConceptDirective: 'PLAY0010',\n attributeReasonWithoutAttribute: 'PLAY0012',\n duplicateAttributeReason: 'PLAY0013',\n duplicateComplianceMarker: 'PLAY0653',\n legacyComplianceMarker: 'PLAY0565',\n unknownComplianceMarker: 'PLAY0566',\n invalidSecretScope: 'PLAY0567',\n duplicateSecretScope: 'PLAY0568',\n secretScopeIgnoredForPii: 'PLAY0569',\n invalidPersonalDataQualifier: 'PLAY0570',\n duplicateSpecialCategory: 'PLAY0571',\n invalidPurposeDeclaration: 'PLAY0596',\n invalidPurposeVocabulary: 'PLAY0597',\n duplicatePurposeField: 'PLAY0598',\n duplicatePurposeDeclaration: 'PLAY0599',\n unknownPurpose: 'PLAY0600',\n purposeInterestMismatch: 'PLAY0601',\n personalDataWithoutPurpose: 'PLAY0602',\n specialDataWithoutCondition: 'PLAY0603',\n criminalDataWithoutAuthorization: 'PLAY0604',\n purposeWithoutBasis: 'PLAY0605',\n unusedPurpose: 'PLAY0606',\n duplicateEventSubject: 'PLAY0590',\n invalidSubjectType: 'PLAY0591',\n protectedSubjectType: 'PLAY0592',\n invalidSubjectOwner: 'PLAY0593',\n readModelSubjectNotSupported: 'PLAY0594',\n invalidSubjectModifierOrder: 'PLAY0595',\n // Supplied compiler diagnostics are preserved, even for checks only the C# tool can run.\n // See Documentation/screenplay/editor-diagnostics.md for the validation boundary.\n conflictingScreenDataBinding: 'PLAY0530',\n screenDataQueryMismatch: 'PLAY0531',\n actionWithoutInputSurface: 'PLAY0532',\n commandWithoutInputSurface: 'PLAY0533',\n readModelFieldWithoutOrigin: 'PLAY0534',\n queryParameterNotHeldByView: 'PLAY0535',\n unconsumedEvent: 'PLAY0536',\n unreachableScreen: 'PLAY0537',\n invalidSpecificationCallerPersona: 'PLAY0572',\n unsynthesizablePersonaCaller: 'PLAY0573',\n personaWithoutGate: 'PLAY0574',\n gateWithoutPersona: 'PLAY0575',\n ambiguousPersonaCaller: 'PLAY0576',\n invalidSpecificationParameter: 'PLAY0577',\n invalidSpecificationCase: 'PLAY0578',\n duplicateSpecificationParameter: 'PLAY0579',\n duplicateSpecificationCase: 'PLAY0580',\n incompleteSpecificationTable: 'PLAY0581',\n invalidSpecificationCaseAssignment: 'PLAY0582',\n invalidSpecificationCaseValue: 'PLAY0583',\n invalidSpecificationCaseReference: 'PLAY0584',\n optionalSpecificationParameterTarget: 'PLAY0585',\n specificationCaseNameCollision: 'PLAY0586',\n incompatibleSpecificationParameterType: 'PLAY0587',\n unusedSpecificationParameter: 'PLAY0588',\n singularSpecificationTableExpansion: 'PLAY0589',\n invalidActionAlternative: 'PLAY0341',\n guardedActionWithoutAlternatives: 'PLAY0342',\n misplacedActionOtherwise: 'PLAY0343',\n unsupportedActionConditionOperand: 'PLAY0344',\n unknownActionSubjectField: 'PLAY0345',\n unresolvedActionSubject: 'PLAY0346',\n unreachableActionAlternative: 'PLAY0347',\n unknownActionArgumentProperty: 'PLAY0348',\n invalidRefusalBranch: 'PLAY0538',\n invalidRefusalBranchBody: 'PLAY0539',\n unreachableRefusalBranch: 'PLAY0540',\n invalidRefusalValue: 'PLAY0541',\n unknownRefusalConstraint: 'PLAY0542',\n unmatchedRedeliveredOccurrence: 'PLAY0543',\n unknownRedeliveryReaction: 'PLAY0544',\n invalidNoEventsExpectation: 'PLAY0545',\n indeterminateNegatedClaimTarget: 'PLAY0546',\n invalidAbsentReadModelStep: 'PLAY0453',\n unknownConstraintProperty: 'PLAY0391',\n invalidSpecificationExample: 'PLAY0518',\n duplicateSpecificationAssignment: 'PLAY0519',\n unknownReadModelProperty: 'PLAY0514',\n piiNotSupportedOnIdentifier: 'PLAY0515',\n invalidEventSourceDeclaration: 'PLAY0503',\n invalidCommandStream: 'PLAY0504',\n invalidSpecificationStream: 'PLAY0547',\n specificationStreamOnCommand: 'PLAY0548',\n invalidSpecificationStreamRoute: 'PLAY0549',\n invalidSpecificationStreamEventSource: 'PLAY0550',\n specificationStreamContradictsCommand: 'PLAY0551',\n ambiguousCommandStream: 'PLAY0505',\n unsupportedStreamIdType: 'PLAY0506',\n redundantSourceStreamId: 'PLAY0507',\n eventFromLaterSlice: 'PLAY0516',\n timelineCycleGroup: 'PLAY0517',\n invalidSpecificationExampleBody: 'PLAY0526',\n undeclaredDependency: 'PLAY0552',\n unusedDependencyDeclaration: 'PLAY0553',\n invalidDependencyTarget: 'PLAY0554',\n repeatedDependencyDeclaration: 'PLAY0555',\n mutualDependencyDeclarations: 'PLAY0556',\n authorizationRefusalWithoutIdentity: 'PLAY0557',\n invalidDocumentation: 'PLAY0558',\n conflictingDocumentationAcrossFiles: 'PLAY0559',\n unsupportedInteractionAlternatives: 'PLAY0560',\n mixedInteractionAlternatives: 'PLAY0561',\n interactionAlternativeWithoutActions: 'PLAY0562',\n inlineInteractionAlternative: 'PLAY0563',\n legacyInteractionWhere: 'PLAY0564',\n ambiguousReference: 'PLAY0198',\n invalidImplementationBlock: 'PLAY0492',\n invalidImplementationHint: 'PLAY0493',\n conflictingImplementationSources: 'PLAY0494',\n eventSourceIdInPayload: 'PLAY0469',\n explicitProducesTargetsRequired: 'PLAY0470',\n redundantEventId: 'PLAY0471',\n invalidEventId: 'PLAY0472',\n inlineEventCollision: 'PLAY0473',\n inlineEventOutsideCommand: 'PLAY0474',\n inlineEventGeneration: 'PLAY0475',\n reservedProductionMetadata: 'PLAY0476',\n invalidEventDocumentation: 'PLAY0477',\n tabIndentation: 'PLAY0006',\n unknownPrimitiveType: 'PLAY0008',\n mismatchedSpecificationQueryResult: 'PLAY0465',\n unknownSliceType: 'PLAY0028',\n duplicateCommandIdentifier: 'PLAY0036',\n unknownContextPath: 'PLAY0153',\n unknownContextCausedByProperty: 'PLAY0154',\n unknownContextIdentityProperty: 'PLAY0155',\n unclosedCodeBlock: 'PLAY0164',\n unknownType: 'PLAY0165',\n unknownEvent: 'PLAY0166',\n unknownPolicy: 'PLAY0167',\n duplicateDeclaration: 'PLAY0168',\n unknownEventContextMember: 'PLAY0295',\n unknownEventContextPath: 'PLAY0296',\n eventContextPathBelowCollection: 'PLAY0297',\n missingEventContextPath: 'PLAY0298',\n unresolvedDynamicKeySource: 'PLAY0299',\n invalidFileImport: 'PLAY0454',\n omittedProductionDestination: 'PLAY0478',\n legacyOptionalSuffix: 'PLAY0479',\n invalidOptionalModifierOrder: 'PLAY0480',\n optionalReadsNotSupported: 'PLAY0481',\n unavailableResponseExecution: 'PLAY0268',\n generatedPropertyOutsideCommand: 'PLAY0482',\n invalidGeneratedType: 'PLAY0483',\n invalidGeneratedModifierOrder: 'PLAY0484',\n generatedPropertyInput: 'PLAY0485',\n invalidCommandResponse: 'PLAY0486',\n invalidResponseSource: 'PLAY0487',\n duplicateResponseField: 'PLAY0488',\n invalidResponseShape: 'PLAY0489',\n invalidGeneratedFixture: 'PLAY0490',\n invalidReturnExpectation: 'PLAY0491',\n unknownGenerationStrategy: 'PLAY0672',\n invalidGenerationArgument: 'PLAY0673',\n invalidGenerationModifier: 'PLAY0674',\n duplicateGenerationModifier: 'PLAY0675',\n duplicateGeneration: 'PLAY0676',\n invalidGenerationPrimitive: 'PLAY0677',\n invalidGenerationPrefix: 'PLAY0678',\n invalidGenerationAlphabet: 'PLAY0679',\n invalidTypeIdPrefix: 'PLAY0680',\n generationSizeOutsideRange: 'PLAY0681',\n reservedSequenceGeneration: 'PLAY0682',\n lowGenerationEntropy: 'PLAY0683',\n lowGeneratedIdentifierEntropy: 'PLAY0684',\n responseNameUsedOnFailure: 'PLAY0685',\n // Retired by ESM v16; preserve supplied warnings from earlier native compilers.\n eventIdPinNotCarriedToRenderers: 'PLAY0686',\n} as const;\n\nexport type DiagnosticCode = (typeof diagnosticCodes)[keyof typeof diagnosticCodes];\n"],"mappings":"AAWA,MAAaA,EAAkB,CAC3B,oBAAqB,WACrB,oBAAqB,WACrB,mCAAoC,WACpC,gCAAiC,WACjC,uCAAwC,WACxC,2CAA4C,WAC5C,8BAA+B,WAC/B,iCAAkC,WAClC,gCAAiC,WACjC,mBAAoB,WACpB,+BAAgC,WAChC,mCAAoC,WACpC,uCAAwC,WACxC,2BAA4B,WAC5B,qBAAsB,WACtB,gBAAiB,WACjB,iBAAkB,WAClB,4BAA6B,WAC7B,4BAA6B,WAC7B,uBAAwB,WACxB,yBAA0B,WAC1B,2BAA4B,WAC5B,wBAAyB,WACzB,sBAAuB,WACvB,6BAA8B,WAC9B,6BAA8B,WAC9B,+BAAgC,WAChC,qBAAsB,WACtB,wBAAyB,WACzB,4BAA6B,WAC7B,yBAA0B,WAC1B,0BAA2B,WAC3B,2BAA4B,WAC5B,8BAA+B,WAC/B,2BAA4B,WAC5B,0BAA2B,WAC3B,2BAA4B,WAC5B,kBAAmB,WACnB,sBAAuB,WACvB,sBAAuB,WACvB,4BAA6B,WAC7B,uBAAwB,WACxB,wBAAyB,WACzB,sBAAuB,WACvB,qBAAsB,WACtB,qBAAsB,WACtB,wBAAyB,WACzB,wBAAyB,WACzB,qCAAsC,WACtC,0BAA2B,WAC3B,wBAAyB,WACzB,+BAAgC,WAChC,uBAAwB,WACxB,mBAAoB,WACpB,4BAA6B,WAC7B,4BAA6B,WAE7B,2BAA4B,WAC5B,uCAAwC,WACxC,yBAA0B,WAC1B,2BAA4B,WAC5B,yBAA0B,WAC1B,yBAA0B,WAC1B,2BAA4B,WAC5B,mCAAoC,WACpC,8BAA+B,WAC/B,wBAAyB,WACzB,0BAA2B,WAC3B,sCAAuC,WACvC,sCAAuC,WACvC,2BAA4B,WAC5B,gCAAiC,WACjC,4BAA6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tB,wBAAyB,WACzB,yBAA0B,WAC1B,0BAA2B,WAC3B,0BAA2B,WAC3B,0BAA2B,WAC3B,4BAA6B,WAC7B,oBAAqB,WACrB,2BAA4B,WAC5B,wBAAyB,WACzB,0BAA2B,WAC3B,oBAAqB,WACrB,2BAA4B,WAC5B,2BAA4B,WAC5B,qBAAsB,WACtB,8BAA+B,WAC/B,0BAA2B,WAE3B,gCAAiC,UACrC"}
|
|
1
|
+
{"version":3,"file":"diagnostic-codes.js","names":["diagnosticCodes"],"sources":["../../diagnostic-codes.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\n// The PLAY codes the editor reports. Every one of them mirrors a condition the compiler checks and\n// carries the compiler's own code for it, so the same problem is called the same thing whether it was\n// found by the CLI or by a squiggle - see Documentation/screenplay/diagnostics.md for the catalogue.\n//\n// A code is only ever added here for a condition the compiler can also report. The editor makes a few\n// structural checks the compiler does not - the capture and projection validators are where they live -\n// and those stay codeless deliberately: minting a PLAY number for something no compiler run can emit\n// would make the catalogue describe two different tools.\nexport const diagnosticCodes = {\n unknownMatchPattern: 'PLAY0366',\n invalidMatchPattern: 'PLAY0367',\n patternOutsidePortableMatchDialect: 'PLAY0699',\n deprecatedStudioTextRulePattern: 'PLAY0787',\n repeatedSingularDeclarationAcrossFiles: 'PLAY0172',\n directionlessTranslationReactsToOwnCapture: 'PLAY0694',\n pendingIntentWithOtherHandler: 'PLAY0698',\n commandHandlerRequiresAttachment: 'PLAY0800', // C# only\n duplicateEventInProjectionScope: 'PLAY0801',\n reservedStoredName: 'PLAY0802',\n ambiguousMatchPattern: 'PLAY0803',\n describedCommandNotImplemented: 'PLAY0695', // C# only\n describedCommandWithoutProductions: 'PLAY0696', // C# only\n describedCommandCardinalityNotAdmitted: 'PLAY0697', // C# only\n invalidExposureDeclaration: 'PLAY0621',\n unknownExposureOwner: 'PLAY0622',\n reExposureCycle: 'PLAY0623',\n reExposureBroken: 'PLAY0624',\n invalidInstanceContribution: 'PLAY0625',\n unknownContributionInstance: 'PLAY0626',\n contributionNotExposed: 'PLAY0627',\n contributionTypeMismatch: 'PLAY0628',\n unknownTemplateContentSlot: 'PLAY0629',\n unknownNavigationOutlet: 'PLAY0630',\n templateScopeMismatch: 'PLAY0631',\n incompatibleComponentPackage: 'PLAY0632',\n unknownNavigationDestination: 'PLAY0654',\n unknownScreenContributionPoint: 'PLAY0655',\n templateNestingCycle: 'PLAY0656',\n templateCategoryMissing: 'PLAY0720',\n invalidTemplateVersionRange: 'PLAY0721',\n unknownTemplateBlueprint: 'PLAY0722',\n mixedEnumerationNumbering: 'PLAY0667',\n duplicateEnumerationNumber: 'PLAY0668',\n enumerationNumberOutsideInt32: 'PLAY0669',\n malformedEnumerationNumber: 'PLAY0670',\n unpinnedStoredEnumeration: 'PLAY0671',\n invalidIdentityDeclaration: 'PLAY0633',\n duplicateIdentity: 'PLAY0634',\n invalidIdentityDetail: 'PLAY0635',\n unknownIdentitySource: 'PLAY0636',\n identityDetailWithoutSource: 'PLAY0637',\n identitySourceWithBody: 'PLAY0638',\n duplicateIdentityDetail: 'PLAY0639',\n builtInIdentityDetail: 'PLAY0640',\n unknownIdentityQuery: 'PLAY0641',\n invalidIdentityQuery: 'PLAY0642',\n identityQueryWithoutKey: 'PLAY0643',\n invalidIdentityQueryKey: 'PLAY0644',\n identityQueryAuthorizationDependency: 'PLAY0645',\n identityQueryTypeMismatch: 'PLAY0646',\n invalidReactionIdentity: 'PLAY0647',\n gatedInvocationWithoutIdentity: 'PLAY0648',\n unusedReactionIdentity: 'PLAY0649',\n unusedReactionRole: 'PLAY0650',\n unsatisfiedReactionIdentity: 'PLAY0651',\n reactionPrivilegeEscalation: 'PLAY0652',\n // Preserve supplied C# whole-model diagnostics; these checks are not yet run by the editor.\n commandProducesPublicEvent: 'PLAY0607',\n publicEventRequiresOutboundTranslation: 'PLAY0608',\n outboundPublicEventCount: 'PLAY0609',\n foreignPublicEventConsumer: 'PLAY0610',\n outboundTranslationInput: 'PLAY0611',\n inboundTranslationOutput: 'PLAY0612',\n foreignPublicEventProduced: 'PLAY0613',\n publicTranslationRequiresDirection: 'PLAY0614',\n translationConstructDirection: 'PLAY0615',\n inboundTranslationInput: 'PLAY0616',\n outboundTranslationOutput: 'PLAY0617',\n eventTargetOutsideOutboundTranslation: 'PLAY0618',\n eventsSourceOutsideInboundTranslation: 'PLAY0619',\n invalidCaptureEventsSource: 'PLAY0620',\n captureEventsFromSeveralOrigins: 'PLAY0687',\n captureEventsKeyNotRequired: 'PLAY0700',\n captureEventsRecordFixture: 'PLAY0701',\n refutedGeneratedConceptRule: 'PLAY0688',\n unprovenGeneratedConceptRule: 'PLAY0689',\n invalidReadModelKey: 'PLAY0660',\n incompleteReadModelKey: 'PLAY0661',\n invalidReadModelKeyLookup: 'PLAY0662',\n productionRouteOutsideCommand: 'PLAY0663',\n redundantProductionRoute: 'PLAY0664',\n invalidObserverFilter: 'PLAY0665',\n observerFilterExcludesEveryProducer: 'PLAY0666',\n reducerIdentityMismatch: 'PLAY0690',\n generationSupportBudgetExceeded: 'PLAY0691',\n emptyGenerationSupport: 'PLAY0692',\n invalidReactionBatchesDeclaration: 'PLAY0693',\n invalidCommandReadsDeclaration: 'PLAY0780',\n invalidDescription: 'PLAY0145',\n emptyDescription: 'PLAY0146',\n duplicateDescription: 'PLAY0147',\n unknownConceptDirective: 'PLAY0010',\n attributeReasonWithoutAttribute: 'PLAY0012',\n duplicateAttributeReason: 'PLAY0013',\n duplicateComplianceMarker: 'PLAY0653',\n legacyComplianceMarker: 'PLAY0565',\n unknownComplianceMarker: 'PLAY0566',\n invalidSecretScope: 'PLAY0567',\n duplicateSecretScope: 'PLAY0568',\n secretScopeIgnoredForPii: 'PLAY0569',\n invalidPersonalDataQualifier: 'PLAY0570',\n duplicateSpecialCategory: 'PLAY0571',\n invalidPurposeDeclaration: 'PLAY0596',\n invalidPurposeVocabulary: 'PLAY0597',\n duplicatePurposeField: 'PLAY0598',\n duplicatePurposeDeclaration: 'PLAY0599',\n unknownPurpose: 'PLAY0600',\n purposeInterestMismatch: 'PLAY0601',\n personalDataWithoutPurpose: 'PLAY0602',\n specialDataWithoutCondition: 'PLAY0603',\n criminalDataWithoutAuthorization: 'PLAY0604',\n purposeWithoutBasis: 'PLAY0605',\n unusedPurpose: 'PLAY0606',\n duplicateEventSubject: 'PLAY0590',\n invalidSubjectType: 'PLAY0591',\n protectedSubjectType: 'PLAY0592',\n invalidSubjectOwner: 'PLAY0593',\n readModelSubjectNotSupported: 'PLAY0594',\n invalidSubjectModifierOrder: 'PLAY0595',\n // Supplied compiler diagnostics are preserved, even for checks only the C# tool can run.\n // See Documentation/screenplay/editor-diagnostics.md for the validation boundary.\n conflictingScreenDataBinding: 'PLAY0530',\n screenDataQueryMismatch: 'PLAY0531',\n actionWithoutInputSurface: 'PLAY0532',\n commandWithoutInputSurface: 'PLAY0533',\n readModelFieldWithoutOrigin: 'PLAY0534',\n queryParameterNotHeldByView: 'PLAY0535',\n unconsumedEvent: 'PLAY0536',\n unreachableScreen: 'PLAY0537',\n invalidSpecificationCallerPersona: 'PLAY0572',\n unsynthesizablePersonaCaller: 'PLAY0573',\n personaWithoutGate: 'PLAY0574',\n gateWithoutPersona: 'PLAY0575',\n ambiguousPersonaCaller: 'PLAY0576',\n invalidSpecificationParameter: 'PLAY0577',\n invalidSpecificationCase: 'PLAY0578',\n duplicateSpecificationParameter: 'PLAY0579',\n duplicateSpecificationCase: 'PLAY0580',\n incompleteSpecificationTable: 'PLAY0581',\n invalidSpecificationCaseAssignment: 'PLAY0582',\n invalidSpecificationCaseValue: 'PLAY0583',\n invalidSpecificationCaseReference: 'PLAY0584',\n optionalSpecificationParameterTarget: 'PLAY0585',\n specificationCaseNameCollision: 'PLAY0586',\n incompatibleSpecificationParameterType: 'PLAY0587',\n unusedSpecificationParameter: 'PLAY0588',\n singularSpecificationTableExpansion: 'PLAY0589',\n invalidActionAlternative: 'PLAY0341',\n guardedActionWithoutAlternatives: 'PLAY0342',\n misplacedActionOtherwise: 'PLAY0343',\n unsupportedActionConditionOperand: 'PLAY0344',\n unknownActionSubjectField: 'PLAY0345',\n unresolvedActionSubject: 'PLAY0346',\n unreachableActionAlternative: 'PLAY0347',\n unknownActionArgumentProperty: 'PLAY0348',\n invalidRefusalBranch: 'PLAY0538',\n invalidRefusalBranchBody: 'PLAY0539',\n unreachableRefusalBranch: 'PLAY0540',\n invalidRefusalValue: 'PLAY0541',\n unknownRefusalConstraint: 'PLAY0542',\n unmatchedRedeliveredOccurrence: 'PLAY0543',\n unknownRedeliveryReaction: 'PLAY0544',\n invalidNoEventsExpectation: 'PLAY0545',\n indeterminateNegatedClaimTarget: 'PLAY0546',\n invalidAbsentReadModelStep: 'PLAY0453',\n unknownConstraintProperty: 'PLAY0391',\n invalidSpecificationExample: 'PLAY0518',\n duplicateSpecificationAssignment: 'PLAY0519',\n unknownReadModelProperty: 'PLAY0514',\n piiNotSupportedOnIdentifier: 'PLAY0515',\n invalidEventSourceDeclaration: 'PLAY0503',\n invalidCommandStream: 'PLAY0504',\n invalidSpecificationStream: 'PLAY0547',\n specificationStreamOnCommand: 'PLAY0548',\n invalidSpecificationStreamRoute: 'PLAY0549',\n invalidSpecificationStreamEventSource: 'PLAY0550',\n specificationStreamContradictsCommand: 'PLAY0551',\n ambiguousCommandStream: 'PLAY0505',\n unsupportedStreamIdType: 'PLAY0506',\n redundantSourceStreamId: 'PLAY0507',\n eventFromLaterSlice: 'PLAY0516',\n timelineCycleGroup: 'PLAY0517',\n invalidSpecificationExampleBody: 'PLAY0526',\n undeclaredDependency: 'PLAY0552',\n unusedDependencyDeclaration: 'PLAY0553',\n invalidDependencyTarget: 'PLAY0554',\n repeatedDependencyDeclaration: 'PLAY0555',\n mutualDependencyDeclarations: 'PLAY0556',\n authorizationRefusalWithoutIdentity: 'PLAY0557',\n invalidDocumentation: 'PLAY0558',\n conflictingDocumentationAcrossFiles: 'PLAY0559',\n unsupportedInteractionAlternatives: 'PLAY0560',\n mixedInteractionAlternatives: 'PLAY0561',\n interactionAlternativeWithoutActions: 'PLAY0562',\n inlineInteractionAlternative: 'PLAY0563',\n legacyInteractionWhere: 'PLAY0564',\n ambiguousReference: 'PLAY0198',\n invalidImplementationBlock: 'PLAY0492',\n invalidImplementationHint: 'PLAY0493',\n conflictingImplementationSources: 'PLAY0494',\n eventSourceIdInPayload: 'PLAY0469',\n explicitProducesTargetsRequired: 'PLAY0470',\n redundantEventId: 'PLAY0471',\n invalidEventId: 'PLAY0472',\n inlineEventCollision: 'PLAY0473',\n inlineEventOutsideCommand: 'PLAY0474',\n inlineEventGeneration: 'PLAY0475',\n reservedProductionMetadata: 'PLAY0476',\n invalidEventDocumentation: 'PLAY0477',\n tabIndentation: 'PLAY0006',\n unknownPrimitiveType: 'PLAY0008',\n mismatchedSpecificationQueryResult: 'PLAY0465',\n unknownSliceType: 'PLAY0028',\n duplicateCommandIdentifier: 'PLAY0036',\n unknownContextPath: 'PLAY0153',\n unknownContextCausedByProperty: 'PLAY0154',\n unknownContextIdentityProperty: 'PLAY0155',\n unclosedCodeBlock: 'PLAY0164',\n unknownType: 'PLAY0165',\n unknownEvent: 'PLAY0166',\n unknownPolicy: 'PLAY0167',\n duplicateDeclaration: 'PLAY0168',\n unknownEventContextMember: 'PLAY0295',\n unknownEventContextPath: 'PLAY0296',\n eventContextPathBelowCollection: 'PLAY0297',\n missingEventContextPath: 'PLAY0298',\n unresolvedDynamicKeySource: 'PLAY0299',\n invalidFileImport: 'PLAY0454',\n omittedProductionDestination: 'PLAY0478',\n legacyOptionalSuffix: 'PLAY0479',\n invalidOptionalModifierOrder: 'PLAY0480',\n optionalReadsNotSupported: 'PLAY0481',\n unavailableResponseExecution: 'PLAY0268',\n generatedPropertyOutsideCommand: 'PLAY0482',\n invalidGeneratedType: 'PLAY0483',\n invalidGeneratedModifierOrder: 'PLAY0484',\n generatedPropertyInput: 'PLAY0485',\n invalidCommandResponse: 'PLAY0486',\n invalidResponseSource: 'PLAY0487',\n duplicateResponseField: 'PLAY0488',\n invalidResponseShape: 'PLAY0489',\n invalidGeneratedFixture: 'PLAY0490',\n invalidReturnExpectation: 'PLAY0491',\n unknownGenerationStrategy: 'PLAY0672',\n invalidGenerationArgument: 'PLAY0673',\n invalidGenerationModifier: 'PLAY0674',\n duplicateGenerationModifier: 'PLAY0675',\n duplicateGeneration: 'PLAY0676',\n invalidGenerationPrimitive: 'PLAY0677',\n invalidGenerationPrefix: 'PLAY0678',\n invalidGenerationAlphabet: 'PLAY0679',\n invalidTypeIdPrefix: 'PLAY0680',\n generationSizeOutsideRange: 'PLAY0681',\n reservedSequenceGeneration: 'PLAY0682',\n lowGenerationEntropy: 'PLAY0683',\n lowGeneratedIdentifierEntropy: 'PLAY0684',\n responseNameUsedOnFailure: 'PLAY0685',\n // Retired by ESM v16; preserve supplied warnings from earlier native compilers.\n eventIdPinNotCarriedToRenderers: 'PLAY0686',\n} as const;\n\nexport type DiagnosticCode = (typeof diagnosticCodes)[keyof typeof diagnosticCodes];\n"],"mappings":"AAWA,MAAaA,EAAkB,CAC3B,oBAAqB,WACrB,oBAAqB,WACrB,mCAAoC,WACpC,gCAAiC,WACjC,uCAAwC,WACxC,2CAA4C,WAC5C,8BAA+B,WAC/B,iCAAkC,WAClC,gCAAiC,WACjC,mBAAoB,WACpB,sBAAuB,WACvB,+BAAgC,WAChC,mCAAoC,WACpC,uCAAwC,WACxC,2BAA4B,WAC5B,qBAAsB,WACtB,gBAAiB,WACjB,iBAAkB,WAClB,4BAA6B,WAC7B,4BAA6B,WAC7B,uBAAwB,WACxB,yBAA0B,WAC1B,2BAA4B,WAC5B,wBAAyB,WACzB,sBAAuB,WACvB,6BAA8B,WAC9B,6BAA8B,WAC9B,+BAAgC,WAChC,qBAAsB,WACtB,wBAAyB,WACzB,4BAA6B,WAC7B,yBAA0B,WAC1B,0BAA2B,WAC3B,2BAA4B,WAC5B,8BAA+B,WAC/B,2BAA4B,WAC5B,0BAA2B,WAC3B,2BAA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WACtB,0BAA2B,WAC3B,sBAAuB,WACvB,2BAA4B,WAC5B,0BAA2B,WAC3B,eAAgB,WAChB,qBAAsB,WACtB,mCAAoC,WACpC,iBAAkB,WAClB,2BAA4B,WAC5B,mBAAoB,WACpB,+BAAgC,WAChC,+BAAgC,WAChC,kBAAmB,WACnB,YAAa,WACb,aAAc,WACd,cAAe,WACf,qBAAsB,WACtB,0BAA2B,WAC3B,wBAAyB,WACzB,gCAAiC,WACjC,wBAAyB,WACzB,2BAA4B,WAC5B,kBAAmB,WACnB,6BAA8B,WAC9B,qBAAsB,WACtB,6BAA8B,WAC9B,0BAA2B,WAC3B,6BAA8B,WAC9B,gCAAiC,WACjC,qBAAsB,WACtB,8BAA+B,WAC/B,uBAAwB,WACxB,uBAAwB,WACxB,sBAAuB,WACvB,uBAAwB,WACxB,qBAAsB,WACtB,wBAAyB,WACzB,yBAA0B,WAC1B,0BAA2B,WAC3B,0BAA2B,WAC3B,0BAA2B,WAC3B,4BAA6B,WAC7B,oBAAqB,WACrB,2BAA4B,WAC5B,wBAAyB,WACzB,0BAA2B,WAC3B,oBAAqB,WACrB,2BAA4B,WAC5B,2BAA4B,WAC5B,qBAAsB,WACtB,8BAA+B,WAC/B,0BAA2B,WAE3B,gCAAiC,UACrC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import"./_virtual/_virtual/_rolldown/runtime.js";import{causedByProperties as e,contextRoots as t,identityProperties as n,primitiveTypes as r,sliceTypes as i}from"./language.js";import{DiagnosticCodes as a}from"./compiler/Diagnostics/DiagnosticCodes.js";import{legacyOptionalTypeLength as o}from"./compiler/Authoring/QuickFixes.js";import"./compiler/index.js";import{enclosingChain as s,fenceMap as c,indentOf as l}from"./document-context.js";import{eventAnalysisSource as u}from"./event-analysis-source.js";import{resolveEventContextPath as d}from"./event-context.js";import{responseAnalysis as f}from"./response-analysis.js";import{knownEventNames as p,knownTypeNames as m,mergeSymbols as h,propertyTypeReference as g,scanDocument as _,symbolsForBuffer as v}from"./symbols.js";import{diagnosticCodes as y}from"./diagnostic-codes.js";import{validateInlineEvents as b}from"./inline-event-validation.js";import{fileImportOn as x,isFileImportLine as S}from"./file-imports.js";function issue(e,t,n,r,i,a){return{severity:e,message:i,line:t,startColumn:n,endColumn:n+r,code:a}}function tokenIssue(e,t,n,r,i,a){return issue(e,t,n.indexOf(r)+1,r.length,i,a)}function validateDeclarations(e,t,n){let i=[],a=/* @__PURE__ */ new Set([...m(t,r),...m(n,[])]),checkProperties=(e,t)=>{for(let n of e.filter(e=>!a.has(g(e).name))){let e=g(n).name;i.push(issue(`warning`,n.line,n.sourceType.startColumn,n.sourceType.text.length,e===`optional`?`Unknown type 'optional' on '${n.name}' of ${t} — did you forget the type before 'optional'?`:`Unknown type '${e}' on '${n.name}' of ${t} — declare it with 'concept ${e} : <Primitive>' or 'type ${e}'.`,y.unknownType))}};for(let e of t.types)checkProperties(e.properties,`type '${e.name}'`);for(let e of t.events)checkProperties(e.properties,`event '${e.name}'`);for(let e of t.queries)checkProperties(e.parameters,`query '${e.name}'`);for(let n of t.commands){checkProperties(n.properties,`command '${n.name}'`);let t=n.properties.filter(e=>e.isIdentifier);for(let r of t.slice(1))i.push(tokenIssue(`error`,r.line,e[r.line],`identifier`,`Command '${n.name}' already marks '${t[0].name}' as identifier — only one property can be the identifier.`,y.duplicateCommandIdentifier))}let o=/* @__PURE__ */ new Map;for(let n of[...t.concepts,...t.types])o.get(n.name)===void 0?o.set(n.name,n.line):i.push(tokenIssue(`error`,n.line,e[n.line],n.name,`Duplicate declaration of '${n.name}' — concept and type names must be unique.`,y.duplicateDeclaration));return i}function validateLines(s,u={}){let d=c(s),m=_(s),g=u.application??h(),x=v(s,{...g,authoringPath:u.path??g.authoringPath,authoringPlacement:u.placement??g.authoringPlacement}),S=f(s,x.authoringDocuments??x.authoringSources?.filter(e=>e!==s.join(`
|
|
2
|
-
`)),x.authoringPlacement,x.authoringPath,x.authoringPlacementResolved),C=new Set(S.eventSources.routes.map(e=>e.location.line-1)),w={...m,commands:m.commands.map(e=>({...e,properties:e.properties.filter(e=>!C.has(e.line)),produces:e.produces?.filter(e=>!S.operationProductionLines?.has(e.line)),productionHeaders:e.productionHeaders?.filter(e=>!S.operationProductionLines?.has(e))}))},T=/* @__PURE__ */ new Set([...p(w),...p(g)]),E=new Set([...w.policies,...g.policies].map(e=>e.name)),D=validateDeclarations(s,w,g);D.push(...validateProductionDestinations(s,w));let O=/* @__PURE__ */ new Set([a.UnknownGenerationStrategy,a.InvalidGenerationArgument,a.InvalidGenerationModifier,a.DuplicateGenerationModifier,a.DuplicateGeneration,a.InvalidGenerationPrimitive,a.InvalidGenerationPrefix,a.InvalidGenerationAlphabet,a.InvalidTypeIdPrefix,a.GenerationSizeOutsideRange,a.ReservedSequenceGeneration,a.LowGenerationEntropy,a.LowGeneratedIdentifierEntropy,a.RefutedGeneratedConceptRule,a.UnprovenGeneratedConceptRule,a.GenerationSupportBudgetExceeded,a.EmptyGenerationSupport]),k=/* @__PURE__ */ new Set([a.MixedEnumerationNumbering,a.DuplicateEnumerationNumber,a.EnumerationNumberOutsideInt32,a.MalformedEnumerationNumber,a.UnpinnedStoredEnumeration]),A=/* @__PURE__ */ new Set([a.LegacyOptionalSuffix,a.InvalidOptionalModifierOrder,a.OptionalReadsNotSupported]),j=/* @__PURE__ */ new Set([a.UnexpectedTokenInPolicyCondition,a.ExpectedPolicyCondition,a.UnclosedPolicyConditionGroup,a.ExpectedRoleName,a.ExpectedClaimName,a.ExpectedClaimMatches,a.ExpectedClaimMatchTarget]),M=/* @__PURE__ */ new Set([a.UnknownEvent,a.UnknownReadModelProperty,a.PiiNotSupportedOnIdentifier]),N=/* @__PURE__ */ new Set([a.EventFromLaterSlice,a.TimelineCycleGroup]),P=/* @__PURE__ */ new Set([a.UndeclaredDependency,a.UnusedDependencyDeclaration,a.InvalidDependencyTarget,a.RepeatedDependencyDeclaration,a.MutualDependencyDeclarations,a.AmbiguousReference]),F=/* @__PURE__ */ new Set([a.InvalidCommandReadsDeclaration,a.UnknownMatchPattern,a.InvalidMatchPattern,a.PatternOutsidePortableMatchDialect,a.DeprecatedStudioTextRulePattern,a.MismatchedSpecificationQueryResult,a.DirectionlessTranslationReactsToOwnCapture,a.CaptureEventsFromSeveralOrigins,a.CaptureEventsKeyNotRequired,a.CaptureEventsRecordFixture,a.EventIdPinNotCarriedToRenderers,a.ResponseNameUsedOnFailure,a.InvalidEventDeclaration,a.InvalidImportDeclaration,a.InvalidSliceDeclaration,a.InvalidDescription,a.DuplicateDescription,a.EmptyDescription,a.DuplicateEventSubject,a.InvalidSubjectType,a.ProtectedSubjectType,a.InvalidSubjectOwner,a.ReadModelSubjectNotSupported,a.InvalidSubjectModifierOrder,a.UnsupportedInteractionAlternatives,a.MixedInteractionAlternatives,a.InteractionAlternativeWithoutActions,a.InlineInteractionAlternative,a.LegacyInteractionWhere,a.InvalidSpecificationParameter,a.InvalidSpecificationCase,a.DuplicateSpecificationParameter,a.DuplicateSpecificationCase,a.IncompleteSpecificationTable,a.InvalidSpecificationCaseAssignment,a.InvalidSpecificationCaseValue,a.InvalidSpecificationCaseReference,a.OptionalSpecificationParameterTarget,a.SpecificationCaseNameCollision,a.IncompatibleSpecificationParameterType,a.UnusedSpecificationParameter,a.SingularSpecificationTableExpansion,a.InvalidSpecificationCallerPersona,a.UnsynthesizablePersonaCaller,a.PersonaWithoutGate,a.GateWithoutPersona,a.AmbiguousPersonaCaller,a.InvalidDocumentation,a.ConflictingDocumentationAcrossFiles,a.InvalidAbsentReadModelStep,a.UnknownConstraintProperty,a.OmittedProductionDestination,a.InvalidSpecificationExample,a.DuplicateSpecificationAssignment,a.InvalidReactionBatchesDeclaration,a.DescribedCommandNotImplemented,a.DescribedCommandWithoutProductions,a.DescribedCommandCardinalityNotAdmitted,a.CommandHandlerRequiresAttachment,a.PendingIntentWithOtherHandler,a.DuplicateEventInProjectionScope,a.ReservedStoredName]),I=/* @__PURE__ */ new Set([a.InvalidPurposeDeclaration,a.InvalidPurposeVocabulary,a.DuplicatePurposeField,a.DuplicatePurposeDeclaration,a.UnknownPurpose,a.PurposeInterestMismatch,a.PersonalDataWithoutPurpose,a.SpecialDataWithoutCondition,a.CriminalDataWithoutAuthorization,a.PurposeWithoutBasis,a.UnusedPurpose,a.UnknownConceptDirective,a.AttributeReasonWithoutAttribute,a.DuplicateAttributeReason,a.LegacyComplianceMarker,a.DuplicateComplianceMarker,a.UnknownComplianceMarker,a.InvalidSecretScope,a.DuplicateSecretScope,a.SecretScopeIgnoredForPii,a.InvalidPersonalDataQualifier,a.DuplicateSpecialCategory]),L=/* @__PURE__ */ new Set;for(let e of u.compilerDiagnostics??S.diagnostics){let t=e.code===a.UnknownType&&(S.identityDetails??[]).some(t=>t.line===e.location.line-1),n=e.code===a.RepeatedSingularDeclarationAcrossFiles&&e.message.includes(`identity block`);if(!(e.code===a.DuplicateDeclaration&&e.message.startsWith(`Duplicate declaration of policy `))&&!t&&!n&&!O.has(e.code)&&!k.has(e.code)&&!I.has(e.code)&&!A.has(e.code)&&!j.has(e.code)&&!M.has(e.code)&&!N.has(e.code)&&!P.has(e.code)&&!F.has(e.code)&&e.code!==a.ReducerIdentityMismatch&&e.code!==a.InvalidSpecificationExampleBody&&e.code!==a.UnknownRuleImplementationDirective&&e.code!==a.InvalidValidationRule&&e.code!==a.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$|^PLAY072[0-2]$/.test(e.code))continue;let r=e.location.line-1;if(e.code===a.OmittedProductionDestination&&D.some(t=>t.code===e.code&&t.line===r))continue;if(e.code===a.UnknownEvent){if(L.has(r))continue;L.add(r)}let i=o(s[r],e)||s[r].length-e.location.column+1;D.push(issue(e.severity,r,e.location.column,i,e.message,e.code))}let checkEvent=(e,t,n)=>{!T.has(n)&&!L.has(e)&&D.push(tokenIssue(`warning`,e,t,n,`Unknown event type '${n}' — declare it in a slice or import it.`,y.unknownEvent))},R=-1;for(let a=0;a<s.length;a++){let o=s[a],c=o.trim();if(d[a]||c.length===0)continue;let u=o.match(/^[ ]*(\t+)/);if(u&&D.push(issue(`warning`,a,u[0].length-u[1].length+1,u[1].length,`Screenplay is indentation-based — use spaces, not tabs.`,y.tabIndentation)),R>=0){if(l(o)>R&&/^(?:or\s+)?[A-Z]\w*(?:\s+or\s+[A-Z]\w*)*$/.test(c)){for(let e of c.split(/\s+/).filter(e=>e!==`or`))E.has(e)||D.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy));continue}R=-1}let f=validateImport(s,d,a);f&&D.push(f);let p=c.match(/^slice\s+(\w+)/);p&&!i.includes(p[1])&&D.push(tokenIssue(`error`,a,o,p[1],`Unknown slice type '${p[1]}' — expected ${i.join(`, `)}.`,y.unknownSliceType));let m=c.match(/^concept\s+\w+\s*:\s*(\w+)/);m&&m[1]!==`Enum`&&!r.includes(m[1])&&D.push(tokenIssue(`error`,a,o,m[1],`Unknown primitive type '${m[1]}' — expected ${r.join(`, `)} or Enum.`,y.unknownPrimitiveType));let h=c.match(/^authorize\s+(.*)$/);if(h){R=l(o);for(let e of h[1].split(/\s+/).filter(e=>e!==`or`&&e.length>0))E.has(e)||D.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy))}let g=c.match(/^on\s+([A-Z]\w*)\s*$/);g&&checkEvent(a,o,g[1]);let _=c.match(/^produces\s+([A-Z]\w*)\s*$/);if(_&&!S.operationProductionLines?.has(a)&&checkEvent(a,o,_[1]),/^produces\s+when\b/.test(c)&&!S.operationProductionLines?.has(a))for(let e=a+1;e<s.length;e++){let t=s[e];if(!(d[e]||t.trim().length===0)){if(l(t)>l(o)){let n=t.trim().match(/^([A-Z]\w*)\s*$/);n&&checkEvent(e,t,n[1])}break}}let v=c.match(/^unique\s+event\s+([A-Z]\w*)/);v&&checkEvent(a,o,v[1]);let b=c.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);b&&checkEvent(a,o,b[1]);for(let e of o.match(/\$identity\.[\w.]+/g)??[]){let t=e.substring(10).split(`.`)[0],r=[...n,...(S.identityDetails??[]).map(e=>e.name)];r.includes(t)||D.push(tokenIssue(`warning`,a,o,e,`Unknown $identity property '${t}' — expected ${r.join(`, `)}.`,y.unknownContextIdentityProperty))}for(let r of o.match(/\$context\.[\w.]+/g)??[]){let i=r.substring(9).split(`.`);t.includes(i[0])?i[0]===`causedBy`&&i.length>1&&!e.includes(i[1])?D.push(tokenIssue(`warning`,a,o,r,`Unknown $context.causedBy property '${i[1]}' — expected ${e.join(`, `)}.`,y.unknownContextCausedByProperty)):i[0]===`identity`&&i.length>1&&!n.includes(i[1])&&D.push(tokenIssue(`warning`,a,o,r,`Unknown $context.identity property '${i[1]}' — expected ${n.join(`, `)}.`,y.unknownContextIdentityProperty)):D.push(tokenIssue(`warning`,a,o,r,`Unknown $context path '${i.join(`.`)}' — expected one of ${t.join(`, `)}.`,y.unknownContextPath))}}D.push(...validateEventContextPaths(s,d)),D.push(...b(s,w,g,S.operationProductionLines));let z=s.map((e,t)=>({line:e,index:t})).filter(({line:e})=>/^\s*```(?:[a-z]+)?\s*$/.test(e));if(z.length%2==1){let e=z[z.length-1];D.push(issue(`error`,e.index,1,e.line.length+1,"Unclosed inline code block — expected a closing ``` line.",y.unclosedCodeBlock))}return D}function validateProductionDestinations(e,t){let n=[];e=u(e);for(let r of t.commands){let t=r.properties.filter(e=>e.isIdentifier&&!g(e).isOptional&&!g(e).isCollection);if(t.length===1)for(let i of r.produces??[]){if(i.inline||i.conditional||i.target!==void 0)continue;let r=i.line;n.push(issue(`information`,r,l(e[r])+1,e[r].trim().length,`Plain 'produces ${i.name}' omits its destination — use 'for ${t[0].name}' to explicitly select the command's identifier.`,y.omittedProductionDestination))}}return n}function validateImport(e,t,n){let r=e[n],i=r.trim().replace(/\s*\/\/.*$/,``);if(!/^import\b/.test(i)||x(r,n))return;let a=l(r);if(a>0&&[`module`,`feature`].includes(s(e,t,n,a)[0])||S(r))return issue(`error`,n,a+1,i.length,`Invalid import '${i}' — inside a module or feature, import names files: 'import "<path or glob>"'.`,y.invalidFileImport)}const C=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function validateEventContextPaths(e,t){let n=[],names=e=>e.map(e=>e.name).join(`, `);for(let r=0;r<e.length;r++){let i=e[r];if(t[r])continue;for(let e of i.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let t=e[0].substring(e[1]?.length??0),i=e[2];if(i.length===0){e[1]&&n.push(issue(`error`,r,(e.index??0)+2,t.length,`'$eventContext' names no member - expected one of ${names(d(``).expected)}.`,y.missingEventContextPath));continue}let a=i.substring(1),o=d(a),s=(e.index??0)+(e[1]?.length??0)+1;switch(o.status){case`missing`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' names no member - expected one of ${names(o.expected)}.`,y.missingEventContextPath));break;case`unknownMember`:n.push(issue(`warning`,r,s,t.length,`Unknown event context member '${o.segment}' in '$eventContext.${a}' - expected one of ${names(o.expected)}.`,y.unknownEventContextMember));break;case`unknownSubPath`:{let e=o.expected.length===0?`no members to address`:`members ${names(o.expected)}`;n.push(issue(`warning`,r,s,t.length,`Unknown event context path '$eventContext.${a}' - '${o.member?.name}' (${o.member?.type}) has ${e}.`,y.unknownEventContextPath));break}case`belowCollection`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' cannot resolve - '${o.member?.name}' is a collection (${o.member?.type}) and cannot be addressed below.`,y.eventContextPathBelowCollection))}}let a=i.trim().match(C)?.[1],o=a?.match(/\.\$(\w+)/)?.[1];a&&o&&o!==`eventContext`&&n.push(tokenIssue(`warning`,r,i,a,`Dynamic dictionary key '$${o}' in '${a}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${o}' becomes the key.`,y.unresolvedDynamicKeySource))}return n}export{validateEventContextPaths,validateLines};
|
|
2
|
+
`)),x.authoringPlacement,x.authoringPath,x.authoringPlacementResolved),C=new Set(S.eventSources.routes.map(e=>e.location.line-1)),w={...m,commands:m.commands.map(e=>({...e,properties:e.properties.filter(e=>!C.has(e.line)),produces:e.produces?.filter(e=>!S.operationProductionLines?.has(e.line)),productionHeaders:e.productionHeaders?.filter(e=>!S.operationProductionLines?.has(e))}))},T=/* @__PURE__ */ new Set([...p(w),...p(g)]),E=new Set([...w.policies,...g.policies].map(e=>e.name)),D=validateDeclarations(s,w,g);D.push(...validateProductionDestinations(s,w));let O=/* @__PURE__ */ new Set([a.UnknownGenerationStrategy,a.InvalidGenerationArgument,a.InvalidGenerationModifier,a.DuplicateGenerationModifier,a.DuplicateGeneration,a.InvalidGenerationPrimitive,a.InvalidGenerationPrefix,a.InvalidGenerationAlphabet,a.InvalidTypeIdPrefix,a.GenerationSizeOutsideRange,a.ReservedSequenceGeneration,a.LowGenerationEntropy,a.LowGeneratedIdentifierEntropy,a.RefutedGeneratedConceptRule,a.UnprovenGeneratedConceptRule,a.GenerationSupportBudgetExceeded,a.EmptyGenerationSupport]),k=/* @__PURE__ */ new Set([a.MixedEnumerationNumbering,a.DuplicateEnumerationNumber,a.EnumerationNumberOutsideInt32,a.MalformedEnumerationNumber,a.UnpinnedStoredEnumeration]),A=/* @__PURE__ */ new Set([a.LegacyOptionalSuffix,a.InvalidOptionalModifierOrder,a.OptionalReadsNotSupported]),j=/* @__PURE__ */ new Set([a.UnexpectedTokenInPolicyCondition,a.ExpectedPolicyCondition,a.UnclosedPolicyConditionGroup,a.ExpectedRoleName,a.ExpectedClaimName,a.ExpectedClaimMatches,a.ExpectedClaimMatchTarget]),M=/* @__PURE__ */ new Set([a.UnknownEvent,a.UnknownReadModelProperty,a.PiiNotSupportedOnIdentifier]),N=/* @__PURE__ */ new Set([a.EventFromLaterSlice,a.TimelineCycleGroup]),P=/* @__PURE__ */ new Set([a.UndeclaredDependency,a.UnusedDependencyDeclaration,a.InvalidDependencyTarget,a.RepeatedDependencyDeclaration,a.MutualDependencyDeclarations,a.AmbiguousReference]),F=/* @__PURE__ */ new Set([a.InvalidCommandReadsDeclaration,a.UnknownMatchPattern,a.InvalidMatchPattern,a.PatternOutsidePortableMatchDialect,a.AmbiguousMatchPattern,a.DeprecatedStudioTextRulePattern,a.MismatchedSpecificationQueryResult,a.DirectionlessTranslationReactsToOwnCapture,a.CaptureEventsFromSeveralOrigins,a.CaptureEventsKeyNotRequired,a.CaptureEventsRecordFixture,a.EventIdPinNotCarriedToRenderers,a.ResponseNameUsedOnFailure,a.InvalidEventDeclaration,a.InvalidImportDeclaration,a.InvalidSliceDeclaration,a.InvalidDescription,a.DuplicateDescription,a.EmptyDescription,a.DuplicateEventSubject,a.InvalidSubjectType,a.ProtectedSubjectType,a.InvalidSubjectOwner,a.ReadModelSubjectNotSupported,a.InvalidSubjectModifierOrder,a.UnsupportedInteractionAlternatives,a.MixedInteractionAlternatives,a.InteractionAlternativeWithoutActions,a.InlineInteractionAlternative,a.LegacyInteractionWhere,a.InvalidSpecificationParameter,a.InvalidSpecificationCase,a.DuplicateSpecificationParameter,a.DuplicateSpecificationCase,a.IncompleteSpecificationTable,a.InvalidSpecificationCaseAssignment,a.InvalidSpecificationCaseValue,a.InvalidSpecificationCaseReference,a.OptionalSpecificationParameterTarget,a.SpecificationCaseNameCollision,a.IncompatibleSpecificationParameterType,a.UnusedSpecificationParameter,a.SingularSpecificationTableExpansion,a.InvalidSpecificationCallerPersona,a.UnsynthesizablePersonaCaller,a.PersonaWithoutGate,a.GateWithoutPersona,a.AmbiguousPersonaCaller,a.InvalidDocumentation,a.ConflictingDocumentationAcrossFiles,a.InvalidAbsentReadModelStep,a.UnknownConstraintProperty,a.OmittedProductionDestination,a.InvalidSpecificationExample,a.DuplicateSpecificationAssignment,a.InvalidReactionBatchesDeclaration,a.DescribedCommandNotImplemented,a.DescribedCommandWithoutProductions,a.DescribedCommandCardinalityNotAdmitted,a.CommandHandlerRequiresAttachment,a.PendingIntentWithOtherHandler,a.DuplicateEventInProjectionScope,a.ReservedStoredName]),I=/* @__PURE__ */ new Set([a.InvalidPurposeDeclaration,a.InvalidPurposeVocabulary,a.DuplicatePurposeField,a.DuplicatePurposeDeclaration,a.UnknownPurpose,a.PurposeInterestMismatch,a.PersonalDataWithoutPurpose,a.SpecialDataWithoutCondition,a.CriminalDataWithoutAuthorization,a.PurposeWithoutBasis,a.UnusedPurpose,a.UnknownConceptDirective,a.AttributeReasonWithoutAttribute,a.DuplicateAttributeReason,a.LegacyComplianceMarker,a.DuplicateComplianceMarker,a.UnknownComplianceMarker,a.InvalidSecretScope,a.DuplicateSecretScope,a.SecretScopeIgnoredForPii,a.InvalidPersonalDataQualifier,a.DuplicateSpecialCategory]),L=/* @__PURE__ */ new Set;for(let e of u.compilerDiagnostics??S.diagnostics){let t=e.code===a.UnknownType&&(S.identityDetails??[]).some(t=>t.line===e.location.line-1),n=e.code===a.RepeatedSingularDeclarationAcrossFiles&&e.message.includes(`identity block`);if(!(e.code===a.DuplicateDeclaration&&e.message.startsWith(`Duplicate declaration of policy `))&&!t&&!n&&!O.has(e.code)&&!k.has(e.code)&&!I.has(e.code)&&!A.has(e.code)&&!j.has(e.code)&&!M.has(e.code)&&!N.has(e.code)&&!P.has(e.code)&&!F.has(e.code)&&e.code!==a.ReducerIdentityMismatch&&e.code!==a.InvalidSpecificationExampleBody&&e.code!==a.UnknownRuleImplementationDirective&&e.code!==a.InvalidValidationRule&&e.code!==a.RepeatedDeclarationAcrossFiles&&!/^PLAY049[0-9]$|^PLAY050[0-7]$|^PLAY054[7-9]$|^PLAY055[01]$|^PLAY048[2-9]$|^PLAY004[56]$|^PLAY053[0-9]$|^PLAY054[0-6]$|^PLAY034[1-8]$|^PLAY0557$|^PLAY060[7-9]$|^PLAY061[0-9]$|^PLAY0620$|^PLAY062[1-9]$|^PLAY063[0-9]$|^PLAY064[0-9]$|^PLAY065[0-2]$|^PLAY065[4-6]$|^PLAY066[0-6]$|^PLAY072[0-2]$/.test(e.code))continue;let r=e.location.line-1;if(e.code===a.OmittedProductionDestination&&D.some(t=>t.code===e.code&&t.line===r))continue;if(e.code===a.UnknownEvent){if(L.has(r))continue;L.add(r)}let i=o(s[r],e)||s[r].length-e.location.column+1;D.push(issue(e.severity,r,e.location.column,i,e.message,e.code))}let checkEvent=(e,t,n)=>{!T.has(n)&&!L.has(e)&&D.push(tokenIssue(`warning`,e,t,n,`Unknown event type '${n}' — declare it in a slice or import it.`,y.unknownEvent))},R=-1;for(let a=0;a<s.length;a++){let o=s[a],c=o.trim();if(d[a]||c.length===0)continue;let u=o.match(/^[ ]*(\t+)/);if(u&&D.push(issue(`warning`,a,u[0].length-u[1].length+1,u[1].length,`Screenplay is indentation-based — use spaces, not tabs.`,y.tabIndentation)),R>=0){if(l(o)>R&&/^(?:or\s+)?[A-Z]\w*(?:\s+or\s+[A-Z]\w*)*$/.test(c)){for(let e of c.split(/\s+/).filter(e=>e!==`or`))E.has(e)||D.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy));continue}R=-1}let f=validateImport(s,d,a);f&&D.push(f);let p=c.match(/^slice\s+(\w+)/);p&&!i.includes(p[1])&&D.push(tokenIssue(`error`,a,o,p[1],`Unknown slice type '${p[1]}' — expected ${i.join(`, `)}.`,y.unknownSliceType));let m=c.match(/^concept\s+\w+\s*:\s*(\w+)/);m&&m[1]!==`Enum`&&!r.includes(m[1])&&D.push(tokenIssue(`error`,a,o,m[1],`Unknown primitive type '${m[1]}' — expected ${r.join(`, `)} or Enum.`,y.unknownPrimitiveType));let h=c.match(/^authorize\s+(.*)$/);if(h){R=l(o);for(let e of h[1].split(/\s+/).filter(e=>e!==`or`&&e.length>0))E.has(e)||D.push(tokenIssue(`warning`,a,o,e,`Unknown policy '${e}' — declare it with 'policy ${e}'.`,y.unknownPolicy))}let g=c.match(/^on\s+([A-Z]\w*)\s*$/);g&&checkEvent(a,o,g[1]);let _=c.match(/^produces\s+([A-Z]\w*)\s*$/);if(_&&!S.operationProductionLines?.has(a)&&checkEvent(a,o,_[1]),/^produces\s+when\b/.test(c)&&!S.operationProductionLines?.has(a))for(let e=a+1;e<s.length;e++){let t=s[e];if(!(d[e]||t.trim().length===0)){if(l(t)>l(o)){let n=t.trim().match(/^([A-Z]\w*)\s*$/);n&&checkEvent(e,t,n[1])}break}}let v=c.match(/^unique\s+event\s+([A-Z]\w*)/);v&&checkEvent(a,o,v[1]);let b=c.match(/^unique\s+[a-z_]\w*\s+on\s+([A-Z]\w*)/);b&&checkEvent(a,o,b[1]);for(let e of o.match(/\$identity\.[\w.]+/g)??[]){let t=e.substring(10).split(`.`)[0],r=[...n,...(S.identityDetails??[]).map(e=>e.name)];r.includes(t)||D.push(tokenIssue(`warning`,a,o,e,`Unknown $identity property '${t}' — expected ${r.join(`, `)}.`,y.unknownContextIdentityProperty))}for(let r of o.match(/\$context\.[\w.]+/g)??[]){let i=r.substring(9).split(`.`);t.includes(i[0])?i[0]===`causedBy`&&i.length>1&&!e.includes(i[1])?D.push(tokenIssue(`warning`,a,o,r,`Unknown $context.causedBy property '${i[1]}' — expected ${e.join(`, `)}.`,y.unknownContextCausedByProperty)):i[0]===`identity`&&i.length>1&&!n.includes(i[1])&&D.push(tokenIssue(`warning`,a,o,r,`Unknown $context.identity property '${i[1]}' — expected ${n.join(`, `)}.`,y.unknownContextIdentityProperty)):D.push(tokenIssue(`warning`,a,o,r,`Unknown $context path '${i.join(`.`)}' — expected one of ${t.join(`, `)}.`,y.unknownContextPath))}}D.push(...validateEventContextPaths(s,d)),D.push(...b(s,w,g,S.operationProductionLines));let z=s.map((e,t)=>({line:e,index:t})).filter(({line:e})=>/^\s*```(?:[a-z]+)?\s*$/.test(e));if(z.length%2==1){let e=z[z.length-1];D.push(issue(`error`,e.index,1,e.line.length+1,"Unclosed inline code block — expected a closing ``` line.",y.unclosedCodeBlock))}return D}function validateProductionDestinations(e,t){let n=[];e=u(e);for(let r of t.commands){let t=r.properties.filter(e=>e.isIdentifier&&!g(e).isOptional&&!g(e).isCollection);if(t.length===1)for(let i of r.produces??[]){if(i.inline||i.conditional||i.target!==void 0)continue;let r=i.line;n.push(issue(`information`,r,l(e[r])+1,e[r].trim().length,`Plain 'produces ${i.name}' omits its destination — use 'for ${t[0].name}' to explicitly select the command's identifier.`,y.omittedProductionDestination))}}return n}function validateImport(e,t,n){let r=e[n],i=r.trim().replace(/\s*\/\/.*$/,``);if(!/^import\b/.test(i)||x(r,n))return;let a=l(r);if(a>0&&[`module`,`feature`].includes(s(e,t,n,a)[0])||S(r))return issue(`error`,n,a+1,i.length,`Invalid import '${i}' — inside a module or feature, import names files: 'import "<path or glob>"'.`,y.invalidFileImport)}const C=/^(?:(?:increment|decrement|count|clear|add|subtract|set)\s+)?@?([$\w.]+)(?=\s|=|$)/;function validateEventContextPaths(e,t){let n=[],names=e=>e.map(e=>e.name).join(`, `);for(let r=0;r<e.length;r++){let i=e[r];if(t[r])continue;for(let e of i.matchAll(/(\.)?\$eventContext((?:\.(?:\w+(?:\(\))?)?)*)/g)){let t=e[0].substring(e[1]?.length??0),i=e[2];if(i.length===0){e[1]&&n.push(issue(`error`,r,(e.index??0)+2,t.length,`'$eventContext' names no member - expected one of ${names(d(``).expected)}.`,y.missingEventContextPath));continue}let a=i.substring(1),o=d(a),s=(e.index??0)+(e[1]?.length??0)+1;switch(o.status){case`missing`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' names no member - expected one of ${names(o.expected)}.`,y.missingEventContextPath));break;case`unknownMember`:n.push(issue(`warning`,r,s,t.length,`Unknown event context member '${o.segment}' in '$eventContext.${a}' - expected one of ${names(o.expected)}.`,y.unknownEventContextMember));break;case`unknownSubPath`:{let e=o.expected.length===0?`no members to address`:`members ${names(o.expected)}`;n.push(issue(`warning`,r,s,t.length,`Unknown event context path '$eventContext.${a}' - '${o.member?.name}' (${o.member?.type}) has ${e}.`,y.unknownEventContextPath));break}case`belowCollection`:n.push(issue(`error`,r,s,t.length,`'$eventContext.${a}' cannot resolve - '${o.member?.name}' is a collection (${o.member?.type}) and cannot be addressed below.`,y.eventContextPathBelowCollection))}}let a=i.trim().match(C)?.[1],o=a?.match(/\.\$(\w+)/)?.[1];a&&o&&o!==`eventContext`&&n.push(tokenIssue(`warning`,r,i,a,`Dynamic dictionary key '$${o}' in '${a}' is never resolved - only '$eventContext.<path>' is, so the literal text '$${o}' becomes the key.`,y.unresolvedDynamicKeySource))}return n}export{validateEventContextPaths,validateLines};
|
|
3
3
|
//# sourceMappingURL=validation.js.map
|