Fix testing scripts for TARGET_JVM
[mono.git] / mcs / mbas / argument.cs
index 8c36e39f835ebbfd60872e204283c74a23eae2f3..9013630ba624ea7d4d6767fd625fedb11b2eb64d 100644 (file)
@@ -24,23 +24,32 @@ namespace Mono.MonoBASIC {
                public enum AType : byte {
                        Expression,
                        Ref,
-                       Out,
                        NoArg,
                        AddressOf
                };
 
                public AType ArgType;
                public Expression Expr;
+               public string ParamName;
                
                public Argument (Expression expr, AType type)
+                       : this ("", expr, type)
                {
+               }
+
+               public Argument (string paramName, Expression expr, AType type)
+               {
+                       this.ParamName = paramName;
+                       expr = Parser.SetValueRequiredFlag (expr);
+                       if (type == AType.AddressOf)
+                               expr = Parser.SetAddressOf (expr);
                        this.Expr = expr;
                        this.ArgType = type;
                }
 
                public Type Type {
                        get {
-                               if (ArgType == AType.Ref || ArgType == AType.Out)
+                               if (ArgType == AType.Ref )
                                        return TypeManager.LookupType (Expr.Type.ToString () + "&");
                                else
                                        return Expr.Type;
@@ -50,9 +59,6 @@ namespace Mono.MonoBASIC {
                public Parameter.Modifier GetParameterModifier ()
                {
                        switch (ArgType) {
-                       case AType.Out:
-                               return Parameter.Modifier.OUT | Parameter.Modifier.ISBYREF;
-
                        case AType.Ref:
                                return Parameter.Modifier.REF | Parameter.Modifier.ISBYREF;
 
@@ -63,8 +69,7 @@ namespace Mono.MonoBASIC {
 
                public static string FullDesc (Argument a)
                {
-                       return (a.ArgType == AType.Ref ? "ref " :
-                               (a.ArgType == AType.Out ? "out " : "")) +
+                       return (a.ArgType == AType.Ref ? "ref " : "") +
                                TypeManager.MonoBASIC_Name (a.Expr.Type);
                }
 
@@ -97,9 +102,7 @@ namespace Mono.MonoBASIC {
                                Expr = Expr.ResolveLValue (ec, Expr);
                        } else */
 
-                       if (ArgType == AType.Out)
-                               Expr = Expr.ResolveLValue (ec, new EmptyExpression ());
-                       else if (ArgType == AType.AddressOf) {
+                       if (ArgType == AType.AddressOf) {
                                Expression temp_expr = Expr;
                                
                                if (temp_expr is SimpleName) {
@@ -150,12 +153,12 @@ namespace Mono.MonoBASIC {
                public void Emit (EmitContext ec)
                {
                        //
-                       // Ref and Out parameters need to have their addresses taken.
+                       // Ref  parameters need to have their addresses taken.
                        //
                        // ParameterReferences might already be references, so we want
                        // to pass just the value
                        //
-                       if (ArgType == AType.Ref || ArgType == AType.Out){
+                       if (ArgType == AType.Ref ){
                                AddressOp mode = AddressOp.Store;
 
                                if (ArgType == AType.Ref)