summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-07-06 19:34:30 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-07-06 19:34:30 +0200
commit8d02589abdbd8d4f476ac951d99d4081319fce35 (patch)
treedc1caec6c912e0b38d83ea97c73da006bce0b7d8 /metapost
parentc6ae1bb6230894346094364eb08d3aca0efdea9a (diff)
downloadcontext-8d02589abdbd8d4f476ac951d99d4081319fce35.tar.gz
2021-07-06 18:47:00
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mpxl/mp-base.mpxl50
-rw-r--r--metapost/context/base/mpxl/mp-luas.mpxl14
2 files changed, 36 insertions, 28 deletions
diff --git a/metapost/context/base/mpxl/mp-base.mpxl b/metapost/context/base/mpxl/mp-base.mpxl
index 8086ee799..c6d60b939 100644
--- a/metapost/context/base/mpxl/mp-base.mpxl
+++ b/metapost/context/base/mpxl/mp-base.mpxl
@@ -61,45 +61,45 @@ mutable ? ;
% These need to be adapted to a library approach:
-warningcheck := 1 ;
+warningcheck := 1 ;
def interact = % sets up to make "show" commands stop
hide (
- showstopping := 1 ;
- tracingonline := 1 ;
+ interim showstopping := 1 ;
+ interim tracingonline := 1 ;
)
enddef ;
def loggingall = % puts tracing info into the log
- tracingcommands := 3 ;
- tracingtitles := 1 ;
- tracingequations := 1 ;
- tracingcapsules := 1 ;
- tracingspecs := 2 ;
- tracingchoices := 1 ;
- tracingstats := 1 ;
- tracingoutput := 1 ;
- tracingmacros := 1 ;
- tracingrestores := 1 ;
+ interim tracingtitles := 1 ;
+ interim tracingequations := 1 ;
+ interim tracingcapsules := 1 ;
+ interim tracingspecs := 2 ;
+ interim tracingchoices := 1 ;
+ interim tracingstats := 1 ;
+ interim tracingoutput := 1 ;
+ interim tracingmacros := 1 ;
+ interim tracingcommands := 3 ;
+ interim tracingrestores := 1 ;
enddef ;
def tracingall = % turns on every form of tracing
- tracingonline := 1 ;
- showstopping := 1 ;
+ interim tracingonline := 1 ;
+ interim showstopping := 1 ;
loggingall ;
enddef ;
def tracingnone = % turns off every form of tracing
- tracingcommands := 0 ;
- tracingtitles := 0 ;
- tracingequations := 0 ;
- tracingcapsules := 0 ;
- tracingspecs := 0 ;
- tracingchoices := 0 ;
- tracingstats := 0 ;
- tracingoutput := 0 ;
- tracingmacros := 0 ;
- tracingrestores := 0 ;
+ interim tracingrestores := 0 ;
+ interim tracingcommands := 0 ;
+ interim tracingtitles := 0 ;
+ interim tracingequations := 0 ;
+ interim tracingcapsules := 0 ;
+ interim tracingspecs := 0 ;
+ interim tracingchoices := 0 ;
+ interim tracingstats := 0 ;
+ interim tracingoutput := 0 ;
+ interim tracingmacros := 0 ;
enddef ;
permanent interact, loggingall, tracingall, tracingnone ;
diff --git a/metapost/context/base/mpxl/mp-luas.mpxl b/metapost/context/base/mpxl/mp-luas.mpxl
index 8a4e369b0..04526c061 100644
--- a/metapost/context/base/mpxl/mp-luas.mpxl
+++ b/metapost/context/base/mpxl/mp-luas.mpxl
@@ -112,8 +112,12 @@ vardef MP@#(text t) =
mlib_luas_lualist("MP." & str @#,t)
enddef ;
-def message expr t =
- lua.mp.report(tostring(t)) ;
+% todo: runner
+
+newscriptindex mfun_message ; mfun_message := scriptindex("message") ;
+
+def message text t =
+ runscript mfun_message tostring(t) ; % todo: scananything
enddef ;
permanent newscriptindex, scriptindex, luacall, lua, lualist, mp, MP ;
@@ -171,6 +175,8 @@ permanent
setmacro, setdimen, setcount, settoks,
setglobalmacro, setglobaldimen, setglobalcount, setglobaltoks ;
+% todo: mfid_
+
vardef positionpath (expr name) = lua.mp.positionpath (name) enddef ;
vardef positioncurve (expr name) = lua.mp.positioncurve (name) enddef ;
vardef positionxy (expr name) = lua.mp.positionxy (name) enddef ;
@@ -279,7 +285,9 @@ newscriptindex mfun_newrecord ; mfun_newrecord := scriptindex "newrecord" ;
newscriptindex mfun_setrecord ; mfun_setrecord := scriptindex "setrecord" ;
newscriptindex mfun_getrecord ; mfun_getrecord := scriptindex "getrecord" ;
-let record = runscript ; % We need to use "let" because we don't expand!
+% let record = runscript ; % We need to use "let" because we don't expand!
+
+def record = newinternal numeric runscript enddef ;
def newrecord = runscript mfun_newrecord ; enddef ; % semicolon prevents lookahead
def setrecord = runscript mfun_setrecord ; enddef ;