Example #1
0
 public override bool beginsWithParen()
 {
     if (isMethodCall())
     {
         Expression obj = function.getTable();
         return(obj.isClosure() || obj.isConstant() || obj.beginsWithParen());
     }
     else
     {
         return(function.isClosure() || function.isConstant() || function.beginsWithParen());
     }
 }
Example #2
0
        public override void print(Output @out)
        {
            List <Expression> args = new List <Expression>(arguments.Length);

            if (isMethodCall())
            {
                Expression obj = function.getTable();
                if (obj.isClosure() || obj.isConstant())
                {
                    @out.print("(");
                    obj.print(@out);
                    @out.print(")");
                }
                else
                {
                    obj.print(@out);
                }
                @out.print(":");
                @out.print(function.getField());
                for (int i = 1; i < arguments.Length; i++)
                {
                    args.Add(arguments[i]);
                }
            }
            else
            {
                if (function.isClosure() || function.isConstant())
                {
                    @out.print("(");
                    function.print(@out);
                    @out.print(")");
                }
                else
                {
                    function.print(@out);
                }
                for (int i = 0; i < arguments.Length; i++)
                {
                    args.Add(arguments[i]);
                }
            }
            @out.print("(");
            Expression.printSequence(@out, args, false, true);
            @out.print(")");
        }