diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-06-08 10:23:49 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-06-08 10:23:49 +0200 |
commit | 86bfea5faac983d15c47eec27f43ec56e75c69ef (patch) | |
tree | 69a37851a9b8beeb625110f4fc51ff1ef188d7e4 /metapost/context/base/mpiv/mp-luas.mpiv | |
parent | c2d2236242c95f4753e7b197d576102c6fc20446 (diff) | |
download | context-86bfea5faac983d15c47eec27f43ec56e75c69ef.tar.gz |
2018-06-08 09:38:00
Diffstat (limited to 'metapost/context/base/mpiv/mp-luas.mpiv')
-rw-r--r-- | metapost/context/base/mpiv/mp-luas.mpiv | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/metapost/context/base/mpiv/mp-luas.mpiv b/metapost/context/base/mpiv/mp-luas.mpiv index d35701ec6..3bc95349d 100644 --- a/metapost/context/base/mpiv/mp-luas.mpiv +++ b/metapost/context/base/mpiv/mp-luas.mpiv @@ -49,17 +49,24 @@ boolean context_luas ; context_luas := true ; % % Fourth variant: -string mfun_lua_bs ; mfun_lua_bs := "[[" ; -string mfun_lua_es ; mfun_lua_es := "]]" ; +string mfun_lua_bs ; mfun_lua_bs := "[===[" ; +string mfun_lua_es ; mfun_lua_es := "]===]" ; vardef mlib_luas_luacall(text t) = runscript("" for s = t : if string s : & s +% & mfun_lua_bs & s & mfun_lua_es elseif numeric s : & decimal s elseif boolean s : & if s : "true" else : "false" fi + elseif pair s : + & mfun_pair_to_table(s) + elseif rgbcolor s : + & mfun_rgb_to_table(s) + elseif cmykcolor s : + & mfun_cmyk_to_table(s) else : & ditto & tostring(s) & ditto fi endfor @@ -81,6 +88,12 @@ vardef mlib_luas_lualist(expr c)(text t) = & decimal s elseif boolean s : & if s : "true" else : "false" fi + elseif pair s : + & mfun_pair_to_table(s) + elseif rgbcolor s : + & mfun_rgb_to_table(s) + elseif cmykcolor s : + & mfun_cmyk_to_table(s) else : & ditto & tostring(s) & ditto fi endfor & ")" |