Esempio n. 1
0
 public ValueState(ParserContext context, ParserNamedParameter param, bool isGlobal, AbstractState returnState)
     : base(context)
 {
     _param = param;
     _isGlobal = isGlobal;
     _returnState = returnState;
 }
Esempio 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;
        }
Esempio 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");
        }
Esempio 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);
        }