Esempio n. 1
0
        public override string VisitFunctionTypeExpr(AstFunctionTypeExpr type, int data = 0)
        {
            string fn   = type.IsFatFunction ? "Fn" : "fn";
            var    args = string.Join(", ", type.ParameterTypes.Select(p => p.Accept(this)));

            if (type.ReturnType != null)
            {
                return($"{fn}({args}) -> {type.ReturnType.Accept(this)}");
            }
            else
            {
                return($"{fn}({args})");
            }
        }
Esempio n. 2
0
 public virtual ReturnType VisitFunctionTypeExpr(AstFunctionTypeExpr type, DataType data   = default) => default;