32 #ifndef _QORE_QORESQUAREBRACKETSOPERATORNODE_H
33 #define _QORE_QORESQUAREBRACKETSOPERATORNODE_H
35 class QoreSquareBracketsOperatorNode :
public QoreBinaryOperatorNode<>,
public FunctionalOperator {
38 DLLLOCAL QoreSquareBracketsOperatorNode(
const QoreProgramLocation* loc,
QoreValue left,
QoreValue right)
39 : QoreBinaryOperatorNode<>(loc, left, right) {
42 DLLLOCAL
virtual const QoreTypeInfo* getTypeInfo()
const {
46 DLLLOCAL
virtual QoreOperatorNode* copyBackground(
ExceptionSink *xsink)
const {
47 return copyBackgroundExplicit<QoreSquareBracketsOperatorNode>(xsink);
50 DLLLOCAL
static QoreValue doSquareBracketsListRange(
const QoreValue l,
const QoreParseListNode* pln,
57 const QoreTypeInfo* typeInfo =
nullptr;
59 bool rhs_list_range =
false;
61 DLLLOCAL
int parseCheckValueTypes(
const QoreParseListNode* pln);
62 DLLLOCAL
int parseCheckValueTypes(
const QoreListNode* ln);
66 DLLLOCAL
virtual int parseInitImpl(
QoreValue& val, QoreParseContext& parse_context);
68 DLLLOCAL
virtual FunctionalOperatorInterface* getFunctionalIteratorImpl(FunctionalValueType& value_type,
77 class QoreFunctionalSquareBracketsOperator :
public FunctionalOperatorInterface {
81 : leftValue(*lhs, lhs.isTemp(), xsink),
87 DLLLOCAL
virtual ~QoreFunctionalSquareBracketsOperator() {}
91 DLLLOCAL
virtual const QoreTypeInfo* getValueTypeImpl()
const;
99 class QoreFunctionalSquareBracketsComplexOperator :
public FunctionalOperatorInterface {
101 DLLLOCAL QoreFunctionalSquareBracketsComplexOperator(
ValueEvalRefHolder& lhs,
const QoreParseListNode* rpl,
103 : leftValue(*lhs, lhs.isTemp(), xsink),
104 rightParseList(rpl) {
108 DLLLOCAL
virtual ~QoreFunctionalSquareBracketsComplexOperator() {}
112 DLLLOCAL
virtual const QoreTypeInfo* getValueTypeImpl()
const;
116 const QoreParseListNode* rightParseList;
118 std::unique_ptr<class QoreFunctionalRangeOperator> rangeIter;
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
evaluates an AbstractQoreNode and dereferences the stored value in the destructor
Definition: QoreValue.h:613
allows storing a value and setting a boolean flag that indicates if the value should be dereference i...
Definition: QoreValue.h:509
DLLLOCAL void clearTemp()
sets needs_deref = false
Definition: QoreValue.h:533
intptr_t qore_offset_t
used for offsets that could be negative
Definition: common.h:76
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275