UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

23 lines 820 B
import { NonterminalKind } from '@nomicfoundation/slang/cst'; import { SlangNode } from './SlangNode.js'; import { MappingKey } from './MappingKey.js'; import { MappingValue } from './MappingValue.js'; export class MappingType extends SlangNode { constructor(ast, collected, options) { super(ast, collected); this.kind = NonterminalKind.MappingType; this.keyType = new MappingKey(ast.keyType, collected); this.valueType = new MappingValue(ast.valueType, collected, options); this.updateMetadata(this.keyType, this.valueType); } print(path, print) { return [ 'mapping(', path.call(print, 'keyType'), ' => ', path.call(print, 'valueType'), ')' ]; } } //# sourceMappingURL=MappingType.js.map