protected function compileVariableDeclaration(CompiledExpression $variableName, CompiledExpression $value, Context $context) { switch ($variableName->getType()) { case CompiledExpression::STRING: break; default: $context->debug('Unexpected type of Variable name after compile'); return new CompiledExpression(); } $symbol = $context->getSymbol($variableName->getValue()); if ($symbol) { $symbol->modify($value->getType(), $value->getValue()); $context->modifyReferencedVariables($symbol, $value->getType(), $value->getValue()); } else { $symbol = new \PHPSA\Variable($variableName->getValue(), $value->getValue(), $value->getType(), $context->getCurrentBranch()); $context->addVariable($symbol); } $symbol->incSets(); }