Ejemplo n.º 1
0
        public static async Task <IBifoqlObject> Join(Location location, QueryContext context, IBifoqlString glue, IBifoqlArrayInternal stringList)
        {
            var strings = new List <string>();

            foreach (var s in stringList)
            {
                var str = await s() as IBifoqlString;

                if (str == null)
                {
                    return(new AsyncError(location, "Each member of join's string list must be a string"));
                }

                strings.Add(await str.Value);
            }

            var glueStr = await glue.Value;

            return(new AsyncString(string.Join(glueStr, strings)));
        }
Ejemplo n.º 2
0
        public static async Task <IBifoqlObject> ToNumber(Location location, QueryContext context, IBifoqlString str)
        {
            double dbl;

            if (double.TryParse(await str.Value, out dbl))
            {
                return(new AsyncNumber(dbl));
            }
            else
            {
                return(new AsyncError(location, "Can't convert string into number"));
            }
        }
Ejemplo n.º 3
0
 private static async Task <object> ToSimpleObject(IBifoqlString str)
 {
     return(await str.Value);
 }