public bool SetValue(string symbol, RuntimeValueNode value) { if (!Values.ContainsKey(symbol)) { return(Parent?.SetValue(symbol, value) == true); } Values[symbol] = value; return(true); }
private RuntimeBoolValueNode WrapBool(bool b, RuntimeValueNode referenceNode) { return(new RuntimeBoolValueNode( new Parser.Syntax.Expressions.Nodes.Value.BoolValueNode( referenceNode.DefiningToken, b ), referenceNode.RuntimeScope )); }
public static RuntimeNode Create(Node node, RuntimeScope scope) { RuntimeNode n; if ((n = RuntimeValueNode.Create(node, scope)) != null) { return(n); } if ((n = RuntimeOperator.Create(node, scope)) != null) { return(n); } if ((n = RuntimeSymbolNode.Create(node, scope)) != null) { return(n); } if ((n = RuntimeScopeNode.Create(node, scope)) != null) { return(n); } return(null); // todo handle this case property (exception?) }