UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

25 lines 995 B
import { NonterminalKind } from '@nomicfoundation/slang/cst'; import { getNodeMetadata, updateMetadata } from '../slang-utils/metadata.js'; import { joinExisting } from '../slang-utils/join-existing.js'; import { StorageLocation } from './StorageLocation.js'; import { Identifier } from './Identifier.js'; export class UntypedTupleMember { constructor(ast) { this.kind = NonterminalKind.UntypedTupleMember; let metadata = getNodeMetadata(ast); if (ast.storageLocation) { this.storageLocation = new StorageLocation(ast.storageLocation); } this.name = new Identifier(ast.name); metadata = updateMetadata(metadata, [this.storageLocation]); this.comments = metadata.comments; this.loc = metadata.loc; } print(path, print) { return joinExisting(' ', [ path.call(print, 'storageLocation'), path.call(print, 'name') ]); } } //# sourceMappingURL=UntypedTupleMember.js.map