From a29546c540f00435f272c043e8bf4460b142695b Mon Sep 17 00:00:00 2001 From: maqiyuan Date: Sat, 19 Apr 2014 23:01:50 +0800 Subject: [PATCH] string pool clean. --- src/texsourc/itex.c | 12 +- src/texsourc/tex0.c | 10 +- src/texsourc/tex3.c | 10 +- src/texsourc/tex4.c | 4 +- src/texsourc/tex5.c | 5 +- src/texsourc/tex6.c | 10 +- src/texsourc/tex7.c | 6 +- src/texsourc/tex8.c | 6 +- src/texsourc/yandy_pool.c | 1368 ++++++++++++++++++++++----------------------- 9 files changed, 716 insertions(+), 715 deletions(-) diff --git a/src/texsourc/itex.c b/src/texsourc/itex.c index 0f40307..00e137a 100644 --- a/src/texsourc/itex.c +++ b/src/texsourc/itex.c @@ -2247,7 +2247,7 @@ void final_cleanup (void) if (selector == term_and_log) { selector = term_only; - print_nl(" (see the transcript file for additional information)"); + print_nl("(see the transcript file for additional information)"); selector = term_and_log; } @@ -2268,7 +2268,7 @@ void final_cleanup (void) } #endif /* INITEX */ if (!is_initex) /* 2000/March/3 */ - print_nl(" (\\dump is performed only by INITEX)"); + print_nl("(\\dump is performed only by INITEX)"); } } // debugging code for checking the string pool @@ -3706,7 +3706,7 @@ void store_fmt_file (void) if (save_ptr != 0) { print_err("You can't dump inside a group"); - help1("`{...\\dump}' is a no-no.."); + help1("`{...\\dump}' is a no-no."); succumb(); } @@ -4216,7 +4216,7 @@ void init_prim (void) primitive("divide", divide, 0); primitive("endcsname", end_cs_name, 0); primitive("endgroup", end_group, 0); - text(frozen_end_group) = 513; + text(frozen_end_group) = make_string_pool("endgroup"); eqtb[frozen_end_group] = eqtb[cur_val]; primitive("expandafter", expand_after, 0); primitive("font", def_font, 0); @@ -4241,7 +4241,7 @@ void init_prim (void) primitive("radical", radical, 0); primitive("read", read_to_cs, 0); primitive("relax", relax, 256); - text(frozen_relax) = 532; + text(frozen_relax) = make_string_pool("relax"); eqtb[frozen_relax] = eqtb[cur_val]; primitive("setbox", set_box, 0); primitive("the", the, 0); @@ -4300,7 +4300,7 @@ void init_prim (void) primitive("iffalse", if_test, 15); primitive("ifcase", if_test, 16); primitive("fi", fi_or_else, 2); - text(frozen_fi) = 770; + text(frozen_fi) = make_string_pool("fi"); eqtb[frozen_fi] = eqtb[cur_val]; primitive("or", fi_or_else, 4); primitive("else", fi_or_else, 3); diff --git a/src/texsourc/tex0.c b/src/texsourc/tex0.c index 8e2868e..dc31ece 100644 --- a/src/texsourc/tex0.c +++ b/src/texsourc/tex0.c @@ -2459,7 +2459,7 @@ void show_node_list_(integer p) { print_esc("setlanguage"); print_int(mem[p + 1].hh.v.RH); - print_string(" (hyphenmin"); + print_string(" (hyphenmin "); print_int(mem[p + 1].hh.b0); print_char(','); print_int(mem[p + 1].hh.b1); @@ -2467,7 +2467,7 @@ void show_node_list_(integer p) } break; default: - print_string("whatsit"); + print_string("whatsit?"); break; } break; @@ -2721,20 +2721,20 @@ void show_node_list_(integer p) break; case 25: { - print_esc("fraction"); + print_esc("fraction, thickness "); if (mem[p + 1].cint == 1073741824L) /* 2^30 */ print_string("= default"); else print_scaled(mem[p + 1].cint); if ((mem[p + 4].qqqq.b0 != 0) || (mem[p + 4].qqqq.b1 != 0) || (mem[p + 4].qqqq.b2 != 0) || (mem[p + 4].qqqq.b3 != 0)) { - print_string(", left"); + print_string(", left-delimiter "); print_delimiter(p + 4); } if ((mem[p + 5].qqqq.b0 != 0) || (mem[p + 5].qqqq.b1 != 0) || (mem[p + 5].qqqq.b2 != 0)||(mem[p + 5].qqqq.b3 != 0)) { - print_string(", right"); + print_string(", right-delimiter "); print_delimiter(p + 5); } print_subsidiary_data(p + 2, 92); diff --git a/src/texsourc/tex3.c b/src/texsourc/tex3.c index 691ab35..3645368 100644 --- a/src/texsourc/tex3.c +++ b/src/texsourc/tex3.c @@ -294,7 +294,7 @@ lab31: { if (cur_order == filll) { - print_err("Illegal unit of measure("); + print_err("Illegal unit of measure ("); print_string("replaced by filll)"); help1("I dddon't go any higher than filll."); error(); @@ -368,7 +368,7 @@ lab45: goto lab88; else { - print_err("Illegal unit of measure("); + print_err("Illegal unit of measure ("); print_string("mu inserted)"); help4("The unit of measurement in math glue must be mu.", "To recover gracefully from this error, it's best to", @@ -444,7 +444,7 @@ lab45: goto lab30; else { - print_err("Illegal unit of measure("); + print_err("Illegal unit of measure ("); print_string("pt inserted)"); help6("Dimensions can be in units of em, ex, in, pt, pc,", "cm, mm, dd, cc, bp, or sp; but yours is a new one!", @@ -969,7 +969,7 @@ lab32: if (cur_cmd != mac_param) if ((cur_tok <= zero_token) || (cur_tok > t)) { - print_err("Illegal parameter number in definition of"); + print_err("Illegal parameter number in definition of "); sprint_cs(warning_index); help3("You meant to type ## instead of #, right?", "Or maybe a } was forgotten somewhere earlier, and things", @@ -1073,7 +1073,7 @@ void read_toks_(integer n, halfword r) if (align_state != 1000000L) { runaway(); - print_err("File ended within"); + print_err("File ended within "); print_esc("read"); help1("This \\read has unbalanced braces."); align_state = 1000000L; diff --git a/src/texsourc/tex4.c b/src/texsourc/tex4.c index ed5c844..488a0a0 100644 --- a/src/texsourc/tex4.c +++ b/src/texsourc/tex4.c @@ -1543,7 +1543,7 @@ lab21: width(link(q)) = overfull_rule; } print_ln(); - print_nl("Overfull \\hbox("); + print_nl("Overfull \\hbox ("); print_scaled(- (integer) x - total_shrink[0]); print_string("pt too wide"); overfull_hbox++; /* 1996/Feb/9 */ @@ -1767,7 +1767,7 @@ halfword vpackage_(halfword p, scaled h, small_number m, scaled l) if ((- (integer) x - total_shrink[0] > vfuzz) || (vbadness < 100)) { print_ln(); - print_nl("Overfull \\vbox("); + print_nl("Overfull \\vbox ("); print_scaled(- (integer) x - total_shrink[0]); print_string("pt too high"); overfull_vbox++; /* 1996/Feb/9 */ diff --git a/src/texsourc/tex5.c b/src/texsourc/tex5.c index b87a47d..2f5b080 100644 --- a/src/texsourc/tex5.c +++ b/src/texsourc/tex5.c @@ -202,7 +202,7 @@ void fetch_(halfword a) print_size(cur_size); print_char(' '); print_int(mem[a].hh.b0); - print_string("is undefined (character "); + print_string(" is undefined (character "); print(cur_c); print_char(')'); help4("Somewhere in the math formula just ended, you used the", @@ -1150,11 +1150,12 @@ void init_align (void) savecsptr = cur_cs; push_alignment(); align_state = -1000000L; + if ((mode == 203) && ((tail != cur_list.head_field) || (cur_list.aux_field.cint != 0))) { print_err("Improper "); print_esc("halign"); - print_string("inside $$"); + print_string(" inside $$'s"); help3("Displays can use special alignments (like \\eqalignno)", "only if nothing but the alignment itself is between $$'s.", "So I've deleted the formulas that preceded this alignment."); diff --git a/src/texsourc/tex6.c b/src/texsourc/tex6.c index 689dd7b..bd95789 100644 --- a/src/texsourc/tex6.c +++ b/src/texsourc/tex6.c @@ -212,7 +212,7 @@ lab22: break; default: { - confusion("disc1"); + confusion("disc2"); return; // abort_flag set } break; @@ -784,7 +784,7 @@ lab31: while (!(cur_p == 0)); if ((curline != best_line) || (mem[temp_head].hh.v.RH != 0)) { - confusion("disc2"); + confusion("line breaking"); return; // abort_flag set } prev_graf = best_line - 1; @@ -1553,7 +1553,7 @@ lab45:; { print_err("Improper "); print_esc("hyphenation"); - print_string("will be flushed"); + print_string(" will be flushed"); help2("Hyphenation exceptions must contain only letters", "and hyphens. But continue; I'll forgive and forget."); error(); @@ -1784,7 +1784,7 @@ halfword vsplit_(eight_bits n, scaled h) { print_err(""); print_esc("vsplit"); - print_string("needs a "); + print_string(" needs a "); print_esc("vbox"); help2("The box you are trying to split is an \\hbox.", "I can't split such a box, so I'll leave it alone."); @@ -1881,7 +1881,7 @@ void freeze_page_specs_(small_number s) if (tracing_pages > 0) { begin_diagnostic(); - print_nl("might split"); + print_nl("%% goal height="); print_scaled(page_so_far[0]); print_string(", max depth="); print_scaled(page_max_depth); diff --git a/src/texsourc/tex7.c b/src/texsourc/tex7.c index 013677d..e3b0192 100644 --- a/src/texsourc/tex7.c +++ b/src/texsourc/tex7.c @@ -150,7 +150,7 @@ lab22: page_so_far[6]= page_so_far[6]+ mem[q + 3].cint; if ((mem[q].hh.b1 != 0)&&(mem[q + 3].cint != 0)) { - print_err("Infinite glue shrinkage inserted from"); + print_err("Infinite glue shrinkage inserted from "); print_esc("skip"); print_int(n); help3("The correction glue for page breaking with insertions", @@ -193,7 +193,7 @@ lab22: if (tracing_pages > 0) { begin_diagnostic(); - print_nl("%% split"); + print_nl("% split"); print_int(n); print_string(" to"); print_scaled(w); @@ -565,7 +565,7 @@ void off_save (void) /* sec 1069 */ void extra_right_brace (void) { - print_err("Extra }, or forgotten"); + print_err("Extra }, or forgotten "); switch(cur_group) { diff --git a/src/texsourc/tex8.c b/src/texsourc/tex8.c index 3b6fb1a..77c9dd1 100644 --- a/src/texsourc/tex8.c +++ b/src/texsourc/tex8.c @@ -781,7 +781,7 @@ void new_font_(small_number a) if ((s <= 0) || (s >= 134217728L)) /* 2^27 */ { - print_err("Improper `at' size("); + print_err("Improper `at' size ("); print_scaled(s); print_string("pt), replaced by 10pt"); help2("I can only handle fonts at positive sizes that are", @@ -1285,7 +1285,7 @@ void do_extension (void) break; default: { - confusion("display"); + confusion("ext1"); return; // abort_flag set } break; @@ -1424,7 +1424,7 @@ void handle_right_brace (void) print_esc("box"); print_int(255); help3("Your \\output commands should empty \\box255,", - "e.g., by saying `\\ship_out\\box255'.", + "e.g., by saying `\\shipout\\box255'.", "Proceed; I'll discard its present contents."); box_error(255); } diff --git a/src/texsourc/yandy_pool.c b/src/texsourc/yandy_pool.c index e7477cc..5261e42 100644 --- a/src/texsourc/yandy_pool.c +++ b/src/texsourc/yandy_pool.c @@ -273,40 +273,40 @@ static const char *pool_file_arr[] = /* 0502 */ "", //"endcsname", /* 0503 */ "IMPOSSIBLE.", /* 0504 */ "NONEXISTENT.", -/* 0505 */ "accent", -/* 0506 */ "advance", -/* 0507 */ "afterassignment", -/* 0508 */ "aftergroup", -/* 0509 */ "begingroup", -/* 0510 */ "char", -/* 0511 */ "delimiter", -/* 0512 */ "divide", -/* 0513 */ "endgroup", -/* 0514 */ "expandafter", -/* 0515 */ "font", -/* 0516 */ "fontdimen", -/* 0517 */ "halign", -/* 0518 */ "hrule", -/* 0519 */ "ignorespaces", -/* 0520 */ "mathaccent", -/* 0521 */ "mathchar", -/* 0522 */ "mathchoice", -/* 0523 */ "multiply", -/* 0524 */ "noalign", -/* 0525 */ "noboundary", -/* 0526 */ "noexpand", -/* 0527 */ "omit", -/* 0528 */ "penalty", -/* 0529 */ "prevgraf", -/* 0530 */ "radical", -/* 0531 */ "read", -/* 0532 */ "relax", -/* 0533 */ "setbox", -/* 0534 */ "the", -/* 0535 */ "valign", -/* 0536 */ "vcenter", -/* 0537 */ "vrule", -/* 0538 */ "save size", +/* 0505 */ "", //"accent", +/* 0506 */ "", //"advance", +/* 0507 */ "", //"afterassignment", +/* 0508 */ "", //"aftergroup", +/* 0509 */ "", //"begingroup", +/* 0510 */ "", //"char", +/* 0511 */ "", //"delimiter", +/* 0512 */ "", //"divide", +/* 0513 */ "", //"endgroup", +/* 0514 */ "", //"expandafter", +/* 0515 */ "", //"font", +/* 0516 */ "", //"fontdimen", +/* 0517 */ "", //"halign", +/* 0518 */ "", //"hrule", +/* 0519 */ "", //"ignorespaces", +/* 0520 */ "", //"mathaccent", +/* 0521 */ "", //"mathchar", +/* 0522 */ "", //"mathchoice", +/* 0523 */ "", //"multiply", +/* 0524 */ "", //"noalign", +/* 0525 */ "", //"noboundary", +/* 0526 */ "", //"noexpand", +/* 0527 */ "", //"omit", +/* 0528 */ "", //"penalty", +/* 0529 */ "", //"prevgraf", +/* 0530 */ "", //"radical", +/* 0531 */ "", //"read", +/* 0532 */ "", //"relax", +/* 0533 */ "", //"setbox", +/* 0534 */ "", //"the", +/* 0535 */ "", //"valign", +/* 0536 */ "", //"vcenter", +/* 0537 */ "", //"vrule", +/* 0538 */ "", //"save size", /* 0539 */ "", //"grouping levels", /* 0540 */ "", //"curlevel", /* 0541 */ "", //"retaining", @@ -343,96 +343,96 @@ static const char *pool_file_arr[] = /* 0572 */ " ", /* 0573 */ " ", -/* 0576 */ "