GPL.Scope.Find C# (CSharp) Method

Find() public method

public Find ( string name, Value newval = null ) : Value
name string
newval Value
return Value
        public Value Find(string name, Value newval = null)
        {
            if (Variables.ContainsKey(name))
            {
                if (newval != null)
                    Variables[name] = newval;

                return Variables[name];
            }
            else
                if (Parent == null)
                    throw new KeyNotFoundException("Unknown variable: " + name);
                else
                    return Parent.Find(name, newval);
        }

Usage Example

Esempio n. 1
0
File: Name.cs Progetto: haasn/-g-pl
 public Value Evaluate(Scope scope)
 {
     return scope.Find(Identifier);
 }
All Usage Examples Of GPL.Scope::Find