diff options
| author | Mel <einebeere@gmail.com> | 2022-05-28 20:56:10 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-28 20:56:10 +0000 |
| commit | a8e90423a6d29d7241b7d1f5ab60d607edffef9f (patch) | |
| tree | 5580f186ba5ac1283a0fce97654d633ddf63beff /pkg/lang/vm/value | |
| parent | 2ddb215e3b0d3818b3fac8f315d97d8020eb699f (diff) | |
| download | jinx-a8e90423a6d29d7241b7d1f5ab60d607edffef9f.tar.zst jinx-a8e90423a6d29d7241b7d1f5ab60d607edffef9f.zip | |
Harden Mem further and add tests
Diffstat (limited to 'pkg/lang/vm/value')
| -rw-r--r-- | pkg/lang/vm/value/cells.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pkg/lang/vm/value/cells.go b/pkg/lang/vm/value/cells.go index 1c34762..116fa5a 100644 --- a/pkg/lang/vm/value/cells.go +++ b/pkg/lang/vm/value/cells.go @@ -10,6 +10,10 @@ func (a ArrayCell) DropCell(m mem.Mem) { } } +func (a ArrayCell) MatchingCellKind() mem.CellKind { + return mem.CellKindArray +} + func (a ArrayCell) Get() []Value { return a } @@ -19,6 +23,10 @@ type StringCell string func (s StringCell) DropCell(m mem.Mem) { } +func (s StringCell) MatchingCellKind() mem.CellKind { + return mem.CellKindString +} + func (s StringCell) Get() string { return string(s) } @@ -29,6 +37,10 @@ func (o OutletCell) DropCell(m mem.Mem) { Value(o).Drop(m) } +func (o OutletCell) MatchingCellKind() mem.CellKind { + return mem.CellKindOutlet +} + func (o OutletCell) Get() Value { return Value(o) } @@ -41,6 +53,10 @@ func (e EnvCell) DropCell(m mem.Mem) { } } +func (e EnvCell) MatchingCellKind() mem.CellKind { + return mem.CellKindEnv +} + func (e EnvCell) Get() Env { return Env(e) } |
