summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2009-05-08 14:03:45 +0000
committerTaco Hoekwater <taco@elvenkind.com>2009-05-08 14:03:45 +0000
commit885eedd3f48fa03875f20c49589f9db732782de3 (patch)
tree745d30c828d0fb516b21c54caf9cdb820a2ee104
parentab366acfe8bae5433f1370910f352db9b861a648 (diff)
The latest in MP development
git-svn-id: svn://tug.org/texlive/trunk@13006 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/web2c/mplibdir/ChangeLog7
-rw-r--r--Build/source/texk/web2c/mplibdir/mp.w43
-rw-r--r--Build/source/texk/web2c/mplibdir/mpxout.w21
-rw-r--r--Build/source/texk/web2c/mplibdir/svgout.w4
4 files changed, 45 insertions, 30 deletions
diff --git a/Build/source/texk/web2c/mplibdir/ChangeLog b/Build/source/texk/web2c/mplibdir/ChangeLog
index 9c9c5aa937e..d45f60fbc05 100644
--- a/Build/source/texk/web2c/mplibdir/ChangeLog
+++ b/Build/source/texk/web2c/mplibdir/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-08 Taco Hoekwater <taco@elvenkind.com>
+
+ * Recent MPlib updates
+
2009-04-22 Taco Hoekwater <taco@elvenkind.com>
- * Import of MPlib version 1.200
+ * Import of MPlib version 1.200
+ \ No newline at end of file
diff --git a/Build/source/texk/web2c/mplibdir/mp.w b/Build/source/texk/web2c/mplibdir/mp.w
index f49d5a451f9..6c56da8e3e0 100644
--- a/Build/source/texk/web2c/mplibdir/mp.w
+++ b/Build/source/texk/web2c/mplibdir/mp.w
@@ -1,4 +1,4 @@
-% $Id: mp.w 976 2009-04-22 07:55:33Z taco $
+% $Id: mp.w 999 2009-04-29 09:05:32Z taco $
%
% Copyright 2008 Taco Hoekwater.
%
@@ -4819,8 +4819,7 @@ and |string_type| in that order.
@<Types...@>=
enum mp_variable_type {
-mp_internal_type=0, /* an internal that has not been frozen yet */
-mp_vacuous, /* no expression was present */
+mp_vacuous = 1, /* no expression was present */
mp_boolean_type, /* \&{boolean} with a known value */
mp_unknown_boolean,
mp_string_type, /* \&{string} with a known value */
@@ -4852,7 +4851,6 @@ static void mp_print_type (MP mp,quarterword t) ;
@ @<Basic printing procedures@>=
void mp_print_type (MP mp,quarterword t) {
switch (t) {
- case mp_internal_type:mp_print(mp, "new internal"); break;
case mp_vacuous:mp_print(mp, "mp_vacuous"); break;
case mp_boolean_type:mp_print(mp, "boolean"); break;
case mp_unknown_boolean:mp_print(mp, "unknown boolean"); break;
@@ -17102,7 +17100,6 @@ case mp_vacuous:mp_print(mp, "mp_vacuous"); break;
case mp_boolean_type:
if ( v==true_code ) mp_print(mp, "true"); else mp_print(mp, "false");
break;
-case mp_internal_type:
case unknown_types: case mp_numeric_type:
@<Display a variable that's been declared but not defined@>;
break;
@@ -17867,14 +17864,8 @@ of the save stack, as described earlier.)
mp->cur_exp=mp_get_avail(mp);
mp_info(mp->cur_exp)=q+hash_end; mp->cur_type=mp_token_list;
goto DONE;
- } else {
- if (mp->int_type[q]==mp_internal_type)
- mp->int_type[q] = mp_known;
}
mp_back_input(mp);
- } else {
- if (mp->int_type[q]==mp_internal_type)
- mp->int_type[q] = mp_known;
}
mp->cur_exp=mp->internal[q];
if (mp->int_type[q]==mp_string_type)
@@ -19717,7 +19708,7 @@ moves at the actual points.
@d bezier_error (720*(256*256*16))+1
@d mp_sign(v) ((v)>0 ? 1 : ((v)<0 ? -1 : 0 ))
@d mp_out(A) (double)((A)/(256*256*16))
-@d divisor (256*256)
+@d divisor (256.0*256.0)
@d double2angle(a) (int)mp_floor(a*256.0*256.0*16.0)
@<Declare unary action...@>=
@@ -21899,9 +21890,6 @@ void mp_do_assignment (MP mp) {
@ @<Assign the current expression to an internal variable@>=
if ( mp->cur_type==mp_known || mp->cur_type==mp_string_type ) {
- if (mp->int_type[mp_info(lhs)-(hash_end)]==mp_internal_type) {
- mp->int_type[mp_info(lhs)-(hash_end)]=mp->cur_type;
- }
if (mp->cur_type==mp_string_type) {
if (mp->int_type[mp_info(lhs)-(hash_end)]!=mp->cur_type) {
exp_err("Internal quantity `");
@@ -22349,10 +22337,7 @@ void mp_set_internal (MP mp, char *n, char *v, int isstring) {
if (text(p)>0 && length(text(p))==l &&
mp_str_eq_cstr(mp, text(p),n)) {
if (eq_type(p)==internal_quantity) {
- if (mp->int_type[equiv(p)]==mp_internal_type) {
- mp->int_type[equiv(p)] = (isstring ? mp_string_type : mp_known);
- }
- if ((mp->int_type[equiv(p)]==mp_string_type) && (isstring)) {
+ if ((mp->int_type[equiv(p)]==mp_string_type) && (isstring)) {
mp->internal[equiv(p)] = mp_rts(mp,v);
} else if ((mp->int_type[equiv(p)]==mp_known) && (!isstring)) {
scaled test = (scaled)atoi(v);
@@ -22577,7 +22562,7 @@ static char *mplib_read_ascii_file(MP mp, void *ff, size_t * size)
if (s == NULL)
return NULL;
while (c != EOF && c != '\n' && c != '\r') {
- if (len == lim) {
+ if (len >= (lim-1)) {
s = xrealloc(s, (lim + (lim >> 2)),1);
if (s == NULL)
return NULL;
@@ -23128,7 +23113,7 @@ void mp_grow_internals (MP mp, int l) {
} else {
internal[k]=0;
int_name[k]=NULL;
- int_type[k]=mp_internal_type;
+ int_type[k]=0;
}
}
xfree(mp->internal); xfree(mp->int_name); xfree(mp->int_type);
@@ -23139,6 +23124,15 @@ void mp_grow_internals (MP mp, int l) {
}
void mp_do_new_internal (MP mp) {
+ int the_type = mp_known;
+ mp_get_x_next(mp);
+ if (mp->cur_cmd==type_name && mp->cur_mod==mp_string_type) {
+ the_type = mp_string_type;
+ } else {
+ if (!(mp->cur_cmd==type_name && mp->cur_mod==mp_known)) {
+ mp_back_input(mp);
+ }
+ }
do {
if ( mp->int_ptr==mp->max_internal ) {
mp_grow_internals(mp, (mp->max_internal + (mp->max_internal/4)));
@@ -23149,7 +23143,12 @@ void mp_do_new_internal (MP mp) {
if(mp->int_name[mp->int_ptr]!=NULL)
xfree(mp->int_name[mp->int_ptr]);
mp->int_name[mp->int_ptr]=str(text(mp->cur_sym));
- mp->internal[mp->int_ptr]=0;
+ if (the_type==mp_string_type) {
+ mp->internal[mp->int_ptr]=null_str;
+ } else {
+ mp->internal[mp->int_ptr]=0;
+ }
+ mp->int_type[mp->int_ptr]=the_type;
mp_get_x_next(mp);
} while (mp->cur_cmd==comma);
}
diff --git a/Build/source/texk/web2c/mplibdir/mpxout.w b/Build/source/texk/web2c/mplibdir/mpxout.w
index 57faa4439a3..3c7edb2f531 100644
--- a/Build/source/texk/web2c/mplibdir/mpxout.w
+++ b/Build/source/texk/web2c/mplibdir/mpxout.w
@@ -1,4 +1,4 @@
-% $Id: mpxout.w 973 2009-04-21 15:28:57Z taco $
+% $Id: mpxout.w 997 2009-04-27 19:31:57Z taco $
%
% Copyright 2008 Taco Hoekwater.
%
@@ -452,6 +452,11 @@ choose the leftmost one. If there is no such $t$, we set $b=s$ and return 0.
static int mpx_getbta(MPX mpx, char *s) {
int ok = 1; /* zero if last character was |a-z|, |A-Z|, or |_| */
mpx->bb = s;
+ if (s==NULL) {
+ mpx->tt = NULL;
+ mpx->aa = NULL;
+ return 0;
+ }
for (mpx->tt = mpx->bb; *(mpx->tt) != 0; mpx->tt++) {
switch (*(mpx->tt)) {
case '"':
@@ -499,19 +504,23 @@ static void mpx_copy_mpto (MPX mpx, FILE *outfile) {
char c;
char *res = NULL;
do {
- if (*mpx->aa == 0) {
+ if (mpx->aa == NULL || *mpx->aa == 0) {
if ((mpx->aa = mpx_getline(mpx,mpx->mpfile)) == NULL) {
mpx_error(mpx,"btex section does not end");
+ return;
}
}
if (mpx_getbta(mpx, mpx->aa) && *(mpx->tt) == 'e') {
s = mpx->tt;
} else {
- if (*(mpx->tt) == 'b')
- mpx_error(mpx,"btex in TeX mode");
- if (*(mpx->tt) == 'v')
- mpx_error(mpx,"verbatimtex in TeX mode");
+ if (mpx->tt == NULL)
+ mpx_error(mpx,"btex section does not end");
+ else if (*(mpx->tt) == 'b')
+ mpx_error(mpx,"btex in TeX mode");
+ else if (*(mpx->tt) == 'v')
+ mpx_error(mpx,"verbatimtex in TeX mode");
s = mpx->aa;
+ return;
}
c = *s;
*s = 0;
diff --git a/Build/source/texk/web2c/mplibdir/svgout.w b/Build/source/texk/web2c/mplibdir/svgout.w
index b2da35a0ea4..4ce9b7dc0dd 100644
--- a/Build/source/texk/web2c/mplibdir/svgout.w
+++ b/Build/source/texk/web2c/mplibdir/svgout.w
@@ -828,6 +828,7 @@ void mp_svg_print_glyph_defs (MP mp, mp_edge_object *h) {
if (mp_chars[k][l] == 1) {
if (f == NULL) {
f = mp_ps_font_parse(mp, k);
+ if (f == NULL) continue;
if (f->extend != 0) {
dx = scaled_from_double(((double)f->extend / 1000.0) * scale);
}
@@ -863,8 +864,9 @@ void mp_svg_print_glyph_defs (MP mp, mp_edge_object *h) {
mp_svg_open_starttag(mp,"path");
mp_svg_attribute(mp, "style", "fill-rule: evenodd;");
while (p!=NULL) {
+ if (mp->svg->loc>0) mp->svg->loc--; /* drop a '\0' */
mp_svg_font_path_out(mp, gr_path_p((mp_fill_object *)p));
- p = gr_link(p);
+ p=p->next;
}
mp_svg_attribute(mp, "d", mp->svg->buf);
mp_svg_reset_buf(mp);