Exemplo n.º 1
0
 private GSCore ExecuteElementWithoutreport(GSCore E)
 {
     if (E is GSList)
     {
         GSList L = (GSList)E;
         if (L.Count == 0)
         {
             return(GSCore.Void);
         }
         else if (L.Count == 1)
         {
             return(ExecuteElement(L[0]));
         }
         else
         {
             if (L.Parts.IsFirstToken())
             {
                 GSCore res = null;
                 try
                 {
                     res = ExecuteMessage(L.Parts.getFirstToken(),
                                          L.Parts.getSublist(1));
                 }
                 catch
                 {
                     res = new GSString();
                 }
                 finally
                 {
                 }
                 return(res);
             }
             else
             {
                 GSCore result = null;
                 foreach (GSCore item in L.Parts)
                 {
                     result = ExecuteElement(item);
                     if (result is GSReturn)
                     {
                         break;
                     }
                 }
                 if (result == null)
                 {
                     return(new GSString());
                 }
                 return(result);
             }
         }
     }
     else if (E is GSToken)
     {
         return(EvaluateProperty(((GSToken)E).Token));
     }
     else
     {
         return(E);
     }
 }
Exemplo n.º 2
0
 public override GSCore GetPropertyValue(string s)
 {
     if (s.Equals("length"))
     {
         return(new GSNumber()
         {
             IntegerValue = Value.Length
         });
     }
     if (s.Equals("lower"))
     {
         GSString str = new GSString();
         str.Value = Value.ToLower();
         return(str);
     }
     if (s.Equals("upper"))
     {
         GSString str = new GSString();
         str.Value = Value.ToUpper();
         return(str);
     }
     return(base.GetPropertyValue(s));
 }