UNPKG

solidity-antlr4

Version:

Solidity Lang Lexer and Parser by official ANTLR4 grammar

39 lines (38 loc) 1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PrinterType = void 0; var _base = require("./base.cjs"); class PrinterType extends _base.BasePrinter { printElementaryTypeName = ({ node }) => { const parts = [node.name]; if (node.name === "address" && node.payable) parts.push(this.space, "payable"); return parts; }; printFunctionTypeName; // TODO: implement in declaration.ts printMappingKeyType = ({ node }) => node.name; printMappingType = ({ path, print }) => { return ["mapping", this.tuple([path.call(print, "keyType"), this.space, "=>", this.space, path.call(print, "valueType")])]; }; printTypeName = args => { const { node, path, print } = args; if (node.type === "TypeName") { return [path.call(print, "baseType"), this.list(path.call(print, "expression"))]; } throw new Error("Unknown node type: " + node.type); }; } exports.PrinterType = PrinterType;