Ejemplo n.º 1
0
        public Value GetProperty(string prop)
        {
            if (type == "FUNC")
            {
                if (function.InnerValues.ContainsKey(prop))
                {
                    return(function.InnerValues[prop].value);
                }
            }
            switch (prop)
            {
            case "length":
                return(InnerValue.length(this));

            default:
                return(NULL);
            }
        }
Ejemplo n.º 2
0
        public RTResult CallProperty(string prop, List <LToken> args, Context _context, TextPosition pos)
        {
            if (type == "FUNC")
            {
                if (function.InnerValues.ContainsKey(prop))
                {
                    return(function.InnerValues[prop].value.function.Execute(args, _context, pos));
                }
            }
            switch (prop)
            {
            case "Contains":
                return(InnerValue.Contains(this, args, _context, pos));

            case "ToString":
                return(InnerValue.toString(this, args, _context, pos));

            default:
                return(new RTResult().Failure(new RuntimeError(pos, prop + " in " + type + " is not a function.", _context)));
            }
        }