Example #1
0
        private static ParserContext SetupFalsyContext(ParserContextBehavior behavior)
        {
            ParserContext context = new ParserContext(behavior);

            context.Set <object>("NullValue", null);
            context.Set <object>("RandomObject", new object());
            context.Set("EmptyString", "");
            context.Set("NonEmptyString", "x");

            return(context);
        }
Example #2
0
        public ParserContext(ParserContextBehavior behavior)
        {
            Behavior = behavior;

            if ((behavior & ParserContextBehavior.CaseInsensitiveVariables) == ParserContextBehavior.CaseInsensitiveVariables)
            {
                _variables = new Dictionary <string, object>(StringComparer.OrdinalIgnoreCase);
                _types     = new Dictionary <string, Type>(StringComparer.OrdinalIgnoreCase);
            }
            else
            {
                _variables = new Dictionary <string, object>();
                _types     = new Dictionary <string, Type>();
            }
        }
Example #3
0
 public CSharpContext(object rootObject, ParserContextBehavior behavior) : base(rootObject, behavior)
 {
     AddKeywords();
 }
Example #4
0
 public CSharpContext(ParserContextBehavior behavior) : base(behavior)
 {
     AddKeywords();
 }
Example #5
0
        private static ParserContext SetupFalsyContext(ParserContextBehavior behavior)
        {
            ParserContext context = new ParserContext(behavior);

            context.Set<object>("NullValue", null);
            context.Set<object>("RandomObject",new object());
            context.Set("EmptyString", "");
            context.Set("NonEmptyString", "x");

            return context;
        }
Example #6
0
 public CSharpContext(object rootObject, IDictionary <string, object> dic, ParserContextBehavior behavior) : base(rootObject, dic, behavior)
 {
     AddKeywords();
 }
Example #7
0
 public CSharpContext(object rootObject, ParserContextBehavior behavior)
     : base(rootObject, behavior)
 {
     AddKeywords();
 }
Example #8
0
 public CSharpContext(ParserContextBehavior behavior)
     : base(behavior)
 {
     AddKeywords();
 }
Example #9
0
 public CSharpContext(object rootObject, IDictionary<string, object> dic, ParserContextBehavior behavior) : base(rootObject, dic, behavior)
 {
     AddKeywords();
 }
Example #10
0
 private bool TestBehavior(ParserContextBehavior behavior)
 {
     return((Behavior & behavior) == behavior);
 }
Example #11
0
 public ParserContext(object rootObject, ParserContextBehavior behavior) : this(behavior)
 {
     _rootObject = rootObject;
 }
Example #12
0
        public ParserContext(object rootObject, IDictionary <string, object> dic, ParserContextBehavior behavior) : this(behavior)
        {
            _rootObject = rootObject;

            AddDictionary(dic);
        }
Example #13
0
 public ParserContext(IDictionary <string, object> dic, ParserContextBehavior behavior) : this(behavior)
 {
     AddDictionary(dic);
 }