summaryrefslogtreecommitdiff
path: root/usr/austin/eval/value.go
diff options
context:
space:
mode:
Diffstat (limited to 'usr/austin/eval/value.go')
-rw-r--r--usr/austin/eval/value.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/usr/austin/eval/value.go b/usr/austin/eval/value.go
index 79c0a0e3e..8950dd00a 100644
--- a/usr/austin/eval/value.go
+++ b/usr/austin/eval/value.go
@@ -383,6 +383,11 @@ func (v *arrayV) Elem(i int64) Value {
return (*v)[i];
}
+func (v *arrayV) From(i int64) ArrayValue {
+ res := (*v)[i:len(*v)];
+ return &res;
+}
+
/*
* Struct
*/
@@ -469,6 +474,37 @@ func (v *funcV) Set(x Func) {
}
/*
+ * Slices
+ */
+
+type sliceV struct {
+ Slice;
+}
+
+func (v *sliceV) String() string {
+ res := "{";
+ for i := int64(0); i < v.Len; i++ {
+ if i > 0 {
+ res += ", ";
+ }
+ res += v.Base.Elem(i).String();
+ }
+ return res + "}";
+}
+
+func (v *sliceV) Assign(o Value) {
+ v.Slice = o.(SliceValue).Get();
+}
+
+func (v *sliceV) Get() Slice {
+ return v.Slice;
+}
+
+func (v *sliceV) Set(x Slice) {
+ v.Slice = x;
+}
+
+/*
* Multi-values
*/