UNPKG

solidity-antlr4

Version:

Solidity Lang Lexer and Parser by official ANTLR4 grammar

19 lines (18 loc) 649 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ElementaryTypeName = void 0; var _base = require("../base.cjs"); class ElementaryTypeName extends _base.BaseNodeString { type = "ElementaryTypeName"; name; payable = false; constructor(ctx, visitor) { super(ctx, visitor); this.payable = !!ctx.Payable(); const types = [ctx.Address(), ctx.Bool(), ctx.String(), ctx.Bytes(), ctx.SignedIntegerType(), ctx.UnsignedIntegerType(), ctx.FixedBytes(), ctx.Fixed(), ctx.Ufixed()]; this.name = types.find(t => !!t)?.getText() ?? ctx.getText(); } } exports.ElementaryTypeName = ElementaryTypeName;