UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

21 lines 911 B
import { NonterminalKind } from '@nomicfoundation/slang/cst'; import { getNodeMetadata, updateMetadata } from '../slang-utils/metadata.js'; import { IdentifierPath } from './IdentifierPath.js'; import { ArgumentsDeclaration } from './ArgumentsDeclaration.js'; export class InheritanceType { constructor(ast, options) { this.kind = NonterminalKind.InheritanceType; let metadata = getNodeMetadata(ast); this.typeName = new IdentifierPath(ast.typeName); if (ast.arguments) { this.arguments = new ArgumentsDeclaration(ast.arguments, options); } metadata = updateMetadata(metadata, [this.typeName, this.arguments]); this.comments = metadata.comments; this.loc = metadata.loc; } print(path, print) { return [path.call(print, 'typeName'), path.call(print, 'arguments')]; } } //# sourceMappingURL=InheritanceType.js.map