Ejemplo n.º 1
0
 public ValueState(ParserContext context, ParserNamedParameter param, bool isGlobal, AbstractState returnState)
     : base(context)
 {
     _param = param;
     _isGlobal = isGlobal;
     _returnState = returnState;
 }
Ejemplo n.º 2
0
        public ParserNamedParameter AddNamedParameter(string key, bool isBool = false)
        {
            var param = new ParserNamedParameter(key, isBool);

            // TODO - check for duplicates

            _namedParameters.Add(param);

            return param;
        }
Ejemplo n.º 3
0
        public void CanPushString()
        {
            ParserParameter param = new ParserNamedParameter("Name", false);
            ParseResult result = new ParseResult();
            result.AddCommandValue(param, "value");

            var pusher = new CommandPusher(result);

            var command = new StringCommand();

            pusher.Push(command);

            command.Name.ShouldBe("value");
        }
Ejemplo n.º 4
0
        public void CanPushBool()
        {
            ParserParameter param = new ParserNamedParameter("Add", true);
            ParseResult result = new ParseResult();
            result.AddCommandValue(param, "true");

            var pusher = new CommandPusher(result);

            var command = new BoolCommand();

            pusher.Push(command);

            command.Add.ShouldBe(true);
        }