From 8782894d7d516ee29fe74d256fc4d2573509812a Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Thu, 18 Mar 2021 16:59:08 -0700 Subject: [PATCH] comments for factored-out index slice functions --- src/Expr.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Expr.h b/src/Expr.h index 33810656e5..3cdecfbb5e 100644 --- a/src/Expr.h +++ b/src/Expr.h @@ -941,8 +941,20 @@ protected: 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); + +// Lower-level access to the slice, where its span is expressed +// directly as integers. 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); class IndexExprWhen final : public IndexExpr {