UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

24 lines 951 B
import { NonterminalKind } from '@nomicfoundation/slang/cst'; import { getNodeMetadata, updateMetadata } from '../slang-utils/metadata.js'; import { ImportDeconstructionSymbols } from './ImportDeconstructionSymbols.js'; import { StringLiteral } from './StringLiteral.js'; export class ImportDeconstruction { constructor(ast, options) { this.kind = NonterminalKind.ImportDeconstruction; let metadata = getNodeMetadata(ast); this.symbols = new ImportDeconstructionSymbols(ast.symbols); this.path = new StringLiteral(ast.path, options); metadata = updateMetadata(metadata, [this.symbols, this.path]); this.comments = metadata.comments; this.loc = metadata.loc; } print(path, print) { return [ '{', path.call(print, 'symbols'), '} from ', path.call(print, 'path') ]; } } //# sourceMappingURL=ImportDeconstruction.js.map