UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

18 lines 978 B
import { NonterminalKind } from '@nomicfoundation/slang/cst'; import addCollectionNodeFirstComment from './add-collection-node-first-comment.js'; import addCollectionNodeLastComment from './add-collection-node-last-comment.js'; export default function handleBlockComments({ precedingNode, enclosingNode, followingNode, comment }) { if ((enclosingNode === null || enclosingNode === void 0 ? void 0 : enclosingNode.kind) !== NonterminalKind.Block) { return false; } if ((precedingNode === null || precedingNode === void 0 ? void 0 : precedingNode.kind) === NonterminalKind.Statements) { addCollectionNodeLastComment(precedingNode, comment); return true; } if ((followingNode === null || followingNode === void 0 ? void 0 : followingNode.kind) === NonterminalKind.Statements) { addCollectionNodeFirstComment(followingNode, comment); return true; } return false; } //# sourceMappingURL=handle-block-comments.js.map