UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

19 lines 802 B
import { NonterminalKind } from '@nomicfoundation/slang/cst'; import { getNodeMetadata, updateMetadata } from '../slang-utils/metadata.js'; import { YulLiteral } from './YulLiteral.js'; import { YulBlock } from './YulBlock.js'; export class YulValueCase { constructor(ast, options) { this.kind = NonterminalKind.YulValueCase; let metadata = getNodeMetadata(ast); this.value = new YulLiteral(ast.value, options); this.body = new YulBlock(ast.body, options); metadata = updateMetadata(metadata, [this.value, this.body]); this.comments = metadata.comments; this.loc = metadata.loc; } print(path, print) { return ['case ', path.call(print, 'value'), ' ', path.call(print, 'body')]; } } //# sourceMappingURL=YulValueCase.js.map