Skip to content

Commit e264ae8

Browse files
fix: animation subtree grammar check
1 parent 0011cda commit e264ae8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@molstar/molstar-components",
3-
"version": "0.6.0-experimental.25",
3+
"version": "0.6.0-experimental.26",
44
"license": "MIT",
55
"exports": {
66
".": "./src/mod.ts",

src/state-builder/compiler/ast/factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ export class ASTFactory {
112112
for (const child of children) {
113113
// TODO: animation is a separate MVSAnimationSchema tree in the real molstar API (a sibling to the
114114
// scene tree, not a child of root). The compiler currently treats it as a child of root as a
115-
// workaround — skip schema grammar validation for it until that is properly restructured.
116-
if (isValidNodeStructure(child) && child.kind !== 'animation' && isValidMVSKind(child.kind) && !canHaveChild(kind, child.kind)) {
115+
// workaround — skip schema grammar validation for the entire animation subtree until restructured.
116+
if (isValidNodeStructure(child) && (kind as string) !== 'animation' && child.kind !== 'animation' && isValidMVSKind(child.kind) && !canHaveChild(kind, child.kind)) {
117117
throw new ASTError(
118118
`Invalid parent-child relationship: "${child.kind}" cannot be a child of "${kind}"`,
119119
node,

0 commit comments

Comments
 (0)