UNPKG

@adamsy/bhai-lang

Version:

<h1 align="center">Bhai Lang</h1> <p align="center"> <a href="https://lgtm.com/projects/g/DulLabs/bhai-lang/alerts/"><img alt="Total alerts" src="https://img.shields.io/lgtm/alerts/g/DulLabs/bhai-lang.svg?logo=lgtm&logoWidth=18"/></a> <a href="https://lgt

19 lines (15 loc) 608 B
import Visitor from "."; import { ASTNode } from "bhai-lang-parser"; import InvalidStateException from "../../exceptions/invalidStateException"; import InterpreterModule from "../../module/interpreterModule"; export default class VariableStatement implements Visitor { visitNode(node: ASTNode) { if (!node.declarations) throw new InvalidStateException( `variable declarations in variable statement is not present: ${node.declarations}` ); node.declarations.forEach((declaration) => { InterpreterModule.getVisitor(declaration.type).visitNode(declaration); }); } }