Exemplo n.º 1
0
 public override bool getBooleanValue()
 {
     if (Value != null)
     {
         return(Value.getBooleanValue());
     }
     return(base.getBooleanValue());
 }
Exemplo n.º 2
0
        private GSCore execIf(GSCoreCollection args)
        {
            GSCore cond = ExecuteElement(args.getSafe(0));
            GSCore cmd1 = args.getSafe(1);
            GSCore cmd2 = args.getSafe(2);
            GSCore r    = null;

            if (cond.getBooleanValue())
            {
                bool running = false;
                foreach (GSCore cmd in args)
                {
                    if (cmd is GSToken && cmd.ToString().Equals("then"))
                    {
                        running = true;
                    }
                    if (cmd is GSToken && cmd.ToString().Equals("else"))
                    {
                        running = false;
                    }
                    if (running)
                    {
                        r = ExecuteElement(cmd);
                        if (r is GSReturn)
                        {
                            return(r);
                        }
                    }
                }
            }
            else
            {
                bool running = false;
                foreach (GSCore cmd in args)
                {
                    if (cmd is GSToken && cmd.ToString().Equals("else"))
                    {
                        running = true;
                    }
                    if (running)
                    {
                        r = ExecuteElement(cmd);
                        if (r is GSReturn)
                        {
                            return(r);
                        }
                    }
                }
            }

            return(cond);
        }