solidity-antlr4
Version:
Solidity Lang Lexer and Parser by official ANTLR4 grammar
23 lines (22 loc) • 556 B
JavaScript
import { BaseNodeString } from "../base.js";
export class ElementaryTypeName extends 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();
}
}