Implement main-thread Camino sessions and synchronous CRDT editing
This commit is contained in:
@@ -316,6 +316,7 @@ const lowerValueType = (state: LoweringState, context: ValueTypeContext | null):
|
||||
throw new Error("Missing value type after a successful parse");
|
||||
}
|
||||
if (
|
||||
context.VARIANT() ||
|
||||
context.REF() ||
|
||||
context.typeArguments() ||
|
||||
(context.identifier() && !context.ATOM_REF() && !context.INTERFACE_REF())
|
||||
@@ -1658,6 +1659,13 @@ const lowerPackage = (
|
||||
const operation = exportContext.packageOperationExport();
|
||||
const generic = operation ?? exportContext.packageFunctionExport();
|
||||
if (generic?.typeParameters()) {
|
||||
if (generic.preparationClause())
|
||||
loweringIssue(
|
||||
state,
|
||||
generic,
|
||||
"unsupported-generic-preparation",
|
||||
"Creation preparation currently requires a closed export",
|
||||
);
|
||||
if (generic.acceptanceClause())
|
||||
loweringIssue(
|
||||
state,
|
||||
@@ -1689,6 +1697,19 @@ const lowerPackage = (
|
||||
// Resolve after all exports have been declared, so checks can follow bodies.
|
||||
for (const source of context.packageExport()) {
|
||||
const declaration = source.packageOperationExport() ?? source.packageFunctionExport();
|
||||
const preparation = declaration?.preparationClause();
|
||||
if (declaration && preparation && !declaration.typeParameters()) {
|
||||
const entry = exports.find((entry) => entry.displayName === identifier(declaration.identifier()));
|
||||
const port = entry?.dependencyPorts.find((port) => port.displayName === identifier(preparation.identifier()));
|
||||
if (!entry || port?.requirement.kind !== "creation")
|
||||
loweringIssue(
|
||||
state,
|
||||
preparation,
|
||||
"invalid-creation-preparation",
|
||||
"Preparation must name a creation port of this export",
|
||||
);
|
||||
else entry.preparation = { port: port.id, key: stringValue(preparation.stringLiteral()) };
|
||||
}
|
||||
const clause = declaration?.acceptanceClause();
|
||||
if (!declaration || !clause || declaration.typeParameters()) continue;
|
||||
const entry = exports.find((entry) => entry.displayName === identifier(declaration.identifier()));
|
||||
|
||||
Reference in New Issue
Block a user