comments for factored-out index slice functions

This commit is contained in:
Vern Paxson 2021-03-18 16:59:08 -07:00
parent 78f18b4fa6
commit 8782894d7d

View file

@ -941,8 +941,20 @@ protected:
bool is_slice; bool is_slice;
}; };
// The following execute the heart of IndexExpr functionality for
// vector slices and strings.
// Extracts a slice of a vector, where the span of the slice is specified
// by a list of (exactly) two values. This is how the interpreter develops
// the components of a slice.
extern VectorValPtr index_slice(VectorVal* vect, const ListVal* lv); extern VectorValPtr index_slice(VectorVal* vect, const ListVal* lv);
// Lower-level access to the slice, where its span is expressed
// directly as integers.
extern VectorValPtr index_slice(VectorVal* vect, int first, int last); extern VectorValPtr index_slice(VectorVal* vect, int first, int last);
// Returns a subset of a string, with the span specified by a list of
// (exactly) two values.
extern StringValPtr index_string(const String* s, const ListVal* lv); extern StringValPtr index_string(const String* s, const ListVal* lv);
class IndexExprWhen final : public IndexExpr { class IndexExprWhen final : public IndexExpr {