-
Notifications
You must be signed in to change notification settings - Fork 85
Expand file tree
/
Copy pathYulParameters.ts
More file actions
31 lines (22 loc) · 932 Bytes
/
YulParameters.ts
File metadata and controls
31 lines (22 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import { NonterminalKind } from '@nomicfoundation/slang/cst';
import { printSeparatedList } from '../slang-printers/print-separated-list.js';
import { getNodeMetadata } from '../slang-utils/metadata.js';
import { YulIdentifier } from './YulIdentifier.js';
import type * as ast from '@nomicfoundation/slang/ast';
import type { AstPath, Doc } from 'prettier';
import type { PrintFunction, SlangNode } from '../types.d.ts';
export class YulParameters implements SlangNode {
readonly kind = NonterminalKind.YulParameters;
comments;
loc;
items: YulIdentifier[];
constructor(ast: ast.YulParameters) {
const metadata = getNodeMetadata(ast, true);
this.items = ast.items.map((item) => new YulIdentifier(item));
this.comments = metadata.comments;
this.loc = metadata.loc;
}
print(path: AstPath<YulParameters>, print: PrintFunction): Doc {
return printSeparatedList(path.map(print, 'items'));
}
}