UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

19 lines 783 B
import { doc } from 'prettier'; import { NonterminalKind } from '@nomicfoundation/slang/cst'; import { getNodeMetadata, updateMetadata } from '../slang-utils/metadata.js'; import { YulSwitchCase } from './YulSwitchCase.js'; const { hardline, join } = doc.builders; export class YulSwitchCases { constructor(ast, options) { this.kind = NonterminalKind.YulSwitchCases; let metadata = getNodeMetadata(ast, true); this.items = ast.items.map((item) => new YulSwitchCase(item, options)); metadata = updateMetadata(metadata, [this.items]); this.comments = metadata.comments; this.loc = metadata.loc; } print(path, print) { return join(hardline, path.map(print, 'items')); } } //# sourceMappingURL=YulSwitchCases.js.map