UNPKG

solidity-antlr4

Version:

Solidity Lang Lexer and Parser by official ANTLR4 grammar

18 lines (17 loc) 433 B
import { BaseNodeString } from "../base.js"; export class DataLocation extends BaseNodeString { type = "DataLocation"; name; constructor(ctx, visitor) { super(ctx, visitor); if (ctx.Storage()) { this.name = "storage"; } else if (ctx.Memory()) { this.name = "memory"; } else if (ctx.Calldata()) { this.name = "calldata"; } else { throw new Error("unknown data location"); } } }