Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/dbml-parse/src/lib/parser/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
AttributeNode,
BlockExpressionNode,
CallExpressionNode,
DummyNode,
ElementDeclarationNode,
ExpressionNode,
FunctionApplicationNode,
Expand Down Expand Up @@ -167,7 +168,7 @@ function markInvalidNode(node: SyntaxNode) {
markInvalid(node.literal);
} else if (node instanceof GroupExpressionNode) {
throw new Error('This case is handled by the TupleExpressionNode case');
} else {
} else if (!(node instanceof DummyNode)) {
throw new Error('Unreachable case in markInvalidNode');
}
}
Expand Down Expand Up @@ -270,10 +271,15 @@ export function getMemberChain(node: SyntaxNode): Readonly<(SyntaxNode | SyntaxT
)
}

if (node instanceof DummyNode) {
return [];
}

if (node instanceof GroupExpressionNode) {
throw new Error('This case is already handled by TupleExpressionNode');
}


throw new Error('Unreachable - no other possible cases');
}

Expand Down