diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-08-10 14:42:06 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-08-10 14:42:06 -0700 |
| commit | f5c8c851966e98778a03f5539431832ee8d452b5 (patch) | |
| tree | 264add6a597eecf5da3d140d932cb92df396d1e0 /src/rt/rust_shape.cpp | |
| parent | dc720c3aba3ef66b49b74ef73579dc716efc2c6a (diff) | |
| download | rust-f5c8c851966e98778a03f5539431832ee8d452b5.tar.gz rust-f5c8c851966e98778a03f5539431832ee8d452b5.zip | |
rt: Implement logging of vectors
Diffstat (limited to 'src/rt/rust_shape.cpp')
| -rw-r--r-- | src/rt/rust_shape.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/rt/rust_shape.cpp b/src/rt/rust_shape.cpp index f33ecd91c51..eb52dfbc618 100644 --- a/src/rt/rust_shape.cpp +++ b/src/rt/rust_shape.cpp @@ -1243,6 +1243,10 @@ private: : data<log,ptr>(other.task, in_sp, in_params, in_tables, other.dp), out(other.out) {} + log(log &other, ptr in_dp) + : data<log,ptr>(other.task, other.sp, other.params, other.tables, in_dp), + out(other.out) {} + void walk_string(const std::pair<ptr,ptr> &data); void walk_evec(bool align, bool is_pod, uint16_t sp_size) { @@ -1301,7 +1305,22 @@ log::walk_vec(bool align, bool is_pod, const std::pair<ptr,ptr> &data) { return; } - // TODO: Write vectors [ ..., ..., ... ] style. + out << "["; + + log sub(*this, data.first); + + bool first = true; + while (sub.dp < data.second) { + if (!first) + out << ", "; + + sub.walk_reset(align); + + align = true; + first = false; + } + + out << "]"; } } // end namespace shape |
