I'm in need of a few methods for manipulating the keys of an ArrayLookupNode:
popKey() should pop the last key off the array lookup and return it.
pushKey() should append a new key to the array lookup, lengthening it by one.
shiftKey() should remove the first key from the array lookup and return it.
unshiftKey() should prepend a new key to the array lookup, lengthening it by one.
Each of these methods should accept an ExpressionNode or a scalar value (which is converted with Node::fromValue).
I also need a setKey() method, to complement getKey(). setKey() should accept a numeric index and an ExpressionNode (or scalar value), and throw OutOfBoundsException if the key is an invalid index.
And finally, I need a setArray() method to complement getArray(). setArray() should accept an ExpressionNode only. The bugaboo here is that I'm not sure if I have to do something special if ExpressionNode is a function or method call, since that's technically an array deference. (Is there a specialized node type for that?)
I'm in need of a few methods for manipulating the keys of an ArrayLookupNode:
Each of these methods should accept an ExpressionNode or a scalar value (which is converted with Node::fromValue).
I also need a setKey() method, to complement getKey(). setKey() should accept a numeric index and an ExpressionNode (or scalar value), and throw OutOfBoundsException if the key is an invalid index.
And finally, I need a setArray() method to complement getArray(). setArray() should accept an ExpressionNode only. The bugaboo here is that I'm not sure if I have to do something special if ExpressionNode is a function or method call, since that's technically an array deference. (Is there a specialized node type for that?)