Ejemplo n.º 1
0
        static ParserFunction GetRegisteredAction(string name, ParsingScript script, ref string action)
        {
            if (Constants.CheckReserved(name))
            {
                return(null);
            }

            if (ActionForUndefined(action) && script.Rest.StartsWith(Constants.UNDEFINED))
            {
                IsUndefinedFunction undef = new IsUndefinedFunction(name, action);
                return(undef);
            }

            ActionFunction actionFunction = GetAction(action);

            // If passed action exists and is registered we are done.
            if (actionFunction == null)
            {
                return(null);
            }

            ActionFunction theAction = actionFunction.NewInstance() as ActionFunction;

            theAction.Name   = name;
            theAction.Action = action;

            action = null;
            return(theAction);
        }
Ejemplo n.º 2
0
 public static void AddAction(string name, ActionFunction action)
 {
     s_actions[name] = action;
 }