public override void EnterRet(LatteParser.RetContext context) { var func = _environment.CurrentFunction; var exprType = new ExpressionTypeVisitor().Visit(context.expr()); if (!func.Type.Equals(exprType)) { _errorState.AddErrorMessage(new ErrorMessage( context.start.Line, context.start.Column, ErrorMessages.WrongReturn( exprType.ToString(), func.Type.ToString(), func.Id))); } }
public Ret(LatteParser.RetContext context) { Expr = Exprs.Utils.ExprFromExprContext(context.expr()); }