UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

21 lines 843 B
import { NonterminalKind } from '@nomicfoundation/slang/cst'; import { getNodeMetadata, updateMetadata } from '../slang-utils/metadata.js'; import { CatchClauseError } from './CatchClauseError.js'; import { Block } from './Block.js'; export class CatchClause { constructor(ast, options) { this.kind = NonterminalKind.CatchClause; let metadata = getNodeMetadata(ast); if (ast.error) { this.error = new CatchClauseError(ast.error, options); } this.body = new Block(ast.body, options); metadata = updateMetadata(metadata, [this.error, this.body]); this.comments = metadata.comments; this.loc = metadata.loc; } print(path, print) { return ['catch ', path.call(print, 'error'), path.call(print, 'body')]; } } //# sourceMappingURL=CatchClause.js.map