Skip to content

Commit cde913f

Browse files
committed
remove childrenOf
1 parent 2b44753 commit cde913f

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

packages/compiler/test/test-cstReader.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ import {CstNodeType} from '../../runtime/src/cstReader.ts';
55
import {createHandle} from '../../runtime/src/cstReaderShared.ts';
66
import {compileAndLoad, matchWithInput} from './_helpers.js';
77

8-
const childrenOf = (cst, handle) => {
9-
const arr = [];
10-
cst.forEachChild(handle, c => arr.push(c));
11-
return arr;
12-
};
138

149
test('root node basics', async t => {
1510
const g = await compileAndLoad('G { start = "ab" "cd" }');
@@ -337,7 +332,7 @@ const spaceMemoIgnored = test.macro(async (t, twoBody, input = '> xx') => {
337332
g.match(input).use(mr => {
338333
t.true(mr.succeeded());
339334
const cst = mr.cstView();
340-
const [two] = childrenOf(cst, cst.root);
335+
const two = cst.withChildren(cst.root, (_h, first) => first);
341336
const children = [];
342337
cst.forEachChild(two, (child, leadingSpacesLen) => {
343338
children.push({child, leadingSpacesLen, childStartIdx: cst.startIdx(child)});

0 commit comments

Comments
 (0)