UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

23 lines 923 B
import { NonterminalKind } from '@nomicfoundation/slang/cst'; import { extractVariant } from '../slang-utils/extract-variant.js'; import { SlangNode } from './SlangNode.js'; import { IdentifierPath } from './IdentifierPath.js'; import { ArgumentsDeclaration } from './ArgumentsDeclaration.js'; export class RevertStatement extends SlangNode { constructor(ast, collected, options) { super(ast, collected); this.kind = NonterminalKind.RevertStatement; this.error = new IdentifierPath(ast.error, collected); this.arguments = extractVariant(new ArgumentsDeclaration(ast.arguments, collected, options)); this.updateMetadata(this.error, this.arguments); } print(path, print) { return [ 'revert ', path.call(print, 'error'), path.call(print, 'arguments'), ';' ]; } } //# sourceMappingURL=RevertStatement.js.map