prettier-plugin-solidity
Version:
A Prettier Plugin for automatically formatting your Solidity code.
27 lines • 1.05 kB
JavaScript
import { NonterminalKind } from '@nomicfoundation/slang/cst';
import { joinExisting } from '../slang-utils/join-existing.js';
import { extractVariant } from '../slang-utils/extract-variant.js';
import { SlangNode } from './SlangNode.js';
import { TypeName } from './TypeName.js';
import { TerminalNode } from './TerminalNode.js';
export class EventParameter extends SlangNode {
constructor(ast, options) {
var _a;
super(ast);
this.kind = NonterminalKind.EventParameter;
this.typeName = extractVariant(new TypeName(ast.typeName, options));
this.indexedKeyword = (_a = ast.indexedKeyword) === null || _a === void 0 ? void 0 : _a.unparse();
if (ast.name) {
this.name = new TerminalNode(ast.name);
}
this.updateMetadata(this.typeName);
}
print(path, print) {
return joinExisting(' ', [
path.call(print, 'typeName'),
this.indexedKeyword,
path.call(print, 'name')
]);
}
}
//# sourceMappingURL=EventParameter.js.map