summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/tex
diff options
context:
space:
mode:
authorLuigi Scarso <luigi.scarso@gmail.com>2019-07-08 06:07:11 +0000
committerLuigi Scarso <luigi.scarso@gmail.com>2019-07-08 06:07:11 +0000
commitf93b62903a20648ab4328443b88495da81f70909 (patch)
tree6a870996cc04dca9a1ae3dbbc334b4c2a1385711 /Build/source/texk/web2c/luatexdir/tex
parent54d39e16610eee4dde770b0a6b569203c79abde8 (diff)
sync with luatex rev.7174: luatex and luahbtex and jit variants
git-svn-id: svn://tug.org/texlive/trunk@51577 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex')
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/align.c4
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/postlinebreak.h13
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texdeffont.c44
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texfileio.c22
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texmath.c7
5 files changed, 60 insertions, 30 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/align.c b/Build/source/texk/web2c/luatexdir/tex/align.c
index b2384cc6290..bb721856fac 100644
--- a/Build/source/texk/web2c/luatexdir/tex/align.c
+++ b/Build/source/texk/web2c/luatexdir/tex/align.c
@@ -1095,7 +1095,9 @@ void fin_align(void)
glue_set(q) = glue_set(p);
shift_amount(q) = o;
r = vlink(list_ptr(q));
- assert (type(r) == unset_node);
+ if (type(r) != unset_node) {
+ formatted_error("alignment","bad box");
+ }
s = vlink(list_ptr(p));
do {
/*tex
diff --git a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.h b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.h
index cd90e1f0bc5..4aee1492c71 100644
--- a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.h
+++ b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.h
@@ -1,5 +1,5 @@
/* postlinebreak.h
-
+
Copyright 2009 Taco Hoekwater <taco@luatex.org>
This file is part of LuaTeX.
@@ -21,13 +21,10 @@
#ifndef POSTLINEBREAK_H
# define POSTLINEBREAK_H
-/* todo: check this macro, especially values of alink() */
-
-# define append_list(A,B) do { \
- vlink(cur_list.tail_field) = vlink((A)); \
- cur_list.tail_field = (B); \
- } while (0)
-
+# define append_list(A,B) do { \
+ couple_nodes(cur_list.tail_field,vlink((A))); \
+ cur_list.tail_field = (B); \
+} while (0)
void ext_post_line_break(int paragraph_dir,
int right_skip,
diff --git a/Build/source/texk/web2c/luatexdir/tex/texdeffont.c b/Build/source/texk/web2c/luatexdir/tex/texdeffont.c
index f0b057d40b1..1ec4b12bf06 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texdeffont.c
+++ b/Build/source/texk/web2c/luatexdir/tex/texdeffont.c
@@ -99,7 +99,7 @@ void tex_def_font(small_number a)
/*tex This runs through existing fonts. */
internal_font_number f;
/*tex The name for the frozen font identifier. */
- str_number t;
+ str_number t, d;
/*tex Thos holds the |selector| setting. */
int old_setting;
/*tex Stated `at' size, or negative of scaled magnification. */
@@ -113,10 +113,6 @@ void tex_def_font(small_number a)
}
get_r_token();
u = cur_cs;
- if (u >= null_cs)
- t = cs_text(u);
- else
- t = maketexstring("FONT");
if (a >= 4) {
geq_define(u, set_font_cmd, null_font);
} else {
@@ -140,17 +136,20 @@ void tex_def_font(small_number a)
selector = new_string;
if (cur_area != get_nullstr()) {
print(cur_area);
+ flush_str(cur_area);
}
if (cur_name != get_nullstr()) {
print(cur_name);
+ flush_str(cur_name);
}
if (cur_ext != get_nullstr()) {
print(cur_ext);
+ flush_str(cur_ext);
}
selector = old_setting;
+ cur_area = get_nullstr();
cur_name = make_string();
cur_ext = get_nullstr();
- cur_area = get_nullstr();
}
} else {
back_input();
@@ -160,9 +159,9 @@ void tex_def_font(small_number a)
token_show(def_ref);
selector = old_setting;
flush_list(def_ref);
+ cur_area = get_nullstr();
cur_name = make_string();
cur_ext = get_nullstr();
- cur_area = get_nullstr();
}
/*tex
Scan the font size specification. The next variable keeps |cur_name| from
@@ -215,5 +214,34 @@ void tex_def_font(small_number a)
xfree(fn);
equiv(u) = f;
eqtb[font_id_base + f] = eqtb[u];
- cs_text(font_id_base + f) = t;
+ /*tex
+
+ This is tricky: when we redefine a string we loose the old one. So this
+ will change as it's only used to display the |\fontname| so we can store
+ that with the font.
+
+ */
+ d = cs_text(font_id_base + f);
+ t = (u >= null_cs) ? cs_text(u) : maketexstring("FONT");
+ if (!d) {
+ /*tex We have a new string. */
+ cs_text(font_id_base + f) = t;
+ } else if ((d!=t) && str_eq_str(d,t)){
+ /*tex We have a duplicate string. */
+ flush_str(t);
+ } else if (d!=t){
+ d = search_string(t);
+ if (d) {
+ /*tex We have already such a string. */
+ cs_text(font_id_base + f) = d;
+ flush_str(t);
+ } else {
+ /*tex The old value is lost but still in the pool. */
+ cs_text(font_id_base + f) = t;
+ }
+ }
+ if (cur_name == str_ptr-1) {
+ flush_str(cur_name);
+ cur_name = get_nullstr();
+ }
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/texfileio.c b/Build/source/texk/web2c/luatexdir/tex/texfileio.c
index 143e694e1ba..2c37ada75e9 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texfileio.c
+++ b/Build/source/texk/web2c/luatexdir/tex/texfileio.c
@@ -332,14 +332,13 @@ boolean lua_a_open_in(alpha_file * f, char *fn, int n)
boolean lua_a_open_out(alpha_file * f, char *fn, int n)
{
boolean test;
- str_number fnam;
+ char *fnam = NULL;
int callback_id;
boolean ret = false;
callback_id = callback_defined(find_write_file_callback);
if (callback_id > 0) {
- fnam = 0;
- test = run_callback(callback_id, "dS->s", n, fn, &fnam);
- if ((test) && (fnam != 0) && (str_length(fnam) > 0)) {
+ test = run_callback(callback_id, "dS->R", n, fn, &fnam);
+ if ((test) && (fnam != NULL) && (strlen(fnam) > 0)) {
/*tex
There is no message here because if that is needed the macro
@@ -347,7 +346,8 @@ boolean lua_a_open_out(alpha_file * f, char *fn, int n)
messaging is left to \LUA\ then.
*/
- ret = open_outfile(f, fn, FOPEN_W_MODE);
+ ret = open_outfile(f, fnam, FOPEN_W_MODE);
+ free(fnam);
}
} else {
if (openoutnameok(fn)) {
@@ -371,15 +371,15 @@ boolean lua_a_open_out(alpha_file * f, char *fn, int n)
boolean lua_b_open_out(alpha_file * f, char *fn)
{
boolean test;
- str_number fnam;
+ char *fnam = NULL;
int callback_id;
boolean ret = false;
callback_id = callback_defined(find_output_file_callback);
if (callback_id > 0) {
- fnam = 0;
- test = run_callback(callback_id, "S->s", fn, &fnam);
- if ((test) && (fnam != 0) && (str_length(fnam) > 0)) {
- ret = open_outfile(f, fn, FOPEN_WBIN_MODE);
+ test = run_callback(callback_id, "S->R", fn, &fnam);
+ if ((test) && (fnam != NULL) && (strlen(fnam) > 0)) {
+ ret = open_outfile(f, fnam, FOPEN_WBIN_MODE);
+ free(fnam);
}
} else {
if (openoutnameok(fn)) {
@@ -937,7 +937,7 @@ void open_log_file(void)
/*tex should be done always */
flush_loggable_info();
/*tex should be done always */
- selector = old_setting + 2;
+ selector = old_setting + 2;
}
/*tex
diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.c b/Build/source/texk/web2c/luatexdir/tex/texmath.c
index 69e58b0ea77..7f1f1296d33 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texmath.c
+++ b/Build/source/texk/web2c/luatexdir/tex/texmath.c
@@ -720,7 +720,9 @@ void display_normal_noad(pointer p)
}
break;
case radical_noad:
- if (subtype(p) == 6)
+ if (subtype(p) == 7)
+ tprint_esc("Uhextensible");
+ else if (subtype(p) == 6)
tprint_esc("Udelimiterover");
else if (subtype(p) == 5)
tprint_esc("Udelimiterunder");
@@ -2618,7 +2620,8 @@ void after_math(void)
tail_append(new_dir(math_direction_par));
}
run_mlist_to_hlist(p, (mode > 0), text_style);
- vlink(tail) = vlink(temp_head);
+ try_couple_nodes(tail,vlink(temp_head));
+
while (vlink(tail) != null) {
tail = vlink(tail);
}