summaryrefslogtreecommitdiffstats
path: root/llparse-frontend/test/fixtures/a-implementation/node/single.ts
blob: d7bcc72546f86adf2a87a7630ce35c2938c9df6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { ContainerWrap, node } from '../../../../src/frontend';
import { Node } from './base';

export class Single extends Node<node.Single> {
  protected doBuild(out: string[]): void {
    const edges: string[] = [];
    for (const edge of this.ref.edges) {
      edges.push(`k${edge.key}${edge.noAdvance ? '-no_adv-' : ''}=` +
        `${edge.node.ref.id.name}`);
    }
    out.push(this.format(edges.join(' ')));

    for (const edge of this.ref.edges) {
      const edgeNode = edge.node as ContainerWrap<node.Node>;
      edgeNode.get<Node<node.Node>>('a').build(out);
    }
  }
}