public void Visit(NodeRet ret)
 {
     throw new NotImplementedException();
 }
 public void Visit(NodeRet ret)
 {
     log.Error(ret.Span, "Return statement is not valid in this placement. Perhaps you meant to put it in a function?");
 }
Exemple #3
0
        public void Visit(NodeRet ret)
        {
            if (ret.IsVoidRet)
            {
                if (!currentFn.ty.IsVoid)
                    log.Error(ret.Span, "Cannot return void from a function that returns {0}.", currentFn.ty.returnTy);
                return;
            }
            else if (currentFn.ty.IsVoid)
            {
                log.Error(ret.Span, "Cannot return a value from a function that returns void.");
                return;
            }

            ret.value.Accept(this);
            var ty = Pop();

            if (ty != currentFn.ty.returnTy.Raw)
                log.Error(ret.Span, "Type mismatch: Cannot convert from {0} to {1}.", ty, currentFn.ty.returnTy);
        }
Exemple #4
0
 public void Visit(NodeRet ret)
 {
     ret.value.Accept(this);
     var result = Pop().value;
     BuildRet(builder, result);
 }
Exemple #5
0
 public void Visit(NodeRet ret)
 {
 }
Exemple #6
0
 public void Visit(NodeRet ret)
 {
     ret.value.Accept(this);
 }
Exemple #7
0
 public void Visit(NodeRet ret)
 {
     Write("'ret'");
     if (!ret.IsVoidRet)
     {
         Write(" ");
         ret.value.Accept(this);
     }
 }