Beispiel #1
0
        public bool AddDynamicValue(string key, Named.Value value)
        {
            foreach (var level in _payload)
            {
                if (level.ContainsKey(key))
                {
                    return(HandleDeclareConflict(level, key, value.Payload));
                }
            }

            _payload.Last().Add(key, value);

            return(true);
        }
Beispiel #2
0
        public static void AddDynamicNamedValue(NameTable names, string key, Named.Value value, string line)
        {
            Match match = Regex.Match(key, Patterns.getnewname);

            if (!match.Success)
            {
                throw new FormatException("No valid variable name in the phrase: \"" + line.Trim() + "\".");
            }

            if (!names.AddDynamicValue(match.Value, value))
            {
                throw new Exception("Name Conflict: The name \"" + key
                                    + "\" already exists in the variable list.");
            }
        }