Skip to content

Commit 59862f3

Browse files
committed
test(psl-parser): drive parseAttributeArg through a wrapping node
parseAttributeArg builds into the cursor node stack and returns void on main; the member-access tests were written against its earlier GreenNode-returning signature. Wrap the call in an AttributeArgList node and extract the parsed AttributeArg child. Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
1 parent 5899fdc commit 59862f3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/1-framework/2-authoring/psl-parser/test/member-access-value.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,15 @@ function greenText(element: GreenElement): string {
1616

1717
function parseArg(source: string) {
1818
const cursor = new Cursor(source);
19-
const node = parseAttributeArg(cursor);
19+
cursor.startNode('AttributeArgList');
20+
parseAttributeArg(cursor);
21+
const list = cursor.finishNode();
22+
const node = list.children.find(
23+
(child): child is GreenNode => child.type === 'node' && child.kind === 'AttributeArg',
24+
);
25+
if (node === undefined) {
26+
throw new Error(`no AttributeArg parsed from ${JSON.stringify(source)}`);
27+
}
2028
return { node, diagnostics: cursor.diagnostics };
2129
}
2230

0 commit comments

Comments
 (0)