1
1
mirror of https://github.com/kanaka/mal.git synced 2024-11-14 00:09:01 +03:00

bbc-basic: Make metadata on string-like types work.

The new string handling makes this simpler than forbidding it.
This commit is contained in:
Ben Harris 2019-05-26 13:36:39 +01:00
parent 94b7a0797a
commit 30409c3d68

View File

@ -190,11 +190,11 @@ DEF FNmeta(val%)
DEF FNwith_meta(val%, meta%) DEF FNwith_meta(val%, meta%)
LOCAL newval% LOCAL newval%
IF Z%(val%,0) AND &02 ERROR &40E8091F, "Can't apply metadata to a string-like type"
newval% = FNmalloc(Z%(val%,0)) newval% = FNmalloc(Z%(val%,0))
Z%(newval%,1) = Z%(val%,1) Z%(newval%,1) = Z%(val%,1)
Z%(newval%,2) = Z%(val%,2) Z%(newval%,2) = Z%(val%,2)
Z%(newval%,3) = meta% Z%(newval%,3) = meta%
Z$(newval%) = Z$(val%)
=newval% =newval%
REM ** Nil ** REM ** Nil **