UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

19 lines 783 B
import { NonterminalKind } from '@nomicfoundation/slang/cst'; import { getNodeMetadata, updateMetadata } from '../slang-utils/metadata.js'; import { Identifier } from './Identifier.js'; import { Expression } from './Expression.js'; export class NamedArgument { constructor(ast, options) { this.kind = NonterminalKind.NamedArgument; let metadata = getNodeMetadata(ast); this.name = new Identifier(ast.name); this.value = new Expression(ast.value, options); metadata = updateMetadata(metadata, [this.value]); this.comments = metadata.comments; this.loc = metadata.loc; } print(path, print) { return [path.call(print, 'name'), ': ', path.call(print, 'value')]; } } //# sourceMappingURL=NamedArgument.js.map