summaryrefslogtreecommitdiff
path: root/Build/source
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-04-08 23:03:26 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-04-08 23:03:26 +0000
commit3fd7648a91e4a246614153c829d00b5a551a98ab (patch)
tree3d22680a39a74ba848e30ada71e2d95b7bf2d4be /Build/source
parentf2767a6a4e94c12bc54f6a5a3c3e2a2511dd96d4 (diff)
web2c/luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@40356 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source')
-rw-r--r--Build/source/texk/web2c/luatexdir/lang/texlang.w4
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnodelib.c20
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luatex-api.h9
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/luatoken.w1
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/commands.h3
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/commands.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/dumpdata.w2
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/linebreak.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/maincontrol.w18
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texnodes.h5
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texnodes.w24
11 files changed, 69 insertions, 29 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lang/texlang.w b/Build/source/texk/web2c/luatexdir/lang/texlang.w
index 07f6de1f469..68cb0581cd2 100644
--- a/Build/source/texk/web2c/luatexdir/lang/texlang.w
+++ b/Build/source/texk/web2c/luatexdir/lang/texlang.w
@@ -709,6 +709,10 @@ static halfword find_next_wordstart(halfword r, halfword first_language)
while (r != null) {
switch (type(r)) {
case boundary_node:
+ if (subtype(r) == word_boundary) {
+ start_ok = 1;
+ }
+ break;
case whatsit_node:
break;
case glue_node:
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
index 5967a67c790..7ff2eb7c3bd 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
@@ -1956,10 +1956,13 @@ static int lua_nodelib_subtypes(lua_State * L)
s = lua_tostring(L,1);
if (lua_key_eq(s,glyph)) subtypes = node_subtypes_glyph;
else if (lua_key_eq(s,glue)) { subtypes = node_subtypes_glue; l = 1; }
+ else if (lua_key_eq(s,boundary)) subtypes = node_subtypes_boundary;
else if (lua_key_eq(s,penalty)) subtypes = node_subtypes_penalty;
else if (lua_key_eq(s,kern)) subtypes = node_subtypes_kern;
else if (lua_key_eq(s,rule)) subtypes = node_subtypes_rule;
- else if (lua_key_eq(s,list)) subtypes = node_subtypes_list;
+ else if (lua_key_eq(s,list)
+ || lua_key_eq(s,hlist)
+ || lua_key_eq(s,vlist)) subtypes = node_subtypes_list; /* too many but ok as reserved */
else if (lua_key_eq(s,adjust)) subtypes = node_subtypes_adjust;
else if (lua_key_eq(s,disc)) subtypes = node_subtypes_disc;
else if (lua_key_eq(s,fill)) subtypes = node_subtypes_fill;
@@ -1978,11 +1981,12 @@ static int lua_nodelib_subtypes(lua_State * L)
t = lua_tointeger(L,1);
if (t == glyph_node) subtypes = node_subtypes_glyph;
else if (t == glue_node) { subtypes = node_subtypes_glue; l = 1; }
+ else if (t == boundary_node) subtypes = node_subtypes_boundary;
else if (t == penalty_node) subtypes = node_subtypes_penalty;
else if (t == kern_node) subtypes = node_subtypes_kern;
else if (t == rule_node) subtypes = node_subtypes_rule;
- else if (t == hlist_node) subtypes = node_subtypes_list;
- else if (t == vlist_node) subtypes = node_subtypes_list;
+ else if((t == hlist_node)
+ || (t == vlist_node)) subtypes = node_subtypes_list;
else if (t == adjust_node) subtypes = node_subtypes_adjust;
else if (t == disc_node) subtypes = node_subtypes_disc;
else if (t == glue_spec_node) subtypes = node_subtypes_fill;
@@ -3131,6 +3135,8 @@ static int lua_nodelib_fast_getfield(lua_State * L)
fast_metatable_or_nil(vlink(post_break(n)));
} else if (lua_key_eq(s, replace)) {
fast_metatable_or_nil(vlink(no_break(n)));
+ } else if (lua_key_eq(s, penalty)) {
+ lua_pushinteger(L, disc_penalty(n));
} else {
lua_pushnil(L);
}
@@ -3875,6 +3881,8 @@ static int lua_nodelib_direct_getfield(lua_State * L)
nodelib_pushdirect_or_nil(vlink(post_break(n)));
} else if (lua_key_eq(s, replace)) {
nodelib_pushdirect_or_nil(vlink(no_break(n)));
+ } else if (lua_key_eq(s, penalty)) {
+ lua_pushinteger(L, disc_penalty(n));
} else {
lua_pushnil(L);
}
@@ -5136,6 +5144,8 @@ static int lua_nodelib_fast_setfield(lua_State * L)
set_disc_field(post_break(n), nodelib_getlist(L, 3));
} else if (lua_key_eq(s, replace)) {
set_disc_field(no_break(n), nodelib_getlist(L, 3));
+ } else if (lua_key_eq(s, penalty)) {
+ disc_penalty(n) = (quarterword) lua_tointeger(L, 3);
} else {
return nodelib_cantset(L, n, s);
}
@@ -5892,7 +5902,7 @@ static int lua_nodelib_direct_setdiscretionary(lua_State * L)
if (t > 4) {
subtype(n) = (quarterword) lua_tointeger(L,5);
if (t > 5) {
- penalty(n) = lua_tointeger(L,6);
+ disc_penalty(n) = lua_tointeger(L,6);
}
}
} else {
@@ -6022,6 +6032,8 @@ static int lua_nodelib_direct_setfield(lua_State * L)
set_disc_field(post_break(n), nodelib_popdirect(3));
} else if (lua_key_eq(s, replace)) {
set_disc_field(no_break(n), nodelib_popdirect(3));
+ } else if (lua_key_eq(s, penalty)) {
+ disc_penalty(n) = (quarterword) lua_tointeger(L, 3);
} else {
return nodelib_cantset(L, n, s);
}
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
index 6e78434f13a..f671842d688 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
+++ b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h
@@ -503,6 +503,7 @@ make_lua_key(bot);\
make_lua_key(bot_accent);\
make_lua_key(bottom_left);\
make_lua_key(bottom_right);\
+make_lua_key(boundary);\
make_lua_key(box);\
make_lua_key(box_left);\
make_lua_key(box_left_width);\
@@ -597,6 +598,7 @@ make_lua_key(hangindent);\
make_lua_key(hbox);\
make_lua_key(head);\
make_lua_key(height);\
+make_lua_key(hlist);\
make_lua_key(hmode_par);\
make_lua_key(hold_head);\
make_lua_key(horiz_variants);\
@@ -808,6 +810,7 @@ make_lua_key(vert_italic);\
make_lua_key(vert_variants);\
make_lua_key(vmode_par);\
make_lua_key(visiblefilename);\
+make_lua_key(vlist);\
make_lua_key(vtop);\
make_lua_key(widowpenalty);\
make_lua_key(width);\
@@ -864,6 +867,7 @@ init_lua_key(bot);\
init_lua_key(bot_accent);\
init_lua_key(bottom_left);\
init_lua_key(bottom_right);\
+init_lua_key(boundary);\
init_lua_key(box);\
init_lua_key(box_left);\
init_lua_key(box_left_width);\
@@ -957,6 +961,7 @@ init_lua_key(hangindent);\
init_lua_key(hbox);\
init_lua_key(head);\
init_lua_key(height);\
+init_lua_key(hlist);\
init_lua_key(hmode_par);\
init_lua_key(hold_head);\
init_lua_key(horiz_variants);\
@@ -1158,6 +1163,7 @@ init_lua_key(vert_italic);\
init_lua_key(vert_variants);\
init_lua_key(vmode_par);\
init_lua_key(visiblefilename);\
+init_lua_key(vlist);\
init_lua_key(vtop);\
init_lua_key(widowpenalty);\
init_lua_key(width);\
@@ -1271,6 +1277,7 @@ use_lua_key(bot);
use_lua_key(bot_accent);
use_lua_key(bottom_left);
use_lua_key(bottom_right);
+use_lua_key(boundary);
use_lua_key(box);
use_lua_key(box_left);
use_lua_key(box_left_width);
@@ -1365,6 +1372,7 @@ use_lua_key(hangindent);
use_lua_key(hbox);
use_lua_key(head);
use_lua_key(height);
+use_lua_key(hlist);
use_lua_key(hmode_par);
use_lua_key(hold_head);
use_lua_key(horiz_variants);
@@ -1576,6 +1584,7 @@ use_lua_key(vert_italic);
use_lua_key(vert_variants);
use_lua_key(vmode_par);
use_lua_key(visiblefilename);
+use_lua_key(vlist);
use_lua_key(vtop);
use_lua_key(widowpenalty);
use_lua_key(width);
diff --git a/Build/source/texk/web2c/luatexdir/lua/luatoken.w b/Build/source/texk/web2c/luatexdir/lua/luatoken.w
index 9001026ca45..893519b5925 100644
--- a/Build/source/texk/web2c/luatexdir/lua/luatoken.w
+++ b/Build/source/texk/web2c/luatexdir/lua/luatoken.w
@@ -94,7 +94,6 @@ command_item command_names[] = {
{"omit", omit_cmd, NULL},
{"ex_space", ex_space_cmd, NULL},
{"boundary", boundary_cmd, NULL},
- {"no_boundary", no_boundary_cmd, NULL},
{"radical", radical_cmd, NULL},
{"super_sub_script", super_sub_script_cmd, NULL},
{"math_shift_cs", math_shift_cs_cmd, NULL},
diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.h b/Build/source/texk/web2c/luatexdir/tex/commands.h
index 60bfef895d2..edaeb72fe28 100644
--- a/Build/source/texk/web2c/luatexdir/tex/commands.h
+++ b/Build/source/texk/web2c/luatexdir/tex/commands.h
@@ -139,8 +139,7 @@ typedef enum {
end_group_cmd, /* end local grouping ( \.{\\endgroup} ) */
omit_cmd, /* omit alignment template ( \.{\\omit} ) */
ex_space_cmd, /* explicit space ( \.{\\\ } ) */
- boundary_cmd, /* insert boundry node with value ( \.{\\boundary} ) */
- no_boundary_cmd, /* suppress boundary ligatures ( \.{\\noboundary} ) */
+ boundary_cmd, /* insert boundry node with value ( \.{\\*boundary} ) */
radical_cmd, /* square root and similar signs ( \.{\\radical} ) */
super_sub_script_cmd, /* explicit super- or subscript */
math_shift_cs_cmd, /* start- and endmath */
diff --git a/Build/source/texk/web2c/luatexdir/tex/commands.w b/Build/source/texk/web2c/luatexdir/tex/commands.w
index 4f796a7b1a7..ece74a5406b 100644
--- a/Build/source/texk/web2c/luatexdir/tex/commands.w
+++ b/Build/source/texk/web2c/luatexdir/tex/commands.w
@@ -201,8 +201,10 @@ void initialize_commands(void)
primitive_luatex("Ustack", math_choice_cmd, 1, 0);
primitive_tex("multiply", multiply_cmd, 0, 0);
primitive_tex("noalign", no_align_cmd, 0, 0);
- primitive_tex("boundary", boundary_cmd, 0, 0);
- primitive_tex("noboundary", no_boundary_cmd, 0, 0);
+ primitive_tex("noboundary", boundary_cmd, 0, 0);
+ primitive_tex("boundary", boundary_cmd, 1, 0);
+ primitive_tex("protrusionboundary", boundary_cmd, 2, 0);
+ primitive_tex("wordboundary", boundary_cmd, 3, 0);
primitive_tex("noexpand", no_expand_cmd, 0, 0);
primitive_luatex("primitive", no_expand_cmd, 1, 0);
primitive_tex("nonscript", non_script_cmd, 0, 0);
diff --git a/Build/source/texk/web2c/luatexdir/tex/dumpdata.w b/Build/source/texk/web2c/luatexdir/tex/dumpdata.w
index be5f0074639..993ad8a16c0 100644
--- a/Build/source/texk/web2c/luatexdir/tex/dumpdata.w
+++ b/Build/source/texk/web2c/luatexdir/tex/dumpdata.w
@@ -27,7 +27,7 @@
/* we start with 907: the sum of the values of the bytes of "don knuth" */
-#define FORMAT_ID (907+14)
+#define FORMAT_ID (907+15)
#if ((FORMAT_ID>=0) && (FORMAT_ID<=256))
#error Wrong value for FORMAT_ID.
#endif
diff --git a/Build/source/texk/web2c/luatexdir/tex/linebreak.w b/Build/source/texk/web2c/luatexdir/tex/linebreak.w
index 8b8f47bc9d5..6e74e0b27be 100644
--- a/Build/source/texk/web2c/luatexdir/tex/linebreak.w
+++ b/Build/source/texk/web2c/luatexdir/tex/linebreak.w
@@ -348,7 +348,8 @@ static boolean check_expand_pars(internal_font_number f)
l = pop_node(); /* don't visit this node again */
run = false;
}
-if ((vlink(l) != null) && (type(l) == boundary_node) && ((subtype(l) == 1) || (subtype(l) == 3))) {
+if ((vlink(l) != null) && (type(l) == boundary_node) && (subtype(l) == protrusion_boundary) &&
+ ((boundary_value(l) == 1) || (boundary_value(l) == 3))) {
/* skip next node */
l = vlink(l);
}
@@ -392,7 +393,8 @@ if ((vlink(l) != null) && (type(l) == boundary_node) && ((subtype(l) == 1) || (s
l = pop_node();
}
if ((r != l) && (r != null)) {
-if ((alink(r) != null) && (type(r) == boundary_node) && ((subtype(r) == 2) || (subtype(r) == 3))) {
+if ((alink(r) != null) && (type(r) == boundary_node) && (subtype(r) == protrusion_boundary) &&
+ ((boundary_value(r) == 2) || (boundary_value(r) == 3))) {
/* skip next node */
r = alink(r);
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
index af89da9d5d7..8f423c63a0e 100644
--- a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
+++ b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
@@ -231,17 +231,14 @@ static void run_app_space (void) {
@ Append a |boundary_node|
@c
-static void run_no_boundary (void) {
- halfword n ;
- n = new_node(boundary_node,cancel_boundary);
- couple_nodes(tail, n);
- tail = n;
-}
static void run_boundary (void) {
halfword n ;
- n = new_node(boundary_node,user_boundary);
- scan_int();
- boundary_value(n) = cur_val;
+ n = new_node(boundary_node,cur_chr);
+ if ((cur_chr == 1) || (cur_chr == 2) ) {
+ /* user boundary or protrusion boundary */
+ scan_int();
+ boundary_value(n) = cur_val;
+ }
couple_nodes(tail, n);
tail = n;
}
@@ -742,14 +739,12 @@ static void init_main_control (void) {
jump_table[hmode + ex_space_cmd] = run_app_space;
jump_table[mmode + ex_space_cmd] = run_app_space;
jump_table[hmode + boundary_cmd] = run_boundary;
- jump_table[hmode + no_boundary_cmd] = run_no_boundary;
jump_table[hmode + char_ghost_cmd] = run_char_ghost;
jump_table[mmode + char_ghost_cmd] = run_char_ghost;
any_mode(relax_cmd, run_relax);
jump_table[vmode + spacer_cmd] = run_relax;
jump_table[mmode + spacer_cmd] = run_relax;
jump_table[mmode + boundary_cmd] = run_relax;
- jump_table[mmode + no_boundary_cmd] = run_relax;
any_mode(ignore_spaces_cmd,run_ignore_spaces);
jump_table[vmode + stop_cmd] = run_stop;
jump_table[vmode + math_char_num_cmd] = run_non_math_math;
@@ -833,7 +828,6 @@ static void init_main_control (void) {
jump_table[vmode + valign_cmd] = run_new_graf;
jump_table[vmode + ex_space_cmd] = run_new_graf;
jump_table[vmode + boundary_cmd] = run_new_graf;
- jump_table[vmode + no_boundary_cmd] = run_new_graf;
jump_table[vmode + par_end_cmd] = run_par_end_vmode;
jump_table[hmode + par_end_cmd] = run_par_end_hmode;
jump_table[hmode + stop_cmd] = head_for_vmode;
diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.h b/Build/source/texk/web2c/luatexdir/tex/texnodes.h
index 20189f130f4..4db62bf61b8 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texnodes.h
+++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.h
@@ -649,7 +649,9 @@ typedef enum {
typedef enum {
cancel_boundary = 0,
- user_boundary
+ user_boundary,
+ protrusion_boundary,
+ word_boundary,
} boundary_subtypes ;
# define boundary_size 3
@@ -872,6 +874,7 @@ extern const char *node_subtypes_glue[];
extern const char *node_subtypes_mathglue[];
extern const char *node_subtypes_leader[];
extern const char *node_subtypes_fill[];
+extern const char *node_subtypes_boundary[];
extern const char *node_subtypes_penalty[];
extern const char *node_subtypes_kern[];
extern const char *node_subtypes_rule[];
diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.w b/Build/source/texk/web2c/luatexdir/tex/texnodes.w
index d5d2d2364b6..4cbd0c00bea 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texnodes.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.w
@@ -278,6 +278,9 @@ const char *node_subtypes_leader[] = { /* 100+ */
const char *node_subtypes_fill[] = {
"stretch", "fi", "fil", "fill", "filll", NULL
};
+const char *node_subtypes_boundary[] = {
+ "cancel", "user", "protrusion", "word", NULL
+};
const char *node_subtypes_penalty[] = {
"userpenalty", NULL
};
@@ -2978,11 +2981,24 @@ void show_node_list(int p)
case boundary_node:
if (subtype(p)==0) {
tprint_esc("noboundary");
- } else{
- tprint_esc("boundary");
+ } else {
+ switch (subtype(p)) {
+ case 1:
+ tprint_esc("boundary");
+ break;
+ case 2:
+ tprint_esc("protrusionboundary");
+ break;
+ case 3:
+ tprint_esc("wordboundary");
+ break;
+ default:
+ tprint_esc("boundary");
+ print_char(':');
+ print_int(subtype(p));
+ break;
+ }
print_char('=');
- print_int(subtype(p));
- print_char(':');
print_int(boundary_value(p));
}
break;