diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-11-18 23:34:12 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-11-18 23:34:12 +0000 |
commit | 60aa1718474a81671727b34573848694e4b8c555 (patch) | |
tree | e077e0faf32b47a97fbc843680eb991499c07328 /Build/source/texk/web2c/luatexdir | |
parent | 13d3d62cdb28a45d886c75c323cb7c9eff3c195e (diff) |
web2c/luatexdir: Sync with the upstream.
git-svn-id: svn://tug.org/texlive/trunk@38888 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/limglib.c | 42 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/luajitstuff.w | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/luastuff.w | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/pdf/pdfgen.w | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/pdf/pdftables.h | 105 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/commands.h | 16 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/equivalents.h | 23 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/extensions.h | 40 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/extensions.w | 63 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/mlist.w | 24 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/textoken.w | 79 |
11 files changed, 180 insertions, 233 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/limglib.c b/Build/source/texk/web2c/luatexdir/lua/limglib.c index 1feb540e4c8..5a1943b5245 100644 --- a/Build/source/texk/web2c/luatexdir/lua/limglib.c +++ b/Build/source/texk/web2c/luatexdir/lua/limglib.c @@ -17,7 +17,6 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ - #include "ptexlib.h" #include "lua/luatex-api.h" #include <stdio.h> @@ -35,24 +34,25 @@ void stackDump(lua_State * L, char *s) { int i, t, top = lua_gettop(L); printf("\n=== stackDump <%s>: ", s); - for (i = top; i >= 1; i--) { /* repeat for each level */ + for (i = top; i >= 1; i--) { t = lua_type(L, i); printf("%d: ", i); switch (t) { - case LUA_TSTRING: /* strings */ - printf("`%s'", lua_tostring(L, i)); - break; - case LUA_TBOOLEAN: /* booleans */ - printf(lua_toboolean(L, i) ? "true" : "false"); - break; - case LUA_TNUMBER: /* numbers */ - printf("%g", (double) lua_tonumber(L, i)); - break; - default: /* other values */ - printf("%s", lua_typename(L, t)); - break; + case LUA_TSTRING: + printf("`%s'", lua_tostring(L, i)); + break; + case LUA_TBOOLEAN: + printf(lua_toboolean(L, i) ? "true" : "false"); + break; + case LUA_TNUMBER: + printf("%g", (double) lua_tonumber(L, i)); + break; + default: + printf("%s", lua_typename(L, t)); + break; } - printf(" "); /* put a separator */ + /* insert a separator */ + printf(" "); } printf("\n"); } @@ -539,8 +539,7 @@ static void read_scale_img(image * a) check_pdfstream_dict(ad); else { fix_pdf_minorversion(static_pdf); - read_img(static_pdf, - ad, pdf_minor_version, pdf_inclusion_errorlevel); + read_img(static_pdf, ad, pdf_minor_version, pdf_inclusion_errorlevel); } } if (is_wd_running(a) || is_ht_running(a) || is_dp_running(a)) @@ -600,8 +599,7 @@ static void setup_image(PDF pdf, image * a, wrtype_e writetype) read_scale_img(a); if (img_objnum(ad) == 0) { /* latest needed just before out_img() */ pdf->ximage_count++; - img_objnum(ad) = - pdf_create_obj(pdf, obj_type_ximage, pdf->ximage_count); + img_objnum(ad) = pdf_create_obj(pdf, obj_type_ximage, pdf->ximage_count); img_index(ad) = pdf->ximage_count; idict_to_array(ad); /* now ad is read-only */ obj_data_ptr(pdf, pdf->obj_ptr) = img_index(ad); @@ -650,9 +648,11 @@ static int l_write_image(lua_State * L) static int l_immediatewrite_image(lua_State * L) { check_o_mode(static_pdf, "img.immediatewrite()", 1 << OMODE_PDF, true); - if (global_shipping_mode != NOT_SHIPPING) + if (global_shipping_mode != NOT_SHIPPING) { luaL_error(L, "pdf.immediatewrite() can not be used with \\latelua"); - write_image_or_node(L, WR_IMMEDIATEWRITE); + } else { + write_image_or_node(L, WR_IMMEDIATEWRITE); + } return 1; /* image */ } diff --git a/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w b/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w index 1305505fe2f..8e0953fa0ab 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w +++ b/Build/source/texk/web2c/luatexdir/lua/luajitstuff.w @@ -320,10 +320,12 @@ void luainterpreter(void) lua_pushstring(L, "pdf"); lua_call(L, 1, 0); - /* |luaopen_img(L);| */ - lua_pushcfunction(L, luaopen_img); - lua_pushstring(L, "img"); - lua_call(L, 1, 0); + if (!lua_only) { + /* |luaopen_img(L);| */ + lua_pushcfunction(L, luaopen_img); + lua_pushstring(L, "img"); + lua_call(L, 1, 0); + } /* |luaopen_epdf(L);| */ lua_pushcfunction(L, luaopen_epdf); diff --git a/Build/source/texk/web2c/luatexdir/lua/luastuff.w b/Build/source/texk/web2c/luatexdir/lua/luastuff.w index 2ac671ae7a7..4214675cd19 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luastuff.w +++ b/Build/source/texk/web2c/luatexdir/lua/luastuff.w @@ -274,8 +274,10 @@ void luainterpreter(void) lua_pushstring(L, "pdf"); lua_call(L, 1, 0); - luaL_requiref(L, "img", luaopen_img, 1); - lua_pop(L, 1); + if (!lua_only) { + luaL_requiref(L, "img", luaopen_img, 1); + lua_pop(L, 1); + } luaL_requiref(L, "epdf", luaopen_epdf, 1); lua_pop(L, 1); diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w index 8ba7a8872a7..f9a96aac808 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w +++ b/Build/source/texk/web2c/luatexdir/pdf/pdfgen.w @@ -1639,6 +1639,11 @@ void check_o_mode(PDF pdf, const char *s, int o_mode_bitpattern, boolean strict) output_mode o_mode; const char *m = NULL; + if (lua_only) { + normal_error("lua only","no backend present, needed for what you asked for"); + return ; + } + /* in warn mode (strict == false): only check, don't do |fix_o_mode()| here! |output_mode_used| is left in possibly wrong state until real output, ok. diff --git a/Build/source/texk/web2c/luatexdir/pdf/pdftables.h b/Build/source/texk/web2c/luatexdir/pdf/pdftables.h index 8b14f5e06ea..adcff69964c 100644 --- a/Build/source/texk/web2c/luatexdir/pdf/pdftables.h +++ b/Build/source/texk/web2c/luatexdir/pdf/pdftables.h @@ -121,39 +121,76 @@ extern void undump_pdftex_data(PDF pdf); /* pdf backend definitions */ -# define pdf_compress_level get_tex_extension_count_register( 1, 9) -# define pdf_decimal_digits get_tex_extension_count_register( 2, 3) -# define pdf_image_resolution get_tex_extension_count_register( 3, 72) -# define pdf_pk_resolution get_tex_extension_count_register( 4, 72) -# define pdf_unique_resname get_tex_extension_count_register( 5, 0) -# define pdf_minor_version get_tex_extension_count_register( 6, 4) -# define pdf_pagebox get_tex_extension_count_register( 7, 0) -# define pdf_inclusion_errorlevel get_tex_extension_count_register( 8, 0) -# define pdf_gamma get_tex_extension_count_register( 9, 1000) -# define pdf_image_apply_gamma get_tex_extension_count_register(10, 0) -# define pdf_image_gamma get_tex_extension_count_register(11, 2200) -# define pdf_image_hicolor get_tex_extension_count_register(12, 1) -# define pdf_image_addfilename get_tex_extension_count_register(13, 1) -# define pdf_objcompresslevel get_tex_extension_count_register(14, 0) -# define pdf_inclusion_copy_font get_tex_extension_count_register(15, 0) -# define pdf_gen_tounicode get_tex_extension_count_register(16, 0) -# define pdf_replace_font get_tex_extension_count_register(17, 0) - -# define pdf_h_origin get_tex_extension_dimen_register(1, one_inch) -# define pdf_v_origin get_tex_extension_dimen_register(2, one_inch) -# define pdf_thread_margin get_tex_extension_dimen_register(3, 0) -# define pdf_dest_margin get_tex_extension_dimen_register(4, 0) -# define pdf_link_margin get_tex_extension_dimen_register(5, 0) - -# define pdf_page_attr get_tex_extension_toks_register(1) -# define pdf_page_resources get_tex_extension_toks_register(2) -# define pdf_pages_attr get_tex_extension_toks_register(3) -# define pdf_xform_attr get_tex_extension_toks_register(4) -# define pdf_xform_resources get_tex_extension_toks_register(5) -# define pdf_pk_mode get_tex_extension_toks_register(6) - -# define set_pdf_minor_version(i) set_tex_extension_count_register( 6,i) -# define set_pdf_compress_level(i) set_tex_extension_count_register( 1,i) -# define set_pdf_objcompresslevel(i) set_tex_extension_count_register(14,i) +typedef enum { + c_pdf_compress_level = 0, + c_pdf_decimal_digits, + c_pdf_image_resolution, + c_pdf_pk_resolution, + c_pdf_unique_resname, + c_pdf_minor_version, + c_pdf_pagebox, + c_pdf_inclusion_errorlevel, + c_pdf_gamma, + c_pdf_image_apply_gamma, + c_pdf_image_gamma, + c_pdf_image_hicolor, + c_pdf_image_addfilename, + c_pdf_objcompresslevel, + c_pdf_inclusion_copy_font, + c_pdf_gen_tounicode, + c_pdf_replace_font, +} pdf_backend_counters ; + +typedef enum { + d_pdf_h_origin = 0, + d_pdf_v_origin, + d_pdf_thread_margin, + d_pdf_dest_margin, + d_pdf_link_margin, +} pdf_backend_dimensions ; + +typedef enum { + t_pdf_page_attr = 0, + t_pdf_page_resources, + t_pdf_pages_attr, + t_pdf_xform_attr, + t_pdf_xform_resources, + t_pdf_pk_mode, +} pdf_backend_tokenlists ; + +# define pdf_compress_level get_tex_extension_count_register(c_pdf_compress_level) +# define pdf_decimal_digits get_tex_extension_count_register(c_pdf_decimal_digits) +# define pdf_image_resolution get_tex_extension_count_register(c_pdf_image_resolution) +# define pdf_pk_resolution get_tex_extension_count_register(c_pdf_pk_resolution) +# define pdf_unique_resname get_tex_extension_count_register(c_pdf_unique_resname) +# define pdf_minor_version get_tex_extension_count_register(c_pdf_minor_version) +# define pdf_pagebox get_tex_extension_count_register(c_pdf_pagebox) +# define pdf_inclusion_errorlevel get_tex_extension_count_register(c_pdf_inclusion_errorlevel) +# define pdf_gamma get_tex_extension_count_register(c_pdf_gamma) +# define pdf_image_apply_gamma get_tex_extension_count_register(c_pdf_image_apply_gamma) +# define pdf_image_gamma get_tex_extension_count_register(c_pdf_image_gamma) +# define pdf_image_hicolor get_tex_extension_count_register(c_pdf_image_hicolor) +# define pdf_image_addfilename get_tex_extension_count_register(c_pdf_image_addfilename) +# define pdf_objcompresslevel get_tex_extension_count_register(c_pdf_objcompresslevel) +# define pdf_inclusion_copy_font get_tex_extension_count_register(c_pdf_inclusion_copy_font) +# define pdf_gen_tounicode get_tex_extension_count_register(c_pdf_gen_tounicode) +# define pdf_replace_font get_tex_extension_count_register(c_pdf_replace_font) + +# define pdf_h_origin get_tex_extension_dimen_register(d_pdf_h_origin) +# define pdf_v_origin get_tex_extension_dimen_register(d_pdf_v_origin) +# define pdf_thread_margin get_tex_extension_dimen_register(d_pdf_thread_margin) +# define pdf_dest_margin get_tex_extension_dimen_register(d_pdf_dest_margin) +# define pdf_link_margin get_tex_extension_dimen_register(d_pdf_link_margin) + +# define pdf_page_attr get_tex_extension_toks_register(t_pdf_page_attr) +# define pdf_page_resources get_tex_extension_toks_register(t_pdf_page_resources) +# define pdf_pages_attr get_tex_extension_toks_register(t_pdf_pages_attr) +# define pdf_xform_attr get_tex_extension_toks_register(t_pdf_xform_attr) +# define pdf_xform_resources get_tex_extension_toks_register(t_pdf_xform_resources) +# define pdf_pk_mode get_tex_extension_toks_register(t_pdf_pk_mode) + +# define set_pdf_minor_version(i) set_tex_extension_count_register(c_pdf_minor_version,i) +# define set_pdf_compress_level(i) set_tex_extension_count_register(c_pdf_compress_level,i) +# define set_pdf_objcompresslevel(i) set_tex_extension_count_register(c_pdf_objcompresslevel,i) #endif /* PDFTABLES_H */ diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.h b/Build/source/texk/web2c/luatexdir/tex/commands.h index b047f837410..ef0e5d796df 100644 --- a/Build/source/texk/web2c/luatexdir/tex/commands.h +++ b/Build/source/texk/web2c/luatexdir/tex/commands.h @@ -268,22 +268,6 @@ typedef enum { pdf_variable_code, } convert_codes; -/* typedef enum { */ -/* pdf_font_name_code = 32, */ -/* pdf_font_objnum_code, */ -/* pdf_font_size_code, */ -/* pdf_page_ref_code, */ -/* pdf_xform_name_code, */ -/* pdf_creation_date_code, */ -/* pdf_colorstack_init_code,*/ -/* pdf_last_obj_code, */ -/* pdf_last_annot_code, */ -/* pdf_retval_code, */ -/* pdf_last_link_code, */ -/* pdf_version_code, */ -/* pdf_revision_code, */ -/* } convert_codes_pdf; */ - typedef enum { lastpenalty_code = 0, /* code for \.{\\lastpenalty} */ lastattr_code, /* not used */ diff --git a/Build/source/texk/web2c/luatexdir/tex/equivalents.h b/Build/source/texk/web2c/luatexdir/tex/equivalents.h index f21bf04c6a0..8a7debe8345 100644 --- a/Build/source/texk/web2c/luatexdir/tex/equivalents.h +++ b/Build/source/texk/web2c/luatexdir/tex/equivalents.h @@ -172,12 +172,10 @@ here, and the |number_regs| \.{\\dimen} registers. # define err_help_loc (local_base+9) /* points to token list for \.{\\errhelp} */ # define every_eof_loc (local_base+10) /* points to token list for \.{\\everyeof} */ -/* define toks_base (local_base+11) */ /* table of |number_regs| token list registers */ - # define backend_toks_base (local_base+11) -# define backend_toks_last (backend_toks_base+10) +# define backend_toks_last (local_base+20) -# define toks_base (backend_toks_last+1) /* table of |number_regs| token list registers */ +# define toks_base (local_base+21) /* table of |number_regs| token list registers */ # define etex_pen_base (toks_base+number_regs) /* start of table of \eTeX's penalties */ # define inter_line_penalties_loc (etex_pen_base) /* additional penalties between lines */ @@ -293,13 +291,12 @@ here, and the |number_regs| \.{\\dimen} registers. # define math_no_char_italic_code 92 /* just for tracing, can change */ # define math_use_old_fraction_scaling_code 93 /* just for tracing, can change */ # define math_old_code 94 /* this one is stable */ - # define math_option_code 95 -# define backend_int_base (math_option_code+1) -# define backend_int_last (backend_int_base+20) +# define backend_int_base (int_base+96) +# define backend_int_last (int_base+115) -# define tex_int_pars (backend_int_last+1) /* total number of integer parameters */ +# define tex_int_pars (116) /* total number of integer parameters */ # define page_direction_code (tex_int_pars) # define body_direction_code (tex_int_pars+1) @@ -342,14 +339,12 @@ here, and the |number_regs| \.{\\dimen} registers. # define page_bottom_offset_code 24 # define px_dimen_code 25 # define page_width_code 26 /* page width of the output */ -# define page_height_code 27 /* page height of the output */ - -/* define dimen_pars (page_height_code + 1) */ /* total number of dimension parameters */ +# define page_height_code 27 /* page height of the output */ /* total number of dimension parameters */ -# define backend_dimen_base (page_height_code+1) -# define backend_dimen_last (backend_dimen_base+10) +# define backend_dimen_base (dimen_base+28) +# define backend_dimen_last (dimen_base+37) -# define dimen_pars (backend_dimen_last + 1) /* total number of dimension parameters */ +# define dimen_pars (38) /* total number of dimension parameters */ # define scaled_base (dimen_base+dimen_pars) /* table of |number_regs| user-defined \.{\\dimen} registers */ # define eqtb_size (scaled_base+biggest_reg) /* largest subscript of |eqtb| */ diff --git a/Build/source/texk/web2c/luatexdir/tex/extensions.h b/Build/source/texk/web2c/luatexdir/tex/extensions.h index 8cf116169d0..4909b9b95f6 100644 --- a/Build/source/texk/web2c/luatexdir/tex/extensions.h +++ b/Build/source/texk/web2c/luatexdir/tex/extensions.h @@ -89,9 +89,9 @@ extern halfword last_line_fill; /* the |par_fill_skip| glue node of the new para # define get_tex_attribute_register(j) attribute(j) # define get_tex_box_register(j) box(j) -extern int get_tex_extension_count_register(int i, int d); +extern int get_tex_extension_count_register(int i); extern void set_tex_extension_count_register(int i, int d); -extern int get_tex_extension_dimen_register(int i, int d); +extern int get_tex_extension_dimen_register(int i); extern void set_tex_extension_dimen_register(int i, int d); extern int get_tex_extension_toks_register (int i); @@ -150,40 +150,4 @@ typedef enum { pdf_extension_code, } extension_codes ; -/* for the moment there */ - -/* reserved, first needs to be larger than max extension_codes */ - -/* typedef enum { */ -/* pdf_literal_code = 32, */ -/* pdf_dest_code, */ -/* pdf_annot_code, */ -/* pdf_save_code, */ -/* pdf_restore_code, */ -/* pdf_setmatrix_code, */ -/* pdf_obj_code, */ -/* pdf_refobj_code, */ -/* pdf_colorstack_code, */ -/* pdf_start_link_code, */ -/* pdf_end_link_code, */ -/* pdf_link_data_code, */ -/* pdf_start_thread_code, */ -/* pdf_end_thread_code, */ -/* pdf_thread_code, */ -/* pdf_outline_code, */ -/* pdf_glyph_to_unicode_code, */ -/* pdf_catalog_code, */ -/* pdf_font_attr_code, */ -/* pdf_map_file_code, */ -/* pdf_map_line_code, */ -/* pdf_include_chars_code, */ -/* pdf_info_code, */ -/* pdf_names_code, */ -/* pdf_trailer_code, */ -/* } pdf_extension_codes; */ -/* */ -/* typedef enum { */ -/* dvi_literal_code = 32, */ -/* } dvi_extension_codes; */ - #endif diff --git a/Build/source/texk/web2c/luatexdir/tex/extensions.w b/Build/source/texk/web2c/luatexdir/tex/extensions.w index c1e289fd438..37736cc5a1a 100644 --- a/Build/source/texk/web2c/luatexdir/tex/extensions.w +++ b/Build/source/texk/web2c/luatexdir/tex/extensions.w @@ -897,78 +897,31 @@ defines are not available. #define get_tex_attribute_register(j) attribute(j) #define get_tex_box_register(j) box(j) -/* - -int get_tex_extension_count_register(const char *s, int d) -{ - int cs; - cs = string_lookup(s,strlen(s)); - if ((cs == undefined_control_sequence || cs == undefined_cs_cmd)) - return d; - return (int) get_tex_count_register((equiv(cs) - count_base)); -} - -void set_tex_extension_count_register(const char *s, int d) -{ - int cs; - cs = string_lookup(s,strlen(s)); - if ((cs == undefined_control_sequence || cs == undefined_cs_cmd)) - return; - get_tex_count_register((equiv(cs) - count_base)) = d; -} - -int get_tex_extension_dimen_register(const char *s, int d) -{ - int cs; - cs = string_lookup(s,strlen(s)); - if ((cs == undefined_control_sequence || cs == undefined_cs_cmd)) - return d; - return (int) get_tex_dimen_register((equiv(cs) - scaled_base)); -} - -void set_tex_extension_dimen_register(const char *s, int d) -{ - int cs; - cs = string_lookup(s,strlen(s)); - if ((cs == undefined_control_sequence || cs == undefined_cs_cmd)) - return; - get_tex_dimen_register((equiv(cs) - scaled_base)) = d; -} - -int get_tex_extension_toks_register(const char *s) -{ - int cs; - cs = string_lookup(s,strlen(s)); - if ((cs == undefined_control_sequence || cs == undefined_cs_cmd)) - return null; - return toks((equiv(cs) - toks_base)); -} - -*/ +/* these can now be macros (todo) */ -int get_tex_extension_count_register(int i, int d) +int get_tex_extension_count_register(int i) { - return (int) int_par(backend_int_base+i); + return (int) int_par(backend_int_base-int_base+i); } void set_tex_extension_count_register(int i, int d) { - int_par(backend_int_base+i) = d; + int_par(backend_int_base-int_base+i) = d; } -int get_tex_extension_dimen_register(int i, int d) +int get_tex_extension_dimen_register(int i) { - return (int) dimen_par(backend_dimen_base+i); + return (int) dimen_par(backend_dimen_base-dimen_base+i); } void set_tex_extension_dimen_register(int i, int d) { - dimen_par(backend_dimen_base+i) = d; + dimen_par(backend_dimen_base-dimen_base+i) = d; } int get_tex_extension_toks_register(int i) { - return equiv(backend_toks_base+i); /* brr */ + return equiv(backend_toks_base+i); } int set_tex_dimen_register(int j, scaled v) diff --git a/Build/source/texk/web2c/luatexdir/tex/mlist.w b/Build/source/texk/web2c/luatexdir/tex/mlist.w index ccb882b521c..a948d42b1a1 100644 --- a/Build/source/texk/web2c/luatexdir/tex/mlist.w +++ b/Build/source/texk/web2c/luatexdir/tex/mlist.w @@ -2577,6 +2577,7 @@ static pointer check_nucleus_complexity(halfword q, scaled * delta, int cur_styl static scaled make_op(pointer q, int cur_style) { scaled delta = 0; /* offset between subscript and superscript */ + scaled dummy = 0; pointer p, v, x, y, z, n; /* temporary registers for box construction */ int c; /* register for character examination */ scaled shift_up, shift_down; /* dimensions for box calculation */ @@ -2652,14 +2653,21 @@ static scaled make_op(pointer q, int cur_style) if (is_new_mathfont(cur_f)) { if (delta != 0) { delta = half(delta) ; - /* similar code then the caller */ - p = check_nucleus_complexity(q, 0, cur_style); - if ((subscr(q) == null) && (supscr(q) == null)) { - assign_new_hlist(q, p); - } else { - make_scripts(q, p, 0, cur_style, delta, -delta); - } - delta = 0; + } + p = check_nucleus_complexity(q, &dummy, cur_style); + if ((subscr(q) == null) && (supscr(q) == null)) { + assign_new_hlist(q, p); + } else { + make_scripts(q, p, 0, cur_style, delta, -delta); + } + delta = 0; + } else { + /* similar code then the caller (before CHECK_DIMENSIONS) */ + p = check_nucleus_complexity(q, &delta, cur_style); + if ((subscr(q) == null) && (supscr(q) == null)) { + assign_new_hlist(q, p); + } else { + make_scripts(q, p, delta, cur_style, 0, 0); } } } else if (subtype(q) == op_noad_type_limits) { diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.w b/Build/source/texk/web2c/luatexdir/tex/textoken.w index 1b1e9e5f095..43445721435 100644 --- a/Build/source/texk/web2c/luatexdir/tex/textoken.w +++ b/Build/source/texk/web2c/luatexdir/tex/textoken.w @@ -302,16 +302,16 @@ a real control sequence named \.{BAD} would come out `\.{\\BAD\ }'. #define not_so_bad(p) \ switch (m) { \ case assign_int_cmd: \ - if (c >= (int_base+backend_int_base) && c <= (int_base+backend_int_last)) \ - p("[internal backend variable]"); \ + if (c >= (backend_int_base) && c <= (backend_int_last)) \ + p("[internal backend integer]"); \ break; \ case assign_dimen_cmd: \ - if (c >= (dimen_base+backend_dimen_base) && c <= (int_base+backend_dimen_last)) \ - p("[internal backend variable]"); \ + if (c >= (backend_dimen_base) && c <= (backend_dimen_last)) \ + p("[internal backend dimension]"); \ break; \ case assign_toks_cmd: \ if (c >= (backend_toks_base) && c <= (backend_toks_last)) \ - p("[internal backend variable]"); \ + p("[internal backend tokenlist]"); \ break; \ default: \ p("BAD"); \ @@ -1747,59 +1747,56 @@ static int do_variable_dvi(halfword c) return 0; } -#define backend_dimen(A) eqtb[scaled_base+(A)].hh.rh -#define backend_count(A) eqtb[count_base+(A)].hh.rh - #define do_variable_backend_int(i) \ cur_cmd = assign_int_cmd; \ - cur_val = backend_int_base + i + int_base; \ + cur_val = backend_int_base + i; \ cur_tok = token_val(cur_cmd, cur_val); \ back_input(); #define do_variable_backend_dimen(i) \ cur_cmd = assign_dimen_cmd; \ - cur_val = backend_dimen_base + i + dimen_base; \ + cur_val = backend_dimen_base + i; \ cur_tok = token_val(cur_cmd, cur_val); \ back_input(); #define do_variable_backend_toks(i) \ cur_cmd = assign_toks_cmd; \ - cur_val = backend_toks_base + i ; /* + local_base ; */ \ + cur_val = backend_toks_base + i ; \ cur_tok = token_val(cur_cmd, cur_val); \ back_input(); static int do_variable_pdf(halfword c) { - if (scan_keyword("compresslevel")) { do_variable_backend_int( 1); } - else if (scan_keyword("decimaldigits")) { do_variable_backend_int( 2); } - else if (scan_keyword("imageresolution")) { do_variable_backend_int( 3); } - else if (scan_keyword("pkresolution")) { do_variable_backend_int( 4); } - else if (scan_keyword("uniqueresname")) { do_variable_backend_int( 5); } - else if (scan_keyword("minorversion")) { do_variable_backend_int( 6); } - else if (scan_keyword("pagebox")) { do_variable_backend_int( 7); } - else if (scan_keyword("inclusionerrorlevel")) { do_variable_backend_int( 8); } - else if (scan_keyword("gamma")) { do_variable_backend_int( 9); } - else if (scan_keyword("imageapplygamma")) { do_variable_backend_int(10); } - else if (scan_keyword("imagegamma")) { do_variable_backend_int(11); } - else if (scan_keyword("imagehicolor")) { do_variable_backend_int(12); } - else if (scan_keyword("imageaddfilename")) { do_variable_backend_int(13); } - else if (scan_keyword("objcompresslevel")) { do_variable_backend_int(14); } - else if (scan_keyword("inclusioncopyfonts")) { do_variable_backend_int(15); } - else if (scan_keyword("gentounicode")) { do_variable_backend_int(16); } - else if (scan_keyword("replacefont")) { do_variable_backend_int(17); } - - else if (scan_keyword("horigin")) { do_variable_backend_dimen(1); } - else if (scan_keyword("vorigin")) { do_variable_backend_dimen(2); } - else if (scan_keyword("threadmargin")) { do_variable_backend_dimen(3); } - else if (scan_keyword("destmargin")) { do_variable_backend_dimen(4); } - else if (scan_keyword("linkmargin")) { do_variable_backend_dimen(5); } - - else if (scan_keyword("pageattr")) { do_variable_backend_toks(1); } - else if (scan_keyword("pageresources")) { do_variable_backend_toks(2); } - else if (scan_keyword("pagesattr")) { do_variable_backend_toks(3); } - else if (scan_keyword("xformattr")) { do_variable_backend_toks(4); } - else if (scan_keyword("xformresources")) { do_variable_backend_toks(5); } - else if (scan_keyword("pkmode")) { do_variable_backend_toks(6); } + if (scan_keyword("compresslevel")) { do_variable_backend_int(c_pdf_compress_level); } + else if (scan_keyword("decimaldigits")) { do_variable_backend_int(c_pdf_decimal_digits); } + else if (scan_keyword("imageresolution")) { do_variable_backend_int(c_pdf_image_resolution); } + else if (scan_keyword("pkresolution")) { do_variable_backend_int(c_pdf_pk_resolution); } + else if (scan_keyword("uniqueresname")) { do_variable_backend_int(c_pdf_unique_resname); } + else if (scan_keyword("minorversion")) { do_variable_backend_int(c_pdf_minor_version); } + else if (scan_keyword("pagebox")) { do_variable_backend_int(c_pdf_pagebox); } + else if (scan_keyword("inclusionerrorlevel")) { do_variable_backend_int(c_pdf_inclusion_errorlevel); } + else if (scan_keyword("gamma")) { do_variable_backend_int(c_pdf_gamma); } + else if (scan_keyword("imageapplygamma")) { do_variable_backend_int(c_pdf_image_apply_gamma); } + else if (scan_keyword("imagegamma")) { do_variable_backend_int(c_pdf_image_gamma); } + else if (scan_keyword("imagehicolor")) { do_variable_backend_int(c_pdf_image_hicolor); } + else if (scan_keyword("imageaddfilename")) { do_variable_backend_int(c_pdf_image_addfilename); } + else if (scan_keyword("objcompresslevel")) { do_variable_backend_int(c_pdf_objcompresslevel); } + else if (scan_keyword("inclusioncopyfonts")) { do_variable_backend_int(c_pdf_inclusion_copy_font); } + else if (scan_keyword("gentounicode")) { do_variable_backend_int(c_pdf_gen_tounicode); } + else if (scan_keyword("replacefont")) { do_variable_backend_int(c_pdf_replace_font); } + + else if (scan_keyword("horigin")) { do_variable_backend_dimen(d_pdf_h_origin); } + else if (scan_keyword("vorigin")) { do_variable_backend_dimen(d_pdf_v_origin); } + else if (scan_keyword("threadmargin")) { do_variable_backend_dimen(d_pdf_thread_margin); } + else if (scan_keyword("destmargin")) { do_variable_backend_dimen(d_pdf_dest_margin); } + else if (scan_keyword("linkmargin")) { do_variable_backend_dimen(d_pdf_link_margin); } + + else if (scan_keyword("pageattr")) { do_variable_backend_toks(t_pdf_page_attr); } + else if (scan_keyword("pageresources")) { do_variable_backend_toks(t_pdf_page_resources); } + else if (scan_keyword("pagesattr")) { do_variable_backend_toks(t_pdf_pages_attr); } + else if (scan_keyword("xformattr")) { do_variable_backend_toks(t_pdf_xform_attr); } + else if (scan_keyword("xformresources")) { do_variable_backend_toks(t_pdf_xform_resources); } + else if (scan_keyword("pkmode")) { do_variable_backend_toks(t_pdf_pk_mode); } else return 0; |