summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/tex
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/tex')
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/align.w7
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/buildpage.w9
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/directions.w36
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/errors.h5
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/errors.w77
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/mainbody.w9
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/maincontrol.w51
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/postlinebreak.w12
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texfileio.w51
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texmath.w6
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/texnodes.w21
-rw-r--r--Build/source/texk/web2c/luatexdir/tex/textoken.w45
12 files changed, 190 insertions, 139 deletions
diff --git a/Build/source/texk/web2c/luatexdir/tex/align.w b/Build/source/texk/web2c/luatexdir/tex/align.w
index 8330f03642e..de80cc0a093 100644
--- a/Build/source/texk/web2c/luatexdir/tex/align.w
+++ b/Build/source/texk/web2c/luatexdir/tex/align.w
@@ -21,8 +21,8 @@
@ @c
static const char _svn_version[] =
- "$Id: align.w 4442 2012-05-25 22:40:34Z hhenkel $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/align.w $";
+ "$Id: align.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/align.w $";
#include "ptexlib.h"
@@ -1140,7 +1140,8 @@ value is changed to zero and so is the next tabskip.
cur_list.tail_field = q;
if (cur_list.mode_field == vmode) {
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "alignment");
+ // lua_node_filter_s(buildpage_filter_callback, "alignment");
+ lua_node_filter_s(buildpage_filter_callback,lua_key_index(alignment));
build_page();
}
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/buildpage.w b/Build/source/texk/web2c/luatexdir/tex/buildpage.w
index 2623d66f90f..5e96e701c71 100644
--- a/Build/source/texk/web2c/luatexdir/tex/buildpage.w
+++ b/Build/source/texk/web2c/luatexdir/tex/buildpage.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: buildpage.w 4442 2012-05-25 22:40:34Z hhenkel $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/buildpage.w $";
+ "$Id: buildpage.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/buildpage.w $";
#include "ptexlib.h"
@@ -1053,7 +1053,8 @@ void resume_after_output(void)
flush_node_list(page_disc);
page_disc = null;
pop_nest();
- lua_node_filter_s(buildpage_filter_callback, "after_output");
- build_page();
+ //lua_node_filter_s(buildpage_filter_callback, "after_output");
+ lua_node_filter_s(buildpage_filter_callback,lua_key_index(after_output));
+ build_page();
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/directions.w b/Build/source/texk/web2c/luatexdir/tex/directions.w
index a859540ba09..704f8ff2508 100644
--- a/Build/source/texk/web2c/luatexdir/tex/directions.w
+++ b/Build/source/texk/web2c/luatexdir/tex/directions.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: directions.w 4709 2014-01-02 13:24:29Z oneiros $"
+ "$Id: directions.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/directions.w $";
#include "ptexlib.h"
@@ -56,7 +56,7 @@ void scan_direction(void)
cur_chr = save_cur_chr;
}
-@ the next two are used by postlinebreak.c
+@ the next two are used by postlinebreak.c
@c
halfword do_push_dir_node(halfword p, halfword a)
@@ -103,21 +103,21 @@ about the actual values of |dir_TRT| etc.
@c
const char *dir_strings[128] = {
- "-TLT","???", "???", "???", "-TRT","???", "???", "???",
- "???", "-LTL","???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "-RTT","???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "+TLT","???", "???", "???", "+TRT","???", "???", "???",
- "???", "+LTL","???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "+RTT","???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
- "???", "???", "???", "???", "???", "???", "???", "???",
+ "-TLT","???", "???", "???", "-TRT","???", "???", "???",
+ "???", "-LTL","???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "-RTT","???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "+TLT","???", "???", "???", "+TRT","???", "???", "???",
+ "???", "+LTL","???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "+RTT","???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
+ "???", "???", "???", "???", "???", "???", "???", "???",
"???", "???", "???", "???", "???", "???", "???", "???" };
const char *string_dir(int d)
@@ -129,6 +129,8 @@ const char *string_dir(int d)
@ @c
void print_dir(int d)
{
+ /* hh-ls: todo: just fetch the string pt from the registry ... then the above can go */
+
tprint(string_dir(d));
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.h b/Build/source/texk/web2c/luatexdir/tex/errors.h
index 2d55e31aa75..e0ea6e671ad 100644
--- a/Build/source/texk/web2c/luatexdir/tex/errors.h
+++ b/Build/source/texk/web2c/luatexdir/tex/errors.h
@@ -17,7 +17,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: errors.h 3385 2010-01-26 05:45:55Z taco $ */
+/* $Id: errors.h 4956 2014-03-28 12:12:17Z luigi $ */
#ifndef ERRORS_H
# define ERRORS_H
@@ -37,9 +37,10 @@ typedef enum {
extern int interaction; /* current level of interaction */
extern int interactionoption; /* set from command line */
-extern const char *last_error;
extern void initialize_errors(void);
+
+extern char *last_error;
extern void print_err(const char *s);
extern void fixup_selector(boolean log_opened);
diff --git a/Build/source/texk/web2c/luatexdir/tex/errors.w b/Build/source/texk/web2c/luatexdir/tex/errors.w
index 7c2601930c1..120d44b8a3c 100644
--- a/Build/source/texk/web2c/luatexdir/tex/errors.w
+++ b/Build/source/texk/web2c/luatexdir/tex/errors.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: errors.w 4563 2013-01-21 03:22:53Z khaled $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/errors.w $";
+ "$Id: errors.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/errors.w $";
#include "ptexlib.h"
@@ -53,22 +53,64 @@ message may be printed.
@c
int interaction; /* current level of interaction */
int interactionoption; /* set from command line */
-const char *last_error;
+
+/* ls-hh: so, new code only kicks in when we have a callback defined */
+
+char *last_error = NULL;
+int err_old_setting = 0 ;
+int in_error = 0 ;
+
+static void flush_err(void)
+{
+ str_number s_error;
+ char *s = NULL;
+ int callback_id ;
+ if (in_error) {
+ selector = err_old_setting;
+ str_room(1);
+ s_error = make_string();
+ s = makecstring(s_error);
+ flush_str(s_error);
+ if (interaction == error_stop_mode) {
+ wake_up_terminal();
+ }
+ xfree(last_error);
+ last_error = (string) xmalloc((unsigned) (strlen(s) + 1));
+ strcpy(last_error,s);
+ callback_id = callback_defined(show_error_message_callback);
+ if (callback_id > 0) {
+ run_callback(callback_id, "->");
+ } else {
+ tprint(s);
+ }
+ in_error = 0 ;
+ }
+}
void print_err(const char *s)
{
+ int callback_id = callback_defined(show_error_message_callback);
if (interaction == error_stop_mode) {
wake_up_terminal();
}
- if (filelineerrorstylep)
+ if (callback_id > 0) {
+ err_old_setting = selector;
+ selector = new_string;
+ in_error = 1 ;
+ }
+ if (filelineerrorstylep) {
print_file_line();
- else
+ } else {
tprint_nl("! ");
+ }
tprint(s);
- last_error = (const char *) s;
+ if (callback_id <= 0) {
+ xfree(last_error);
+ last_error = (string) xmalloc((unsigned) (strlen(s) + 1));
+ strcpy(last_error,s);
+ }
}
-
@ \TeX\ is careful not to call |error| when the print |selector| setting
might be unusual. The only possible values of |selector| at the time of
error messages are
@@ -142,7 +184,7 @@ occurs while \TeX\ is trying to fix a non-fatal one. But such recursion
@^recursion@>
is never more than two levels deep.
-@ Individual lines of help are recorded in the array |help_line|.
+@ Individual lines of help are recorded in the array |help_line|.
@c
const char *help_line[7]; /* helps for the next |error| */
@@ -178,13 +220,16 @@ void error(void)
int callback_id;
int s1, s2, s3, s4; /* used to save global variables when deleting tokens */
int i;
+ flush_err(); /* hh-ls */
if (history < error_message_issued)
history = error_message_issued;
- print_char('.');
callback_id = callback_defined(show_error_hook_callback);
- if (callback_id > 0)
+ if (callback_id > 0) {
run_callback(callback_id, "->");
- show_context();
+ } else {
+ print_char('.');
+ show_context();
+ }
if (haltonerrorp) {
history = fatal_error_stop;
jump_out();
@@ -440,10 +485,16 @@ void fatal_error(const char *s)
void lua_norm_error(const char *s)
{ /* lua found a problem */
int saved_new_line_char;
+ int report_id ;
saved_new_line_char = new_line_char;
new_line_char = 10;
- print_err("LuaTeX error ");
- tprint(s);
+ report_id = callback_defined(show_lua_error_hook_callback);
+ if (report_id == 0) {
+ print_err("LuaTeX error ");
+ tprint(s);
+ } else {
+ (void) run_callback(report_id, "->");
+ }
help2("The lua interpreter ran into a problem, so the",
"remainder of this lua chunk will be ignored.");
error();
diff --git a/Build/source/texk/web2c/luatexdir/tex/mainbody.w b/Build/source/texk/web2c/luatexdir/tex/mainbody.w
index 9aada03cf30..4fe5f20c30b 100644
--- a/Build/source/texk/web2c/luatexdir/tex/mainbody.w
+++ b/Build/source/texk/web2c/luatexdir/tex/mainbody.w
@@ -23,12 +23,12 @@
@ @c
static const char _svn_version[] =
- "$Id: mainbody.w 4877 2014-03-14 01:26:05Z luigi $"
+ "$Id: mainbody.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/mainbody.w $";
#include "ptexlib.h"
-@
+@
pdfTeX is copyright (C) 1996-2006 Han The Thanh, <thanh@@pdftex.org>.
e-TeX is copyright (C) 1994,98 by Peter Breitenlohner.
@@ -590,8 +590,7 @@ void final_cleanup(void)
else
end_file_reading();
while (open_parens > 0) {
- if (tracefilenames)
- tprint(" )");
+ report_stop_file(filetype_tex);
decr(open_parens);
}
if (cur_level > level_one) {
@@ -647,7 +646,7 @@ void final_cleanup(void)
}
@ Once \TeX\ is working, you should be able to diagnose most errors with
-the \.{\\show} commands and other diagnostic features.
+the \.{\\show} commands and other diagnostic features.
An additional routine called |debug_help|
will come into play when you type `\.D' after an error message;
|debug_help| also occurs just before a fatal error causes \TeX\ to succumb.
diff --git a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
index 305def96472..5ee630dc24d 100644
--- a/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
+++ b/Build/source/texk/web2c/luatexdir/tex/maincontrol.w
@@ -19,10 +19,11 @@
@ @c
static const char _svn_version[] =
- "$Id: maincontrol.w 4562 2013-01-21 02:58:59Z khaled $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/maincontrol.w $";
+ "$Id: maincontrol.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/maincontrol.w $";
#include "ptexlib.h"
+#include "lua/luatex-api.h"
@ @c
#define explicit 1
@@ -97,7 +98,7 @@ static const char _svn_version[] =
#define prev_graf cur_list.pg_field
#define dir_save cur_list.dirs_field
-#define check_filter(A) if (!output_active) lua_node_filter_s(buildpage_filter_callback,(A))
+#define check_filter(A) if (!output_active) lua_node_filter_s(buildpage_filter_callback,lua_key_index(A))
#define var_code 7 /* math code meaning ``use the current family'' */
@@ -196,21 +197,21 @@ Here are all the functions that are called from |main_control| that
are not already defined elsewhere. For the moment, this list simply
in the order that the appear in |init_main_control|, below.
-@
+@
@c
static void run_char_num (void) {
scan_char_num();
cur_chr = cur_val;
adjust_space_factor();
tail_append(new_char(cur_font, cur_chr));
-}
+}
static void run_char (void) {
adjust_space_factor();
tail_append(new_char(cur_font, cur_chr));
}
-@
+@
The occurrence of blank spaces is almost part of \TeX's inner loop,
since we usually encounter about one space for every five non-blank characters.
Therefore |main_control| gives second-highest priority to ordinary spaces.
@@ -281,9 +282,9 @@ static void run_relax (void) {
return;
}
-@ |ignore_spaces| is a special case: after it has acted, |get_x_token| has already
+@ |ignore_spaces| is a special case: after it has acted, |get_x_token| has already
fetched the next token from the input, so that operation in |main_control|
-should be skipped.
+should be skipped.
@c
static void run_ignore_spaces (void) {
@@ -478,13 +479,13 @@ static void run_new_graf (void) {
@ A paragraph ends when a |par_end| command is sensed, or when we are in
horizontal mode when reaching the right brace of vertical-mode routines
-like \.{\\vbox}, \.{\\insert}, or \.{\\output}.
-
+like \.{\\vbox}, \.{\\insert}, or \.{\\output}.
+
@c
static void run_par_end_vmode (void) {
normal_paragraph();
if (mode > 0) {
- check_filter("vmode_par");
+ check_filter(vmode_par);
build_page();
}
}
@@ -495,7 +496,7 @@ static void run_par_end_hmode (void) {
off_save(); /* this tries to recover from an alignment that didn't end properly */
end_graf(bottom_level); /* this takes us to the enclosing mode, if |mode>0| */
if (mode == vmode) {
- check_filter("hmode_par");
+ check_filter(hmode_par);
build_page();
}
}
@@ -642,7 +643,7 @@ it makes sense ot have a macro for that as well.
@c
#define any_mode(A,B) jump_table[vmode+(A)]=B; jump_table[hmode+(A)]=B; jump_table[mmode+(A)]=B
-#define non_math(A,B) jump_table[vmode+(A)]=B; jump_table[hmode+(A)]=B;
+#define non_math(A,B) jump_table[vmode+(A)]=B; jump_table[hmode+(A)]=B;
@ The |main_control| uses a jump table, and |init_main_control| sets that table up.
@@ -882,7 +883,7 @@ void main_control(void)
show_cur_cmd_chr();
(jump_table[(abs(mode) + cur_cmd)])(); /* run the command */
-
+
if (main_control_state == goto_return) {
return;
}
@@ -941,7 +942,7 @@ void you_cant(void)
print_in_mode(mode);
}
-@
+@
When erroneous situations arise, \TeX\ usually issues an error message
specific to the particular error. For example, `\.{\\noalign}' should
not appear in any mode, since it is recognized by the |align_peek| routine
@@ -1001,7 +1002,7 @@ boolean its_all_over(void)
width(tail) = hsize;
tail_append(new_glue(fill_glue));
tail_append(new_penalty(-010000000000));
- lua_node_filter_s(buildpage_filter_callback, "end");
+ lua_node_filter_s(buildpage_filter_callback,lua_key_index(end));
build_page(); /* append \.{\\hbox to \\hsize\{\}\\vfill\\penalty-'10000000000} */
}
return false;
@@ -1199,7 +1200,7 @@ void handle_right_brace(void)
list_ptr(p) = null;
flush_node(p);
if (nest_ptr == 0) {
- check_filter("insert");
+ check_filter(insert);
build_page();
}
break;
@@ -1328,7 +1329,7 @@ void box_end(int box_context)
adjust_tail = null;
}
if (mode > 0) {
- check_filter("box");
+ check_filter(box);
build_page();
}
} else {
@@ -1444,7 +1445,7 @@ void new_graf(boolean indented)
if (every_par != null)
begin_token_list(every_par, every_par_text);
if (nest_ptr == 1) {
- check_filter("new_graf");
+ check_filter(new_graf);
build_page(); /* put |par_skip| glue on current page */
}
}
@@ -1582,7 +1583,7 @@ void append_penalty(void)
scan_int();
tail_append(new_penalty(cur_val));
if (mode == vmode) {
- check_filter("penalty");
+ check_filter(penalty);
build_page();
}
}
@@ -1596,7 +1597,7 @@ appears at the tail of the current list, using a brute-force linear scan.
Like \.{\\lastbox}, this command is not allowed in vertical mode (except
internal vertical mode), since the current list in vertical mode is sent
to the page builder. But if we happen to be able to implement it in
-vertical mode, we do.
+vertical mode, we do.
@c
void delete_last(void)
@@ -1694,7 +1695,7 @@ void unpackage(void)
}
}
-@
+@
Italic corrections are converted to kern nodes when the |ital_corr| command
follows a character. In math mode the same effect is achieved by appending
a kern of zero here, since italic corrections are supplied later.
@@ -2051,7 +2052,7 @@ void do_endv(void)
}
}
-@ Finally, \.{\\endcsname} is not supposed to get through to |main_control|.
+@ Finally, \.{\\endcsname} is not supposed to get through to |main_control|.
@c
void cs_error(void)
@@ -2383,8 +2384,8 @@ void prefixed_command(void)
break;
case int_base + text_direction_code:
#if 0
- /* various tests hint that this is unnecessary and
- * sometimes even produces weird results, eg
+ /* various tests hint that this is unnecessary and
+ * sometimes even produces weird results, eg
* (\hbox{\textdir TRT ABC\textdir TLT DEF})
* becomes
* (DEFCBA)
diff --git a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w
index 5d8f77eedf7..ef769f7a357 100644
--- a/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w
+++ b/Build/source/texk/web2c/luatexdir/tex/postlinebreak.w
@@ -19,8 +19,8 @@
@ @c
static const char _svn_version[] =
- "$Id: postlinebreak.w 4457 2012-07-13 13:16:19Z taco $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/tex/postlinebreak.w $";
+ "$Id: postlinebreak.w 4956 2014-03-28 12:12:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/postlinebreak.w $";
#include "ptexlib.h"
@@ -441,20 +441,20 @@ void ext_post_line_break(int paragraph_dir,
if ((vlink(contrib_head) != null))
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "pre_box");
+ lua_node_filter_s(buildpage_filter_callback, lua_key_index(pre_box));
if (pre_adjust_head != pre_adjust_tail) {
append_list(pre_adjust_head, pre_adjust_tail);
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "pre_adjust");
+ lua_node_filter_s(buildpage_filter_callback, lua_key_index(pre_adjust));
}
pre_adjust_tail = null;
append_to_vlist(just_box);
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "box");
+ lua_node_filter_s(buildpage_filter_callback, lua_key_index(box));
if (adjust_head != adjust_tail) {
append_list(adjust_head, adjust_tail);
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "adjust");
+ lua_node_filter_s(buildpage_filter_callback, lua_key_index(adjust));
}
adjust_tail = null;
diff --git a/Build/source/texk/web2c/luatexdir/tex/texfileio.w b/Build/source/texk/web2c/luatexdir/tex/texfileio.w
index 3a7ab5578c0..f6314e3f181 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texfileio.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texfileio.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: texfileio.w 4877 2014-03-14 01:26:05Z luigi $"
+ "$Id: texfileio.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texfileio.w $";
#include "ptexlib.h"
@@ -30,7 +30,7 @@ static const char _svn_version[] =
@ @c
#define end_line_char int_par(end_line_char_code)
-
+
@ The bane of portability is the fact that different operating systems treat
input and output quite differently, perhaps because computer scientists
have not given sufficient attention to this problem. People have felt somehow
@@ -66,7 +66,7 @@ for us to specify simple operations on word files before they are defined.
@ We finally did away with |nameoffile| and |namelength|, but the variables
have to be kept otherwise there will be link errors from |openclose.c| in
-the web2c library
+the web2c library
@c
char *nameoffile;
@@ -90,7 +90,7 @@ int read_file_callback_id[17];
We assume that it is OK to look here first. Possibly it
would be better to replace lookups in "." with lookups in the
|output_directory| followed by "." but to do this requires much more
-invasive surgery in libkpathsea.
+invasive surgery in libkpathsea.
@c
static char *find_in_output_directory(const char *s)
@@ -110,7 +110,7 @@ static char *find_in_output_directory(const char *s)
return NULL;
}
-@ find an \.{\\input} or \.{\\read} file. |n| differentiates between those case.
+@ find an \.{\\input} or \.{\\read} file. |n| differentiates between those case.
@c
char *luatex_find_read_file(const char *s, int n, int callback_index)
@@ -194,8 +194,8 @@ char *luatex_find_file(const char *s, int callback_index)
}
-@ LuaTeX used to have private functions for these that did not use kpathsea,
-but since the file paranoia tests have to come from kpathsea anyway, that is no
+@ LuaTeX used to have private functions for these that did not use kpathsea,
+but since the file paranoia tests have to come from kpathsea anyway, that is no
longer useful. The only downside to using luatex is that if one wants to disable
kpathsea via the Lua startup script, it is now an absolute requirement that all
file discovery callbacks are specified. Just using the find_read_file, but not
@@ -207,7 +207,7 @@ to be used at all.
#define openinnameok(A) kpse_in_name_ok (A)
@ Open an input file F, using the kpathsea format FILEFMT and passing
- |FOPEN_MODE| to fopen. The filename is in `fn'. We return whether or
+ |FOPEN_MODE| to fopen. The filename is in `fn'. We return whether or
not the open succeeded.
@c
@@ -399,7 +399,7 @@ void lua_a_close_out(alpha_file f)
}
-@ Binary input and output are done with C's ordinary
+@ Binary input and output are done with C's ordinary
procedures, so we don't have to make any other special arrangements for
binary~I/O. Text output is also easy to do with standard routines.
The treatment of text input is more difficult, however, because
@@ -451,7 +451,7 @@ from the user's terminal as well as from ordinary text files.
Since the inner loop of |lua_input_ln| is part of \TeX's ``inner loop''---each
character of input comes in at this place---it is wise to reduce system
overhead by making use of special routines that read in an entire array
-of characters at once, if such routines are available.
+of characters at once, if such routines are available.
@^inner loop@>
@c
@@ -673,7 +673,7 @@ pool_pointer ext_delimiter; /* the relevant `\..', if any */
system area called |TEX_area|. Font metric files whose areas are not given
explicitly are assumed to appear in a standard system area called
|TEX_font_area|. $\Omega$'s compiled translation process files whose areas
-are not given explicitly are assumed to appear in a standard system area.
+are not given explicitly are assumed to appear in a standard system area.
These system area names will, of course, vary from place to place.
@c
@@ -719,7 +719,7 @@ length will be set in the main program.
char *TEX_format_default;
-@ This part of the program becomes active when a ``virgin'' \TeX\ is trying to get going,
+@ This part of the program becomes active when a ``virgin'' \TeX\ is trying to get going,
just after the preliminary initialization, or when the user is substituting another
format file by typing `\.\&' after the initial `\.{**}' prompt. The buffer
contains the first line of input in |buffer[loc..(last-1)]|, where
@@ -859,7 +859,7 @@ char *get_full_log_name (void)
return ret;
} else {
return xstrdup((const char*)texmf_log_name);
- }
+ }
}
@ Synctex uses this to get the anchored path of an input file.
@@ -905,7 +905,7 @@ void start_input(void)
fn = prompt_file_name("input file name", "");
}
iname = maketexstring(fullnameoffile);
- /* Now that we have |fullnameoffile|, it is time to post-adjust
+ /* Now that we have |fullnameoffile|, it is time to post-adjust
|cur_name| and |cur_ext| for trailing |.tex| */
{
char *n, *p;
@@ -949,14 +949,7 @@ void start_input(void)
}
/* |open_log_file| doesn't |show_context|, so |limit|
and |loc| needn't be set to meaningful values yet */
- if (tracefilenames) {
- if (term_offset + (int) str_length(iname) > max_print_line - 2)
- print_ln();
- else if ((term_offset > 0) || (file_offset > 0))
- print_char(' ');
- print_char('(');
- tprint_file_name(NULL, (unsigned char *) fullnameoffile, NULL);
- }
+ report_start_file(filetype_tex,fullnameoffile);
incr(open_parens);
update_terminal();
istate = new_line;
@@ -984,7 +977,7 @@ void start_input(void)
@ Read and write dump files through zlib
@ Earlier versions recast |*f| from |FILE *| to |gzFile|, but there is
-no guarantee that these have the same size, so a static variable
+no guarantee that these have the same size, so a static variable
is needed.
@c
@@ -1079,7 +1072,7 @@ swap_items(char *pp, int nitems, int size)
FATAL1("Can't swap a %d-byte item for (un)dumping", size);
}
memcpy(pp,q,total);
- xfree(q);
+ xfree(q);
}
#endif /* not WORDS_BIGENDIAN and not NO_DUMP_SHARE */
@@ -1178,7 +1171,7 @@ void zwclose(FILE * f)
gzclose(gz_fmtfile);
}
-@ create the dvi or pdf file
+@ create the dvi or pdf file
@c
int open_outfile(FILE ** f, const char *name, const char *mode)
{
@@ -1222,7 +1215,7 @@ int readbinfile(FILE * f, unsigned char **tfm_buffer, int *tfm_size)
@ Like |runsystem()|, the |runpopen()| function is called only when
|shellenabledp == 1|. Unlike |runsystem()|, here we write errors to
stderr, since we have nowhere better to use; and of course we return
- a file handle (or NULL) instead of a status indicator.
+ a file handle (or NULL) instead of a status indicator.
@c
static FILE *runpopen(char *cmd, const char *mode)
@@ -1267,14 +1260,14 @@ static FILE *runpopen(char *cmd, const char *mode)
@ piped I/O
-@ The code that implements |popen()| needs an array for tracking
+@ The code that implements |popen()| needs an array for tracking
possible pipe file pointers, because these need to be
closed using |pclose()|.
@c
#define NUM_PIPES 16
static FILE *pipes[NUM_PIPES];
-
+
#ifdef WIN32
FILE *Poptr;
#endif
@@ -1335,7 +1328,7 @@ boolean open_out_or_pipe(FILE ** f_ptr, char *fn, const_string fopen_mode)
fname = (string) xmalloc((unsigned) (strlen(fn) + 1));
strcpy(fname, fn);
if (strchr(fname, ' ') == NULL && strchr(fname, '>') == NULL) {
- /* mp and mf currently do not use this code, but it
+ /* mp and mf currently do not use this code, but it
is better to be prepared */
if (STREQ((fname + strlen(fname) - 3), "tex"))
*(fname + strlen(fname) - 4) = 0;
diff --git a/Build/source/texk/web2c/luatexdir/tex/texmath.w b/Build/source/texk/web2c/luatexdir/tex/texmath.w
index f9e400b6098..527be959082 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texmath.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texmath.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: texmath.w 4750 2014-01-15 09:13:32Z taco $"
+ "$Id: texmath.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texmath.w $";
#include "ptexlib.h"
@@ -1023,7 +1023,7 @@ void enter_display_math(void)
begin_token_list(every_display, every_display_text);
if (nest_ptr == 1) {
if (!output_active)
- lua_node_filter_s(buildpage_filter_callback, "before_display");
+ lua_node_filter_s(buildpage_filter_callback,lua_key_index(before_display));
build_page();
}
}
@@ -1977,7 +1977,7 @@ static void resume_after_display(void)
if (cur_cmd != spacer_cmd)
back_input();
if (nest_ptr == 1) {
- lua_node_filter_s(buildpage_filter_callback, "after_display");
+ lua_node_filter_s(buildpage_filter_callback,lua_key_index(after_display));
build_page();
}
}
diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.w b/Build/source/texk/web2c/luatexdir/tex/texnodes.w
index 73b39d08757..e5c4e1cacfd 100644
--- a/Build/source/texk/web2c/luatexdir/tex/texnodes.w
+++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: texnodes.w 4847 2014-03-05 18:13:17Z luigi $"
+ "$Id: texnodes.w 4911 2014-03-20 14:00:02Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/texnodes.w $";
#include "ptexlib.h"
@@ -874,16 +874,19 @@ halfword copy_node(const halfword p)
case 'a':
add_node_attr_ref(user_node_value(p));
break;
- case 't':
- add_token_ref(user_node_value(p));
- break;
- case 's':
- /* |add_string_ref(user_node_value(p));| *//* if this was mpost .. */
+ case 'l':
+ copy_user_lua(r, p);
break;
case 'n':
s = copy_node_list(user_node_value(p));
user_node_value(r) = s;
break;
+ case 's':
+ /* |add_string_ref(user_node_value(p));| *//* if this was mpost .. */
+ break;
+ case 't':
+ add_token_ref(user_node_value(p));
+ break;
}
break;
#if 0
@@ -1217,8 +1220,7 @@ void flush_node(halfword p)
case 'a':
delete_attribute_ref(user_node_value(p));
break;
- case 't':
- delete_token_ref(user_node_value(p));
+ case 'd':
break;
case 'n':
flush_node_list(user_node_value(p));
@@ -1226,7 +1228,8 @@ void flush_node(halfword p)
case 's':
/* |delete_string_ref(user_node_value(p));| *//* if this was mpost .. */
break;
- case 'd':
+ case 't':
+ delete_token_ref(user_node_value(p));
break;
default:
{
diff --git a/Build/source/texk/web2c/luatexdir/tex/textoken.w b/Build/source/texk/web2c/luatexdir/tex/textoken.w
index 48f6e43d48b..e9ae2e670a4 100644
--- a/Build/source/texk/web2c/luatexdir/tex/textoken.w
+++ b/Build/source/texk/web2c/luatexdir/tex/textoken.w
@@ -19,7 +19,7 @@
@ @c
static const char _svn_version[] =
- "$Id: textoken.w 4877 2014-03-14 01:26:05Z luigi $"
+ "$Id: textoken.w 4956 2014-03-28 12:12:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/tex/textoken.w $";
#include "ptexlib.h"
@@ -42,7 +42,7 @@ static const char _svn_version[] =
a=get_cat_code(cat_code_table,b); \
} while (0)
-
+
@ The \TeX\ system does nearly all of its own memory allocation, so that it
can readily be transported into environments that do not have automatic
facilities for strings, garbage collection, etc., and so that it can be in
@@ -59,7 +59,7 @@ value represents a null pointer. \TeX\ does not assume that |mem[null]| exists.
-@ Locations in |fixmem| are used for storing one-word records; a conventional
+@ Locations in |fixmem| are used for storing one-word records; a conventional
\.{AVAIL} stack is used for allocation in this array.
@c
@@ -406,7 +406,7 @@ void token_show(halfword p)
}
-
+
@ |delete_token_ref|, is called when
a pointer to a token list's reference count is being removed. This means
that the token list should disappear if the reference count was |null|,
@@ -456,7 +456,7 @@ typedef enum { next_line_ok, next_line_return,
static next_line_retval next_line(void); /* below */
-
+
@ In case you are getting bored, here is a slightly less trivial routine:
Given a string of lowercase letters, like `\.{pt}' or `\.{plus}' or
`\.{width}', the |scan_keyword| routine checks to see whether the next
@@ -497,7 +497,7 @@ boolean scan_keyword(const char *s)
token_link(q) = null;
token_link(p) = q;
begin_token_list(token_link(backup_head), backed_up);
- if (cur_cmd != endv_cmd)
+ if (cur_cmd != endv_cmd)
align_state = saved_align_state;
} else {
back_input();
@@ -515,7 +515,7 @@ boolean scan_keyword(const char *s)
@ We can not return |undefined_control_sequence| under some conditions
(inside |shift_case|, for example). This needs thinking.
-
+
@c
halfword active_to_cs(int curchr, int force)
{
@@ -542,7 +542,7 @@ halfword active_to_cs(int curchr, int force)
return curcs;
}
-@ TODO this function should listen to \.{\\escapechar}
+@ TODO this function should listen to \.{\\escapechar}
@c
static char *cs_to_string(halfword p)
@@ -586,7 +586,7 @@ static char *cs_to_string(halfword p)
return (char *) ret;
}
-@ TODO this is a quick hack, will be solved differently soon
+@ TODO this is a quick hack, will be solved differently soon
@c
static char *cmd_chr_to_string(int cmd, int chr)
@@ -821,7 +821,7 @@ static boolean get_next_file(void)
} else {
do_get_cat_code(cur_cmd, cur_chr);
}
- /*
+ /*
Change state if necessary, and |goto switch| if the current
character should be ignored, or |goto reswitch| if the current
character changes to another;
@@ -926,13 +926,13 @@ static boolean get_next_file(void)
case skip_blanks + mac_param:
case skip_blanks + sub_mark:
case skip_blanks + letter:
- case skip_blanks + other_char:
+ case skip_blanks + other_char:
case new_line + math_shift:
case new_line + tab_mark:
case new_line + mac_param:
case new_line + sub_mark:
case new_line + letter:
- case new_line + other_char:
+ case new_line + other_char:
#else
default:
#endif
@@ -1071,7 +1071,7 @@ static boolean process_sup_mark(void)
a file; once they have been scanned the first time, their |eqtb| location
serves as a unique identification, so \TeX\ doesn't need to refer to the
original name any more except when it prints the equivalent in symbolic form.
-
+
The program that scans a control sequence has been written carefully
in order to avoid the blowups that might otherwise occur if a malicious
user tried something like `\.{\\catcode\'15=0}'. The algorithm might
@@ -1301,9 +1301,8 @@ static next_line_retval next_line(void)
if (!((iname == 19) || (iname == 21)))
file_warning(); /* give warning for some unfinished groups and/or conditionals */
if ((iname > 21) || (iname == 20)) {
- if (tracefilenames)
- print_char(')');
- open_parens--;
+ report_stop_file(filetype_tex);
+ decr(open_parens);
#if 0
update_terminal(); /* show user that file has been read */
#endif
@@ -1361,7 +1360,7 @@ static next_line_retval next_line(void)
return next_line_ok;
}
-@ Let's consider now what happens when |get_next| is looking at a token list.
+@ Let's consider now what happens when |get_next| is looking at a token list.
@c
static boolean get_next_tokenlist(void)
@@ -1414,7 +1413,7 @@ static boolean get_next_tokenlist(void)
this routine are executed more often than any other instructions of \TeX.
@^mastication@>@^inner loop@>
-@ sets |cur_cmd|, |cur_chr|, |cur_cs| to next token
+@ sets |cur_cmd|, |cur_chr|, |cur_cs| to next token
@c
void get_next(void)
@@ -1495,7 +1494,7 @@ void get_token_lua(void)
}
-@ changes the string |s| to a token list
+@ changes the string |s| to a token list
@c
halfword string_to_toks(char *ss)
{
@@ -1562,7 +1561,7 @@ static halfword lua_str_toks(lstring b)
}
-@ Incidentally, the main reason for wanting |str_toks| is the function |the_toks|,
+@ Incidentally, the main reason for wanting |str_toks| is the function |the_toks|,
which has similar input/output characteristics.
@c
@@ -1621,7 +1620,7 @@ static void print_job_name(void)
@ Here is a routine that print the result of a convert command, using
the argument |i|. It returns |false | if it does not know to print
the code |c|. The function exists because lua code and tex code can
- both call it to convert something.
+ both call it to convert something.
@c
static boolean print_convert_string(halfword c, int i)
@@ -2046,7 +2045,7 @@ void conv_toks(void)
@c
boolean in_lua_escape;
-@ probably not needed anymore
+@ probably not needed anymore
@c
boolean is_convert(halfword c)
{
@@ -2262,7 +2261,7 @@ str_number tokens_to_string(halfword p)
#define is_cat_letter(a) \
(get_char_cat_code(pool_to_unichar(str_string((a)))) == 11)
-@ the actual token conversion in this function is now functionally
+@ the actual token conversion in this function is now functionally
equivalent to |show_token_list|, except that it always prints the
whole token list.
TODO: check whether this causes problems in the lua library.