diff --git a/Chapter 2/The Parser.w b/Chapter 2/The Parser.w index ce797fc..ef3021d 100644 --- a/Chapter 2/The Parser.w +++ b/Chapter 2/The Parser.w @@ -96,9 +96,11 @@ version 2 it's much tidier. @ = if (S->md->using_syntax >= V2_SYNTAX) { source_line *L = S->first_line; - if ((L) && (L->category == CHAPTER_HEADING_LCAT)) L = L->next_line; - S->sect_purpose = Parser::extract_purpose(I"", L?L->next_line: NULL, S, NULL); - if (Str::len(S->sect_purpose) > 0) L->next_line->category = PURPOSE_LCAT; + if ((L) && (L->category == CHAPTER_HEADING_LCAT)) L = L->next_line; + if (Str::len(S->sect_purpose) == 0) { + S->sect_purpose = Parser::extract_purpose(I"", L?L->next_line: NULL, S, NULL); + if (Str::len(S->sect_purpose) > 0) L->next_line->category = PURPOSE_LCAT; + } } @ A new paragraph is implied when a macro definition begins in the middle of @@ -177,7 +179,13 @@ namespace for its functions. @ = match_results mr = Regexp::create_mr(); - if (Regexp::match(&mr, L->text, L"%[(%C+)%] (%C+/%C+): (%c+).")) { + if (Regexp::match(&mr, L->text, L"Implied Purpose: (%c+)")) { + S->sect_purpose = Str::duplicate(mr.exp[0]); + if (Str::len(S->sect_purpose) > 0) { + L->category = PURPOSE_LCAT; + L->is_commentary = TRUE; + } + } else if (Regexp::match(&mr, L->text, L"%[(%C+)%] (%C+/%C+): (%c+).")) { if (S->md->using_syntax >= V2_SYNTAX) Parser::wrong_version(S->md->using_syntax, L, "section range in header line", V1_SYNTAX); diff --git a/Chapter 2/The Reader.w b/Chapter 2/The Reader.w index 7f435d1..1f218e9 100644 --- a/Chapter 2/The Reader.w +++ b/Chapter 2/The Reader.w @@ -252,6 +252,14 @@ void Reader::read_file(web *W, chapter *C, filename *F, text_stream *titling_lin @; Str::clear(line); @; + text_stream *purpose = Bibliographic::get_datum(W->md, I"Purpose"); + if (Str::len(purpose) > 0) { + Str::clear(line); + WRITE_TO(line, "Implied Purpose: %S", purpose); + @; + Str::clear(line); + @; + } DISCARD_TEXT(line); @ Non-implied source lines come from here. Note that we assume here that @@ -262,7 +270,8 @@ tangled for. void Reader::scan_source_line(text_stream *line, text_file_position *tfp, void *state) { section *S = (section *) state; int l = Str::len(line) - 1; - while ((l>=0) && (Characters::is_space_or_tab(Str::get_at(line, l)))) Str::truncate(line, l--); + while ((l>=0) && (Characters::is_space_or_tab(Str::get_at(line, l)))) + Str::truncate(line, l--); if (S->paused_until_at) { if (Str::get_at(line, 0) == '@') S->paused_until_at = FALSE; diff --git a/Chapter 6/Colonies.w b/Chapter 6/Colonies.w index 244bd34..15fb0d7 100644 --- a/Chapter 6/Colonies.w +++ b/Chapter 6/Colonies.w @@ -286,6 +286,21 @@ is where the reference is made from. = int Colonies::resolve_reference_in_weave(text_stream *url, text_stream *title, + filename *for_HTML_file, text_stream *text, web_md *Wm, source_line *L) { + int r = 0; + match_results mr = Regexp::create_mr(); + if (Regexp::match(&mr, text, L"(%c+?) -> (%c+)")) { + r = Colonies::resolve_reference_in_weave_inner(url, NULL, + for_HTML_file, mr.exp[1], Wm, L); + WRITE_TO(title, "%S", mr.exp[0]); + } else { + r = Colonies::resolve_reference_in_weave_inner(url, title, + for_HTML_file, text, Wm, L); + } + Regexp::dispose_of(&mr); + return r; +} +int Colonies::resolve_reference_in_weave_inner(text_stream *url, text_stream *title, filename *for_HTML_file, text_stream *text, web_md *Wm, source_line *L) { module *from_M = (Wm)?(Wm->as_module):NULL; module *search_M = from_M; diff --git a/Examples/goldbach/Contents.w b/Examples/goldbach/Contents.w index 008b157..288fd3f 100644 --- a/Examples/goldbach/Contents.w +++ b/Examples/goldbach/Contents.w @@ -1,9 +1,9 @@ -Title: goldbach +Title: The Goldbach Conjecture Author: Graham Nelson Purpose: This example of using inweb is a simple program to test Goldbach's Conjecture, a classic problem in number theory. Language: C Licence: This is a free, open-source program published under the Artistic License 2.0. Sections - The Goldbach Conjecture + Summing Primes The Sieve of Eratosthenes diff --git a/Examples/goldbach/Sections/The Goldbach Conjecture.w b/Examples/goldbach/Sections/Summing Primes.w similarity index 83% rename from Examples/goldbach/Sections/The Goldbach Conjecture.w rename to Examples/goldbach/Sections/Summing Primes.w index 21ca83a..e75591f 100755 --- a/Examples/goldbach/Sections/The Goldbach Conjecture.w +++ b/Examples/goldbach/Sections/Summing Primes.w @@ -1,9 +1,8 @@ -The Goldbach Conjecture. +Summing Two Primes. Here we verify the conjecture for small numbers. -@h The conjecture. -So, this is a program to see if even numbers from 4 to 100 can all be written +@ So, this is a program to see if even numbers from 4 to 100 can all be written as a sum of two primes. Christian Goldbach asked Euler in 1742 if every even number greater than 2 can be written this way. This remains open, though every even number is a sum of at most six primes (Ramaré, 1995) and every @@ -29,9 +28,9 @@ int main(int argc, char *argv[]) { 4 = 2+2 6 = 3+3 8 = 3+5 - 10 = 3+7 5+5 + 10 = 3+7 = 5+5 12 = 5+7 - 14 = 3+11 7+7 + 14 = 3+11 = 7+7 ... = We'll print each different pair of primes adding up to i. We @@ -39,8 +38,8 @@ only check in the range $2 \leq j \leq i/2$ to avoid counting pairs twice over (thus $8 = 3+5 = 5+3$, but that's hardly two different ways). @ = - printf("%d =", i); + printf("%d", i); for (int j=2; j<=i/2; j++) if ((isprime(j)) && (isprime(i-j))) - printf(" %d+%d", j, i-j); + printf(" = %d+%d", j, i-j); printf("\n"); diff --git a/Examples/twinprimes.inweb b/Examples/twinprimes.inweb index b4f7567..97557be 100755 --- a/Examples/twinprimes.inweb +++ b/Examples/twinprimes.inweb @@ -1,6 +1,6 @@ -Title: twinprimes +Title: The Twin Primes Conjecture Author: Graham Nelson -Purpose: A single-file test web for inweb. +Purpose: This example of using inweb is a whole web in a single short file, to look for twin primes, a classic problem in number theory. Language: C @h The conjecture. diff --git a/Manual/How to Write a Web.w b/Manual/How to Write a Web.w index 2530723..7e73554 100644 --- a/Manual/How to Write a Web.w +++ b/Manual/How to Write a Web.w @@ -406,7 +406,15 @@ numerically, link to the first section in them; modules likewise. Errors are thrown if these references to sections are in any way ambiguous. They are not case sensitive. -It's also possible to reference function names and type names, provided that +@ Sometimes we want to make a link without literally showing the destination. +This is simple: for example, += (text) + First //the program has to configure itself -> Configuration//, then... += +produces: "First //the program has to configure itself -> Configuration//, +then..."; the text "the program has to configure itself" links to //Configuration//. + +@ It's also possible to reference function names and type names, provided that the language definition supports these (see //Supporting Programming Languages//): this is certainly the case for C-like languages. For example, = (text) diff --git a/README.md b/README.md index b1ec426..9b2e6e5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Inweb 7 -v7-alpha.1+1A20 'Escape to Danger' (14 April 2020) +v7-alpha.1+1A21 'Escape to Danger' (15 April 2020) ## About Inweb diff --git a/Tangled/inweb.c b/Tangled/inweb.c index 00b7d51..0c0ac4f 100644 --- a/Tangled/inweb.c +++ b/Tangled/inweb.c @@ -1524,7 +1524,7 @@ typedef struct hash_table { struct linked_list *analysis_hash[HASH_TAB_SIZE]; /* of |hash_table_entry| */ int analysis_hash_initialised; /* when we start up, array's contents are undefined */ } hash_table; -#line 377 "inweb/Chapter 2/The Reader.w" +#line 386 "inweb/Chapter 2/The Reader.w" typedef struct tangle_target { struct programming_language *tangle_language; /* common to the entire contents */ struct hash_table symbols; /* a table of identifiable names in this program */ @@ -1554,7 +1554,7 @@ typedef struct source_line { struct source_line *next_line; /* within the owning section's linked list */ struct paragraph *owning_paragraph; /* for lines falling under paragraphs; |NULL| if not */ } source_line; -#line 634 "inweb/Chapter 2/The Parser.w" +#line 642 "inweb/Chapter 2/The Parser.w" typedef struct paragraph { int above_bar; /* placed above the dividing bar in its section (in Version 1 syntax) */ int placed_early; /* should appear early in the tangled code */ @@ -3142,27 +3142,27 @@ web * Reader__load_web(pathname *P, filename *alt_F, module_search *I, int verbo void Reader__read_web(web *W, int verbosely) ; #line 219 "inweb/Chapter 2/The Reader.w" void Reader__read_file(web *W, chapter *C, filename *F, text_stream *titling_line, section *S, int verbosely, int disregard_top) ; -#line 262 "inweb/Chapter 2/The Reader.w" +#line 270 "inweb/Chapter 2/The Reader.w" void Reader__scan_source_line(text_stream *line, text_file_position *tfp, void *state) ; -#line 289 "inweb/Chapter 2/The Reader.w" +#line 298 "inweb/Chapter 2/The Reader.w" pathname * Reader__woven_folder(web *W) ; -#line 295 "inweb/Chapter 2/The Reader.w" +#line 304 "inweb/Chapter 2/The Reader.w" pathname * Reader__tangled_folder(web *W) ; -#line 310 "inweb/Chapter 2/The Reader.w" -chapter * Reader__get_chapter_for_range(web *W, text_stream *range) ; #line 319 "inweb/Chapter 2/The Reader.w" +chapter * Reader__get_chapter_for_range(web *W, text_stream *range) ; +#line 328 "inweb/Chapter 2/The Reader.w" section * Reader__get_section_for_range(web *W, text_stream *range) ; -#line 333 "inweb/Chapter 2/The Reader.w" +#line 342 "inweb/Chapter 2/The Reader.w" section * Reader__section_by_filename(web *W, text_stream *filename) ; -#line 355 "inweb/Chapter 2/The Reader.w" +#line 364 "inweb/Chapter 2/The Reader.w" int Reader__range_within(text_stream *range1, text_stream *range2) ; -#line 384 "inweb/Chapter 2/The Reader.w" +#line 393 "inweb/Chapter 2/The Reader.w" tangle_target * Reader__add_tangle_target(web *W, programming_language *language) ; -#line 408 "inweb/Chapter 2/The Reader.w" +#line 417 "inweb/Chapter 2/The Reader.w" void Reader__add_imported_header(web *W, filename *HF) ; -#line 415 "inweb/Chapter 2/The Reader.w" +#line 424 "inweb/Chapter 2/The Reader.w" int Reader__web_has_one_section(web *W) ; -#line 423 "inweb/Chapter 2/The Reader.w" +#line 432 "inweb/Chapter 2/The Reader.w" void Reader__print_web_statistics(web *W) ; #line 45 "inweb/Chapter 2/Line Categories.w" source_line * Lines__new_source_line_in(text_stream *line, text_file_position *tfp, section *S) ; @@ -3170,11 +3170,11 @@ source_line * Lines__new_source_line_in(text_stream *line, text_file_position *t char * Lines__category_name(int cat) ; #line 17 "inweb/Chapter 2/The Parser.w" void Parser__parse_web(web *W, int inweb_mode) ; -#line 723 "inweb/Chapter 2/The Parser.w" +#line 731 "inweb/Chapter 2/The Parser.w" text_stream * Parser__extract_purpose(text_stream *prologue, source_line *XL, section *S, source_line **adjust) ; -#line 744 "inweb/Chapter 2/The Parser.w" +#line 752 "inweb/Chapter 2/The Parser.w" void Parser__wrong_version(int using, source_line *L, char *feature, int need) ; -#line 755 "inweb/Chapter 2/The Parser.w" +#line 763 "inweb/Chapter 2/The Parser.w" int Parser__detect_footnote(web *W, text_stream *matter, text_stream *before, text_stream *cue, text_stream *after) ; #line 20 "inweb/Chapter 2/Paragraph Macros.w" para_macro * Macros__create(section *S, paragraph *P, source_line *L, text_stream *name) ; @@ -3846,13 +3846,15 @@ module * Colonies__as_module(colony_member *CM, source_line *L, web_md *Wm) ; text_stream * Colonies__home(void) ; #line 288 "inweb/Chapter 6/Colonies.w" int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title, filename *for_HTML_file, text_stream *text, web_md *Wm, source_line *L) ; -#line 403 "inweb/Chapter 6/Colonies.w" +#line 303 "inweb/Chapter 6/Colonies.w" +int Colonies__resolve_reference_in_weave_inner(text_stream *url, text_stream *title, filename *for_HTML_file, text_stream *text, web_md *Wm, source_line *L) ; +#line 418 "inweb/Chapter 6/Colonies.w" void Colonies__link_URL(OUTPUT_STREAM, text_stream *link_text, filename *F) ; -#line 412 "inweb/Chapter 6/Colonies.w" +#line 427 "inweb/Chapter 6/Colonies.w" void Colonies__reference_URL(OUTPUT_STREAM, text_stream *link_text, filename *F) ; -#line 423 "inweb/Chapter 6/Colonies.w" +#line 438 "inweb/Chapter 6/Colonies.w" void Colonies__section_URL(OUTPUT_STREAM, section_md *Sm) ; -#line 433 "inweb/Chapter 6/Colonies.w" +#line 448 "inweb/Chapter 6/Colonies.w" void Colonies__paragraph_URL(OUTPUT_STREAM, paragraph *P, section *from, int a_link) ; void register_tangled_nonterminals(void); text_stream *TL_IS_0 = NULL; @@ -4387,6 +4389,7 @@ text_stream *TL_IS_528 = NULL; text_stream *TL_IS_529 = NULL; text_stream *TL_IS_530 = NULL; text_stream *TL_IS_531 = NULL; +text_stream *TL_IS_532 = NULL; void register_tangled_text_literals(void); #line 57 "inweb/foundation-module/Chapter 2/Streams.w" #define WRITE(args...) Writers__printf(OUT, args) @@ -7232,11 +7235,11 @@ int CommandLine__read_pair_p(text_stream *opt, text_stream *opt_val, int N, ; innocuous = TRUE; break; case VERSION_CLSW: { PRINT("inweb"); - char *svn = "7-alpha.1+1A20"; + char *svn = "7-alpha.1+1A21"; if (svn[0]) PRINT(" version %s", svn); char *vname = "Escape to Danger"; if (vname[0]) PRINT(" '%s'", vname); - char *d = "14 April 2020"; + char *d = "15 April 2020"; if (d[0]) PRINT(" (%s)", d); PRINT("\n"); innocuous = TRUE; break; @@ -14684,7 +14687,7 @@ void Reader__read_file(web *W, chapter *C, filename *F, text_stream *titling_lin WRITE_TO(line, "Chapter Heading"); { -#line 275 "inweb/Chapter 2/The Reader.w" +#line 284 "inweb/Chapter 2/The Reader.w" source_line *sl = Lines__new_source_line_in(line, tfp, S); /* enter this in its section's linked list of lines: */ @@ -14713,7 +14716,7 @@ void Reader__read_file(web *W, chapter *C, filename *F, text_stream *titling_lin WRITE_TO(line, "Main."); { -#line 275 "inweb/Chapter 2/The Reader.w" +#line 284 "inweb/Chapter 2/The Reader.w" source_line *sl = Lines__new_source_line_in(line, tfp, S); /* enter this in its section's linked list of lines: */ @@ -14730,7 +14733,7 @@ void Reader__read_file(web *W, chapter *C, filename *F, text_stream *titling_lin Str__clear(line); { -#line 275 "inweb/Chapter 2/The Reader.w" +#line 284 "inweb/Chapter 2/The Reader.w" source_line *sl = Lines__new_source_line_in(line, tfp, S); /* enter this in its section's linked list of lines: */ @@ -14744,6 +14747,44 @@ void Reader__read_file(web *W, chapter *C, filename *F, text_stream *titling_lin } #line 254 "inweb/Chapter 2/The Reader.w" ; + text_stream *purpose = Bibliographic__get_datum(W->md, TL_IS_125); + if (Str__len(purpose) > 0) { + Str__clear(line); + WRITE_TO(line, "Implied Purpose: %S", purpose); + +{ +#line 284 "inweb/Chapter 2/The Reader.w" + source_line *sl = Lines__new_source_line_in(line, tfp, S); + + /* enter this in its section's linked list of lines: */ + if (S->first_line == NULL) S->first_line = sl; + else S->last_line->next_line = sl; + S->last_line = sl; + + /* we haven't detected paragraph boundaries yet, so: */ + sl->owning_paragraph = NULL; + +} +#line 259 "inweb/Chapter 2/The Reader.w" +; + Str__clear(line); + +{ +#line 284 "inweb/Chapter 2/The Reader.w" + source_line *sl = Lines__new_source_line_in(line, tfp, S); + + /* enter this in its section's linked list of lines: */ + if (S->first_line == NULL) S->first_line = sl; + else S->last_line->next_line = sl; + S->last_line = sl; + + /* we haven't detected paragraph boundaries yet, so: */ + sl->owning_paragraph = NULL; + +} +#line 261 "inweb/Chapter 2/The Reader.w" +; + } DISCARD_TEXT(line); } @@ -14756,11 +14797,12 @@ void Reader__read_file(web *W, chapter *C, filename *F, text_stream *titling_lin PRINT("Read section: '%S' (%d lines)\n", S->md->sect_title, cl); } -#line 262 "inweb/Chapter 2/The Reader.w" +#line 270 "inweb/Chapter 2/The Reader.w" void Reader__scan_source_line(text_stream *line, text_file_position *tfp, void *state) { section *S = (section *) state; int l = Str__len(line) - 1; - while ((l>=0) && (Characters__is_space_or_tab(Str__get_at(line, l)))) Str__truncate(line, l--); + while ((l>=0) && (Characters__is_space_or_tab(Str__get_at(line, l)))) + Str__truncate(line, l--); if (S->paused_until_at) { if (Str__get_at(line, 0) == '@') S->paused_until_at = FALSE; @@ -14768,7 +14810,7 @@ void Reader__scan_source_line(text_stream *line, text_file_position *tfp, void * } { -#line 275 "inweb/Chapter 2/The Reader.w" +#line 284 "inweb/Chapter 2/The Reader.w" source_line *sl = Lines__new_source_line_in(line, tfp, S); /* enter this in its section's linked list of lines: */ @@ -14780,25 +14822,25 @@ void Reader__scan_source_line(text_stream *line, text_file_position *tfp, void * sl->owning_paragraph = NULL; } -#line 271 "inweb/Chapter 2/The Reader.w" +#line 280 "inweb/Chapter 2/The Reader.w" ; } -#line 289 "inweb/Chapter 2/The Reader.w" +#line 298 "inweb/Chapter 2/The Reader.w" pathname *Reader__woven_folder(web *W) { - pathname *P = Pathnames__subfolder(W->md->path_to_web, TL_IS_125); + pathname *P = Pathnames__subfolder(W->md->path_to_web, TL_IS_126); if (Pathnames__create_in_file_system(P) == FALSE) Errors__fatal_with_path("unable to create Woven subdirectory", P); return P; } pathname *Reader__tangled_folder(web *W) { - pathname *P = Pathnames__subfolder(W->md->path_to_web, TL_IS_126); + pathname *P = Pathnames__subfolder(W->md->path_to_web, TL_IS_127); if (Pathnames__create_in_file_system(P) == FALSE) Errors__fatal_with_path("unable to create Tangled subdirectory", P); return P; } -#line 310 "inweb/Chapter 2/The Reader.w" +#line 319 "inweb/Chapter 2/The Reader.w" chapter *Reader__get_chapter_for_range(web *W, text_stream *range) { chapter *C; if (W) @@ -14819,7 +14861,7 @@ section *Reader__get_section_for_range(web *W, text_stream *range) { return NULL; } -#line 333 "inweb/Chapter 2/The Reader.w" +#line 342 "inweb/Chapter 2/The Reader.w" section *Reader__section_by_filename(web *W, text_stream *filename) { chapter *C; section *S; @@ -14835,7 +14877,7 @@ section *Reader__section_by_filename(web *W, text_stream *filename) { return NULL; } -#line 355 "inweb/Chapter 2/The Reader.w" +#line 364 "inweb/Chapter 2/The Reader.w" int Reader__range_within(text_stream *range1, text_stream *range2) { if (Str__eq_wide_string(range2, L"0")) return TRUE; if (Str__eq(range1, range2)) return TRUE; @@ -14847,9 +14889,9 @@ int Reader__range_within(text_stream *range1, text_stream *range2) { return FALSE; } -#line 382 "inweb/Chapter 2/The Reader.w" +#line 391 "inweb/Chapter 2/The Reader.w" -#line 384 "inweb/Chapter 2/The Reader.w" +#line 393 "inweb/Chapter 2/The Reader.w" tangle_target *Reader__add_tangle_target(web *W, programming_language *language) { tangle_target *tt = CREATE(tangle_target); tt->tangle_language = language; @@ -14858,20 +14900,20 @@ tangle_target *Reader__add_tangle_target(web *W, programming_language *language) return tt; } -#line 408 "inweb/Chapter 2/The Reader.w" +#line 417 "inweb/Chapter 2/The Reader.w" void Reader__add_imported_header(web *W, filename *HF) { ADD_TO_LINKED_LIST(HF, filename, W->headers); } -#line 415 "inweb/Chapter 2/The Reader.w" +#line 424 "inweb/Chapter 2/The Reader.w" int Reader__web_has_one_section(web *W) { if (WebMetadata__section_count(W->md) == 1) return TRUE; return FALSE; } -#line 423 "inweb/Chapter 2/The Reader.w" +#line 432 "inweb/Chapter 2/The Reader.w" void Reader__print_web_statistics(web *W) { - PRINT("web \"%S\": ", Bibliographic__get_datum(W->md, TL_IS_127)); + PRINT("web \"%S\": ", Bibliographic__get_datum(W->md, TL_IS_128)); int c = WebMetadata__chapter_count(W->md); int s = WebMetadata__section_count(W->md); if (W->md->chaptered) PRINT("%d chapter%s : ", @@ -15009,7 +15051,7 @@ void Parser__parse_web(web *W, int inweb_mode) { ; { -#line 109 "inweb/Chapter 2/The Parser.w" +#line 111 "inweb/Chapter 2/The Parser.w" match_results mr = Regexp__create_mr(); if ((PL) && (PL->category == CODE_BODY_LCAT) && (Str__get_first_char(L->text) == '@') && (Str__get_at(L->text, 1) == '<') && @@ -15017,8 +15059,8 @@ void Parser__parse_web(web *W, int inweb_mode) { (S->md->using_syntax >= V2_SYNTAX)) { { -#line 129 "inweb/Chapter 2/The Parser.w" - source_line *NL = Lines__new_source_line_in(TL_IS_130, &(L->source), S); +#line 131 "inweb/Chapter 2/The Parser.w" + source_line *NL = Lines__new_source_line_in(TL_IS_131, &(L->source), S); PL->next_line = NL; NL->next_line = L; L = PL; @@ -15026,18 +15068,18 @@ void Parser__parse_web(web *W, int inweb_mode) { continue; } -#line 114 "inweb/Chapter 2/The Parser.w" +#line 116 "inweb/Chapter 2/The Parser.w" ; } if ((PL) && (Regexp__match(&mr, L->text, L"@ *= *"))) { Str__clear(L->text); - Str__copy(L->text, TL_IS_129); + Str__copy(L->text, TL_IS_130); if (S->md->using_syntax < V2_SYNTAX) Parser__wrong_version(S->md->using_syntax, L, "implied paragraph breaks", V2_SYNTAX); { -#line 129 "inweb/Chapter 2/The Parser.w" - source_line *NL = Lines__new_source_line_in(TL_IS_130, &(L->source), S); +#line 131 "inweb/Chapter 2/The Parser.w" + source_line *NL = Lines__new_source_line_in(TL_IS_131, &(L->source), S); PL->next_line = NL; NL->next_line = L; L = PL; @@ -15045,7 +15087,7 @@ void Parser__parse_web(web *W, int inweb_mode) { continue; } -#line 121 "inweb/Chapter 2/The Parser.w" +#line 123 "inweb/Chapter 2/The Parser.w" ; } Regexp__dispose_of(&mr); @@ -15055,14 +15097,14 @@ void Parser__parse_web(web *W, int inweb_mode) { ; { -#line 141 "inweb/Chapter 2/The Parser.w" +#line 143 "inweb/Chapter 2/The Parser.w" L->is_commentary = comment_mode; L->category = COMMENT_BODY_LCAT; /* until set otherwise down below */ L->owning_paragraph = current_paragraph; if (L->source.line_count == 0) { -#line 168 "inweb/Chapter 2/The Parser.w" +#line 170 "inweb/Chapter 2/The Parser.w" if (Str__eq_wide_string(L->text, L"Chapter Heading")) { comment_mode = TRUE; extract_mode = FALSE; @@ -15071,13 +15113,19 @@ void Parser__parse_web(web *W, int inweb_mode) { } } -#line 145 "inweb/Chapter 2/The Parser.w" +#line 147 "inweb/Chapter 2/The Parser.w" ; if (L->source.line_count <= 1) { -#line 179 "inweb/Chapter 2/The Parser.w" +#line 181 "inweb/Chapter 2/The Parser.w" match_results mr = Regexp__create_mr(); - if (Regexp__match(&mr, L->text, L"%[(%C+)%] (%C+/%C+): (%c+).")) { + if (Regexp__match(&mr, L->text, L"Implied Purpose: (%c+)")) { + S->sect_purpose = Str__duplicate(mr.exp[0]); + if (Str__len(S->sect_purpose) > 0) { + L->category = PURPOSE_LCAT; + L->is_commentary = TRUE; + } + } else if (Regexp__match(&mr, L->text, L"%[(%C+)%] (%C+/%C+): (%c+).")) { if (S->md->using_syntax >= V2_SYNTAX) Parser__wrong_version(S->md->using_syntax, L, "section range in header line", V1_SYNTAX); @@ -15107,12 +15155,12 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr); } -#line 146 "inweb/Chapter 2/The Parser.w" +#line 148 "inweb/Chapter 2/The Parser.w" ; if (extract_mode == FALSE) { { -#line 214 "inweb/Chapter 2/The Parser.w" +#line 222 "inweb/Chapter 2/The Parser.w" match_results mr = Regexp__create_mr(); if (Regexp__match(&mr, L->text, L"%[%[(%c+)%]%]")) { TEMPORARY_TEXT(full_command); @@ -15138,10 +15186,10 @@ void Parser__parse_web(web *W, int inweb_mode) { } else if (Str__eq_wide_string(command_text, L"Figure")) { if (S->md->using_syntax > V1_SYNTAX) Parser__wrong_version(S->md->using_syntax, L, "[[Figure...]]", V1_SYNTAX); - Tags__add_by_name(L->owning_paragraph, TL_IS_131); + Tags__add_by_name(L->owning_paragraph, TL_IS_132); L->command_code = FIGURE_CMD; } else { - Main__error_in_web(TL_IS_132, L); + Main__error_in_web(TL_IS_133, L); } L->is_commentary = TRUE; DISCARD_TEXT(command_text); @@ -15150,11 +15198,11 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr); } -#line 148 "inweb/Chapter 2/The Parser.w" +#line 150 "inweb/Chapter 2/The Parser.w" ; { -#line 254 "inweb/Chapter 2/The Parser.w" +#line 262 "inweb/Chapter 2/The Parser.w" match_results mr = Regexp__create_mr(); if ((Str__get_first_char(L->text) == '@') && (Str__get_at(L->text, 1) == '<') && (Regexp__match(&mr, L->text, L"%c<(%c+)@> *= *"))) { @@ -15162,7 +15210,7 @@ void Parser__parse_web(web *W, int inweb_mode) { Str__copy(para_macro_name, mr.exp[0]); L->category = MACRO_DEFINITION_LCAT; if (current_paragraph == NULL) - Main__error_in_web(TL_IS_133, L); + Main__error_in_web(TL_IS_134, L); else Macros__create(S, current_paragraph, L, para_macro_name); comment_mode = FALSE; extract_mode = FALSE; L->is_commentary = FALSE; @@ -15176,7 +15224,7 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr); } -#line 149 "inweb/Chapter 2/The Parser.w" +#line 151 "inweb/Chapter 2/The Parser.w" ; } if (Str__get_first_char(L->text) == '=') { @@ -15184,17 +15232,17 @@ void Parser__parse_web(web *W, int inweb_mode) { Parser__wrong_version(S->md->using_syntax, L, "column-1 '=' as code divider", V2_SYNTAX); if (extract_mode) { -#line 296 "inweb/Chapter 2/The Parser.w" +#line 304 "inweb/Chapter 2/The Parser.w" L->category = END_EXTRACT_LCAT; comment_mode = TRUE; extract_mode = FALSE; } -#line 154 "inweb/Chapter 2/The Parser.w" +#line 156 "inweb/Chapter 2/The Parser.w" else { -#line 303 "inweb/Chapter 2/The Parser.w" +#line 311 "inweb/Chapter 2/The Parser.w" L->category = BEGIN_CODE_LCAT; L->plainer = FALSE; code_lcat_for_body = CODE_BODY_LCAT; @@ -15203,23 +15251,23 @@ void Parser__parse_web(web *W, int inweb_mode) { match_results mr = Regexp__create_mr(); match_results mr2 = Regexp__create_mr(); if (Regexp__match(&mr, L->text, L"= *(%c+) *")) { - if ((current_paragraph) && (Str__eq(mr.exp[0], TL_IS_134))) { + if ((current_paragraph) && (Str__eq(mr.exp[0], TL_IS_135))) { current_paragraph->placed_very_early = TRUE; - } else if ((current_paragraph) && (Str__eq(mr.exp[0], TL_IS_135))) { + } else if ((current_paragraph) && (Str__eq(mr.exp[0], TL_IS_136))) { current_paragraph->placed_early = TRUE; } else if ((current_paragraph) && (Regexp__match(&mr2, mr.exp[0], L"%((%c*?) *text%)"))) { { -#line 379 "inweb/Chapter 2/The Parser.w" +#line 387 "inweb/Chapter 2/The Parser.w" match_results mr3 = Regexp__create_mr(); while (TRUE) { if (Regexp__match(&mr3, mr2.exp[0], L" *(%C+) *(%c*?)")) { - if (Str__eq(mr3.exp[0], TL_IS_140)) L->plainer = TRUE; - else if (Str__eq(mr3.exp[0], TL_IS_141)) L->enable_hyperlinks = TRUE; + if (Str__eq(mr3.exp[0], TL_IS_141)) L->plainer = TRUE; + else if (Str__eq(mr3.exp[0], TL_IS_142)) L->enable_hyperlinks = TRUE; else { Main__error_in_web( - TL_IS_142, L); + TL_IS_143, L); } } else break; Str__clear(mr2.exp[0]); @@ -15228,7 +15276,7 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr3); } -#line 317 "inweb/Chapter 2/The Parser.w" +#line 325 "inweb/Chapter 2/The Parser.w" ; code_lcat_for_body = TEXT_EXTRACT_LCAT; code_pl_for_body = NULL; @@ -15237,15 +15285,15 @@ void Parser__parse_web(web *W, int inweb_mode) { (Regexp__match(&mr2, mr.exp[0], L"%((%c*?) *text as code%)"))) { { -#line 379 "inweb/Chapter 2/The Parser.w" +#line 387 "inweb/Chapter 2/The Parser.w" match_results mr3 = Regexp__create_mr(); while (TRUE) { if (Regexp__match(&mr3, mr2.exp[0], L" *(%C+) *(%c*?)")) { - if (Str__eq(mr3.exp[0], TL_IS_140)) L->plainer = TRUE; - else if (Str__eq(mr3.exp[0], TL_IS_141)) L->enable_hyperlinks = TRUE; + if (Str__eq(mr3.exp[0], TL_IS_141)) L->plainer = TRUE; + else if (Str__eq(mr3.exp[0], TL_IS_142)) L->enable_hyperlinks = TRUE; else { Main__error_in_web( - TL_IS_142, L); + TL_IS_143, L); } } else break; Str__clear(mr2.exp[0]); @@ -15254,7 +15302,7 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr3); } -#line 323 "inweb/Chapter 2/The Parser.w" +#line 331 "inweb/Chapter 2/The Parser.w" ; code_lcat_for_body = TEXT_EXTRACT_LCAT; code_pl_for_body = S->sect_language; @@ -15263,15 +15311,15 @@ void Parser__parse_web(web *W, int inweb_mode) { (Regexp__match(&mr2, mr.exp[0], L"%((%c*?) *text as (%c+)%)"))) { { -#line 379 "inweb/Chapter 2/The Parser.w" +#line 387 "inweb/Chapter 2/The Parser.w" match_results mr3 = Regexp__create_mr(); while (TRUE) { if (Regexp__match(&mr3, mr2.exp[0], L" *(%C+) *(%c*?)")) { - if (Str__eq(mr3.exp[0], TL_IS_140)) L->plainer = TRUE; - else if (Str__eq(mr3.exp[0], TL_IS_141)) L->enable_hyperlinks = TRUE; + if (Str__eq(mr3.exp[0], TL_IS_141)) L->plainer = TRUE; + else if (Str__eq(mr3.exp[0], TL_IS_142)) L->enable_hyperlinks = TRUE; else { Main__error_in_web( - TL_IS_142, L); + TL_IS_143, L); } } else break; Str__clear(mr2.exp[0]); @@ -15280,7 +15328,7 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr3); } -#line 329 "inweb/Chapter 2/The Parser.w" +#line 337 "inweb/Chapter 2/The Parser.w" ; code_lcat_for_body = TEXT_EXTRACT_LCAT; code_pl_for_body = Languages__find_by_name(mr2.exp[1], W); @@ -15289,15 +15337,15 @@ void Parser__parse_web(web *W, int inweb_mode) { (Regexp__match(&mr2, mr.exp[0], L"%((%c*?) *text from (%c+) as code%)"))) { { -#line 379 "inweb/Chapter 2/The Parser.w" +#line 387 "inweb/Chapter 2/The Parser.w" match_results mr3 = Regexp__create_mr(); while (TRUE) { if (Regexp__match(&mr3, mr2.exp[0], L" *(%C+) *(%c*?)")) { - if (Str__eq(mr3.exp[0], TL_IS_140)) L->plainer = TRUE; - else if (Str__eq(mr3.exp[0], TL_IS_141)) L->enable_hyperlinks = TRUE; + if (Str__eq(mr3.exp[0], TL_IS_141)) L->plainer = TRUE; + else if (Str__eq(mr3.exp[0], TL_IS_142)) L->enable_hyperlinks = TRUE; else { Main__error_in_web( - TL_IS_142, L); + TL_IS_143, L); } } else break; Str__clear(mr2.exp[0]); @@ -15306,12 +15354,12 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr3); } -#line 335 "inweb/Chapter 2/The Parser.w" +#line 343 "inweb/Chapter 2/The Parser.w" ; code_pl_for_body = S->sect_language; { -#line 395 "inweb/Chapter 2/The Parser.w" +#line 403 "inweb/Chapter 2/The Parser.w" L->category = BEGIN_CODE_LCAT; pathname *P = W->md->path_to_web; filename *F = Filenames__from_text_relative(P, mr2.exp[1]); @@ -15325,28 +15373,28 @@ void Parser__parse_web(web *W, int inweb_mode) { latest->next_line = TL; latest = TL; } - source_line *EEL = Lines__new_source_line_in(TL_IS_143, &(L->source), S); + source_line *EEL = Lines__new_source_line_in(TL_IS_144, &(L->source), S); EEL->next_line = latest->next_line; latest->next_line = EEL; code_lcat_for_body = TEXT_EXTRACT_LCAT; extract_mode = TRUE; } -#line 337 "inweb/Chapter 2/The Parser.w" +#line 345 "inweb/Chapter 2/The Parser.w" ; } else if ((current_paragraph) && (Regexp__match(&mr2, mr.exp[0], L"%((%c*?) *text from (%c+) as (%c+)%)"))) { { -#line 379 "inweb/Chapter 2/The Parser.w" +#line 387 "inweb/Chapter 2/The Parser.w" match_results mr3 = Regexp__create_mr(); while (TRUE) { if (Regexp__match(&mr3, mr2.exp[0], L" *(%C+) *(%c*?)")) { - if (Str__eq(mr3.exp[0], TL_IS_140)) L->plainer = TRUE; - else if (Str__eq(mr3.exp[0], TL_IS_141)) L->enable_hyperlinks = TRUE; + if (Str__eq(mr3.exp[0], TL_IS_141)) L->plainer = TRUE; + else if (Str__eq(mr3.exp[0], TL_IS_142)) L->enable_hyperlinks = TRUE; else { Main__error_in_web( - TL_IS_142, L); + TL_IS_143, L); } } else break; Str__clear(mr2.exp[0]); @@ -15355,12 +15403,12 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr3); } -#line 340 "inweb/Chapter 2/The Parser.w" +#line 348 "inweb/Chapter 2/The Parser.w" ; code_pl_for_body = Languages__find_by_name(mr2.exp[2], W); { -#line 395 "inweb/Chapter 2/The Parser.w" +#line 403 "inweb/Chapter 2/The Parser.w" L->category = BEGIN_CODE_LCAT; pathname *P = W->md->path_to_web; filename *F = Filenames__from_text_relative(P, mr2.exp[1]); @@ -15374,28 +15422,28 @@ void Parser__parse_web(web *W, int inweb_mode) { latest->next_line = TL; latest = TL; } - source_line *EEL = Lines__new_source_line_in(TL_IS_143, &(L->source), S); + source_line *EEL = Lines__new_source_line_in(TL_IS_144, &(L->source), S); EEL->next_line = latest->next_line; latest->next_line = EEL; code_lcat_for_body = TEXT_EXTRACT_LCAT; extract_mode = TRUE; } -#line 342 "inweb/Chapter 2/The Parser.w" +#line 350 "inweb/Chapter 2/The Parser.w" ; } else if ((current_paragraph) && (Regexp__match(&mr2, mr.exp[0], L"%((%c*?) *text from (%c+)%)"))) { { -#line 379 "inweb/Chapter 2/The Parser.w" +#line 387 "inweb/Chapter 2/The Parser.w" match_results mr3 = Regexp__create_mr(); while (TRUE) { if (Regexp__match(&mr3, mr2.exp[0], L" *(%C+) *(%c*?)")) { - if (Str__eq(mr3.exp[0], TL_IS_140)) L->plainer = TRUE; - else if (Str__eq(mr3.exp[0], TL_IS_141)) L->enable_hyperlinks = TRUE; + if (Str__eq(mr3.exp[0], TL_IS_141)) L->plainer = TRUE; + else if (Str__eq(mr3.exp[0], TL_IS_142)) L->enable_hyperlinks = TRUE; else { Main__error_in_web( - TL_IS_142, L); + TL_IS_143, L); } } else break; Str__clear(mr2.exp[0]); @@ -15404,12 +15452,12 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr3); } -#line 345 "inweb/Chapter 2/The Parser.w" +#line 353 "inweb/Chapter 2/The Parser.w" ; code_pl_for_body = NULL; { -#line 395 "inweb/Chapter 2/The Parser.w" +#line 403 "inweb/Chapter 2/The Parser.w" L->category = BEGIN_CODE_LCAT; pathname *P = W->md->path_to_web; filename *F = Filenames__from_text_relative(P, mr2.exp[1]); @@ -15423,18 +15471,18 @@ void Parser__parse_web(web *W, int inweb_mode) { latest->next_line = TL; latest = TL; } - source_line *EEL = Lines__new_source_line_in(TL_IS_143, &(L->source), S); + source_line *EEL = Lines__new_source_line_in(TL_IS_144, &(L->source), S); EEL->next_line = latest->next_line; latest->next_line = EEL; code_lcat_for_body = TEXT_EXTRACT_LCAT; extract_mode = TRUE; } -#line 347 "inweb/Chapter 2/The Parser.w" +#line 355 "inweb/Chapter 2/The Parser.w" ; } else if ((current_paragraph) && (Regexp__match(&mr2, mr.exp[0], L"%(figure (%c+)%)"))) { - Tags__add_by_name(L->owning_paragraph, TL_IS_136); + Tags__add_by_name(L->owning_paragraph, TL_IS_137); L->command_code = FIGURE_CMD; L->category = COMMAND_LCAT; code_lcat_for_body = COMMENT_BODY_LCAT; @@ -15443,7 +15491,7 @@ void Parser__parse_web(web *W, int inweb_mode) { } else if ((current_paragraph) && ((Regexp__match(&mr2, mr.exp[0], L"%(embedded (%C+) video (%c+)%)")) || (Regexp__match(&mr2, mr.exp[0], L"%(embedded (%C+) audio (%c+)%)")))) { - Tags__add_by_name(L->owning_paragraph, TL_IS_137); + Tags__add_by_name(L->owning_paragraph, TL_IS_138); L->command_code = EMBED_CMD; L->category = COMMAND_LCAT; code_lcat_for_body = COMMENT_BODY_LCAT; @@ -15451,10 +15499,10 @@ void Parser__parse_web(web *W, int inweb_mode) { L->text_operand2 = Str__duplicate(mr2.exp[1]); comment_mode = TRUE; } else { - Main__error_in_web(TL_IS_138, L); + Main__error_in_web(TL_IS_139, L); } } else if (Regexp__match(&mr, L->text, L"= *%C%c*")) { - Main__error_in_web(TL_IS_139, L); + Main__error_in_web(TL_IS_140, L); } code_plainness_for_body = L->plainer; hyperlink_body = L->enable_hyperlinks; @@ -15463,7 +15511,7 @@ void Parser__parse_web(web *W, int inweb_mode) { continue; } -#line 155 "inweb/Chapter 2/The Parser.w" +#line 157 "inweb/Chapter 2/The Parser.w" ; } if ((Str__get_first_char(L->text) == '@') && @@ -15471,7 +15519,7 @@ void Parser__parse_web(web *W, int inweb_mode) { (L->category != MACRO_DEFINITION_LCAT)) { -#line 278 "inweb/Chapter 2/The Parser.w" +#line 286 "inweb/Chapter 2/The Parser.w" TEMPORARY_TEXT(command_text); Str__copy(command_text, L->text); Str__delete_first_character(command_text); /* i.e., strip the at-sign from the front */ @@ -15483,12 +15531,12 @@ void Parser__parse_web(web *W, int inweb_mode) { } { -#line 421 "inweb/Chapter 2/The Parser.w" +#line 429 "inweb/Chapter 2/The Parser.w" extract_mode = FALSE; if (Str__eq_wide_string(command_text, L"Purpose:")) { -#line 469 "inweb/Chapter 2/The Parser.w" - if (before_bar == FALSE) Main__error_in_web(TL_IS_145, L); +#line 477 "inweb/Chapter 2/The Parser.w" + if (before_bar == FALSE) Main__error_in_web(TL_IS_146, L); if (S->md->using_syntax >= V2_SYNTAX) Parser__wrong_version(S->md->using_syntax, L, "'@Purpose'", V1_SYNTAX); L->category = PURPOSE_LCAT; @@ -15497,14 +15545,14 @@ void Parser__parse_web(web *W, int inweb_mode) { S->sect_purpose = Parser__extract_purpose(remainder, L->next_line, L->owning_section, &L); } -#line 422 "inweb/Chapter 2/The Parser.w" +#line 430 "inweb/Chapter 2/The Parser.w" else if (Str__eq_wide_string(command_text, L"Interface:")) { -#line 478 "inweb/Chapter 2/The Parser.w" +#line 486 "inweb/Chapter 2/The Parser.w" if (S->md->using_syntax >= V2_SYNTAX) Parser__wrong_version(S->md->using_syntax, L, "'@Interface'", V1_SYNTAX); - if (before_bar == FALSE) Main__error_in_web(TL_IS_146, L); + if (before_bar == FALSE) Main__error_in_web(TL_IS_147, L); L->category = INTERFACE_LCAT; L->is_commentary = TRUE; source_line *XL = L->next_line; @@ -15516,28 +15564,28 @@ void Parser__parse_web(web *W, int inweb_mode) { } } -#line 423 "inweb/Chapter 2/The Parser.w" +#line 431 "inweb/Chapter 2/The Parser.w" else if (Str__eq_wide_string(command_text, L"Definitions:")) { -#line 492 "inweb/Chapter 2/The Parser.w" +#line 500 "inweb/Chapter 2/The Parser.w" if (S->md->using_syntax >= V2_SYNTAX) Parser__wrong_version(S->md->using_syntax, L, "'@Definitions' headings", V1_SYNTAX); - if (before_bar == FALSE) Main__error_in_web(TL_IS_147, L); + if (before_bar == FALSE) Main__error_in_web(TL_IS_148, L); L->category = DEFINITIONS_LCAT; L->is_commentary = TRUE; before_bar = TRUE; next_par_number = 1; } -#line 424 "inweb/Chapter 2/The Parser.w" +#line 432 "inweb/Chapter 2/The Parser.w" else if (Regexp__match(&mr, command_text, L"----+")) { -#line 504 "inweb/Chapter 2/The Parser.w" +#line 512 "inweb/Chapter 2/The Parser.w" if (S->md->using_syntax >= V2_SYNTAX) Parser__wrong_version(S->md->using_syntax, L, "the bar '----...'", V1_SYNTAX); - if (before_bar == FALSE) Main__error_in_web(TL_IS_148, L); + if (before_bar == FALSE) Main__error_in_web(TL_IS_149, L); L->category = BAR_LCAT; L->is_commentary = TRUE; comment_mode = TRUE; @@ -15546,14 +15594,14 @@ void Parser__parse_web(web *W, int inweb_mode) { next_par_number = 1; } -#line 425 "inweb/Chapter 2/The Parser.w" +#line 433 "inweb/Chapter 2/The Parser.w" else if ((Str__eq_wide_string(command_text, L"c")) || (Str__eq_wide_string(command_text, L"x")) || ((S->md->using_syntax == V1_SYNTAX) && (Str__eq_wide_string(command_text, L"e")))) { -#line 521 "inweb/Chapter 2/The Parser.w" +#line 529 "inweb/Chapter 2/The Parser.w" if (S->md->using_syntax > V1_SYNTAX) Parser__wrong_version(S->md->using_syntax, L, "'@c' and '@x'", V1_SYNTAX); L->category = BEGIN_CODE_LCAT; @@ -15567,11 +15615,11 @@ void Parser__parse_web(web *W, int inweb_mode) { hyperlink_body = FALSE; } -#line 429 "inweb/Chapter 2/The Parser.w" +#line 437 "inweb/Chapter 2/The Parser.w" else if (Str__eq_wide_string(command_text, L"d")) { -#line 537 "inweb/Chapter 2/The Parser.w" +#line 545 "inweb/Chapter 2/The Parser.w" L->category = BEGIN_DEFINITION_LCAT; code_lcat_for_body = CONT_DEFINITION_LCAT; code_pl_for_body = NULL; @@ -15589,14 +15637,14 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr); } -#line 430 "inweb/Chapter 2/The Parser.w" +#line 438 "inweb/Chapter 2/The Parser.w" else if (Str__eq_wide_string(command_text, L"define")) { if (S->md->using_syntax < V2_SYNTAX) Parser__wrong_version(S->md->using_syntax, L, "'@define' for definitions (use '@d' instead)", V2_SYNTAX); { -#line 537 "inweb/Chapter 2/The Parser.w" +#line 545 "inweb/Chapter 2/The Parser.w" L->category = BEGIN_DEFINITION_LCAT; code_lcat_for_body = CONT_DEFINITION_LCAT; code_pl_for_body = NULL; @@ -15613,101 +15661,101 @@ void Parser__parse_web(web *W, int inweb_mode) { L->is_commentary = FALSE; Regexp__dispose_of(&mr); -} -#line 434 "inweb/Chapter 2/The Parser.w" -; - } else if (Str__eq_wide_string(command_text, L"default")) { - if (S->md->using_syntax < V2_SYNTAX) - Parser__wrong_version(S->md->using_syntax, L, "'@default' for definitions", V2_SYNTAX); - L->default_defn = TRUE; - -{ -#line 537 "inweb/Chapter 2/The Parser.w" - L->category = BEGIN_DEFINITION_LCAT; - code_lcat_for_body = CONT_DEFINITION_LCAT; - code_pl_for_body = NULL; - match_results mr = Regexp__create_mr(); - if (Regexp__match(&mr, remainder, L"(%C+) (%c+)")) { - L->text_operand = Str__duplicate(mr.exp[0]); /* name of term defined */ - L->text_operand2 = Str__duplicate(mr.exp[1]); /* Value */ - } else { - L->text_operand = Str__duplicate(remainder); /* name of term defined */ - L->text_operand2 = Str__new(); /* no value given */ - } - Analyser__mark_reserved_word_at_line(L, L->text_operand, CONSTANT_COLOUR); - comment_mode = FALSE; - L->is_commentary = FALSE; - Regexp__dispose_of(&mr); - -} -#line 439 "inweb/Chapter 2/The Parser.w" -; - } else if (Str__eq_wide_string(command_text, L"enum")) -{ -#line 557 "inweb/Chapter 2/The Parser.w" - L->category = BEGIN_DEFINITION_LCAT; - text_stream *from = NULL; - match_results mr = Regexp__create_mr(); - L->text_operand = Str__duplicate(remainder); /* name of term defined */ - TEMPORARY_TEXT(before); - TEMPORARY_TEXT(after); - if (LanguageMethods__parse_comment(S->sect_language, L->text_operand, - before, after)) { - Str__copy(L->text_operand, before); - } - DISCARD_TEXT(before); - DISCARD_TEXT(after); - Str__trim_white_space(L->text_operand); - if (Regexp__match(&mr, L->text_operand, L"(%C+) from (%c+)")) { - from = mr.exp[1]; - Str__copy(L->text_operand, mr.exp[0]); - } else if (Regexp__match(&mr, L->text_operand, L"(%C+) (%c+)")) { - Main__error_in_web(TL_IS_149, L); - } - L->text_operand2 = Str__new(); - if (inweb_mode == TANGLE_MODE) - Enumerations__define(L->text_operand2, L->text_operand, from, L); - Analyser__mark_reserved_word_at_line(L, L->text_operand, CONSTANT_COLOUR); - comment_mode = FALSE; - L->is_commentary = FALSE; - Regexp__dispose_of(&mr); - -} -#line 440 "inweb/Chapter 2/The Parser.w" - - else if ((Str__eq_wide_string(command_text, L"e")) && (S->md->using_syntax >= V2_SYNTAX)) - -{ -#line 557 "inweb/Chapter 2/The Parser.w" - L->category = BEGIN_DEFINITION_LCAT; - text_stream *from = NULL; - match_results mr = Regexp__create_mr(); - L->text_operand = Str__duplicate(remainder); /* name of term defined */ - TEMPORARY_TEXT(before); - TEMPORARY_TEXT(after); - if (LanguageMethods__parse_comment(S->sect_language, L->text_operand, - before, after)) { - Str__copy(L->text_operand, before); - } - DISCARD_TEXT(before); - DISCARD_TEXT(after); - Str__trim_white_space(L->text_operand); - if (Regexp__match(&mr, L->text_operand, L"(%C+) from (%c+)")) { - from = mr.exp[1]; - Str__copy(L->text_operand, mr.exp[0]); - } else if (Regexp__match(&mr, L->text_operand, L"(%C+) (%c+)")) { - Main__error_in_web(TL_IS_149, L); - } - L->text_operand2 = Str__new(); - if (inweb_mode == TANGLE_MODE) - Enumerations__define(L->text_operand2, L->text_operand, from, L); - Analyser__mark_reserved_word_at_line(L, L->text_operand, CONSTANT_COLOUR); - comment_mode = FALSE; - L->is_commentary = FALSE; - Regexp__dispose_of(&mr); - } #line 442 "inweb/Chapter 2/The Parser.w" +; + } else if (Str__eq_wide_string(command_text, L"default")) { + if (S->md->using_syntax < V2_SYNTAX) + Parser__wrong_version(S->md->using_syntax, L, "'@default' for definitions", V2_SYNTAX); + L->default_defn = TRUE; + +{ +#line 545 "inweb/Chapter 2/The Parser.w" + L->category = BEGIN_DEFINITION_LCAT; + code_lcat_for_body = CONT_DEFINITION_LCAT; + code_pl_for_body = NULL; + match_results mr = Regexp__create_mr(); + if (Regexp__match(&mr, remainder, L"(%C+) (%c+)")) { + L->text_operand = Str__duplicate(mr.exp[0]); /* name of term defined */ + L->text_operand2 = Str__duplicate(mr.exp[1]); /* Value */ + } else { + L->text_operand = Str__duplicate(remainder); /* name of term defined */ + L->text_operand2 = Str__new(); /* no value given */ + } + Analyser__mark_reserved_word_at_line(L, L->text_operand, CONSTANT_COLOUR); + comment_mode = FALSE; + L->is_commentary = FALSE; + Regexp__dispose_of(&mr); + +} +#line 447 "inweb/Chapter 2/The Parser.w" +; + } else if (Str__eq_wide_string(command_text, L"enum")) +{ +#line 565 "inweb/Chapter 2/The Parser.w" + L->category = BEGIN_DEFINITION_LCAT; + text_stream *from = NULL; + match_results mr = Regexp__create_mr(); + L->text_operand = Str__duplicate(remainder); /* name of term defined */ + TEMPORARY_TEXT(before); + TEMPORARY_TEXT(after); + if (LanguageMethods__parse_comment(S->sect_language, L->text_operand, + before, after)) { + Str__copy(L->text_operand, before); + } + DISCARD_TEXT(before); + DISCARD_TEXT(after); + Str__trim_white_space(L->text_operand); + if (Regexp__match(&mr, L->text_operand, L"(%C+) from (%c+)")) { + from = mr.exp[1]; + Str__copy(L->text_operand, mr.exp[0]); + } else if (Regexp__match(&mr, L->text_operand, L"(%C+) (%c+)")) { + Main__error_in_web(TL_IS_150, L); + } + L->text_operand2 = Str__new(); + if (inweb_mode == TANGLE_MODE) + Enumerations__define(L->text_operand2, L->text_operand, from, L); + Analyser__mark_reserved_word_at_line(L, L->text_operand, CONSTANT_COLOUR); + comment_mode = FALSE; + L->is_commentary = FALSE; + Regexp__dispose_of(&mr); + +} +#line 448 "inweb/Chapter 2/The Parser.w" + + else if ((Str__eq_wide_string(command_text, L"e")) && (S->md->using_syntax >= V2_SYNTAX)) + +{ +#line 565 "inweb/Chapter 2/The Parser.w" + L->category = BEGIN_DEFINITION_LCAT; + text_stream *from = NULL; + match_results mr = Regexp__create_mr(); + L->text_operand = Str__duplicate(remainder); /* name of term defined */ + TEMPORARY_TEXT(before); + TEMPORARY_TEXT(after); + if (LanguageMethods__parse_comment(S->sect_language, L->text_operand, + before, after)) { + Str__copy(L->text_operand, before); + } + DISCARD_TEXT(before); + DISCARD_TEXT(after); + Str__trim_white_space(L->text_operand); + if (Regexp__match(&mr, L->text_operand, L"(%C+) from (%c+)")) { + from = mr.exp[1]; + Str__copy(L->text_operand, mr.exp[0]); + } else if (Regexp__match(&mr, L->text_operand, L"(%C+) (%c+)")) { + Main__error_in_web(TL_IS_150, L); + } + L->text_operand2 = Str__new(); + if (inweb_mode == TANGLE_MODE) + Enumerations__define(L->text_operand2, L->text_operand, from, L); + Analyser__mark_reserved_word_at_line(L, L->text_operand, CONSTANT_COLOUR); + comment_mode = FALSE; + L->is_commentary = FALSE; + Regexp__dispose_of(&mr); + +} +#line 450 "inweb/Chapter 2/The Parser.w" else { int weight = -1, new_page = FALSE; @@ -15729,7 +15777,7 @@ void Parser__parse_web(web *W, int inweb_mode) { } if (weight >= 0) { -#line 609 "inweb/Chapter 2/The Parser.w" +#line 617 "inweb/Chapter 2/The Parser.w" comment_mode = TRUE; L->is_commentary = TRUE; L->category = PARAGRAPH_START_LCAT; @@ -15748,7 +15796,7 @@ void Parser__parse_web(web *W, int inweb_mode) { } { -#line 656 "inweb/Chapter 2/The Parser.w" +#line 664 "inweb/Chapter 2/The Parser.w" paragraph *P = CREATE(paragraph); if (S->md->using_syntax > V1_SYNTAX) { P->above_bar = FALSE; @@ -15760,9 +15808,9 @@ void Parser__parse_web(web *W, int inweb_mode) { P->placed_very_early = FALSE; } if ((S->md->using_syntax == V1_SYNTAX) && (before_bar)) - P->ornament = Str__duplicate(TL_IS_150); - else P->ornament = Str__duplicate(TL_IS_151); + else + P->ornament = Str__duplicate(TL_IS_152); WRITE_TO(P->paragraph_number, "%d", next_par_number++); P->parent_paragraph = NULL; P->next_child_number = 1; @@ -15781,7 +15829,7 @@ void Parser__parse_web(web *W, int inweb_mode) { current_paragraph = P; } -#line 625 "inweb/Chapter 2/The Parser.w" +#line 633 "inweb/Chapter 2/The Parser.w" ; L->owning_paragraph = current_paragraph; @@ -15789,13 +15837,13 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr); } -#line 461 "inweb/Chapter 2/The Parser.w" +#line 469 "inweb/Chapter 2/The Parser.w" - else Main__error_in_web(TL_IS_144, L); + else Main__error_in_web(TL_IS_145, L); } } -#line 287 "inweb/Chapter 2/The Parser.w" +#line 295 "inweb/Chapter 2/The Parser.w" ; DISCARD_TEXT(remainder); DISCARD_TEXT(command_text); @@ -15803,11 +15851,11 @@ void Parser__parse_web(web *W, int inweb_mode) { continue; } -#line 160 "inweb/Chapter 2/The Parser.w" +#line 162 "inweb/Chapter 2/The Parser.w" ; if (comment_mode) { -#line 690 "inweb/Chapter 2/The Parser.w" +#line 698 "inweb/Chapter 2/The Parser.w" match_results mr = Regexp__create_mr(); if (Regexp__match(&mr, L->text, L">> (%c+)")) { L->category = SOURCE_DISPLAY_LCAT; @@ -15816,11 +15864,11 @@ void Parser__parse_web(web *W, int inweb_mode) { Regexp__dispose_of(&mr); } -#line 161 "inweb/Chapter 2/The Parser.w" +#line 163 "inweb/Chapter 2/The Parser.w" ; if (comment_mode == FALSE) { -#line 702 "inweb/Chapter 2/The Parser.w" +#line 710 "inweb/Chapter 2/The Parser.w" if ((L->category != BEGIN_DEFINITION_LCAT) && (L->category != COMMAND_LCAT)) { L->category = code_lcat_for_body; L->plainer = code_plainness_for_body; @@ -15838,7 +15886,7 @@ void Parser__parse_web(web *W, int inweb_mode) { LanguageMethods__subcategorise_line(S->sect_language, L); } -#line 162 "inweb/Chapter 2/The Parser.w" +#line 164 "inweb/Chapter 2/The Parser.w" ; } @@ -15852,8 +15900,10 @@ void Parser__parse_web(web *W, int inweb_mode) { if (S->md->using_syntax >= V2_SYNTAX) { source_line *L = S->first_line; if ((L) && (L->category == CHAPTER_HEADING_LCAT)) L = L->next_line; - S->sect_purpose = Parser__extract_purpose(TL_IS_128, L?L->next_line: NULL, S, NULL); - if (Str__len(S->sect_purpose) > 0) L->next_line->category = PURPOSE_LCAT; + if (Str__len(S->sect_purpose) == 0) { + S->sect_purpose = Parser__extract_purpose(TL_IS_129, L?L->next_line: NULL, S, NULL); + if (Str__len(S->sect_purpose) > 0) L->next_line->category = PURPOSE_LCAT; + } } } @@ -15879,9 +15929,9 @@ void Parser__parse_web(web *W, int inweb_mode) { LanguageMethods__further_parsing(W, W->main_language); } -#line 654 "inweb/Chapter 2/The Parser.w" +#line 662 "inweb/Chapter 2/The Parser.w" -#line 723 "inweb/Chapter 2/The Parser.w" +#line 731 "inweb/Chapter 2/The Parser.w" text_stream *Parser__extract_purpose(text_stream *prologue, source_line *XL, section *S, source_line **adjust) { text_stream *P = Str__duplicate(prologue); while ((XL) && (XL->next_line) && (XL->owning_section == S) && @@ -15897,7 +15947,7 @@ text_stream *Parser__extract_purpose(text_stream *prologue, source_line *XL, sec return P; } -#line 744 "inweb/Chapter 2/The Parser.w" +#line 752 "inweb/Chapter 2/The Parser.w" void Parser__wrong_version(int using, source_line *L, char *feature, int need) { TEMPORARY_TEXT(warning); WRITE_TO(warning, "%s is a feature available only in version %d syntax (you're using version %d)", @@ -15906,14 +15956,14 @@ void Parser__wrong_version(int using, source_line *L, char *feature, int need) { DISCARD_TEXT(warning); } -#line 755 "inweb/Chapter 2/The Parser.w" +#line 763 "inweb/Chapter 2/The Parser.w" int Parser__detect_footnote(web *W, text_stream *matter, text_stream *before, text_stream *cue, text_stream *after) { text_stream *fn_on_notation = - Bibliographic__get_datum(W->md, TL_IS_152); - text_stream *fn_off_notation = Bibliographic__get_datum(W->md, TL_IS_153); - if (Str__ne(fn_on_notation, TL_IS_154)) { + text_stream *fn_off_notation = + Bibliographic__get_datum(W->md, TL_IS_154); + if (Str__ne(fn_on_notation, TL_IS_155)) { int N1 = Str__len(fn_on_notation); int N2 = Str__len(fn_off_notation); if ((N1 > 0) && (N2 > 0)) @@ -15986,10 +16036,10 @@ theme_tag *Tags__find_by_name(text_stream *name, int creating_if_necessary) { tag->tag_name = Str__duplicate(name); tag->ifdef_positive = NOT_APPLICABLE; tag->ifdef_symbol = Str__new(); - if (Str__prefix_eq(name, TL_IS_155, 6)) { + if (Str__prefix_eq(name, TL_IS_156, 6)) { Str__substr(tag->ifdef_symbol, Str__at(name, 6), Str__end(name)); tag->ifdef_positive = TRUE; - } else if (Str__prefix_eq(name, TL_IS_156, 7)) { + } else if (Str__prefix_eq(name, TL_IS_157, 7)) { Str__substr(tag->ifdef_symbol, Str__at(name, 7), Str__end(name)); tag->ifdef_positive = FALSE; } @@ -16083,20 +16133,20 @@ void Tags__show_endnote_on_ifdefs(OUTPUT_STREAM, weave_target *wv, paragraph *P) if (c++ == 0) { if (d++ == 0) { Formats__endnote(OUT, wv, 1); - Formats__text(OUT, wv, TL_IS_158); - } else { Formats__text(OUT, wv, TL_IS_159); + } else { + Formats__text(OUT, wv, TL_IS_160); } } else { - Formats__text(OUT, wv, TL_IS_160); + Formats__text(OUT, wv, TL_IS_161); } Formats__text(OUT, wv, pt->the_tag->ifdef_symbol); } if (c > 0) { - if (c == 1) Formats__text(OUT, wv, TL_IS_161); - else Formats__text(OUT, wv, TL_IS_162); - if (sense) Formats__text(OUT, wv, TL_IS_163); - else Formats__text(OUT, wv, TL_IS_164); + if (c == 1) Formats__text(OUT, wv, TL_IS_162); + else Formats__text(OUT, wv, TL_IS_163); + if (sense) Formats__text(OUT, wv, TL_IS_164); + else Formats__text(OUT, wv, TL_IS_165); } } @@ -16114,27 +16164,27 @@ void Tags__show_endnote_on_ifdefs(OUTPUT_STREAM, weave_target *wv, paragraph *P) if (c++ == 0) { if (d++ == 0) { Formats__endnote(OUT, wv, 1); - Formats__text(OUT, wv, TL_IS_158); - } else { Formats__text(OUT, wv, TL_IS_159); + } else { + Formats__text(OUT, wv, TL_IS_160); } } else { - Formats__text(OUT, wv, TL_IS_160); + Formats__text(OUT, wv, TL_IS_161); } Formats__text(OUT, wv, pt->the_tag->ifdef_symbol); } if (c > 0) { - if (c == 1) Formats__text(OUT, wv, TL_IS_161); - else Formats__text(OUT, wv, TL_IS_162); - if (sense) Formats__text(OUT, wv, TL_IS_163); - else Formats__text(OUT, wv, TL_IS_164); + if (c == 1) Formats__text(OUT, wv, TL_IS_162); + else Formats__text(OUT, wv, TL_IS_163); + if (sense) Formats__text(OUT, wv, TL_IS_164); + else Formats__text(OUT, wv, TL_IS_165); } } #line 139 "inweb/Chapter 2/Tags.w" ; if (d > 0) { - Formats__text(OUT, wv, TL_IS_157); + Formats__text(OUT, wv, TL_IS_158); Formats__endnote(OUT, wv, 2); } } @@ -16160,7 +16210,7 @@ void Enumerations__define(OUTPUT_STREAM, text_stream *symbol, match_results mr = Regexp__create_mr(); if (Regexp__match(&mr, symbol, L"%c*_(%C+?)")) Str__copy(pf, mr.exp[0]); else { - Main__error_in_web(TL_IS_165, L); + Main__error_in_web(TL_IS_166, L); WRITE_TO(pf, "BOGUS"); } Regexp__dispose_of(&mr); @@ -16176,7 +16226,7 @@ void Enumerations__define(OUTPUT_STREAM, text_stream *symbol, if (es->stub) WRITE("(%S+", es->stub); WRITE("%d", es->next_free_value++); if (es->stub) WRITE(")"); - } else Main__error_in_web(TL_IS_166, L); + } else Main__error_in_web(TL_IS_167, L); } #line 45 "inweb/Chapter 2/Enumerated Constants.w" @@ -16184,7 +16234,7 @@ void Enumerations__define(OUTPUT_STREAM, text_stream *symbol, else { #line 70 "inweb/Chapter 2/Enumerated Constants.w" - if (es) Main__error_in_web(TL_IS_167, L); + if (es) Main__error_in_web(TL_IS_168, L); else { es = CREATE(enumeration_set); es->postfix = Str__duplicate(pf); @@ -16474,7 +16524,7 @@ void Analyser__analyse_code(web *W) { if ((L->category == INTERFACE_BODY_LCAT) && (L->interface_line_identified == FALSE) && (Regexp__string_is_white_space(L->text) == FALSE)) - Main__error_in_web(TL_IS_168, L); + Main__error_in_web(TL_IS_169, L); } #line 109 "inweb/Chapter 3/The Analyser.w" @@ -16678,16 +16728,16 @@ void Analyser__analyse_find(web *W, source_line *L, text_stream *identifier, int #line 385 "inweb/Chapter 3/The Analyser.w" void Analyser__write_makefile(web *W, filename *F, module_search *I) { - filename *prototype = Filenames__in_folder(W->md->path_to_web, TL_IS_169); + filename *prototype = Filenames__in_folder(W->md->path_to_web, TL_IS_170); if (!(TextFiles__exists(prototype))) - prototype = Filenames__in_folder(path_to_inweb_materials, TL_IS_170); + prototype = Filenames__in_folder(path_to_inweb_materials, TL_IS_171); Makefiles__write(W, prototype, F, I); } void Analyser__write_gitignore(web *W, filename *F) { - filename *prototype = Filenames__in_folder(W->md->path_to_web, TL_IS_171); + filename *prototype = Filenames__in_folder(W->md->path_to_web, TL_IS_172); if (!(TextFiles__exists(prototype))) - prototype = Filenames__in_folder(path_to_inweb_materials, TL_IS_172); + prototype = Filenames__in_folder(path_to_inweb_materials, TL_IS_173); Git__write_gitignore(W, prototype, F); } @@ -16744,7 +16794,7 @@ weave_target *Swarm__weave_subset(web *W, text_stream *range, int open_afterward wt->breadcrumbs = breadcrumbs; wt->plugins = NEW_LINKED_LIST(weave_plugin); if (Reader__web_has_one_section(W)) wt->self_contained = TRUE; - Str__copy(wt->cover_sheet_to_use, TL_IS_173); + Str__copy(wt->cover_sheet_to_use, TL_IS_174); wt->current_weave_line = NULL; wt->footnotes_cued = NEW_LINKED_LIST(text_stream); @@ -16804,7 +16854,7 @@ weave_target *Swarm__weave_subset(web *W, text_stream *range, int open_afterward Str__copy(leafname, range); Str__clear(wt->cover_sheet_to_use); } - Bibliographic__set_datum(W->md, TL_IS_174, wt->booklet_title); + Bibliographic__set_datum(W->md, TL_IS_175, wt->booklet_title); LOOP_THROUGH_TEXT(P, leafname) if ((Str__get(P) == '/') || (Str__get(P) == ' ')) Str__put(P, '-'); @@ -16863,22 +16913,22 @@ void Swarm__ensure_plugin(weave_target *wt, text_stream *name) { #line 208 "inweb/Chapter 3/The Swarm.w" void Swarm__weave_index_templates(web *W, text_stream *range, weave_pattern *pattern, pathname *into, filename *nav, linked_list *crumbs) { - if (!(Bibliographic__data_exists(W->md, TL_IS_175))) - Bibliographic__set_datum(W->md, TL_IS_176, TL_IS_177); + if (!(Bibliographic__data_exists(W->md, TL_IS_176))) + Bibliographic__set_datum(W->md, TL_IS_177, TL_IS_178); text_stream *index_leaf = NULL; - if (W->md->chaptered) index_leaf = TL_IS_178; - else index_leaf = TL_IS_179; + if (W->md->chaptered) index_leaf = TL_IS_179; + else index_leaf = TL_IS_180; filename *INF = Patterns__obtain_filename(pattern, index_leaf); - if (INF == NULL) INF = Patterns__obtain_filename(pattern, TL_IS_180); + if (INF == NULL) INF = Patterns__obtain_filename(pattern, TL_IS_181); if (INF) { pathname *H = W->redirect_weaves_to; if (H == NULL) H = Reader__woven_folder(W); - filename *Contents = Filenames__in_folder(H, TL_IS_181); + filename *Contents = Filenames__in_folder(H, TL_IS_182); text_stream TO_struct; text_stream *OUT = &TO_struct; if (STREAM_OPEN_TO_FILE(OUT, Contents, ISO_ENC) == FALSE) Errors__fatal_with_file("unable to write contents file", Contents); if (W->as_ebook) - Epub__note_page(W->as_ebook, Contents, TL_IS_182, TL_IS_183); + Epub__note_page(W->as_ebook, Contents, TL_IS_183, TL_IS_184); Indexer__set_current_file(Contents); PRINT("[Index file: %f]\n", Contents); Indexer__incorporate_template(OUT, W, range, INF, pattern, nav, crumbs); @@ -16956,7 +17006,7 @@ void Indexer__scan_cover_line(text_stream *line, text_file_position *tfp, void * weave_pattern *saved = state->target->pattern; state->target->pattern = state->target->pattern->based_on; Indexer__cover_sheet_maker(OUT, state->target->weave_web, - TL_IS_184, state->target, + TL_IS_185, state->target, (state->halves & (WEAVE_FIRST_HALF + WEAVE_SECOND_HALF))); state->target->pattern = saved; } else { @@ -17023,7 +17073,7 @@ void Indexer__scan_cover_line(text_stream *line, text_file_position *tfp, void * #line 147 "inweb/Chapter 3/The Indexer.w" void Indexer__incorporate_template_for_web_and_pattern(text_stream *OUT, web *W, weave_pattern *pattern, filename *F) { - Indexer__incorporate_template(OUT, W, TL_IS_185, F, pattern, NULL, NULL); + Indexer__incorporate_template(OUT, W, TL_IS_186, F, pattern, NULL, NULL); } void Indexer__incorporate_template_for_target(text_stream *OUT, weave_target *wv, @@ -17518,7 +17568,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) { #line 678 "inweb/Chapter 3/The Indexer.w" ; WRITE_TO(substituted, ""); - } else if (Str__eq(url, TL_IS_186)) { + } else if (Str__eq(url, TL_IS_187)) { WRITE_TO(substituted, "", url); WRITE_TO(substituted, ""); @@ -17616,7 +17666,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) { #line 678 "inweb/Chapter 3/The Indexer.w" ; WRITE_TO(substituted, ""); - } else if (Str__eq(url, TL_IS_186)) { + } else if (Str__eq(url, TL_IS_187)) { WRITE_TO(substituted, "", url); WRITE_TO(substituted, ""); @@ -17725,7 +17775,7 @@ void Indexer__list_module(OUTPUT_STREAM, module *M, int list_this) { WRITE("
  • %S - ", M->module_name); TEMPORARY_TEXT(url); WRITE_TO(url, "%p", M->module_location); - Readme__write_var(OUT, url, TL_IS_187); + Readme__write_var(OUT, url, TL_IS_188); DISCARD_TEXT(url); WRITE("

  • "); } @@ -17779,8 +17829,8 @@ int Weaver__weave_source(web *W, weave_target *wv) { { #line 45 "inweb/Chapter 3/The Weaver.w" - if (!(Bibliographic__data_exists(W->md, TL_IS_188))) - Bibliographic__set_datum(W->md, TL_IS_189, wv->booklet_title); + if (!(Bibliographic__data_exists(W->md, TL_IS_189))) + Bibliographic__set_datum(W->md, TL_IS_190, wv->booklet_title); Indexer__cover_sheet_maker(OUT, W, wv->cover_sheet_to_use, wv, WEAVE_FIRST_HALF); } @@ -17957,7 +18007,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { { #line 249 "inweb/Chapter 3/The Weaver.w" if (L->category == DEFINITIONS_LCAT) { - Formats__subheading(OUT, wv, 2, TL_IS_192, NULL); + Formats__subheading(OUT, wv, 2, TL_IS_193, NULL); state->next_heading_without_vertical_skip = TRUE; state->horizontal_rule_just_drawn = FALSE; continue; @@ -18089,19 +18139,19 @@ int Weaver__weave_source(web *W, weave_target *wv) { { #line 650 "inweb/Chapter 3/The Weaver.w" switch (weight) { - case 0: TeX_macro = TL_IS_202; break; - case 1: TeX_macro = TL_IS_203; break; - case 2: TeX_macro = TL_IS_204; break; - default: TeX_macro = TL_IS_205; break; + case 0: TeX_macro = TL_IS_203; break; + case 1: TeX_macro = TL_IS_204; break; + case 2: TeX_macro = TL_IS_205; break; + default: TeX_macro = TL_IS_206; break; } if (wv->theme_match) { #line 669 "inweb/Chapter 3/The Weaver.w" switch (weight) { - case 0: TeX_macro = TL_IS_208; break; - case 1: TeX_macro = TL_IS_209; break; - case 2: TeX_macro = TL_IS_210; break; - default: TeX_macro = TL_IS_211; break; + case 0: TeX_macro = TL_IS_209; break; + case 1: TeX_macro = TL_IS_210; break; + case 2: TeX_macro = TL_IS_211; break; + default: TeX_macro = TL_IS_212; break; } if (weight >= 0) { weight = 0; } text_stream *cap = Tags__retrieve_caption(L->owning_paragraph, wv->theme_match); @@ -18122,8 +18172,8 @@ int Weaver__weave_source(web *W, weave_target *wv) { if ((state->next_heading_without_vertical_skip) && (weight < 2)) { state->next_heading_without_vertical_skip = FALSE; switch (weight) { - case 0: TeX_macro = TL_IS_206; break; - case 1: TeX_macro = TL_IS_207; break; + case 0: TeX_macro = TL_IS_207; break; + case 1: TeX_macro = TL_IS_208; break; } } @@ -18146,7 +18196,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { DISCARD_TEXT(brief_title); Regexp__dispose_of(&mr); } else if ((weight == 2) && (Reader__web_has_one_section(W))) { - Str__copy(heading_text, Bibliographic__get_datum(W->md, TL_IS_212)); + Str__copy(heading_text, Bibliographic__get_datum(W->md, TL_IS_213)); } else { if ((weight == 2) && (wv->pattern->number_sections) && (S->printed_number >= 0)) WRITE_TO(heading_text, "%d. ", S->printed_number); @@ -18228,13 +18278,13 @@ int Weaver__weave_source(web *W, weave_target *wv) { Formats__change_material(OUT, wv, state->kind_of_material, REGULAR_MATERIAL, state->substantive_comment, FALSE); state->kind_of_material = REGULAR_MATERIAL; - Formats__item(OUT, wv, 1, TL_IS_193); + Formats__item(OUT, wv, 1, TL_IS_194); Str__copy(matter, mr.exp[0]); } else if (Regexp__match(&mr, matter, L"%(-...%) (%c*)")) { /* continue double */ Formats__change_material(OUT, wv, state->kind_of_material, REGULAR_MATERIAL, state->substantive_comment, FALSE); state->kind_of_material = REGULAR_MATERIAL; - Formats__item(OUT, wv, 2, TL_IS_194); + Formats__item(OUT, wv, 2, TL_IS_195); Str__copy(matter, mr.exp[0]); } else if (Regexp__match(&mr, matter, L"%((%i+)%) (%c*)")) { /* begin single */ Formats__change_material(OUT, wv, state->kind_of_material, REGULAR_MATERIAL, @@ -18269,7 +18319,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { Str__copy(matter, mr.exp[1]); TEMPORARY_TEXT(colouring); for (int i=0; ienable_hyperlinks); Formats__text(OUT, wv, matter); DISCARD_TEXT(colouring); @@ -18300,15 +18350,15 @@ int Weaver__weave_source(web *W, weave_target *wv) { text_stream *T; LOOP_OVER_LINKED_LIST(T, text_stream, wv->footnotes_cued) if (Str__eq(T, cue)) - Main__error_in_web(TL_IS_197, L); + Main__error_in_web(TL_IS_198, L); ADD_TO_LINKED_LIST(T, text_stream, wv->footnotes_cued); if (Str__len(wv->current_footnote) > 0) - Main__error_in_web(TL_IS_198, L); + Main__error_in_web(TL_IS_199, L); } else { text_stream *T; LOOP_OVER_LINKED_LIST(T, text_stream, wv->footnotes_written) if (Str__eq(T, cue)) - Main__error_in_web(TL_IS_199, L); + Main__error_in_web(TL_IS_200, L); ADD_TO_LINKED_LIST(T, text_stream, wv->footnotes_written); { @@ -18441,11 +18491,11 @@ int Weaver__weave_source(web *W, weave_target *wv) { match_results mr = Regexp__create_mr(); if ((Regexp__match(&mr, matter, L"@d (%c*)")) || (Regexp__match(&mr, matter, L"@define (%c*)"))) { - Str__copy(prefatory, TL_IS_200); + Str__copy(prefatory, TL_IS_201); Str__copy(matter, mr.exp[0]); } else if ((Regexp__match(&mr, matter, L"@e (%c*)")) || (Regexp__match(&mr, matter, L"@enum (%c*)"))) { - Str__copy(prefatory, TL_IS_201); + Str__copy(prefatory, TL_IS_202); Str__copy(matter, mr.exp[0]); } Regexp__dispose_of(&mr); @@ -18562,8 +18612,8 @@ int Weaver__weave_source(web *W, weave_target *wv) { { #line 68 "inweb/Chapter 3/The Weaver.w" - if (!(Bibliographic__data_exists(W->md, TL_IS_190))) - Bibliographic__set_datum(W->md, TL_IS_191, wv->booklet_title); + if (!(Bibliographic__data_exists(W->md, TL_IS_191))) + Bibliographic__set_datum(W->md, TL_IS_192, wv->booklet_title); Indexer__cover_sheet_maker(OUT, W, wv->cover_sheet_to_use, wv, WEAVE_SECOND_HALF); } @@ -18599,30 +18649,30 @@ void Weaver__show_endnotes_on_previous_paragraph(OUTPUT_STREAM, { #line 755 "inweb/Chapter 3/The Weaver.w" Formats__endnote(OUT, wv, 1); - Formats__text(OUT, wv, TL_IS_213); + Formats__text(OUT, wv, TL_IS_214); int ct = 0; macro_usage *mu; LOOP_OVER_LINKED_LIST(mu, macro_usage, P->defines_macro->macro_usages) ct++; - if (ct == 1) Formats__text(OUT, wv, TL_IS_214); + if (ct == 1) Formats__text(OUT, wv, TL_IS_215); else { int k = 0, used_flag = FALSE; LOOP_OVER_LINKED_LIST(mu, macro_usage, P->defines_macro->macro_usages) if (P != mu->used_in_paragraph) { if (used_flag) { - if (k < ct-1) Formats__text(OUT, wv, TL_IS_215); - else Formats__text(OUT, wv, TL_IS_216); + if (k < ct-1) Formats__text(OUT, wv, TL_IS_216); + else Formats__text(OUT, wv, TL_IS_217); } else { - Formats__text(OUT, wv, TL_IS_217); + Formats__text(OUT, wv, TL_IS_218); } Formats__locale(OUT, wv, mu->used_in_paragraph, NULL); used_flag = TRUE; k++; switch (mu->multiplicity) { case 1: break; - case 2: Formats__text(OUT, wv, TL_IS_218); break; - case 3: Formats__text(OUT, wv, TL_IS_219); break; - case 4: Formats__text(OUT, wv, TL_IS_220); break; - case 5: Formats__text(OUT, wv, TL_IS_221); break; + case 2: Formats__text(OUT, wv, TL_IS_219); break; + case 3: Formats__text(OUT, wv, TL_IS_220); break; + case 4: Formats__text(OUT, wv, TL_IS_221); break; + case 5: Formats__text(OUT, wv, TL_IS_222); break; default: { TEMPORARY_TEXT(mt); WRITE_TO(mt, " (%d times)", mu->multiplicity); @@ -18633,7 +18683,7 @@ void Weaver__show_endnotes_on_previous_paragraph(OUTPUT_STREAM, } } } - Formats__text(OUT, wv, TL_IS_222); + Formats__text(OUT, wv, TL_IS_223); Formats__endnote(OUT, wv, 2); } @@ -18659,7 +18709,7 @@ void Weaver__show_endnotes_on_previous_paragraph(OUTPUT_STREAM, { #line 801 "inweb/Chapter 3/The Weaver.w" Formats__endnote(OUT, wv, 1); - Formats__text(OUT, wv, TL_IS_223); + Formats__text(OUT, wv, TL_IS_224); Formats__text(OUT, wv, st->structure_name); section *S; @@ -18683,18 +18733,18 @@ void Weaver__show_endnotes_on_previous_paragraph(OUTPUT_STREAM, usage_count++; if (S != P->under_section) external++; } - if (external == 0) Formats__text(OUT, wv, TL_IS_224); + if (external == 0) Formats__text(OUT, wv, TL_IS_225); else { - Formats__text(OUT, wv, TL_IS_225); + Formats__text(OUT, wv, TL_IS_226); int c = 0; LOOP_OVER(S, section) if ((S->scratch_flag) && (S != P->under_section)) { - if (c++ > 0) Formats__text(OUT, wv, TL_IS_226); + if (c++ > 0) Formats__text(OUT, wv, TL_IS_227); Formats__text(OUT, wv, S->md->sect_range); } - if (P->under_section->scratch_flag) Formats__text(OUT, wv, TL_IS_227); + if (P->under_section->scratch_flag) Formats__text(OUT, wv, TL_IS_228); } - Formats__text(OUT, wv, TL_IS_228); + Formats__text(OUT, wv, TL_IS_229); Formats__endnote(OUT, wv, 2); } @@ -18710,7 +18760,7 @@ void Weaver__show_function_usage(OUTPUT_STREAM, weave_target *wv, paragraph *P, Analyser__find_hash_entry_for_section(fn->function_header_at->owning_section, fn->function_name, FALSE); if (as_list == FALSE) { - Formats__text(OUT, wv, TL_IS_229); + Formats__text(OUT, wv, TL_IS_230); Formats__text(OUT, wv, fn->function_name); } int used_flag = FALSE; @@ -18724,7 +18774,7 @@ void Weaver__show_function_usage(OUTPUT_STREAM, weave_target *wv, paragraph *P, { #line 877 "inweb/Chapter 3/The Weaver.w" if (as_list == FALSE) { - if (used_flag == FALSE) Formats__text(OUT, wv, TL_IS_234); + if (used_flag == FALSE) Formats__text(OUT, wv, TL_IS_235); } used_flag = TRUE; section *S = hteu->usage_recorded_at->under_section; @@ -18732,18 +18782,18 @@ void Weaver__show_function_usage(OUTPUT_STREAM, weave_target *wv, paragraph *P, count_under = 0; if (last_cited_in) { if (as_list == FALSE) { - if (last_cited_in != P->under_section) Formats__text(OUT, wv, TL_IS_235); - else Formats__text(OUT, wv, TL_IS_236); + if (last_cited_in != P->under_section) Formats__text(OUT, wv, TL_IS_236); + else Formats__text(OUT, wv, TL_IS_237); } else { if (last_cited_in != P->under_section) WRITE("
    "); - else Formats__text(OUT, wv, TL_IS_237); + else Formats__text(OUT, wv, TL_IS_238); } } Formats__text(OUT, wv, hteu->usage_recorded_at->under_section->md->sect_title); - if (as_list == FALSE) Formats__text(OUT, wv, TL_IS_238); + if (as_list == FALSE) Formats__text(OUT, wv, TL_IS_239); else WRITE(" - "); } - if (count_under++ > 0) Formats__text(OUT, wv, TL_IS_239); + if (count_under++ > 0) Formats__text(OUT, wv, TL_IS_240); Formats__locale(OUT, wv, hteu->usage_recorded_at, NULL); last_cited_in = hteu->usage_recorded_at->under_section; @@ -18756,7 +18806,7 @@ void Weaver__show_function_usage(OUTPUT_STREAM, weave_target *wv, paragraph *P, { #line 877 "inweb/Chapter 3/The Weaver.w" if (as_list == FALSE) { - if (used_flag == FALSE) Formats__text(OUT, wv, TL_IS_234); + if (used_flag == FALSE) Formats__text(OUT, wv, TL_IS_235); } used_flag = TRUE; section *S = hteu->usage_recorded_at->under_section; @@ -18764,18 +18814,18 @@ void Weaver__show_function_usage(OUTPUT_STREAM, weave_target *wv, paragraph *P, count_under = 0; if (last_cited_in) { if (as_list == FALSE) { - if (last_cited_in != P->under_section) Formats__text(OUT, wv, TL_IS_235); - else Formats__text(OUT, wv, TL_IS_236); + if (last_cited_in != P->under_section) Formats__text(OUT, wv, TL_IS_236); + else Formats__text(OUT, wv, TL_IS_237); } else { if (last_cited_in != P->under_section) WRITE("
    "); - else Formats__text(OUT, wv, TL_IS_237); + else Formats__text(OUT, wv, TL_IS_238); } } Formats__text(OUT, wv, hteu->usage_recorded_at->under_section->md->sect_title); - if (as_list == FALSE) Formats__text(OUT, wv, TL_IS_238); + if (as_list == FALSE) Formats__text(OUT, wv, TL_IS_239); else WRITE(" - "); } - if (count_under++ > 0) Formats__text(OUT, wv, TL_IS_239); + if (count_under++ > 0) Formats__text(OUT, wv, TL_IS_240); Formats__locale(OUT, wv, hteu->usage_recorded_at, NULL); last_cited_in = hteu->usage_recorded_at->under_section; @@ -18784,15 +18834,15 @@ void Weaver__show_function_usage(OUTPUT_STREAM, weave_target *wv, paragraph *P, ; if (used_flag == FALSE) { if (as_list == FALSE) { - Formats__text(OUT, wv, TL_IS_230); - } else { Formats__text(OUT, wv, TL_IS_231); + } else { + Formats__text(OUT, wv, TL_IS_232); } } if (as_list == FALSE) { if ((last_cited_in != P->under_section) && (last_cited_in)) - Formats__text(OUT, wv, TL_IS_232); - Formats__text(OUT, wv, TL_IS_233); + Formats__text(OUT, wv, TL_IS_233); + Formats__text(OUT, wv, TL_IS_234); } } @@ -18805,18 +18855,18 @@ int Weaver__weave_table_of_contents(OUTPUT_STREAM, weave_target *wv, section *S) noteworthy++; if (noteworthy == 0) return FALSE; - Formats__toc(OUT, wv, 1, S->md->sect_range, TL_IS_240, NULL); + Formats__toc(OUT, wv, 1, S->md->sect_range, TL_IS_241, NULL); noteworthy = 0; LOOP_OVER_LINKED_LIST(P, paragraph, S->paragraphs) if ((P->weight > 0) && ((S->barred == FALSE) || (P->above_bar == FALSE))) { - if (noteworthy > 0) Formats__toc(OUT, wv, 2, TL_IS_241, TL_IS_242, NULL); + if (noteworthy > 0) Formats__toc(OUT, wv, 2, TL_IS_242, TL_IS_243, NULL); TEMPORARY_TEXT(loc); WRITE_TO(loc, "%S%S", P->ornament, P->paragraph_number); Formats__toc(OUT, wv, 3, loc, P->first_line_in_paragraph->text_operand, P); DISCARD_TEXT(loc); noteworthy++; } - Formats__toc(OUT, wv, 4, TL_IS_243, TL_IS_244, NULL); + Formats__toc(OUT, wv, 4, TL_IS_244, TL_IS_245, NULL); return TRUE; } @@ -18853,7 +18903,7 @@ void Tangler__go(web *W, tangle_target *target, filename *dest_file) { { #line 87 "inweb/Chapter 3/The Tangler.w" - if (L->owning_paragraph == NULL) Main__error_in_web(TL_IS_245, L); + if (L->owning_paragraph == NULL) Main__error_in_web(TL_IS_246, L); else Tags__open_ifdefs(OUT, L->owning_paragraph); LanguageMethods__start_definition(OUT, lang, L->text_operand, @@ -18875,7 +18925,7 @@ void Tangler__go(web *W, tangle_target *target, filename *dest_file) { { #line 87 "inweb/Chapter 3/The Tangler.w" - if (L->owning_paragraph == NULL) Main__error_in_web(TL_IS_245, L); + if (L->owning_paragraph == NULL) Main__error_in_web(TL_IS_246, L); else Tags__open_ifdefs(OUT, L->owning_paragraph); LanguageMethods__start_definition(OUT, lang, L->text_operand, @@ -18996,7 +19046,7 @@ void Tangler__tangle_code(OUTPUT_STREAM, text_stream *original, section *S, sour LanguageMethods__after_macro_expansion(OUT, lang, pmac); LanguageMethods__insert_line_marker(OUT, lang, L); } else { - Main__error_in_web(TL_IS_246, L); + Main__error_in_web(TL_IS_247, L); WRITE_TO(STDERR, "Macro is '%S'\n", temp); LanguageMethods__comment(OUT, lang, temp); /* recover by putting macro name in comment */ } @@ -19065,7 +19115,7 @@ programming_language *Languages__find_by_name(text_stream *lname, web *W) { #line 26 "inweb/Chapter 4/Programming Languages.w" filename *F = NULL; if (W) { - pathname *P = Pathnames__subfolder(W->md->path_to_web, TL_IS_247); + pathname *P = Pathnames__subfolder(W->md->path_to_web, TL_IS_248); { #line 39 "inweb/Chapter 4/Programming Languages.w" @@ -19112,7 +19162,7 @@ programming_language *Languages__find_by_name(text_stream *lname, web *W) { #line 50 "inweb/Chapter 4/Programming Languages.w" programming_language *Languages__default(web *W) { - return Languages__find_by_name(TL_IS_248, W); + return Languages__find_by_name(TL_IS_249, W); } void Languages__show(OUTPUT_STREAM) { @@ -19154,7 +19204,7 @@ void Languages__read_definitions(pathname *P) { } pathname *Languages__default_directory(void) { - return Pathnames__subfolder(path_to_inweb, TL_IS_249); + return Pathnames__subfolder(path_to_inweb, TL_IS_250); } #line 144 "inweb/Chapter 4/Programming Languages.w" @@ -19214,7 +19264,7 @@ programming_language *Languages__read_definition(filename *F) { { #line 215 "inweb/Chapter 4/Programming Languages.w" if (pl->C_like) CLike__make_c_like(pl); - if (Str__eq(pl->language_name, TL_IS_250)) InCSupport__add_features(pl); + if (Str__eq(pl->language_name, TL_IS_251)) InCSupport__add_features(pl); ACMESupport__add_fallbacks(pl); } @@ -19236,7 +19286,7 @@ void Languages__read_definition_line(text_stream *line, text_file_position *tfp, if (state->current_block) { #line 323 "inweb/Chapter 4/Programming Languages.w" - if (Str__eq(line, TL_IS_282)) { + if (Str__eq(line, TL_IS_283)) { state->current_block = state->current_block->parent; } else if (Regexp__match(&mr, line, L"characters {")) { colouring_rule *rule = Languages__new_rule(state->current_block); @@ -19252,7 +19302,7 @@ void Languages__read_definition_line(text_stream *line, text_file_position *tfp, } else if (Regexp__match(&mr, line, L"runs of (%c+) {")) { colouring_rule *rule = Languages__new_rule(state->current_block); int r = UNQUOTED_COLOUR; - if (Str__ne(mr.exp[0], TL_IS_283)) r = Languages__colour(mr.exp[0], tfp); + if (Str__ne(mr.exp[0], TL_IS_284)) r = Languages__colour(mr.exp[0], tfp); rule->execute_block = Languages__new_block(state->current_block, r); state->current_block = rule->execute_block; } else if (Regexp__match(&mr, line, L"instances of (%c+) {")) { @@ -19307,66 +19357,66 @@ void Languages__read_definition_line(text_stream *line, text_file_position *tfp, Languages__reserved(pl, Languages__text(mr.exp[0], tfp, FALSE), RESERVED_COLOUR, tfp); } else if (Regexp__match(&mr, line, L"(%c+) *: *(%c+?)")) { text_stream *key = mr.exp[0], *value = Str__duplicate(mr.exp[1]); - if (Str__eq(key, TL_IS_251)) pl->language_name = Languages__text(value, tfp, TRUE); - else if (Str__eq(key, TL_IS_252)) - pl->language_details = Languages__text(value, tfp, TRUE); + if (Str__eq(key, TL_IS_252)) pl->language_name = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_253)) - pl->file_extension = Languages__text(value, tfp, TRUE); + pl->language_details = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_254)) - pl->line_comment = Languages__text(value, tfp, TRUE); + pl->file_extension = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_255)) - pl->whole_line_comment = Languages__text(value, tfp, TRUE); + pl->line_comment = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_256)) - pl->multiline_comment_open = Languages__text(value, tfp, TRUE); + pl->whole_line_comment = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_257)) - pl->multiline_comment_close = Languages__text(value, tfp, TRUE); + pl->multiline_comment_open = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_258)) - pl->string_literal = Languages__text(value, tfp, TRUE); + pl->multiline_comment_close = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_259)) - pl->string_literal_escape = Languages__text(value, tfp, TRUE); + pl->string_literal = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_260)) - pl->character_literal = Languages__text(value, tfp, TRUE); + pl->string_literal_escape = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_261)) - pl->character_literal_escape = Languages__text(value, tfp, TRUE); + pl->character_literal = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_262)) - pl->binary_literal_prefix = Languages__text(value, tfp, TRUE); + pl->character_literal_escape = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_263)) - pl->octal_literal_prefix = Languages__text(value, tfp, TRUE); + pl->binary_literal_prefix = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_264)) - pl->hexadecimal_literal_prefix = Languages__text(value, tfp, TRUE); + pl->octal_literal_prefix = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_265)) - pl->negative_literal_prefix = Languages__text(value, tfp, TRUE); + pl->hexadecimal_literal_prefix = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_266)) - pl->shebang = Languages__text(value, tfp, TRUE); + pl->negative_literal_prefix = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_267)) - pl->line_marker = Languages__text(value, tfp, TRUE); + pl->shebang = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_268)) - pl->before_macro_expansion = Languages__text(value, tfp, TRUE); + pl->line_marker = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_269)) - pl->after_macro_expansion = Languages__text(value, tfp, TRUE); + pl->before_macro_expansion = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_270)) - pl->start_definition = Languages__text(value, tfp, TRUE); + pl->after_macro_expansion = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_271)) - pl->prolong_definition = Languages__text(value, tfp, TRUE); + pl->start_definition = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_272)) - pl->end_definition = Languages__text(value, tfp, TRUE); + pl->prolong_definition = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_273)) - pl->start_ifdef = Languages__text(value, tfp, TRUE); + pl->end_definition = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_274)) - pl->start_ifndef = Languages__text(value, tfp, TRUE); + pl->start_ifdef = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_275)) - pl->end_ifdef = Languages__text(value, tfp, TRUE); + pl->start_ifndef = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_276)) - pl->end_ifndef = Languages__text(value, tfp, TRUE); + pl->end_ifdef = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_277)) - pl->C_like = Languages__boolean(value, tfp); + pl->end_ifndef = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_278)) - pl->suppress_disclaimer = Languages__boolean(value, tfp); + pl->C_like = Languages__boolean(value, tfp); else if (Str__eq(key, TL_IS_279)) - pl->supports_namespaces = Languages__boolean(value, tfp); + pl->suppress_disclaimer = Languages__boolean(value, tfp); else if (Str__eq(key, TL_IS_280)) - Languages__regexp(pl->function_notation, value, tfp); + pl->supports_namespaces = Languages__boolean(value, tfp); else if (Str__eq(key, TL_IS_281)) + Languages__regexp(pl->function_notation, value, tfp); + else if (Str__eq(key, TL_IS_282)) Languages__regexp(pl->type_notation, value, tfp); else { Errors__in_text_file("unknown property name before ':'", tfp); @@ -19476,7 +19526,7 @@ void Languages__parse_rule(language_reader_state *state, text_stream *premiss, { #line 533 "inweb/Chapter 4/Programming Languages.w" - if (Str__eq(action, TL_IS_284)) { + if (Str__eq(action, TL_IS_285)) { rule->execute_block = Languages__new_block(state->current_block, WHOLE_LINE_CRULE_RUN); state->current_block = rule->execute_block; @@ -19489,7 +19539,7 @@ void Languages__parse_rule(language_reader_state *state, text_stream *premiss, rule->set_prefix_to_colour = rule->set_to_colour; } else if (Str__get_first_char(action) == '!') { rule->set_to_colour = Languages__colour(action, tfp); - } else if (Str__eq(action, TL_IS_285)) { + } else if (Str__eq(action, TL_IS_286)) { rule->debug = TRUE; } else { Errors__in_text_file("action after '=>' illegible", tfp); @@ -19524,17 +19574,17 @@ int Languages__colour(text_stream *T, text_file_position *tfp) { Errors__in_text_file("colour names must begin with !", tfp); return PLAIN_COLOUR; } - if (Str__eq(T, TL_IS_286)) return STRING_COLOUR; - else if (Str__eq(T, TL_IS_287)) return FUNCTION_COLOUR; - else if (Str__eq(T, TL_IS_288)) return DEFINITION_COLOUR; - else if (Str__eq(T, TL_IS_289)) return RESERVED_COLOUR; - else if (Str__eq(T, TL_IS_290)) return ELEMENT_COLOUR; - else if (Str__eq(T, TL_IS_291)) return IDENTIFIER_COLOUR; - else if (Str__eq(T, TL_IS_292)) return CHAR_LITERAL_COLOUR; - else if (Str__eq(T, TL_IS_293)) return CONSTANT_COLOUR; - else if (Str__eq(T, TL_IS_294)) return PLAIN_COLOUR; - else if (Str__eq(T, TL_IS_295)) return EXTRACT_COLOUR; - else if (Str__eq(T, TL_IS_296)) return COMMENT_COLOUR; + if (Str__eq(T, TL_IS_287)) return STRING_COLOUR; + else if (Str__eq(T, TL_IS_288)) return FUNCTION_COLOUR; + else if (Str__eq(T, TL_IS_289)) return DEFINITION_COLOUR; + else if (Str__eq(T, TL_IS_290)) return RESERVED_COLOUR; + else if (Str__eq(T, TL_IS_291)) return ELEMENT_COLOUR; + else if (Str__eq(T, TL_IS_292)) return IDENTIFIER_COLOUR; + else if (Str__eq(T, TL_IS_293)) return CHAR_LITERAL_COLOUR; + else if (Str__eq(T, TL_IS_294)) return CONSTANT_COLOUR; + else if (Str__eq(T, TL_IS_295)) return PLAIN_COLOUR; + else if (Str__eq(T, TL_IS_296)) return EXTRACT_COLOUR; + else if (Str__eq(T, TL_IS_297)) return COMMENT_COLOUR; else { Errors__in_text_file("no such !colour", tfp); return PLAIN_COLOUR; @@ -19543,8 +19593,8 @@ int Languages__colour(text_stream *T, text_file_position *tfp) { #line 624 "inweb/Chapter 4/Programming Languages.w" int Languages__boolean(text_stream *T, text_file_position *tfp) { - if (Str__eq(T, TL_IS_297)) return TRUE; - else if (Str__eq(T, TL_IS_298)) return FALSE; + if (Str__eq(T, TL_IS_298)) return TRUE; + else if (Str__eq(T, TL_IS_299)) return FALSE; else { Errors__in_text_file("must be true or false", tfp); return FALSE; @@ -19602,7 +19652,6 @@ text_stream *Languages__text(text_stream *T, text_file_position *tfp, int allow) } if (bareword) { int rw = FALSE; - if (Str__eq(V, TL_IS_299)) rw = TRUE; if (Str__eq(V, TL_IS_300)) rw = TRUE; if (Str__eq(V, TL_IS_301)) rw = TRUE; if (Str__eq(V, TL_IS_302)) rw = TRUE; @@ -19624,6 +19673,7 @@ text_stream *Languages__text(text_stream *T, text_file_position *tfp, int allow) if (Str__eq(V, TL_IS_318)) rw = TRUE; if (Str__eq(V, TL_IS_319)) rw = TRUE; if (Str__eq(V, TL_IS_320)) rw = TRUE; + if (Str__eq(V, TL_IS_321)) rw = TRUE; if (rw) { TEMPORARY_TEXT(err); @@ -19722,7 +19772,7 @@ language_type *Functions__new_struct(web *W, text_stream *name, source_line *L) { #line 40 "inweb/Chapter 4/Types and Functions.w" - Tags__add_by_name(L->owning_paragraph, TL_IS_321); + Tags__add_by_name(L->owning_paragraph, TL_IS_322); ADD_TO_LINKED_LIST(str, language_type, W->language_types); ADD_TO_LINKED_LIST(str, language_type, L->owning_paragraph->structures); @@ -19835,7 +19885,7 @@ language_function *Functions__new_function(text_stream *fname, source_line *L) { fn->within_namespace = TRUE; } else if ((Str__eq_wide_string(fname, L"main")) && (Str__eq_wide_string(ambient_namespace, L"Main::"))) - declared_namespace = TL_IS_322; + declared_namespace = TL_IS_323; if ((Str__ne(declared_namespace, ambient_namespace)) && (L->owning_paragraph->placed_very_early == FALSE)) { TEMPORARY_TEXT(err_mess); @@ -19931,7 +19981,7 @@ void LanguageMethods__disclaimer(text_stream *OUT, programming_language *pl, web int rv = FALSE; IMETHOD_CALLV(rv, pl, SUPPRESS_DISCLAIMER_TAN_MTID); if (rv == FALSE) - LanguageMethods__comment(OUT, pl, TL_IS_323); + LanguageMethods__comment(OUT, pl, TL_IS_324); } #line 127 "inweb/Chapter 4/Language Methods.w" @@ -19954,7 +20004,7 @@ void LanguageMethods__start_definition(OUTPUT_STREAM, programming_language *pl, int rv = FALSE; IMETHOD_CALL(rv, pl, START_DEFN_TAN_MTID, OUT, term, start, S, L); if (rv == FALSE) - Main__error_in_web(TL_IS_324, L); + Main__error_in_web(TL_IS_325, L); } void LanguageMethods__prolong_definition(OUTPUT_STREAM, programming_language *pl, @@ -19962,7 +20012,7 @@ void LanguageMethods__prolong_definition(OUTPUT_STREAM, programming_language *pl int rv = FALSE; IMETHOD_CALL(rv, pl, PROLONG_DEFN_TAN_MTID, OUT, more, S, L); if (rv == FALSE) - Main__error_in_web(TL_IS_325, L); + Main__error_in_web(TL_IS_326, L); } void LanguageMethods__end_definition(OUTPUT_STREAM, programming_language *pl, @@ -20862,7 +20912,7 @@ void CLike__parse_types(programming_language *self, web *W) { if (Regexp__match(&mr, L->text, L"typedef struct (%i+) %c*{%c*")) { current_str = Functions__new_struct(W, mr.exp[0], L); - Tags__add_by_name(L->owning_paragraph, TL_IS_326); + Tags__add_by_name(L->owning_paragraph, TL_IS_327); } else if ((Str__get_first_char(L->text) == '}') && (current_str)) { current_str->typedef_ends = L; current_str = NULL; @@ -20997,14 +21047,14 @@ void CLike__parse_functions(programming_language *self, web *W) { if ((Regexp__match(&mr, L->text, L" *#ifn*def %c+")) || (Regexp__match(&mr, L->text, L" *#IFN*DEF %c+"))) { if (cc_sp >= MAX_CONDITIONAL_COMPILATION_STACK) - Main__error_in_web(TL_IS_328, L); + Main__error_in_web(TL_IS_329, L); else cc_stack[cc_sp++] = L; } if ((Regexp__match(&mr, L->text, L" *#endif *")) || (Regexp__match(&mr, L->text, L" *#ENDIF *"))) { if (cc_sp <= 0) - Main__error_in_web(TL_IS_329, L); + Main__error_in_web(TL_IS_330, L); else cc_sp--; } @@ -21098,7 +21148,7 @@ void CLike__parse_functions(programming_language *self, web *W) { ; } if (cc_sp > 0) - Main__error_in_web(TL_IS_327, NULL); + Main__error_in_web(TL_IS_328, NULL); } #line 317 "inweb/Chapter 4/C-Like Languages.w" @@ -21231,7 +21281,7 @@ void CLike__analyse_code(programming_language *self, web *W) { #line 492 "inweb/Chapter 4/C-Like Languages.w" void CLike__post_analysis(programming_language *self, web *W) { int check_namespaces = FALSE; - if (Str__eq_wide_string(Bibliographic__get_datum(W->md, TL_IS_330), L"On")) check_namespaces = TRUE; + if (Str__eq_wide_string(Bibliographic__get_datum(W->md, TL_IS_331), L"On")) check_namespaces = TRUE; language_function *fn; LOOP_OVER(fn, language_function) { hash_table_entry *hte = @@ -21250,11 +21300,11 @@ void CLike__post_analysis(programming_language *self, web *W) { && (fn->call_freely == FALSE)) { if (fn->within_namespace) Main__error_in_web( - TL_IS_331, + TL_IS_332, fn->function_header_at); else Main__error_in_web( - TL_IS_332, + TL_IS_333, fn->function_header_at); } } @@ -21826,8 +21876,8 @@ preform_nonterminal *InCSupport__nonterminal_by_name(text_stream *name) { #line 764 "inweb/Chapter 4/InC Support.w" text_stream *InCSupport__nonterminal_variable_identifier(text_stream *name) { - if (Str__eq_wide_string(name, L"r")) return TL_IS_337; - if (Str__eq_wide_string(name, L"rp")) return TL_IS_338; + if (Str__eq_wide_string(name, L"r")) return TL_IS_338; + if (Str__eq_wide_string(name, L"rp")) return TL_IS_339; nonterminal_variable *ntv; LOOP_OVER(ntv, nonterminal_variable) if (Str__eq(ntv->ntv_name, name)) @@ -21839,7 +21889,7 @@ text_stream *InCSupport__nonterminal_variable_identifier(text_stream *name) { void InCSupport__additional_tangling(programming_language *self, web *W, tangle_target *target) { if (NUMBER_CREATED(preform_nonterminal) > 0) { pathname *P = Reader__tangled_folder(W); - filename *Syntax = Filenames__in_folder(P, TL_IS_339); + filename *Syntax = Filenames__in_folder(P, TL_IS_340); text_stream TO_struct; text_stream *OUT = &TO_struct; @@ -21850,8 +21900,8 @@ void InCSupport__additional_tangling(programming_language *self, web *W, tangle_ WRITE("[Preform syntax generated by inweb: do not edit.]\n\n"); - if (Bibliographic__data_exists(W->md, TL_IS_340)) - WRITE("language %S\n", Bibliographic__get_datum(W->md, TL_IS_341)); + if (Bibliographic__data_exists(W->md, TL_IS_341)) + WRITE("language %S\n", Bibliographic__get_datum(W->md, TL_IS_342)); { @@ -22136,7 +22186,7 @@ void Formats__source_fragment(OUTPUT_STREAM, weave_target *wv, text_stream *frag VMETHOD_CALL(wf, INLINE_CODE_FOR_MTID, OUT, wv, TRUE); TEMPORARY_TEXT(colouring); for (int i=0; i< Str__len(fragment); i++) PUT_TO(colouring, EXTRACT_COLOUR); - Formats__source_code(OUT, wv, 0, TL_IS_342, fragment, colouring, TL_IS_343, FALSE, FALSE, TRUE, FALSE); + Formats__source_code(OUT, wv, 0, TL_IS_343, fragment, colouring, TL_IS_344, FALSE, FALSE, TRUE, FALSE); DISCARD_TEXT(colouring); VMETHOD_CALL(wf, INLINE_CODE_FOR_MTID, OUT, wv, FALSE); } @@ -22321,8 +22371,8 @@ void Formats__text_r(OUTPUT_STREAM, weave_target *wv, text_stream *id, int within, int comments) { text_stream *code_in_comments_notation = Bibliographic__get_datum(wv->weave_web->md, - (comments)?(TL_IS_344):(TL_IS_345)); - if (Str__ne(code_in_comments_notation, TL_IS_346)) + (comments)?(TL_IS_345):(TL_IS_346)); + if (Str__ne(code_in_comments_notation, TL_IS_347)) { #line 484 "inweb/Chapter 5/Format Methods.w" for (int i=0; i < Str__len(id); i++) { @@ -22349,8 +22399,8 @@ void Formats__text_r(OUTPUT_STREAM, weave_target *wv, text_stream *id, { #line 501 "inweb/Chapter 5/Format Methods.w" for (int i=0; i < Str__len(id); i++) { - if ((Str__includes_at(id, i, TL_IS_349)) || - (Str__includes_at(id, i, TL_IS_350))) { + if ((Str__includes_at(id, i, TL_IS_350)) || + (Str__includes_at(id, i, TL_IS_351))) { TEMPORARY_TEXT(before); Str__copy(before, id); Str__truncate(before, i); TEMPORARY_TEXT(after); @@ -22374,8 +22424,8 @@ void Formats__text_r(OUTPUT_STREAM, weave_target *wv, text_stream *id, ; text_stream *xref_notation = Bibliographic__get_datum(wv->weave_web->md, - TL_IS_347); - if (Str__ne(xref_notation, TL_IS_348)) + TL_IS_348); + if (Str__ne(xref_notation, TL_IS_349)) { #line 539 "inweb/Chapter 5/Format Methods.w" int N = Str__len(xref_notation); @@ -22464,7 +22514,7 @@ void Formats__text_fragment(OUTPUT_STREAM, weave_target *wv, text_stream *fragme TEMPORARY_TEXT(matter); int rv = TRUE; if (Str__eq_wide_string( - Bibliographic__get_datum(wv->weave_web->md, TL_IS_351), L"On")) { + Bibliographic__get_datum(wv->weave_web->md, TL_IS_352), L"On")) { rv = FALSE; IMETHOD_CALL(rv, wf, PRESERVE_MATH_MODE_FOR_MTID, wv, matter, fragment); } @@ -22561,7 +22611,7 @@ int Formats__substitute_post_processing_data(OUTPUT_STREAM, weave_target *wv, #line 9 "inweb/Chapter 5/Plain Text Format.w" void PlainText__create(void) { - weave_format *wf = Formats__create_weave_format(TL_IS_352, TL_IS_353); + weave_format *wf = Formats__create_weave_format(TL_IS_353, TL_IS_354); METHOD_ADD(wf, TOP_FOR_MTID, PlainText__top); METHOD_ADD(wf, SUBHEADING_FOR_MTID, PlainText__subheading); METHOD_ADD(wf, TOC_FOR_MTID, PlainText__toc); @@ -22705,7 +22755,7 @@ void TeX__create(void) { { #line 16 "inweb/Chapter 5/TeX Format.w" - weave_format *wf = Formats__create_weave_format(TL_IS_354, TL_IS_355); + weave_format *wf = Formats__create_weave_format(TL_IS_355, TL_IS_356); { #line 40 "inweb/Chapter 5/TeX Format.w" @@ -22742,7 +22792,7 @@ void TeX__create(void) { { #line 20 "inweb/Chapter 5/TeX Format.w" - weave_format *wf = Formats__create_weave_format(TL_IS_356, TL_IS_357); + weave_format *wf = Formats__create_weave_format(TL_IS_357, TL_IS_358); { #line 40 "inweb/Chapter 5/TeX Format.w" @@ -22783,7 +22833,7 @@ void TeX__create(void) { { #line 28 "inweb/Chapter 5/TeX Format.w" - weave_format *wf = Formats__create_weave_format(TL_IS_358, TL_IS_359); + weave_format *wf = Formats__create_weave_format(TL_IS_359, TL_IS_360); METHOD_ADD(wf, PARA_MACRO_FOR_MTID, TeX__para_macro_PDF_1); { @@ -22843,7 +22893,7 @@ void TeX__top(weave_format *self, text_stream *OUT, weave_target *wv, text_strea { #line 90 "inweb/Chapter 5/TeX Format.w" - filename *Macros = Patterns__obtain_filename(wv->pattern, TL_IS_360); + filename *Macros = Patterns__obtain_filename(wv->pattern, TL_IS_361); FILE *MACROS = Filenames__fopen(Macros, "r"); if (MACROS == NULL) Errors__fatal_with_file("can't open file of TeX macros", Macros); while (TRUE) { @@ -23398,7 +23448,7 @@ void TeX__remove_math_mode_range(OUTPUT_STREAM, text_stream *text, int from, int i++; while ((i < Str__len(text)) && (Characters__isalpha(Str__get_at(text, i)))) PUT_TO(macro, Str__get_at(text, i++)); - if (Str__eq(macro, TL_IS_361)) + if (Str__eq(macro, TL_IS_362)) { #line 766 "inweb/Chapter 5/TeX Format.w" if (Str__get_at(text, i) == '\\') { @@ -23406,8 +23456,8 @@ void TeX__remove_math_mode_range(OUTPUT_STREAM, text_stream *text, int from, int i++; while ((i < Str__len(text)) && (Characters__isalpha(Str__get_at(text, i)))) PUT_TO(macro, Str__get_at(text, i++)); - if (Str__eq(macro, TL_IS_457)) PUT((wchar_t) 0x2204); - else if (Str__eq(macro, TL_IS_458)) { PUT((wchar_t) 0x00AC); PUT((wchar_t) 0x2200); } + if (Str__eq(macro, TL_IS_458)) PUT((wchar_t) 0x2204); + else if (Str__eq(macro, TL_IS_459)) { PUT((wchar_t) 0x00AC); PUT((wchar_t) 0x2200); } else { PRINT("Don't know how to apply '\\not' to '\\%S'\n", macro); } @@ -23421,99 +23471,99 @@ void TeX__remove_math_mode_range(OUTPUT_STREAM, text_stream *text, int from, int else { #line 653 "inweb/Chapter 5/TeX Format.w" - if (Str__eq(macro, TL_IS_362)) WRITE("<="); - else if (Str__eq(macro, TL_IS_363)) WRITE(">="); - else if (Str__eq(macro, TL_IS_364)) WRITE("~"); - else if (Str__eq(macro, TL_IS_365)) WRITE(""); + if (Str__eq(macro, TL_IS_363)) WRITE("<="); + else if (Str__eq(macro, TL_IS_364)) WRITE(">="); + else if (Str__eq(macro, TL_IS_365)) WRITE("~"); else if (Str__eq(macro, TL_IS_366)) WRITE(""); else if (Str__eq(macro, TL_IS_367)) WRITE(""); - else if (Str__eq(macro, TL_IS_368)) WRITE("=>"); - else if (Str__eq(macro, TL_IS_369)) WRITE("<=>"); - else if (Str__eq(macro, TL_IS_370)) WRITE("-->"); + else if (Str__eq(macro, TL_IS_368)) WRITE(""); + else if (Str__eq(macro, TL_IS_369)) WRITE("=>"); + else if (Str__eq(macro, TL_IS_370)) WRITE("<=>"); else if (Str__eq(macro, TL_IS_371)) WRITE("-->"); else if (Str__eq(macro, TL_IS_372)) WRITE("-->"); - else if (Str__eq(macro, TL_IS_373)) WRITE("<--"); + else if (Str__eq(macro, TL_IS_373)) WRITE("-->"); else if (Str__eq(macro, TL_IS_374)) WRITE("<--"); - else if (Str__eq(macro, TL_IS_375)) WRITE("{"); - else if (Str__eq(macro, TL_IS_376)) WRITE("|"); - else if (Str__eq(macro, TL_IS_377)) WRITE("}"); - else if (Str__eq(macro, TL_IS_378)) WRITE("."); - else if (Str__eq(macro, TL_IS_379)) WRITE("..."); + else if (Str__eq(macro, TL_IS_375)) WRITE("<--"); + else if (Str__eq(macro, TL_IS_376)) WRITE("{"); + else if (Str__eq(macro, TL_IS_377)) WRITE("|"); + else if (Str__eq(macro, TL_IS_378)) WRITE("}"); + else if (Str__eq(macro, TL_IS_379)) WRITE("."); else if (Str__eq(macro, TL_IS_380)) WRITE("..."); - else if (Str__eq(macro, TL_IS_381)) WRITE("*"); - else if (Str__eq(macro, TL_IS_382)) WRITE(" "); - else if (Str__eq(macro, TL_IS_383)) WRITE(" "); - else if (Str__eq(macro, TL_IS_384)) WRITE("TeX"); - else if (Str__eq(macro, TL_IS_385)) WRITE("!="); + else if (Str__eq(macro, TL_IS_381)) WRITE("..."); + else if (Str__eq(macro, TL_IS_382)) WRITE("*"); + else if (Str__eq(macro, TL_IS_383)) WRITE(" "); + else if (Str__eq(macro, TL_IS_384)) WRITE(" "); + else if (Str__eq(macro, TL_IS_385)) WRITE("TeX"); else if (Str__eq(macro, TL_IS_386)) WRITE("!="); - else if (Str__eq(macro, TL_IS_387)) WRITE("l"); - else if (Str__eq(macro, TL_IS_388)) WRITE("log"); - else if (Str__eq(macro, TL_IS_389)) WRITE("exp"); - else if (Str__eq(macro, TL_IS_390)) WRITE("sin"); - else if (Str__eq(macro, TL_IS_391)) WRITE("cos"); - else if (Str__eq(macro, TL_IS_392)) WRITE("tan"); - else if (Str__eq(macro, TL_IS_393)) WRITE("T"); - else if (Str__eq(macro, TL_IS_394)) PUT((wchar_t) 0x0391); - else if (Str__eq(macro, TL_IS_395)) PUT((wchar_t) 0x0392); - else if (Str__eq(macro, TL_IS_396)) PUT((wchar_t) 0x0393); - else if (Str__eq(macro, TL_IS_397)) PUT((wchar_t) 0x0394); - else if (Str__eq(macro, TL_IS_398)) PUT((wchar_t) 0x0395); - else if (Str__eq(macro, TL_IS_399)) PUT((wchar_t) 0x0396); - else if (Str__eq(macro, TL_IS_400)) PUT((wchar_t) 0x0397); - else if (Str__eq(macro, TL_IS_401)) PUT((wchar_t) 0x0398); - else if (Str__eq(macro, TL_IS_402)) PUT((wchar_t) 0x0399); - else if (Str__eq(macro, TL_IS_403)) PUT((wchar_t) 0x039A); - else if (Str__eq(macro, TL_IS_404)) PUT((wchar_t) 0x039B); - else if (Str__eq(macro, TL_IS_405)) PUT((wchar_t) 0x039C); - else if (Str__eq(macro, TL_IS_406)) PUT((wchar_t) 0x039D); - else if (Str__eq(macro, TL_IS_407)) PUT((wchar_t) 0x039E); - else if (Str__eq(macro, TL_IS_408)) PUT((wchar_t) 0x039F); - else if (Str__eq(macro, TL_IS_409)) PUT((wchar_t) 0x03A0); - else if (Str__eq(macro, TL_IS_410)) PUT((wchar_t) 0x03A1); - else if (Str__eq(macro, TL_IS_411)) PUT((wchar_t) 0x03A2); - else if (Str__eq(macro, TL_IS_412)) PUT((wchar_t) 0x03A3); - else if (Str__eq(macro, TL_IS_413)) PUT((wchar_t) 0x03A4); - else if (Str__eq(macro, TL_IS_414)) PUT((wchar_t) 0x03A5); - else if (Str__eq(macro, TL_IS_415)) PUT((wchar_t) 0x03A6); - else if (Str__eq(macro, TL_IS_416)) PUT((wchar_t) 0x03A7); - else if (Str__eq(macro, TL_IS_417)) PUT((wchar_t) 0x03A8); - else if (Str__eq(macro, TL_IS_418)) PUT((wchar_t) 0x03A9); - else if (Str__eq(macro, TL_IS_419)) PUT((wchar_t) 0x03B1); - else if (Str__eq(macro, TL_IS_420)) PUT((wchar_t) 0x03B2); - else if (Str__eq(macro, TL_IS_421)) PUT((wchar_t) 0x03B3); - else if (Str__eq(macro, TL_IS_422)) PUT((wchar_t) 0x03B4); - else if (Str__eq(macro, TL_IS_423)) PUT((wchar_t) 0x03B5); - else if (Str__eq(macro, TL_IS_424)) PUT((wchar_t) 0x03B6); - else if (Str__eq(macro, TL_IS_425)) PUT((wchar_t) 0x03B7); - else if (Str__eq(macro, TL_IS_426)) PUT((wchar_t) 0x03B8); - else if (Str__eq(macro, TL_IS_427)) PUT((wchar_t) 0x03B9); - else if (Str__eq(macro, TL_IS_428)) PUT((wchar_t) 0x03BA); - else if (Str__eq(macro, TL_IS_429)) PUT((wchar_t) 0x03BB); - else if (Str__eq(macro, TL_IS_430)) PUT((wchar_t) 0x03BC); - else if (Str__eq(macro, TL_IS_431)) PUT((wchar_t) 0x03BD); - else if (Str__eq(macro, TL_IS_432)) PUT((wchar_t) 0x03BE); - else if (Str__eq(macro, TL_IS_433)) PUT((wchar_t) 0x03BF); - else if (Str__eq(macro, TL_IS_434)) PUT((wchar_t) 0x03C0); - else if (Str__eq(macro, TL_IS_435)) PUT((wchar_t) 0x03C1); - else if (Str__eq(macro, TL_IS_436)) PUT((wchar_t) 0x03C2); - else if (Str__eq(macro, TL_IS_437)) PUT((wchar_t) 0x03C3); - else if (Str__eq(macro, TL_IS_438)) PUT((wchar_t) 0x03C4); - else if (Str__eq(macro, TL_IS_439)) PUT((wchar_t) 0x03C5); - else if (Str__eq(macro, TL_IS_440)) PUT((wchar_t) 0x03C6); - else if (Str__eq(macro, TL_IS_441)) PUT((wchar_t) 0x03C7); - else if (Str__eq(macro, TL_IS_442)) PUT((wchar_t) 0x03C8); - else if (Str__eq(macro, TL_IS_443)) PUT((wchar_t) 0x03C9); - else if (Str__eq(macro, TL_IS_444)) PUT((wchar_t) 0x2203); - else if (Str__eq(macro, TL_IS_445)) PUT((wchar_t) 0x2208); - else if (Str__eq(macro, TL_IS_446)) PUT((wchar_t) 0x2200); - else if (Str__eq(macro, TL_IS_447)) PUT((wchar_t) 0x2229); - else if (Str__eq(macro, TL_IS_448)) PUT((wchar_t) 0x2205); - else if (Str__eq(macro, TL_IS_449)) PUT((wchar_t) 0x2286); - else if (Str__eq(macro, TL_IS_450)) PUT((wchar_t) 0x2227); - else if (Str__eq(macro, TL_IS_451)) PUT((wchar_t) 0x2228); - else if (Str__eq(macro, TL_IS_452)) PUT((wchar_t) 0x00AC); - else if (Str__eq(macro, TL_IS_453)) PUT((wchar_t) 0x03A3); - else if (Str__eq(macro, TL_IS_454)) PUT((wchar_t) 0x03A0); + else if (Str__eq(macro, TL_IS_387)) WRITE("!="); + else if (Str__eq(macro, TL_IS_388)) WRITE("l"); + else if (Str__eq(macro, TL_IS_389)) WRITE("log"); + else if (Str__eq(macro, TL_IS_390)) WRITE("exp"); + else if (Str__eq(macro, TL_IS_391)) WRITE("sin"); + else if (Str__eq(macro, TL_IS_392)) WRITE("cos"); + else if (Str__eq(macro, TL_IS_393)) WRITE("tan"); + else if (Str__eq(macro, TL_IS_394)) WRITE("T"); + else if (Str__eq(macro, TL_IS_395)) PUT((wchar_t) 0x0391); + else if (Str__eq(macro, TL_IS_396)) PUT((wchar_t) 0x0392); + else if (Str__eq(macro, TL_IS_397)) PUT((wchar_t) 0x0393); + else if (Str__eq(macro, TL_IS_398)) PUT((wchar_t) 0x0394); + else if (Str__eq(macro, TL_IS_399)) PUT((wchar_t) 0x0395); + else if (Str__eq(macro, TL_IS_400)) PUT((wchar_t) 0x0396); + else if (Str__eq(macro, TL_IS_401)) PUT((wchar_t) 0x0397); + else if (Str__eq(macro, TL_IS_402)) PUT((wchar_t) 0x0398); + else if (Str__eq(macro, TL_IS_403)) PUT((wchar_t) 0x0399); + else if (Str__eq(macro, TL_IS_404)) PUT((wchar_t) 0x039A); + else if (Str__eq(macro, TL_IS_405)) PUT((wchar_t) 0x039B); + else if (Str__eq(macro, TL_IS_406)) PUT((wchar_t) 0x039C); + else if (Str__eq(macro, TL_IS_407)) PUT((wchar_t) 0x039D); + else if (Str__eq(macro, TL_IS_408)) PUT((wchar_t) 0x039E); + else if (Str__eq(macro, TL_IS_409)) PUT((wchar_t) 0x039F); + else if (Str__eq(macro, TL_IS_410)) PUT((wchar_t) 0x03A0); + else if (Str__eq(macro, TL_IS_411)) PUT((wchar_t) 0x03A1); + else if (Str__eq(macro, TL_IS_412)) PUT((wchar_t) 0x03A2); + else if (Str__eq(macro, TL_IS_413)) PUT((wchar_t) 0x03A3); + else if (Str__eq(macro, TL_IS_414)) PUT((wchar_t) 0x03A4); + else if (Str__eq(macro, TL_IS_415)) PUT((wchar_t) 0x03A5); + else if (Str__eq(macro, TL_IS_416)) PUT((wchar_t) 0x03A6); + else if (Str__eq(macro, TL_IS_417)) PUT((wchar_t) 0x03A7); + else if (Str__eq(macro, TL_IS_418)) PUT((wchar_t) 0x03A8); + else if (Str__eq(macro, TL_IS_419)) PUT((wchar_t) 0x03A9); + else if (Str__eq(macro, TL_IS_420)) PUT((wchar_t) 0x03B1); + else if (Str__eq(macro, TL_IS_421)) PUT((wchar_t) 0x03B2); + else if (Str__eq(macro, TL_IS_422)) PUT((wchar_t) 0x03B3); + else if (Str__eq(macro, TL_IS_423)) PUT((wchar_t) 0x03B4); + else if (Str__eq(macro, TL_IS_424)) PUT((wchar_t) 0x03B5); + else if (Str__eq(macro, TL_IS_425)) PUT((wchar_t) 0x03B6); + else if (Str__eq(macro, TL_IS_426)) PUT((wchar_t) 0x03B7); + else if (Str__eq(macro, TL_IS_427)) PUT((wchar_t) 0x03B8); + else if (Str__eq(macro, TL_IS_428)) PUT((wchar_t) 0x03B9); + else if (Str__eq(macro, TL_IS_429)) PUT((wchar_t) 0x03BA); + else if (Str__eq(macro, TL_IS_430)) PUT((wchar_t) 0x03BB); + else if (Str__eq(macro, TL_IS_431)) PUT((wchar_t) 0x03BC); + else if (Str__eq(macro, TL_IS_432)) PUT((wchar_t) 0x03BD); + else if (Str__eq(macro, TL_IS_433)) PUT((wchar_t) 0x03BE); + else if (Str__eq(macro, TL_IS_434)) PUT((wchar_t) 0x03BF); + else if (Str__eq(macro, TL_IS_435)) PUT((wchar_t) 0x03C0); + else if (Str__eq(macro, TL_IS_436)) PUT((wchar_t) 0x03C1); + else if (Str__eq(macro, TL_IS_437)) PUT((wchar_t) 0x03C2); + else if (Str__eq(macro, TL_IS_438)) PUT((wchar_t) 0x03C3); + else if (Str__eq(macro, TL_IS_439)) PUT((wchar_t) 0x03C4); + else if (Str__eq(macro, TL_IS_440)) PUT((wchar_t) 0x03C5); + else if (Str__eq(macro, TL_IS_441)) PUT((wchar_t) 0x03C6); + else if (Str__eq(macro, TL_IS_442)) PUT((wchar_t) 0x03C7); + else if (Str__eq(macro, TL_IS_443)) PUT((wchar_t) 0x03C8); + else if (Str__eq(macro, TL_IS_444)) PUT((wchar_t) 0x03C9); + else if (Str__eq(macro, TL_IS_445)) PUT((wchar_t) 0x2203); + else if (Str__eq(macro, TL_IS_446)) PUT((wchar_t) 0x2208); + else if (Str__eq(macro, TL_IS_447)) PUT((wchar_t) 0x2200); + else if (Str__eq(macro, TL_IS_448)) PUT((wchar_t) 0x2229); + else if (Str__eq(macro, TL_IS_449)) PUT((wchar_t) 0x2205); + else if (Str__eq(macro, TL_IS_450)) PUT((wchar_t) 0x2286); + else if (Str__eq(macro, TL_IS_451)) PUT((wchar_t) 0x2227); + else if (Str__eq(macro, TL_IS_452)) PUT((wchar_t) 0x2228); + else if (Str__eq(macro, TL_IS_453)) PUT((wchar_t) 0x00AC); + else if (Str__eq(macro, TL_IS_454)) PUT((wchar_t) 0x03A3); + else if (Str__eq(macro, TL_IS_455)) PUT((wchar_t) 0x03A0); else { if (Str__len(macro) > 0) { int suspect = TRUE; @@ -23523,8 +23573,8 @@ void TeX__remove_math_mode_range(OUTPUT_STREAM, text_stream *text, int from, int if ((c >= 'a') && (c <= 'z')) continue; suspect = FALSE; } - if (Str__eq(macro, TL_IS_455)) suspect = FALSE; if (Str__eq(macro, TL_IS_456)) suspect = FALSE; + if (Str__eq(macro, TL_IS_457)) suspect = FALSE; if (suspect) PRINT("[Passing through unknown TeX macro \\%S:\n %S\n", macro, text); } @@ -23550,7 +23600,7 @@ void HTMLFormat__create(void) { { #line 12 "inweb/Chapter 5/HTML Formats.w" - weave_format *wf = Formats__create_weave_format(TL_IS_459, TL_IS_460); + weave_format *wf = Formats__create_weave_format(TL_IS_460, TL_IS_461); METHOD_ADD(wf, TOP_FOR_MTID, HTMLFormat__top); METHOD_ADD(wf, PRESERVE_MATH_MODE_FOR_MTID, HTMLFormat__preserve_math_mode); @@ -23590,7 +23640,7 @@ void HTMLFormat__create(void) { { #line 18 "inweb/Chapter 5/HTML Formats.w" - weave_format *wf = Formats__create_weave_format(TL_IS_461, TL_IS_462); + weave_format *wf = Formats__create_weave_format(TL_IS_462, TL_IS_463); METHOD_ADD(wf, TOP_FOR_MTID, HTMLFormat__top_EPUB); { @@ -23692,8 +23742,8 @@ void HTMLFormat__exit_current_paragraph(OUTPUT_STREAM) { #line 128 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__top(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *comment) { HTML__declare_as_HTML(OUT, FALSE); - Indexer__cover_sheet_maker(OUT, wv->weave_web, TL_IS_463, wv, WEAVE_FIRST_HALF); - filename *CSS = Patterns__obtain_filename(wv->pattern, TL_IS_464); + Indexer__cover_sheet_maker(OUT, wv->weave_web, TL_IS_464, wv, WEAVE_FIRST_HALF); + filename *CSS = Patterns__obtain_filename(wv->pattern, TL_IS_465); if (wv->pattern->hierarchical) Patterns__copy_up_file_into_weave(wv->weave_web, CSS); else @@ -23705,8 +23755,8 @@ void HTMLFormat__top(weave_format *self, text_stream *OUT, weave_target *wv, tex int HTMLFormat__preserve_math_mode(weave_format *self, weave_target *wv, text_stream *matter, text_stream *text) { text_stream *plugin_name = - Bibliographic__get_datum(wv->weave_web->md, TL_IS_465); - if (Str__eq_insensitive(plugin_name, TL_IS_466)) return FALSE; + Bibliographic__get_datum(wv->weave_web->md, TL_IS_466); + if (Str__eq_insensitive(plugin_name, TL_IS_467)) return FALSE; int math_mode = FALSE, mode_exists = FALSE; for (int i=0; iweave_web->as_ebook, wv->weave_to, wv->booklet_title, TL_IS_467); - Indexer__cover_sheet_maker(OUT, wv->weave_web, TL_IS_468, wv, WEAVE_FIRST_HALF); + Epub__note_page(wv->weave_web->as_ebook, wv->weave_to, wv->booklet_title, TL_IS_468); + Indexer__cover_sheet_maker(OUT, wv->weave_web, TL_IS_469, wv, WEAVE_FIRST_HALF); HTML__comment(OUT, comment); html_in_para = HTML_OUT; } @@ -23809,7 +23859,7 @@ void HTMLFormat__paragraph_heading(weave_format *self, text_stream *OUT, HTML_CLOSE("b"); } else { if (crumbs_dropped == FALSE) { - filename *C = Patterns__obtain_filename(wv->pattern, TL_IS_469); + filename *C = Patterns__obtain_filename(wv->pattern, TL_IS_470); if (wv->pattern->hierarchical) Patterns__copy_up_file_into_weave(wv->weave_web, C); else @@ -23819,12 +23869,12 @@ void HTMLFormat__paragraph_heading(weave_format *self, text_stream *OUT, HTML_OPEN_WITH("ul", "class=\"crumbs\""); Colonies__drop_initial_breadcrumbs(OUT, wv->weave_to, wv->breadcrumbs); - text_stream *bct = Bibliographic__get_datum(wv->weave_web->md, TL_IS_470); - if (Str__len(Bibliographic__get_datum(wv->weave_web->md, TL_IS_471)) > 0) { - bct = Bibliographic__get_datum(wv->weave_web->md, TL_IS_472); + text_stream *bct = Bibliographic__get_datum(wv->weave_web->md, TL_IS_471); + if (Str__len(Bibliographic__get_datum(wv->weave_web->md, TL_IS_472)) > 0) { + bct = Bibliographic__get_datum(wv->weave_web->md, TL_IS_473); } if (wv->self_contained == FALSE) { - Colonies__write_breadcrumb(OUT, bct, TL_IS_473); + Colonies__write_breadcrumb(OUT, bct, TL_IS_474); if (wv->weave_web->md->chaptered) { TEMPORARY_TEXT(chapter_link); WRITE_TO(chapter_link, "index.html#%s%S", (wv->weave_web->as_ebook)?"C":"", @@ -23853,7 +23903,7 @@ void HTMLFormat__source_code(weave_format *self, text_stream *OUT, weave_target WRITE("%S", prefatory); HTML_CLOSE("span"); WRITE(" "); - if (Str__eq(prefatory, TL_IS_474)) { + if (Str__eq(prefatory, TL_IS_475)) { match_results mr = Regexp__create_mr(); if (Regexp__match(&mr, matter, L"(%c*) from (%C+) *")) { HTMLFormat__source_code(self, OUT, wv, 0, NULL, mr.exp[0], colouring, @@ -23895,7 +23945,7 @@ void HTMLFormat__source_code(weave_format *self, text_stream *OUT, weave_target language_function *fn = Analyser__get_function( wv->current_weave_line->owning_section, fname, FUNCTION_COLOUR); if ((defn_line) && (fn) && (fn->usage_described == FALSE)) { - Swarm__ensure_plugin(wv, TL_IS_479); + Swarm__ensure_plugin(wv, TL_IS_480); WRITE("%S", fname); WRITE("
    (int n) { + int isprime(int n) { if (n <= 1) return FALSE; if (n > RANGE) { printf("Out of range!\n"); return FALSE; } if (!sieve_performed) <Perform the sieve 2.1>; @@ -127,7 +127,7 @@ for example.

    This code is used in §2.1.


    -
    +