summaryrefslogtreecommitdiff
path: root/metapost
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2015-01-24 00:15:04 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2015-01-24 00:15:04 +0100
commit373ae8954dcd9f9d986edd1a316a331dff47a534 (patch)
tree73438ac8abbf2fbb4ce88bba29d8c67b5d971e39 /metapost
parent80ec8a2141d8eb9c7c21e62cdd2874192be11bd7 (diff)
downloadcontext-373ae8954dcd9f9d986edd1a316a331dff47a534.tar.gz
2015-01-23 22:14:00
Diffstat (limited to 'metapost')
-rw-r--r--metapost/context/base/mp-func.mpiv24
-rw-r--r--metapost/context/base/mp-mlib.mpiv6
-rw-r--r--metapost/context/base/mp-tool.mpiv16
3 files changed, 26 insertions, 20 deletions
diff --git a/metapost/context/base/mp-func.mpiv b/metapost/context/base/mp-func.mpiv
index 81b37fd1c..b1b9d6d5d 100644
--- a/metapost/context/base/mp-func.mpiv
+++ b/metapost/context/base/mp-func.mpiv
@@ -29,27 +29,30 @@ def pathconnectors = mfun_pathconnectors enddef ;
vardef mfun_function (expr f) (expr u, t, b, e, s) =
save x ; numeric x ;
+ save c ; string c ; c := if string f : f else : mfun_pathconnectors[f] fi ;
for xx := b step s until e :
hide (x := xx ;)
if xx > b :
- scantokens(mfun_pathconnectors[f])
+ scantokens(c)
fi
(scantokens(u),scantokens(t))
endfor
enddef ;
-def function = mfun_function enddef ; % let doesn't work here
-def straightfunction = mfun_function (1) enddef ;
-def curvedfunction = mfun_function (2) enddef ;
+def function = mfun_function enddef ; % let doesn't work here
+def constructedfunction = mfun_function enddef ;
+def straightfunction = mfun_function (1) enddef ;
+def curvedfunction = mfun_function (2) enddef ;
% def punkedfunction = mfun_function (1) enddef ; % same as straightfunction
% def tightfunction = mfun_function (3) enddef ; % same as curvedfunction
vardef mfun_constructedpath (expr f) (text t) =
save ok ; boolean ok ; ok := false ;
+ save c ; string c ; c := if string f : f else : mfun_pathconnectors[f] fi ;
for i=t :
if ok :
- scantokens(mfun_pathconnectors[f])
+ scantokens(c)
else :
ok := true ;
fi
@@ -61,15 +64,16 @@ def constructedpath = mfun_constructedpath enddef ; % let doesn't work here
def straightpath = mfun_constructedpath (1) enddef ;
def curvedpath = mfun_constructedpath (2) enddef ;
-def punkedpath = mfun_constructedpath (1) enddef ; % same as straightpath
-def tightpath = mfun_constructedpath (3) enddef ; % same as curvedpath
+% def punkedpath = mfun_constructedpath (1) enddef ; % same as straightpath
+% def tightpath = mfun_constructedpath (3) enddef ; % same as curvedpath
vardef mfun_constructedpairs (expr f) (text p) =
save i ; i := -1 ;
+ save c ; string c ; c := if string f : f else : mfun_pathconnectors[f] fi ;
forever :
exitif unknown p[incr(i)] ;
if i>0 :
- scantokens(mfun_pathconnectors[f])
+ scantokens(c)
fi
p[i]
endfor
@@ -79,5 +83,5 @@ def constructedpairs = mfun_constructedpairs enddef ; % let doesn't work her
def straightpairs = mfun_constructedpairs (1) enddef ;
def curvedpairs = mfun_constructedpairs (2) enddef ;
-def punkedpairs = mfun_constructedpairs (1) enddef ; % same as straightpairs
-def tightpairs = mfun_constructedpairs (3) enddef ; % same as curvedpairs
+% def punkedpairs = mfun_constructedpairs (1) enddef ; % same as straightpairs
+% def tightpairs = mfun_constructedpairs (3) enddef ; % same as curvedpairs
diff --git a/metapost/context/base/mp-mlib.mpiv b/metapost/context/base/mp-mlib.mpiv
index a3eec2818..1140673ab 100644
--- a/metapost/context/base/mp-mlib.mpiv
+++ b/metapost/context/base/mp-mlib.mpiv
@@ -707,10 +707,10 @@ enddef ;
% Positions
-def register (expr label, width, height, offset) =
+def register (expr tag, width, height, offset) =
% draw image (
addto currentpicture doublepath unitsquare xscaled width yscaled height shifted offset
- withprescript "ps_label=" & label ;
+ withprescript "ps_label=" & tag ;
% ) ; % no transformations
enddef ;
@@ -799,7 +799,7 @@ primarydef t asgroup s = % s = isolated|knockout
endgroup
enddef ;
-% Also experimental
+% Also experimental ... needs to be made better ... so it can change!
string mfun_auto_align[] ;
diff --git a/metapost/context/base/mp-tool.mpiv b/metapost/context/base/mp-tool.mpiv
index b82910f6b..dda8e84a1 100644
--- a/metapost/context/base/mp-tool.mpiv
+++ b/metapost/context/base/mp-tool.mpiv
@@ -57,13 +57,15 @@ mpprocset := 1 ;
%
% protect ;
-string space ; space := char 32 ;
-string crlf ; crlf := char 10 & char 13 ;
-string dquote ; dquote := char 34 ;
-
-let SPACE = space ;
-let CRLF = crlf ;
-let DQUOTE = dquote ;
+string space ; space := char 32 ;
+string percent ; percent := char 37 ;
+string crlf ; crlf := char 10 & char 13 ;
+string dquote ; dquote := char 34 ;
+
+let SPACE = space ;
+let CRLF = crlf ;
+let DQUOTE = dquote ;
+let PERCENT = percent ;
vardef ddecimal primary p =
decimal xpart p & " " & decimal ypart p