prettier-plugin-solidity
Version:
A Prettier Plugin for automatically formatting your Solidity code.
25 lines • 930 B
JavaScript
import { NonterminalKind } from '@nomicfoundation/slang/cst';
import { getNodeMetadata, updateMetadata } from '../slang-utils/metadata.js';
import { Identifier } from './Identifier.js';
import { ElementaryType } from './ElementaryType.js';
export class UserDefinedValueTypeDefinition {
constructor(ast) {
this.kind = NonterminalKind.UserDefinedValueTypeDefinition;
let metadata = getNodeMetadata(ast);
this.name = new Identifier(ast.name);
this.valueType = new ElementaryType(ast.valueType);
metadata = updateMetadata(metadata, [this.valueType]);
this.comments = metadata.comments;
this.loc = metadata.loc;
}
print(path, print) {
return [
'type ',
path.call(print, 'name'),
' is ',
path.call(print, 'valueType'),
';'
];
}
}
//# sourceMappingURL=UserDefinedValueTypeDefinition.js.map