Content


NTL
Core
CFunctionSubscript

CFunctionSubscript


Class provides implementation of the array element access operator [index] or [name] for expressions. It is being used by expression runners.

If second operand is a string, the first operand is treated as an object and the second operand as a property name of that object. Otherwise the first operand is treated as an array and the second one as an index of an element in that array. Pointer to the object property or pointer to the element is stored as a result.

You can find more information in comments below. Overrided methods can be found in corresponding base class or interface.

class CFunctionSubscript :public CFunction
{
public:
    // IFunction methods 
    bool Run() override;

    CFunctionSubscript(IErrorListener *error_listener, IFunction *operand1, IFunction *operand2);
};
Namespace: nitisa::script
Include: Nitisa/Modules/Script/Functions/General/FunctionSubscript.h