UNPKG

prettier-plugin-solidity

Version:

A Prettier Plugin for automatically formatting your Solidity code.

18 lines 740 B
import { NonterminalKind } from '@nomicfoundation/slang/cst'; import { getNodeMetadata, updateMetadata } from '../slang-utils/metadata.js'; import { VersionLiteral } from './VersionLiteral.js'; export class VersionRange { constructor(ast) { this.kind = NonterminalKind.VersionRange; let metadata = getNodeMetadata(ast); this.start = new VersionLiteral(ast.start); this.end = new VersionLiteral(ast.end); metadata = updateMetadata(metadata, [this.start, this.end]); this.comments = metadata.comments; this.loc = metadata.loc; } print(path, print) { return [path.call(print, 'start'), ' - ', path.call(print, 'end')]; } } //# sourceMappingURL=VersionRange.js.map