UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

16 lines 589 B
import { doc } from 'prettier'; import { printSeparatedItem } from '../common/printer-helpers.js'; const { group, indent, line } = doc.builders; const printBody = (node, path, print) => node.body.type === 'Block' ? [' ', path.call(print, 'body'), ' '] : group([indent([line, path.call(print, 'body')]), line]); export const DoWhileStatement = { print: ({ node, path, print }) => [ 'do', printBody(node, path, print), 'while (', printSeparatedItem(path.call(print, 'condition')), ');' ] }; //# sourceMappingURL=DoWhileStatement.js.map