From 46c1ad0de76ff5111bdb98c42978afb0fc87745c Mon Sep 17 00:00:00 2001 From: Graham Nelson Date: Tue, 7 Apr 2020 00:53:26 +0100 Subject: [PATCH] Improved extracts and testing for the painter --- .gitignore | 1 + Chapter 1/Configuration.w | 18 + Chapter 1/Program Control.w | 17 + Chapter 2/Line Categories.w | 2 + Chapter 2/The Parser.w | 39 +- Chapter 3/The Weaver.w | 25 +- Chapter 4/ACME Support.w | 2 +- Chapter 4/Programming Languages.w | 8 +- Chapter 4/The Painter.w | 80 +- Chapter 5/HTML Formats.w | 55 +- Chapter 5/TeX Format.w | 2 +- Chapter 5/Weave Formats.w | 7 +- .../AssemblageExample.ildf | 0 .../EquationsExample.ildf | 0 .../LineageExample.ildf | 0 Dialects/PainterOutput.ildf | 19 + .../RunningExample.ildf | 0 .../StdioExample.ildf | 0 .../ThirdExample.ildf | 0 .../VowelsExample.ildf | 0 Figures/help.txt | 2 + Languages/ACME.ildf | 4 +- Languages/ILDF.ildf | 1 - Languages/Inform 6.ildf | 110 +- Manual/Reference Card.w | 4 +- Manual/Supporting Programming Languages.w | 53 +- README.md | 2 +- Tangled/inweb.c | 2134 +++++++++-------- .../Test Cases/_Tangled_Ideal/conditional.txt | 3 - Tests/Test Cases/_Tangled_Ideal/empty.txt | 3 - Tests/Test Cases/_Tangled_Ideal/hellow.txt | 3 - .../Test Cases/_Tangled_Ideal/twinprimes.txt | 3 - .../Test Cases/_Woven_Ideal/conditional.html | 6 +- Tests/Test Cases/_Woven_Ideal/empty.html | 1 - Tests/Test Cases/_Woven_Ideal/hellow.html | 3 +- Tests/Test Cases/_Woven_Ideal/perl.html | 14 +- Tests/Test Cases/_Woven_Ideal/plain.html | 2 - Tests/Test Cases/_Woven_Ideal/twinprimes.html | 15 +- Tests/Test Painter/AssemblageExample.txt | 5 + Tests/Test Painter/EquationsExample.txt | 4 + Tests/Test Painter/LineageExample.txt | 2 + Tests/Test Painter/PainterOutput.txt | 4 + Tests/Test Painter/RunningExample.txt | 2 + Tests/Test Painter/StdioExample.txt | 1 + Tests/Test Painter/ThirdExample.txt | 14 + Tests/Test Painter/VowelsExample.txt | 4 + .../_Results_Ideal/AssemblageExample.txt | 13 + .../_Results_Ideal/EquationsExample.txt | 11 + .../_Results_Ideal/LineageExample.txt | 7 + .../_Results_Ideal/PainterOutput.txt | 11 + .../_Results_Ideal/RunningExample.txt | 7 + .../_Results_Ideal/StdioExample.txt | 5 + .../_Results_Ideal/ThirdExample.txt | 31 + .../_Results_Ideal/VowelsExample.txt | 11 + Tests/inweb.intest | 22 + build.txt | 4 +- docs/foundation-module/1-fnd.html | 6 - docs/foundation-module/1-pp.html | 16 - docs/foundation-module/1-wp.html | 9 - docs/foundation-module/2-dct.html | 11 - docs/foundation-module/2-dl.html | 10 - docs/foundation-module/2-llas.html | 5 - docs/foundation-module/2-mmr.html | 24 - docs/foundation-module/2-mth.html | 2 - docs/foundation-module/2-str.html | 29 - docs/foundation-module/2-wal.html | 5 - docs/foundation-module/3-cf.html | 5 - docs/foundation-module/3-cla.html | 11 - docs/foundation-module/3-drc.html | 2 - docs/foundation-module/3-em.html | 6 - docs/foundation-module/3-fln.html | 11 - docs/foundation-module/3-pth.html | 15 - docs/foundation-module/3-shl.html | 4 - docs/foundation-module/3-tm.html | 2 - docs/foundation-module/4-chr.html | 6 - docs/foundation-module/4-cst.html | 8 - docs/foundation-module/4-pm.html | 45 +- docs/foundation-module/4-sm.html | 27 +- docs/foundation-module/4-taa.html | 7 - docs/foundation-module/4-tf.html | 8 - docs/foundation-module/4-ws.html | 3 - docs/foundation-module/5-ee.html | 7 - docs/foundation-module/5-htm.html | 19 - docs/foundation-module/6-bf.html | 9 - docs/foundation-module/6-id.html | 2 - docs/foundation-module/6-sd.html | 3 - docs/foundation-module/7-vn.html | 9 - docs/foundation-module/7-vnr.html | 8 - docs/foundation-module/8-bdfw.html | 6 - docs/foundation-module/8-bf.html | 9 - docs/foundation-module/8-wm.html | 7 - docs/foundation-module/8-ws.html | 8 - docs/foundation-test/S-ut.html | 8 - docs/inweb/1-bsc.html | 1 - docs/inweb/1-cnf.html | 26 +- docs/inweb/1-pc.html | 101 +- docs/inweb/1-ptt.html | 9 +- docs/inweb/2-ec.html | 4 - docs/inweb/2-lc.html | 9 +- docs/inweb/2-pm.html | 3 - docs/inweb/2-pn.html | 5 +- docs/inweb/2-tgs.html | 9 +- docs/inweb/2-tp.html | 57 +- docs/inweb/2-tr.html | 40 +- docs/inweb/3-ta.html | 18 +- docs/inweb/3-ti.html | 7 - docs/inweb/3-ts.html | 8 +- docs/inweb/3-tt.html | 11 +- docs/inweb/3-tw.html | 31 +- docs/inweb/4-as.html | 8 +- docs/inweb/4-cl.html | 18 - docs/inweb/4-is.html | 38 - docs/inweb/4-lm.html | 3 +- docs/inweb/4-pl.html | 149 +- docs/inweb/4-tp.html | 158 +- docs/inweb/5-hf.html | 89 +- docs/inweb/5-ptf.html | 16 - docs/inweb/5-rtt.html | 5 - docs/inweb/5-tf.html | 30 +- docs/inweb/5-wf.html | 17 +- docs/inweb/6-gs.html | 2 - docs/inweb/6-mkf.html | 4 - docs/inweb/6-rw.html | 15 +- docs/inweb/M-awwp.html | 17 - docs/inweb/M-htwaw.html | 31 - docs/inweb/M-iti.html | 6 - docs/inweb/M-rc.html | 130 +- docs/inweb/M-spl.html | 318 +-- docs/inweb/M-tid.html | 6 - docs/inweb/M-wtaw.html | 47 - scripts/gitignorescript.txt | 1 + 131 files changed, 2330 insertions(+), 2285 deletions(-) rename {Private Languages => Dialects}/AssemblageExample.ildf (100%) rename {Private Languages => Dialects}/EquationsExample.ildf (100%) rename {Private Languages => Dialects}/LineageExample.ildf (100%) create mode 100644 Dialects/PainterOutput.ildf rename {Private Languages => Dialects}/RunningExample.ildf (100%) rename {Private Languages => Dialects}/StdioExample.ildf (100%) rename {Private Languages => Dialects}/ThirdExample.ildf (100%) rename {Private Languages => Dialects}/VowelsExample.ildf (100%) create mode 100644 Tests/Test Painter/AssemblageExample.txt create mode 100644 Tests/Test Painter/EquationsExample.txt create mode 100644 Tests/Test Painter/LineageExample.txt create mode 100644 Tests/Test Painter/PainterOutput.txt create mode 100644 Tests/Test Painter/RunningExample.txt create mode 100644 Tests/Test Painter/StdioExample.txt create mode 100644 Tests/Test Painter/ThirdExample.txt create mode 100644 Tests/Test Painter/VowelsExample.txt create mode 100644 Tests/Test Painter/_Results_Ideal/AssemblageExample.txt create mode 100644 Tests/Test Painter/_Results_Ideal/EquationsExample.txt create mode 100644 Tests/Test Painter/_Results_Ideal/LineageExample.txt create mode 100644 Tests/Test Painter/_Results_Ideal/PainterOutput.txt create mode 100644 Tests/Test Painter/_Results_Ideal/RunningExample.txt create mode 100644 Tests/Test Painter/_Results_Ideal/StdioExample.txt create mode 100644 Tests/Test Painter/_Results_Ideal/ThirdExample.txt create mode 100644 Tests/Test Painter/_Results_Ideal/VowelsExample.txt diff --git a/.gitignore b/.gitignore index be7ec13..c25dffe 100644 --- a/.gitignore +++ b/.gitignore @@ -25,4 +25,5 @@ Tests/Test Cases/_Tangled_Actual/ Tests/Test Cases/_Tangled_Console/ Tests/Test Cases/_Woven_Actual/ Tests/Test Cases/_Woven_Console/ +Tests/Test Painter/_Results_Actual/ diff --git a/Chapter 1/Configuration.w b/Chapter 1/Configuration.w index 1ba798c..cff7d0d 100644 --- a/Chapter 1/Configuration.w +++ b/Chapter 1/Configuration.w @@ -42,6 +42,9 @@ typedef struct inweb_instructions { int verbose_switch; /* |-verbose|: print names of files read to stdout */ int targets; /* used only for parsing */ + struct programming_language *test_language_setting; /* |-test-language X| */ + struct filename *test_language_on_setting; /* |-test-language-on X| */ + struct pathname *import_setting; /* |-import X|: where to find imported webs */ } inweb_instructions; @@ -105,6 +108,8 @@ inweb_instructions Configuration::read(int argc, char **argv) { args.weave_docs = FALSE; args.import_setting = NULL; args.targets = 0; + args.test_language_setting = NULL; + args.test_language_on_setting = NULL; @ The CommandLine section of Foundation needs to be told what command-line switches we want, other than the standard set (such as |-help|) which it @@ -118,6 +123,8 @@ provides automatically. @e LANGUAGE_CLSW @e LANGUAGES_CLSW @e SHOW_LANGUAGES_CLSW +@e TEST_LANGUAGE_CLSW +@e TEST_LANGUAGE_ON_CLSW @e ANALYSIS_CLSG @@ -173,6 +180,10 @@ provides automatically. L"read all language definitions in path X"); CommandLine::declare_switch(SHOW_LANGUAGES_CLSW, L"show-languages", 1, L"list programming languages supported by Inweb"); + CommandLine::declare_switch(TEST_LANGUAGE_CLSW, L"test-language", 2, + L"test language X on..."); + CommandLine::declare_switch(TEST_LANGUAGE_ON_CLSW, L"test-language-on", 2, + L"...the code in the file X"); CommandLine::end_group(); CommandLine::begin_group(ANALYSIS_CLSG, @@ -256,6 +267,13 @@ void Configuration::switch(int id, int val, text_stream *arg, void *state) { case SHOW_LANGUAGES_CLSW: args->show_languages_switch = TRUE; Configuration::set_fundamental_mode(args, ANALYSE_MODE); break; + case TEST_LANGUAGE_CLSW: + args->test_language_setting = + Languages::read_definition(Filenames::from_text(arg)); + Configuration::set_fundamental_mode(args, ANALYSE_MODE); break; + case TEST_LANGUAGE_ON_CLSW: + args->test_language_on_setting = Filenames::from_text(arg); + Configuration::set_fundamental_mode(args, ANALYSE_MODE); break; case CATALOGUE_CLSW: args->catalogue_switch = TRUE; Configuration::set_fundamental_mode(args, ANALYSE_MODE); break; diff --git a/Chapter 1/Program Control.w b/Chapter 1/Program Control.w index 67334b9..a3386a9 100644 --- a/Chapter 1/Program Control.w +++ b/Chapter 1/Program Control.w @@ -100,6 +100,7 @@ void Main::follow_instructions(inweb_instructions *ins) { if (no_inweb_errors == 0) { if (ins->inweb_mode == TRANSLATE_MODE) @ else if (ins->show_languages_switch) @ + else if ((ins->test_language_setting) || (ins->test_language_on_setting)) @ else if (ins->inweb_mode != NO_MODE) @; } } @@ -129,6 +130,22 @@ void Main::follow_instructions(inweb_instructions *ins) { Languages::read_definitions(NULL); Languages::show(STDOUT); +@ And this: + +@ = + if ((ins->test_language_setting) && (ins->test_language_on_setting)) { + TEMPORARY_TEXT(matter); + TEMPORARY_TEXT(coloured); + Painter::colour_file(ins->test_language_setting, ins->test_language_on_setting, + matter, coloured); + PRINT("Test of colouring for language %S:\n%S\n%S\n", + ins->test_language_setting->language_name, matter, coloured); + DISCARD_TEXT(matter); + DISCARD_TEXT(coloured); + } else { + Errors::fatal("-test-language and -test-language-on must both be given"); + } + @ But otherwise we do something with the given web: @ = diff --git a/Chapter 2/Line Categories.w b/Chapter 2/Line Categories.w index 4a80517..0ab75d2 100644 --- a/Chapter 2/Line Categories.w +++ b/Chapter 2/Line Categories.w @@ -25,6 +25,7 @@ typedef struct source_line { int category; /* what sort of line this is: an |*_LCAT| value */ int command_code; /* used only for |COMMAND_LCAT| lines: a |*_CMD| value */ int default_defn; /* used only for |BEGIN_DEFINITION_LCAT| lines */ + int plainer; /* used only for |BEGIN_CODE_LCAT| lines: suppresses box */ struct programming_language *colour_as; /* used only for |TEXT_EXTRACT_LCAT| lines */ int is_commentary; /* flag */ struct function *function_defined; /* if any C-like function is defined on this line */ @@ -49,6 +50,7 @@ source_line *Lines::new_source_line(text_stream *line, text_file_position *tfp) sl->category = NO_LCAT; /* that is, unknown category as yet */ sl->command_code = NO_CMD; sl->default_defn = FALSE; + sl->plainer = FALSE; sl->colour_as = NULL; sl->is_commentary = FALSE; sl->function_defined = NULL; diff --git a/Chapter 2/The Parser.w b/Chapter 2/The Parser.w index 93af577..0790bde 100644 --- a/Chapter 2/The Parser.w +++ b/Chapter 2/The Parser.w @@ -387,14 +387,29 @@ division in the current section. code_lcat_for_body = TEXT_EXTRACT_LCAT; code_pl_for_body = NULL; extract_mode = TRUE; - } else if ((current_paragraph) && (Regexp::match(&mr2, mr.exp[0], L"%(sample (%c+) code%)"))) { + } else if ((current_paragraph) && + (Regexp::match(&mr2, mr.exp[0], L"%(sample (%c+) code%)"))) { code_lcat_for_body = TEXT_EXTRACT_LCAT; code_pl_for_body = Languages::find_by_name(mr2.exp[0], W); extract_mode = TRUE; - } else if ((current_paragraph) && (Regexp::match(&mr2, mr.exp[0], L"%(sample code%)"))) { + } else if ((current_paragraph) && + (Regexp::match(&mr2, mr.exp[0], L"%(sample code%)"))) { code_lcat_for_body = TEXT_EXTRACT_LCAT; code_pl_for_body = S->sect_language; extract_mode = TRUE; + } else if ((current_paragraph) && + (Regexp::match(&mr2, mr.exp[0], L"%(text from (%c+) as (%c+)%)"))) { + code_pl_for_body = Languages::find_by_name(mr2.exp[1], W); + @; + } else if ((current_paragraph) && + (Regexp::match(&mr2, mr.exp[0], L"%(text from (%c+)%)"))) { + code_pl_for_body = NULL; + @; + } else if ((current_paragraph) && + (Regexp::match(&mr2, mr.exp[0], L"%(undisplayed text from (%c+)%)"))) { + code_pl_for_body = NULL; + L->plainer = TRUE; + @; } else { Main::error_in_web(I"unknown bracketed annotation", L); } @@ -405,6 +420,26 @@ division in the current section. Regexp::dispose_of(&mr2); continue; +@ = + L->category = BEGIN_CODE_LCAT; + pathname *P = W->md->path_to_web; + filename *F = Filenames::from_text_relative(P, mr2.exp[0]); + linked_list *lines = Painter::lines(F); + text_stream *T; + source_line *latest = L; + LOOP_OVER_LINKED_LIST(T, text_stream, lines) { + source_line *TL = Lines::new_source_line(T, &(L->source)); + TL->next_line = latest->next_line; + TL->plainer = L->plainer; + latest->next_line = TL; + latest = TL; + } + source_line *EEL = Lines::new_source_line(I"=", &(L->source)); + EEL->next_line = latest->next_line; + latest->next_line = EEL; + code_lcat_for_body = TEXT_EXTRACT_LCAT; + extract_mode = TRUE; + @ So here we have the possibilities which start with a column-1 |@| sign. There appear to be hordes of these, but in fact most of them were removed in Inweb syntax version 2: in modern syntax, only |@d|, |@e|, |@h|, their diff --git a/Chapter 3/The Weaver.w b/Chapter 3/The Weaver.w index 2b385fc..3e003f4 100644 --- a/Chapter 3/The Weaver.w +++ b/Chapter 3/The Weaver.w @@ -152,6 +152,7 @@ We skip these because we weave their contents in some other way: if (L->category == END_EXTRACT_LCAT) continue; if (L->category == BEGIN_CODE_LCAT) { state->line_break_pending = FALSE; + LanguageMethods::reset_syntax_colouring(S->sect_language); continue; } @@ -292,25 +293,25 @@ add a vertical skip between them to show the division more clearly. match_results mr = Regexp::create_mr(); if (Regexp::match(&mr, matter, L"%(...%) (%c*)")) { /* continue single */ Formats::change_material(OUT, wv, state->kind_of_material, REGULAR_MATERIAL, - state->substantive_comment); + state->substantive_comment, FALSE); state->kind_of_material = REGULAR_MATERIAL; Formats::item(OUT, wv, 1, I""); 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); + state->substantive_comment, FALSE); state->kind_of_material = REGULAR_MATERIAL; Formats::item(OUT, wv, 2, I""); 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, - state->substantive_comment); + state->substantive_comment, FALSE); state->kind_of_material = REGULAR_MATERIAL; Formats::item(OUT, wv, 1, mr.exp[0]); Str::copy(matter, mr.exp[1]); } else if (Regexp::match(&mr, matter, L"%(-(%i+)%) (%c*)")) { /* begin double */ Formats::change_material(OUT, wv, state->kind_of_material, REGULAR_MATERIAL, - state->substantive_comment); + state->substantive_comment, FALSE); state->kind_of_material = REGULAR_MATERIAL; Formats::item(OUT, wv, 2, mr.exp[0]); Str::copy(matter, mr.exp[1]); @@ -324,7 +325,8 @@ in the source is set indented in code style. match_results mr = Regexp::create_mr(); if (Regexp::match(&mr, matter, L"\t|(%c*)|(%c*?)")) { if (state->kind_of_material != CODE_MATERIAL) { - Formats::change_material(OUT, wv, state->kind_of_material, CODE_MATERIAL, TRUE); + Formats::change_material(OUT, wv, state->kind_of_material, CODE_MATERIAL, + TRUE, L->plainer); state->kind_of_material = CODE_MATERIAL; } TEMPORARY_TEXT(original); @@ -338,7 +340,8 @@ in the source is set indented in code style. DISCARD_TEXT(original); continue; } else if (state->kind_of_material != REGULAR_MATERIAL) { - Formats::change_material(OUT, wv, state->kind_of_material, REGULAR_MATERIAL, TRUE); + Formats::change_material(OUT, wv, state->kind_of_material, REGULAR_MATERIAL, + TRUE, FALSE); state->kind_of_material = REGULAR_MATERIAL; } Regexp::dispose_of(&mr); @@ -364,7 +367,8 @@ and macro usage is rendered differently. W, C, S, L, matter, concluding_comment)) continue; TEMPORARY_TEXT(colouring); - LanguageMethods::syntax_colour(OUT, S->sect_language, wv, W, C, S, L, matter, colouring); + LanguageMethods::syntax_colour(OUT, S->sect_language, wv, W, C, S, L, + matter, colouring); int found = 0; @; @@ -399,7 +403,7 @@ hence the name of the following paragraph: else state->kind_of_material = CODE_MATERIAL; Formats::change_material(OUT, wv, mode_now, state->kind_of_material, - state->substantive_comment); + state->substantive_comment, L->plainer); state->line_break_pending = FALSE; } @@ -501,7 +505,7 @@ otherwise, they are set flush right. @; if (wv->theme_match) @; - LanguageMethods::reset_syntax_colouring(S->sect_language); /* a precaution: limits bad colouring accidents to one para */ + LanguageMethods::reset_syntax_colouring(S->sect_language); int weight = 0; if (L->category == HEADING_START_LCAT) weight = 1; if (L->category == SECTION_HEADING_LCAT) weight = 2; @@ -647,7 +651,8 @@ At the end of a paragraph, on the other hand, we do this: int mode_now = state->kind_of_material; if (state->kind_of_material != REGULAR_MATERIAL) { state->kind_of_material = REGULAR_MATERIAL; - Formats::change_material(OUT, wv, mode_now, state->kind_of_material, TRUE); + Formats::change_material(OUT, wv, mode_now, state->kind_of_material, + TRUE, L?(L->plainer):FALSE); } if ((current_paragraph) && (current_paragraph != state->last_endnoted_para)) { state->last_endnoted_para = current_paragraph; diff --git a/Chapter 4/ACME Support.w b/Chapter 4/ACME Support.w index 2681365..1fb8e94 100644 --- a/Chapter 4/ACME Support.w +++ b/Chapter 4/ACME Support.w @@ -245,5 +245,5 @@ int ACMESupport::syntax_colour(programming_language *pl, text_stream *OUT, weave hash_table *ht = &(S->sect_target->symbols); if ((L->category == TEXT_EXTRACT_LCAT) && (pl != S->sect_language)) ht = &(pl->built_in_keywords); - return Painter::syntax_colour(pl, OUT, ht, matter, colouring, FALSE); + return Painter::syntax_colour(pl, ht, matter, colouring, FALSE); } diff --git a/Chapter 4/Programming Languages.w b/Chapter 4/Programming Languages.w index ac7a29d..df0094c 100644 --- a/Chapter 4/Programming Languages.w +++ b/Chapter 4/Programming Languages.w @@ -25,7 +25,7 @@ programming_language *Languages::find_by_name(text_stream *lname, web *W) { @ = filename *F = NULL; if (W) { - pathname *P = Pathnames::subfolder(W->md->path_to_web, I"Private Languages"); + pathname *P = Pathnames::subfolder(W->md->path_to_web, I"Dialects"); @; } pathname *P = Languages::default_directory(); @@ -415,6 +415,7 @@ typedef struct colouring_rule { int match_prefix; /* one of the |*_RULE_PREFIX| values above */ wchar_t match_regexp_text[MAX_ILDF_REGEXP_LENGTH]; int number; /* for |number N| rules; 0 for others */ + int number_of; /* for |number N of M| rules; 0 for others */ /* the conclusion: */ struct colouring_language_block *execute_block; /* or |NULL|, in which case... */ @@ -440,6 +441,7 @@ colouring_rule *Languages::new_rule(colouring_language_block *within) { rule->match_keyword_of_colour = NOT_A_COLOUR; rule->match_regexp_text[0] = 0; rule->number = 0; + rule->number_of = 0; rule->set_to_colour = NOT_A_COLOUR; rule->set_prefix_to_colour = NOT_A_COLOUR; @@ -469,6 +471,9 @@ void Languages::parse_rule(language_reader_state *state, text_stream *premiss, } if (Regexp::match(&mr, premiss, L"number (%d+)")) { rule->number = Str::atoi(mr.exp[0], 0); + } else if (Regexp::match(&mr, premiss, L"number (%d+) of (%d+)")) { + rule->number = Str::atoi(mr.exp[0], 0); + rule->number_of = Str::atoi(mr.exp[1], 0); } else if (Regexp::match(&mr, premiss, L"keyword of (%c+)")) { rule->match_keyword_of_colour = Languages::colour(mr.exp[0], tfp); } else if (Regexp::match(&mr, premiss, L"keyword")) { @@ -560,6 +565,7 @@ but which are not expressible in the syntax of this file. @d PLAIN_COLOUR 'p' @d EXTRACT_COLOUR 'x' @d COMMENT_COLOUR '!' +@d NEWLINE_COLOUR '\n' @d NOT_A_COLOUR ' ' @d UNQUOTED_COLOUR '_' diff --git a/Chapter 4/The Painter.w b/Chapter 4/The Painter.w index 2dff0c1..083bede 100644 --- a/Chapter 4/The Painter.w +++ b/Chapter 4/The Painter.w @@ -13,8 +13,10 @@ Because of that, we need to call the following before we begin a run of calls to |Painter::syntax_colour|: = +int painter_count = 1; void Painter::reset_syntax_colouring(programming_language *pl) { colouring_state = PLAIN_COLOUR; + painter_count = 1; } @ As we begin, the text to colour is in |matter|, while |colouring| is an @@ -33,7 +35,7 @@ We get to that by using a language's rules on literals, and then executing its colouring program. = -int Painter::syntax_colour(programming_language *pl, text_stream *OUT, +int Painter::syntax_colour(programming_language *pl, hash_table *HT, text_stream *matter, text_stream *colouring, int with_comments) { int from = 0, to = Str::len(matter) - 1; if (with_comments) { @@ -49,11 +51,11 @@ int Painter::syntax_colour(programming_language *pl, text_stream *OUT, DISCARD_TEXT(part_before_comment); DISCARD_TEXT(part_within_comment); } - Painter::syntax_colour_inner(pl, OUT, HT, matter, colouring, from, to); + Painter::syntax_colour_inner(pl, HT, matter, colouring, from, to); return FALSE; } -void Painter::syntax_colour_inner(programming_language *pl, text_stream *OUT, +void Painter::syntax_colour_inner(programming_language *pl, hash_table *HT, text_stream *matter, text_stream *colouring, int from, int to) { @; @; @@ -190,7 +192,7 @@ takes over. @ = if (pl->program) - Painter::execute(HT, pl->program, matter, colouring, from, to); + Painter::execute(HT, pl->program, matter, colouring, from, to, painter_count++); @ The run-type for a block determines what the rules in it apply to: the whole snippet of text, or each character on its own, or each run of characters @@ -199,7 +201,7 @@ rule across the whole snippet before moving on to the next. = void Painter::execute(hash_table *HT, colouring_language_block *block, text_stream *matter, - text_stream *colouring, int from, int to) { + text_stream *colouring, int from, int to, int N) { if (block == NULL) internal_error("no block"); TEMPORARY_TEXT(colouring_at_start); Str::copy(colouring_at_start, colouring); @@ -207,7 +209,8 @@ void Painter::execute(hash_table *HT, colouring_language_block *block, text_stre LOOP_OVER_LINKED_LIST(rule, colouring_rule, block->rules) { switch (block->run) { case WHOLE_LINE_CRULE_RUN: - Painter::execute_rule(HT, rule, matter, colouring, from, to, 1); + Painter::execute_rule(HT, rule, matter, colouring, from, to, + (N == 0)?1:N); break; case CHARACTERS_CRULE_RUN: for (int i=from; i<=to; i++) @@ -298,7 +301,11 @@ void Painter::execute_rule(hash_table *HT, colouring_rule *rule, text_stream *ma int Painter::satisfies(hash_table *HT, colouring_rule *rule, text_stream *matter, text_stream *colouring, int from, int to, int N) { if (rule->number > 0) { - if (rule->number != N) return FALSE; + if (rule->number_of > 0) { + if (rule->number != ((N-1)%(rule->number_of)) + 1) return FALSE; + } else { + if (rule->number != N) return FALSE; + } } else if (rule->match_regexp_text[0]) { if (Regexp::match(&(rule->mr), matter, rule->match_regexp_text) == FALSE) return FALSE; @@ -355,7 +362,7 @@ int Painter::satisfies(hash_table *HT, colouring_rule *rule, text_stream *matter void Painter::follow(hash_table *HT, colouring_rule *rule, text_stream *matter, text_stream *colouring, int from, int to) { if (rule->execute_block) - Painter::execute(HT, rule->execute_block, matter, colouring, from, to); + Painter::execute(HT, rule->execute_block, matter, colouring, from, to, 0); else if (rule->debug) @ else { if (rule->set_to_colour != NOT_A_COLOUR) @@ -375,3 +382,60 @@ void Painter::follow(hash_table *HT, colouring_rule *rule, text_stream *matter, for (int i=from; i<=to; i++) PUT_TO(STDOUT, Str::get_at(colouring, i)); PRINT("\n"); + +@h Painting a file. + += +linked_list *Painter::lines(filename *F) { + linked_list *L = NEW_LINKED_LIST(text_stream); + TextFiles::read(F, FALSE, "unable to read file of textual extract", TRUE, + &Painter::text_file_helper, NULL, L); + int n = -1, c = 0; + text_stream *T; + LOOP_OVER_LINKED_LIST(T, text_stream, L) { + c++; + if (Str::is_whitespace(T) == FALSE) + n = c; + } + if (n >= 0) { + linked_list *R = NEW_LINKED_LIST(text_stream); + c = 0; + LOOP_OVER_LINKED_LIST(T, text_stream, L) + if (++c <= n) + ADD_TO_LINKED_LIST(T, text_stream, R); + return R; + } + return L; +} + +void Painter::text_file_helper(text_stream *text, text_file_position *tfp, void *state) { + linked_list *L = (linked_list *) state; + ADD_TO_LINKED_LIST(Str::duplicate(text), text_stream, L); +} + +void Painter::colour_file(programming_language *pl, filename *F, text_stream *to, text_stream *coloured) { + linked_list *L = Painter::lines(F); + if (pl) Painter::reset_syntax_colouring(pl); + int c = 1; + text_stream *T; + LOOP_OVER_LINKED_LIST(T, text_stream, L) { + if (c++ > 1) { PUT_TO(to, '\n'); PUT_TO(coloured, NEWLINE_COLOUR); } + Str::trim_white_space_at_end(T); + TEMPORARY_TEXT(ST); + TEMPORARY_TEXT(SC); + LOOP_THROUGH_TEXT(pos, T) + if (Str::get(pos) == '\t') + WRITE_TO(ST, " "); + else + PUT_TO(ST, Str::get(pos)); + if (pl) { + Painter::syntax_colour(pl, (pl)?(&(pl->built_in_keywords)):NULL, ST, SC, TRUE); + } else { + LOOP_THROUGH_TEXT(pos, ST) + PUT_TO(SC, PLAIN_COLOUR); + } + WRITE_TO(to, "%S", ST); + WRITE_TO(coloured, "%S", SC); + } + if (c > 0) { PUT_TO(to, '\n'); PUT_TO(coloured, NEWLINE_COLOUR); } +} diff --git a/Chapter 5/HTML Formats.w b/Chapter 5/HTML Formats.w index 6d1a967..f289507 100644 --- a/Chapter 5/HTML Formats.w +++ b/Chapter 5/HTML Formats.w @@ -374,13 +374,6 @@ void HTMLFormat::bar(weave_format *self, text_stream *OUT, weave_target *wv) { } @ = -typedef struct HTML_figure_state { - struct text_stream *OUT; - struct programming_language *colour_as; - struct weave_target *wv; - struct hash_table *keywords; -} HTML_figure_state; - void HTMLFormat::figure(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *figname, int w, int h, programming_language *pl) { HTMLFormat::exit_current_paragraph(OUT); @@ -388,44 +381,13 @@ void HTMLFormat::figure(weave_format *self, text_stream *OUT, weave_target *wv, Pathnames::subfolder(wv->weave_web->md->path_to_web, I"Figures"), figname); filename *RF = Filenames::from_text(figname); - TEMPORARY_TEXT(ext); - Filenames::write_extension(ext, RF); - if ((pl) || (Str::eq_insensitive(ext, I".txt"))) { - if (pl == NULL) HTMLFormat::pre(OUT, NULL); - else HTMLFormat::pre(OUT, "display"); - if (pl) Painter::reset_syntax_colouring(pl); - HTML_figure_state hfs; - hfs.OUT = OUT; - hfs.colour_as = pl; - hfs.wv = wv; - hfs.keywords = (pl)?(&(pl->built_in_keywords)):NULL; - TextFiles::read(F, FALSE, "unable to read file of textual figure", TRUE, - &HTMLFormat::text_file_helper, NULL, &hfs); - if (pl == NULL) HTMLFormat::cpre(OUT); - else HTMLFormat::cpre(OUT); - } else { - HTML_OPEN("center"); - HTML::image(OUT, RF); - Patterns::copy_file_into_weave(wv->weave_web, F); - HTML_CLOSE("center"); - } - DISCARD_TEXT(ext); + HTML_OPEN("center"); + HTML::image(OUT, RF); + Patterns::copy_file_into_weave(wv->weave_web, F); + HTML_CLOSE("center"); WRITE("\n"); } -void HTMLFormat::text_file_helper(text_stream *text, text_file_position *tfp, void *state) { - HTML_figure_state *hfs = (HTML_figure_state *) state; - TEMPORARY_TEXT(colouring); - LOOP_THROUGH_TEXT(pos, text) PUT_TO(colouring, PLAIN_COLOUR); - if (hfs->colour_as) { - Painter::syntax_colour(hfs->colour_as, hfs->OUT, hfs->keywords, text, colouring, TRUE); - Formats::source_code(hfs->OUT, hfs->wv, 0, I"", text, colouring, I"", TRUE, TRUE, TRUE); - } else { - WRITE_TO(hfs->OUT, "%S\n", text); - } - DISCARD_TEXT(colouring); -} - @ = void HTMLFormat::para_macro(weave_format *self, text_stream *OUT, weave_target *wv, para_macro *pmac, int defn) { @@ -461,7 +423,7 @@ void HTMLFormat::blank_line(weave_format *self, text_stream *OUT, weave_target * @ = void HTMLFormat::change_material(weave_format *self, text_stream *OUT, weave_target *wv, - int old_material, int new_material, int content) { + int old_material, int new_material, int content, int plainly) { if (old_material != new_material) { if (old_material == MACRO_MATERIAL) HTML_CLOSE("code"); if ((content) || (new_material != MACRO_MATERIAL)) @@ -471,8 +433,8 @@ void HTMLFormat::change_material(weave_format *self, text_stream *OUT, weave_tar case REGULAR_MATERIAL: switch (new_material) { case CODE_MATERIAL: - WRITE("\n"); - HTMLFormat::pre(OUT, "display"); + if (plainly) HTMLFormat::pre(OUT, NULL); + else HTMLFormat::pre(OUT, "display"); break; case DEFINITION_MATERIAL: WRITE("\n"); @@ -510,7 +472,8 @@ void HTMLFormat::change_material(weave_format *self, text_stream *OUT, weave_tar switch (new_material) { case CODE_MATERIAL: WRITE("\n"); - HTMLFormat::pre(OUT, "display"); + if (plainly) HTMLFormat::pre(OUT, NULL); + else HTMLFormat::pre(OUT, "display"); break; case MACRO_MATERIAL: WRITE("\n"); diff --git a/Chapter 5/TeX Format.w b/Chapter 5/TeX Format.w index 51694df..568e229 100644 --- a/Chapter 5/TeX Format.w +++ b/Chapter 5/TeX Format.w @@ -379,7 +379,7 @@ void TeX::locale(weave_format *self, text_stream *OUT, weave_target *wv, @ = void TeX::change_material(weave_format *self, text_stream *OUT, weave_target *wv, - int old_material, int new_material, int content) { + int old_material, int new_material, int content, int change_material) { if (old_material != new_material) { switch (old_material) { case REGULAR_MATERIAL: diff --git a/Chapter 5/Weave Formats.w b/Chapter 5/Weave Formats.w index ccb7d2c..ecab2a9 100644 --- a/Chapter 5/Weave Formats.w +++ b/Chapter 5/Weave Formats.w @@ -340,11 +340,12 @@ weaver and turned into something else (such as list items). = VMETHOD_TYPE(CHANGE_MATERIAL_FOR_MTID, weave_format *wf, text_stream *OUT, - weave_target *wv, int old_material, int new_material, int content) + weave_target *wv, int old_material, int new_material, int content, int plainly) void Formats::change_material(OUTPUT_STREAM, weave_target *wv, - int old_material, int new_material, int content) { + int old_material, int new_material, int content, int plainly) { weave_format *wf = wv->format; - VMETHOD_CALL(wf, CHANGE_MATERIAL_FOR_MTID, OUT, wv, old_material, new_material, content); + VMETHOD_CALL(wf, CHANGE_MATERIAL_FOR_MTID, OUT, wv, old_material, new_material, + content, plainly); } @ This is called on a change of colour. "Colour" is really a shorthand way diff --git a/Private Languages/AssemblageExample.ildf b/Dialects/AssemblageExample.ildf similarity index 100% rename from Private Languages/AssemblageExample.ildf rename to Dialects/AssemblageExample.ildf diff --git a/Private Languages/EquationsExample.ildf b/Dialects/EquationsExample.ildf similarity index 100% rename from Private Languages/EquationsExample.ildf rename to Dialects/EquationsExample.ildf diff --git a/Private Languages/LineageExample.ildf b/Dialects/LineageExample.ildf similarity index 100% rename from Private Languages/LineageExample.ildf rename to Dialects/LineageExample.ildf diff --git a/Dialects/PainterOutput.ildf b/Dialects/PainterOutput.ildf new file mode 100644 index 0000000..ef9bec7 --- /dev/null +++ b/Dialects/PainterOutput.ildf @@ -0,0 +1,19 @@ +Name: "PainterOutput" +colouring { + number 1 of 2 => !plain + number 2 of 2 => { + characters { + "!" => !comment + "c" => !character + "d" => !definition + "e" => !element + "f" => !function + "i" => !identifier + "n" => !constant + "p" => !plain + "r" => !reserved + "s" => !string + "x" => !extract + } + } +} diff --git a/Private Languages/RunningExample.ildf b/Dialects/RunningExample.ildf similarity index 100% rename from Private Languages/RunningExample.ildf rename to Dialects/RunningExample.ildf diff --git a/Private Languages/StdioExample.ildf b/Dialects/StdioExample.ildf similarity index 100% rename from Private Languages/StdioExample.ildf rename to Dialects/StdioExample.ildf diff --git a/Private Languages/ThirdExample.ildf b/Dialects/ThirdExample.ildf similarity index 100% rename from Private Languages/ThirdExample.ildf rename to Dialects/ThirdExample.ildf diff --git a/Private Languages/VowelsExample.ildf b/Dialects/VowelsExample.ildf similarity index 100% rename from Private Languages/VowelsExample.ildf rename to Dialects/VowelsExample.ildf diff --git a/Figures/help.txt b/Figures/help.txt index 4e6c860..a09e945 100644 --- a/Figures/help.txt +++ b/Figures/help.txt @@ -22,6 +22,8 @@ for locating programming language definitions: -read-language X read language definition from file X -read-languages X read all language definitions in path X -show-languages list programming languages supported by Inweb + -test-language X test language X on... + -test-language-on X ...the code in the file X for analysing a web: -advance-build increment daily build code for the web diff --git a/Languages/ACME.ildf b/Languages/ACME.ildf index 3b9e2ca..3662830 100644 --- a/Languages/ACME.ildf +++ b/Languages/ACME.ildf @@ -14,8 +14,8 @@ colouring { runs of unquoted { runs of !identifier { => !reserved - prefix . => !identifier on both - prefix ! => !element on both + prefix "." => !identifier on both + prefix "!" => !element on both } characters { + => !identifier diff --git a/Languages/ILDF.ildf b/Languages/ILDF.ildf index 5b9a0ab..f58cf22 100644 --- a/Languages/ILDF.ildf +++ b/Languages/ILDF.ildf @@ -2,7 +2,6 @@ Name: "ILDF" Details: "The Inweb Language Definition File format" Extension: ".ildf" Whole Line Comment: "#" -Supports Namespaces: false String Literal: "\"" String Literal Escape: "\\" diff --git a/Languages/Inform 6.ildf b/Languages/Inform 6.ildf index 3cf5728..de2bd15 100644 --- a/Languages/Inform 6.ildf +++ b/Languages/Inform 6.ildf @@ -20,62 +20,62 @@ End Ifndef: "#endif; ! %S\n" # Reserved words: -keyword Constant -keyword Array +keyword "Constant" +keyword "Array" -keyword box -keyword break -keyword child -keyword children -keyword continue -keyword default -keyword do -keyword elder -keyword eldest -keyword else -keyword false -keyword font -keyword for -keyword give -keyword has -keyword hasnt -keyword if -keyword in -keyword indirect -keyword inversion -keyword jump -keyword metaclass -keyword move -keyword new_line -keyword nothing -keyword notin -keyword objectloop -keyword ofclass -keyword or -keyword parent -keyword print -keyword print_ret -keyword provides -keyword quit -keyword random -keyword read -keyword remove -keyword restore -keyword return -keyword rfalse -keyword rtrue -keyword save -keyword sibling -keyword spaces -keyword string -keyword style -keyword switch -keyword to -keyword true -keyword until -keyword while -keyword younger -keyword youngest +keyword "box" +keyword "break" +keyword "child" +keyword "children" +keyword "continue" +keyword "default" +keyword "do" +keyword "elder" +keyword "eldest" +keyword "else" +keyword "false" +keyword "font" +keyword "for" +keyword "give" +keyword "has" +keyword "hasnt" +keyword "if" +keyword "in" +keyword "indirect" +keyword "inversion" +keyword "jump" +keyword "metaclass" +keyword "move" +keyword "new_line" +keyword "nothing" +keyword "notin" +keyword "objectloop" +keyword "ofclass" +keyword "or" +keyword "parent" +keyword "print" +keyword "print_ret" +keyword "provides" +keyword "quit" +keyword "random" +keyword "read" +keyword "remove" +keyword "restore" +keyword "return" +keyword "rfalse" +keyword "rtrue" +keyword "save" +keyword "sibling" +keyword "spaces" +keyword "string" +keyword "style" +keyword "switch" +keyword "to" +keyword "true" +keyword "until" +keyword "while" +keyword "younger" +keyword "youngest" colouring { runs of unquoted { diff --git a/Manual/Reference Card.w b/Manual/Reference Card.w index 1b3e261..371a3f5 100644 --- a/Manual/Reference Card.w +++ b/Manual/Reference Card.w @@ -4,13 +4,13 @@ The current help information as it would be printed at the command line. @ Running Inweb with |-help| currently produces the following summary: -[[help.txt]] += (undisplayed text from Figures/help.txt) @ Running Inweb with |-show-languages| currently produces the following list of programming languages for which support is provided in the standard distribution: -[[languages.txt]] += (undisplayed text from Figures/languages.txt) It's easy to make new language definitions, and contributions of these are welcome. diff --git a/Manual/Supporting Programming Languages.w b/Manual/Supporting Programming Languages.w index 4a9a794..9ce2d36 100644 --- a/Manual/Supporting Programming Languages.w +++ b/Manual/Supporting Programming Languages.w @@ -9,6 +9,7 @@ is woven, it will look much nicer with syntax-colouring, and that clearly can't be done without at least a surface understanding of what programs in the language mean. +@ As we've seen, the Contents section of a web has to specify its language. For example, @@ -22,7 +23,7 @@ then its file is |L.ildf|. You can see the languages currently available to Inweb by using |-show-languages|. At present, a newly installed Inweb replies like so: -[[languages.txt]] += (undisplayed text from Figures/languages.txt) @ So what if you want to write a literate program in a language not on that list? One option is to give the language as |None|. (Note that this is @@ -48,7 +49,14 @@ Once you have written a definition, use |-read-language L| at the command line, where |L| is the file defining it. If you have many custom languages, |-read-languages D| reads all of the definitions in a directory |D|. Or, if the language in question is really quite specific to a single web, you can -make a |Private Languages| subdirectory of the web and put it in there. +make a |Dialects| subdirectory of the web and put it in there. (A dialect is, +after all, a local language.) + +For testing purposes, running with |-test-language F -test-language-on G| +reads in a file |G| of code, and syntax-colours it according to the rules +for the language defined in the file |F|, then prints a plain-text diagram +of the results. (This can then be tested with Intest test cases, as indeed +Inweb does itself.) @h Structure of language definitions. Each language is defined by a single ILDF file. ("Inweb Language Definition @@ -366,9 +374,7 @@ to be followed by |=>|: they always begin a block. 2. |characters in T| splits the snippet into each of its characters which lie inside the text |T|. For example, here is a not very useful ILD for plain text in which all vowels are in red: - -[[../Private Languages/VowelsExample.ildf as ILDF]] - += (text from Dialects/VowelsExample.ildf as ILDF) Given the text: = (not code) A noir, E blanc, I rouge, U vert, O bleu : voyelles, @@ -386,7 +392,7 @@ Qui bombinent autour des puanteurs cruelles, 3. The split |instances of X| narrows in on each usage of the text |X| inside the snippet. For example, -[[../Private Languages/LineageExample.ildf as ILDF]] += (text from Dialects/LineageExample.ildf as ILDF) acts on the text: = (not code) Jacob first appears in the Book of Genesis, the son of Isaac and Rebecca, the @@ -403,7 +409,7 @@ while |====| would have two. 4. The split |runs of C|, where |C| describes a colour, splits the snippet into non-overlapping contiguous pieces which have that colour. For example: -[[../Private Languages/RunningExample.ildf as ILDF]] += (text from Dialects/RunningExample.ildf as ILDF) acts on: = (not code) Napoleon Bonaparte (1769-1821) took 167 scientists to Egypt in 1798, @@ -418,7 +424,7 @@ Here the hyphens in number ranges have been coloured, but not the hyphen in "so-called". A more computer-science sort of example would be: -[[../Private Languages/StdioExample.ildf as ILDF]] += (text from Dialects/StdioExample.ildf as ILDF) which acts on: = (not code) if (x == 1) printf("Hello!"); @@ -438,7 +444,7 @@ not a colour. splits the snippet up into non-overlapping pieces which match it: possibly none at all, of course, in which case the block of rules is never used. This is easier to demonstrate than explain: -[[../Private Languages/AssemblageExample.ildf as ILDF]] += (text from Dialects/AssemblageExample.ildf as ILDF) which acts on: = (not code) JSR .initialise @@ -460,7 +466,7 @@ to produce: regular expression |E|, and then runs the rules on each bracketed subexpression in turn. (If there is no match, or there are no bracketed terms in |E|, nothing happens.) -[[../Private Languages/EquationsExample.ildf as ILDF]] += (text from Dialects/EquationsExample.ildf as ILDF) acts on: = (not code) A = 2716 @@ -552,7 +558,7 @@ is required to match the entire snippet, not just somewhere inside. 7. Whenever a split takes place, Inweb keeps count of how many pieces there are, and different rules can apply to differently numbered pieces. The notation is |number N|, where |N| is the number, counting from 1. For example, -[[../Private Languages/ThirdExample.ildf as ILDF]] += (text from Dialects/ThirdExample.ildf as ILDF) acts on: = (not code) With how sad steps, O Moon, thou climb'st the skies! @@ -587,6 +593,28 @@ Do they above love to be lov'd, and yet Those lovers scorn whom that love doth possess? Do they call virtue there ungratefulness? = +We can also cycle through a set of possibilities with |number N of M|, +where this time the count runs 1, 2, ..., |M|, 1, 2, ..., |M|, 1, ... and +so on. Thus |number 1 of 3| would work on the 1st, 4th, 7th, ... times; +|number 2 of 3| on the 2nd, 5th, 8th, ...; |number 3 of 3| on the 3rd, 6th, +9th, and so on. This, for example, paints the output from the painting +algorithm in Inweb: += (text from Dialects/PainterOutput.ildf as ILDF) +since alternate lines are plain, for the original text, and then coloured, +to highlight the colours given to the characters in the original. Thus: += (not code) + int x = 55; /* a magic number */ + rrrpipppnnpp!!!!!!!!!!!!!!!!!!!! + Imaginary::function(x, beta); + fffffffffffffffffffpippiiiipp += +becomes += (sample PainterOutput code) + int x = 55; /* a magic number */ + rrrpipppnnpp!!!!!!!!!!!!!!!!!!!! + Imaginary::function(x, beta); + fffffffffffffffffffpippiiiipp += @ Any condition can be reversed by preceding it with |not|. For example, = (sample ILDF code) @@ -629,5 +657,4 @@ The rule |=> debug| is unconditional, and will print whenever it's reached. Inweb Language Definition Format is a kind of language in itself, and in fact Inweb is supplied with an ILD for ILDF itself, which Inweb used to syntax-colour the examples above. Here it is, as syntax-coloured by itself: - -[[../Languages/ILDF.ildf as ILDF]] += (text from Languages/ILDF.ildf as ILDF) diff --git a/README.md b/README.md index c6a123d..a457a06 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Inweb 7 -v7 'Escape to Danger' (6 April 2020) +v7 'Escape to Danger' (7 April 2020) ## About Inweb diff --git a/Tangled/inweb.c b/Tangled/inweb.c index fb053d0..351cec9 100644 --- a/Tangled/inweb.c +++ b/Tangled/inweb.c @@ -764,31 +764,33 @@ void __stdcall LeaveCriticalSection(struct Win32_Critical_Section* cs); #define LANGUAGE_CLSW 8 #define LANGUAGES_CLSW 9 #define SHOW_LANGUAGES_CLSW 10 +#define TEST_LANGUAGE_CLSW 11 +#define TEST_LANGUAGE_ON_CLSW 12 #define ANALYSIS_CLSG 3 -#define CATALOGUE_CLSW 11 -#define FUNCTIONS_CLSW 12 -#define STRUCTURES_CLSW 13 -#define ADVANCE_CLSW 14 -#define GITIGNORE_CLSW 15 -#define MAKEFILE_CLSW 16 -#define WRITEME_CLSW 17 -#define ADVANCE_FILE_CLSW 18 -#define PROTOTYPE_CLSW 19 -#define SCAN_CLSW 20 +#define CATALOGUE_CLSW 13 +#define FUNCTIONS_CLSW 14 +#define STRUCTURES_CLSW 15 +#define ADVANCE_CLSW 16 +#define GITIGNORE_CLSW 17 +#define MAKEFILE_CLSW 18 +#define WRITEME_CLSW 19 +#define ADVANCE_FILE_CLSW 20 +#define PROTOTYPE_CLSW 21 +#define SCAN_CLSW 22 #define WEAVING_CLSG 4 -#define WEAVE_CLSW 21 -#define WEAVE_INTO_CLSW 22 -#define WEAVE_TO_CLSW 23 -#define SEQUENTIAL_CLSW 24 -#define OPEN_CLSW 25 -#define WEAVE_AS_CLSW 26 -#define WEAVE_TAG_CLSW 27 -#define WEAVE_DOCS_CLSW 28 -#define BREADCRUMB_CLSW 29 -#define NAVIGATION_CLSW 30 +#define WEAVE_CLSW 23 +#define WEAVE_INTO_CLSW 24 +#define WEAVE_TO_CLSW 25 +#define SEQUENTIAL_CLSW 26 +#define OPEN_CLSW 27 +#define WEAVE_AS_CLSW 28 +#define WEAVE_TAG_CLSW 29 +#define WEAVE_DOCS_CLSW 30 +#define BREADCRUMB_CLSW 31 +#define NAVIGATION_CLSW 32 #define TANGLING_CLSG 5 -#define TANGLE_CLSW 31 -#define TANGLE_TO_CLSW 32 +#define TANGLE_CLSW 33 +#define TANGLE_TO_CLSW 34 #define LOOP_WITHIN_TANGLE(C, S, T)\ LOOP_OVER_LINKED_LIST(C, chapter, W->chapters)\ LOOP_OVER_LINKED_LIST(S, section, C->sections)\ @@ -879,6 +881,7 @@ void __stdcall LeaveCriticalSection(struct Win32_Critical_Section* cs); #define PLAIN_COLOUR 'p' #define EXTRACT_COLOUR 'x' #define COMMENT_COLOUR '!' +#define NEWLINE_COLOUR '\n' #define NOT_A_COLOUR ' ' #define UNQUOTED_COLOUR '_' #define FURTHER_PARSING_PAR_MTID 2 @@ -960,7 +963,7 @@ void __stdcall LeaveCriticalSection(struct Win32_Critical_Section* cs); #define HTML_IN_P 1 /* write position in HTML file is currently outside p */ #define HTML_IN_PRE 2 /* write position in HTML file is currently outside pre */ #define HTML_IN_LI 3 /* write position in HTML file is currently outside li */ -#define NO_DEFINED_CLSW_VALUES 33 +#define NO_DEFINED_CLSW_VALUES 35 #define NO_DEFINED_DA_VALUES 4 #define NO_DEFINED_MT_VALUES 63 #define NO_DEFINED_MREASON_VALUES 5 @@ -1413,9 +1416,12 @@ typedef struct inweb_instructions { int verbose_switch; /* |-verbose|: print names of files read to stdout */ int targets; /* used only for parsing */ + struct programming_language *test_language_setting; /* |-test-language X| */ + struct filename *test_language_on_setting; /* |-test-language-on X| */ + struct pathname *import_setting; /* |-import X|: where to find imported webs */ } inweb_instructions; -#line 48 "inweb/Chapter 1/Configuration.w" +#line 51 "inweb/Chapter 1/Configuration.w" typedef struct breadcrumb_request { struct text_stream *breadcrumb_text; struct text_stream *breadcrumb_link; @@ -1524,6 +1530,7 @@ typedef struct source_line { int category; /* what sort of line this is: an |*_LCAT| value */ int command_code; /* used only for |COMMAND_LCAT| lines: a |*_CMD| value */ int default_defn; /* used only for |BEGIN_DEFINITION_LCAT| lines */ + int plainer; /* used only for |BEGIN_CODE_LCAT| lines: suppresses box */ struct programming_language *colour_as; /* used only for |TEXT_EXTRACT_LCAT| lines */ int is_commentary; /* flag */ struct function *function_defined; /* if any C-like function is defined on this line */ @@ -1537,7 +1544,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 626 "inweb/Chapter 2/The Parser.w" +#line 661 "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 */ @@ -1729,6 +1736,7 @@ typedef struct colouring_rule { int match_prefix; /* one of the |*_RULE_PREFIX| values above */ wchar_t match_regexp_text[MAX_ILDF_REGEXP_LENGTH]; int number; /* for |number N| rules; 0 for others */ + int number_of; /* for |number N of M| rules; 0 for others */ /* the conclusion: */ struct colouring_language_block *execute_block; /* or |NULL|, in which case... */ @@ -1741,7 +1749,7 @@ typedef struct colouring_rule { struct match_results mr; /* of a regular expression */ MEMORY_MANAGEMENT } colouring_rule; -#line 526 "inweb/Chapter 4/Programming Languages.w" +#line 531 "inweb/Chapter 4/Programming Languages.w" typedef struct reserved_word { struct text_stream *word; int colour; @@ -1813,13 +1821,6 @@ typedef struct weave_format { METHOD_CALLS MEMORY_MANAGEMENT } weave_format; -#line 377 "inweb/Chapter 5/HTML Formats.w" -typedef struct HTML_figure_state { - struct text_stream *OUT; - struct programming_language *colour_as; - struct weave_target *wv; - struct hash_table *keywords; -} HTML_figure_state; #line 42 "inweb/Chapter 5/Running Through TeX.w" typedef struct tex_results { int overfull_hbox_count; @@ -3039,19 +3040,19 @@ void BuildFiles__increment(text_stream *T) ; int main(int argc, char **argv) ; #line 90 "inweb/Chapter 1/Program Control.w" void Main__follow_instructions(inweb_instructions *ins) ; -#line 281 "inweb/Chapter 1/Program Control.w" +#line 298 "inweb/Chapter 1/Program Control.w" void Main__error_in_web(text_stream *message, source_line *sl) ; -#line 60 "inweb/Chapter 1/Configuration.w" +#line 63 "inweb/Chapter 1/Configuration.w" inweb_instructions Configuration__read(int argc, char **argv) ; -#line 244 "inweb/Chapter 1/Configuration.w" +#line 255 "inweb/Chapter 1/Configuration.w" void Configuration__switch(int id, int val, text_stream *arg, void *state) ; -#line 338 "inweb/Chapter 1/Configuration.w" +#line 356 "inweb/Chapter 1/Configuration.w" breadcrumb_request * Configuration__breadcrumb(text_stream *arg) ; -#line 358 "inweb/Chapter 1/Configuration.w" +#line 376 "inweb/Chapter 1/Configuration.w" void Configuration__bareword(int id, text_stream *opt, void *state) ; -#line 373 "inweb/Chapter 1/Configuration.w" +#line 391 "inweb/Chapter 1/Configuration.w" void Configuration__set_range(inweb_instructions *args, text_stream *opt) ; -#line 405 "inweb/Chapter 1/Configuration.w" +#line 423 "inweb/Chapter 1/Configuration.w" void Configuration__set_fundamental_mode(inweb_instructions *args, int new_material) ; #line 37 "inweb/Chapter 1/Patterns.w" weave_pattern * Patterns__find(web *W, text_stream *name) ; @@ -3097,15 +3098,15 @@ void Reader__add_imported_header(web *W, filename *HF) ; int Reader__web_has_one_section(web *W) ; #line 430 "inweb/Chapter 2/The Reader.w" void Reader__print_web_statistics(web *W) ; -#line 43 "inweb/Chapter 2/Line Categories.w" +#line 44 "inweb/Chapter 2/Line Categories.w" source_line * Lines__new_source_line(text_stream *line, text_file_position *tfp) ; -#line 105 "inweb/Chapter 2/Line Categories.w" +#line 107 "inweb/Chapter 2/Line Categories.w" char * Lines__category_name(int cat) ; #line 17 "inweb/Chapter 2/The Parser.w" void Parser__parse_web(web *W, int inweb_mode, int sequential) ; -#line 713 "inweb/Chapter 2/The Parser.w" +#line 748 "inweb/Chapter 2/The Parser.w" text_stream * Parser__extract_purpose(text_stream *prologue, source_line *XL, section *S, source_line **adjust) ; -#line 734 "inweb/Chapter 2/The Parser.w" +#line 769 "inweb/Chapter 2/The Parser.w" void Parser__wrong_version(int using, source_line *L, char *feature, int need) ; #line 20 "inweb/Chapter 2/Paragraph Macros.w" para_macro * Macros__create(section *S, paragraph *P, source_line *L, text_stream *name) ; @@ -3197,9 +3198,9 @@ void Indexer__transcribe_CSS(OUTPUT_STREAM, filename *CSS_file) ; void Indexer__copy_CSS(text_stream *line, text_file_position *tfp, void *X) ; #line 16 "inweb/Chapter 3/The Weaver.w" int Weaver__weave_source(web *W, weave_target *wv) ; -#line 663 "inweb/Chapter 3/The Weaver.w" +#line 668 "inweb/Chapter 3/The Weaver.w" void Weaver__show_endnotes_on_previous_paragraph(OUTPUT_STREAM, weave_target *wv, paragraph *P) ; -#line 800 "inweb/Chapter 3/The Weaver.w" +#line 805 "inweb/Chapter 3/The Weaver.w" int Weaver__weave_table_of_contents(OUTPUT_STREAM, weave_target *wv, section *S) ; #line 14 "inweb/Chapter 3/The Tangler.w" void Tangler__go(web *W, tangle_target *target, filename *dest_file) ; @@ -3225,23 +3226,23 @@ programming_language * Languages__read_definition(filename *F) ; void Languages__read_definition_line(text_stream *line, text_file_position *tfp, void *v_state) ; #line 379 "inweb/Chapter 4/Programming Languages.w" colouring_language_block * Languages__new_block(colouring_language_block *within, int r) ; -#line 432 "inweb/Chapter 4/Programming Languages.w" +#line 433 "inweb/Chapter 4/Programming Languages.w" colouring_rule * Languages__new_rule(colouring_language_block *within) ; -#line 455 "inweb/Chapter 4/Programming Languages.w" +#line 457 "inweb/Chapter 4/Programming Languages.w" void Languages__parse_rule(language_reader_state *state, text_stream *premiss, text_stream *action, text_file_position *tfp) ; -#line 532 "inweb/Chapter 4/Programming Languages.w" +#line 537 "inweb/Chapter 4/Programming Languages.w" reserved_word * Languages__reserved(programming_language *pl, text_stream *W, int C, text_file_position *tfp) ; -#line 568 "inweb/Chapter 4/Programming Languages.w" +#line 574 "inweb/Chapter 4/Programming Languages.w" int Languages__colour(text_stream *T, text_file_position *tfp) ; -#line 593 "inweb/Chapter 4/Programming Languages.w" +#line 599 "inweb/Chapter 4/Programming Languages.w" int Languages__boolean(text_stream *T, text_file_position *tfp) ; -#line 607 "inweb/Chapter 4/Programming Languages.w" +#line 613 "inweb/Chapter 4/Programming Languages.w" text_stream * Languages__text(text_stream *T, text_file_position *tfp, int allow) ; -#line 694 "inweb/Chapter 4/Programming Languages.w" +#line 700 "inweb/Chapter 4/Programming Languages.w" void Languages__regexp(wchar_t *write_to, text_stream *T, text_file_position *tfp) ; -#line 744 "inweb/Chapter 4/Programming Languages.w" +#line 750 "inweb/Chapter 4/Programming Languages.w" int Languages__add_to_regexp(wchar_t *write_to, int i, wchar_t c) ; -#line 749 "inweb/Chapter 4/Programming Languages.w" +#line 755 "inweb/Chapter 4/Programming Languages.w" int Languages__add_escape_to_regexp(wchar_t *write_to, int i, wchar_t c) ; #line 39 "inweb/Chapter 4/Language Methods.w" void LanguageMethods__further_parsing(web *W, programming_language *pl) ; @@ -3347,22 +3348,28 @@ void ACMESupport__begin_weave(programming_language *pl, section *S, weave_targe void ACMESupport__reset_syntax_colouring(programming_language *pl) ; #line 242 "inweb/Chapter 4/ACME Support.w" int ACMESupport__syntax_colour(programming_language *pl, text_stream *OUT, weave_target *wv, web *W, chapter *C, section *S, source_line *L, text_stream *matter, text_stream *colouring) ; -#line 16 "inweb/Chapter 4/The Painter.w" +#line 17 "inweb/Chapter 4/The Painter.w" void Painter__reset_syntax_colouring(programming_language *pl) ; -#line 36 "inweb/Chapter 4/The Painter.w" -int Painter__syntax_colour(programming_language *pl, text_stream *OUT, hash_table *HT, text_stream *matter, text_stream *colouring, int with_comments) ; -#line 56 "inweb/Chapter 4/The Painter.w" -void Painter__syntax_colour_inner(programming_language *pl, text_stream *OUT, hash_table *HT, text_stream *matter, text_stream *colouring, int from, int to) ; -#line 168 "inweb/Chapter 4/The Painter.w" +#line 38 "inweb/Chapter 4/The Painter.w" +int Painter__syntax_colour(programming_language *pl, hash_table *HT, text_stream *matter, text_stream *colouring, int with_comments) ; +#line 58 "inweb/Chapter 4/The Painter.w" +void Painter__syntax_colour_inner(programming_language *pl, hash_table *HT, text_stream *matter, text_stream *colouring, int from, int to) ; +#line 170 "inweb/Chapter 4/The Painter.w" int Painter__identifier_at(programming_language *pl, text_stream *matter, text_stream *colouring, int i) ; -#line 201 "inweb/Chapter 4/The Painter.w" -void Painter__execute(hash_table *HT, colouring_language_block *block, text_stream *matter, text_stream *colouring, int from, int to) ; -#line 281 "inweb/Chapter 4/The Painter.w" +#line 203 "inweb/Chapter 4/The Painter.w" +void Painter__execute(hash_table *HT, colouring_language_block *block, text_stream *matter, text_stream *colouring, int from, int to, int N) ; +#line 284 "inweb/Chapter 4/The Painter.w" void Painter__execute_rule(hash_table *HT, colouring_rule *rule, text_stream *matter, text_stream *colouring, int from, int to, int N) ; -#line 298 "inweb/Chapter 4/The Painter.w" +#line 301 "inweb/Chapter 4/The Painter.w" int Painter__satisfies(hash_table *HT, colouring_rule *rule, text_stream *matter, text_stream *colouring, int from, int to, int N) ; -#line 355 "inweb/Chapter 4/The Painter.w" +#line 362 "inweb/Chapter 4/The Painter.w" void Painter__follow(hash_table *HT, colouring_rule *rule, text_stream *matter, text_stream *colouring, int from, int to) ; +#line 389 "inweb/Chapter 4/The Painter.w" +linked_list * Painter__lines(filename *F) ; +#line 411 "inweb/Chapter 4/The Painter.w" +void Painter__text_file_helper(text_stream *text, text_file_position *tfp, void *state) ; +#line 416 "inweb/Chapter 4/The Painter.w" +void Painter__colour_file(programming_language *pl, filename *F, text_stream *to, text_stream *coloured) ; #line 9 "inweb/Chapter 4/C-Like Languages.w" void CLike__make_c_like(programming_language *pl) ; #line 41 "inweb/Chapter 4/C-Like Languages.w" @@ -3462,30 +3469,30 @@ void Formats__blank_line(OUTPUT_STREAM, weave_target *wv, int in_comment) ; #line 328 "inweb/Chapter 5/Weave Formats.w" void Formats__after_definitions(OUTPUT_STREAM, weave_target *wv) ; #line 344 "inweb/Chapter 5/Weave Formats.w" -void Formats__change_material(OUTPUT_STREAM, weave_target *wv, int old_material, int new_material, int content) ; -#line 360 "inweb/Chapter 5/Weave Formats.w" +void Formats__change_material(OUTPUT_STREAM, weave_target *wv, int old_material, int new_material, int content, int plainly) ; +#line 361 "inweb/Chapter 5/Weave Formats.w" void Formats__change_colour(OUTPUT_STREAM, weave_target *wv, int col, int in_code) ; -#line 371 "inweb/Chapter 5/Weave Formats.w" +#line 372 "inweb/Chapter 5/Weave Formats.w" void Formats__text(OUTPUT_STREAM, weave_target *wv, text_stream *id) ; -#line 375 "inweb/Chapter 5/Weave Formats.w" +#line 376 "inweb/Chapter 5/Weave Formats.w" void Formats__text_r(OUTPUT_STREAM, weave_target *wv, text_stream *id, int within) ; -#line 412 "inweb/Chapter 5/Weave Formats.w" +#line 413 "inweb/Chapter 5/Weave Formats.w" void Formats__text_fragment(OUTPUT_STREAM, weave_target *wv, text_stream *fragment) ; -#line 433 "inweb/Chapter 5/Weave Formats.w" +#line 434 "inweb/Chapter 5/Weave Formats.w" int Formats__preform_document(OUTPUT_STREAM, weave_target *wv, web *W, chapter *C, section *S, source_line *L, text_stream *matter, text_stream *concluding_comment) ; -#line 451 "inweb/Chapter 5/Weave Formats.w" +#line 452 "inweb/Chapter 5/Weave Formats.w" void Formats__endnote(OUTPUT_STREAM, weave_target *wv, int end) ; -#line 466 "inweb/Chapter 5/Weave Formats.w" +#line 467 "inweb/Chapter 5/Weave Formats.w" void Formats__locale(OUTPUT_STREAM, weave_target *wv, paragraph *par1, paragraph *par2) ; -#line 479 "inweb/Chapter 5/Weave Formats.w" +#line 480 "inweb/Chapter 5/Weave Formats.w" void Formats__tail(OUTPUT_STREAM, weave_target *wv, text_stream *comment, section *S) ; -#line 495 "inweb/Chapter 5/Weave Formats.w" +#line 496 "inweb/Chapter 5/Weave Formats.w" void Formats__post_process_weave(weave_target *wv, int open_afterwards) ; -#line 506 "inweb/Chapter 5/Weave Formats.w" +#line 507 "inweb/Chapter 5/Weave Formats.w" void Formats__report_on_post_processing(weave_target *wv) ; -#line 518 "inweb/Chapter 5/Weave Formats.w" +#line 519 "inweb/Chapter 5/Weave Formats.w" int Formats__index_pdfs(text_stream *format) ; -#line 534 "inweb/Chapter 5/Weave Formats.w" +#line 535 "inweb/Chapter 5/Weave Formats.w" int Formats__substitute_post_processing_data(OUTPUT_STREAM, weave_target *wv, text_stream *detail, weave_pattern *pattern) ; #line 9 "inweb/Chapter 5/Plain Text Format.w" void PlainText__create(void) ; @@ -3566,7 +3573,7 @@ void TeX__commentary_text(weave_format *self, text_stream *OUT, weave_target *w #line 374 "inweb/Chapter 5/TeX Format.w" void TeX__locale(weave_format *self, text_stream *OUT, weave_target *wv, paragraph *par1, paragraph *par2) ; #line 381 "inweb/Chapter 5/TeX Format.w" -void TeX__change_material(weave_format *self, text_stream *OUT, weave_target *wv, int old_material, int new_material, int content) ; +void TeX__change_material(weave_format *self, text_stream *OUT, weave_target *wv, int old_material, int new_material, int content, int change_material) ; #line 407 "inweb/Chapter 5/TeX Format.w" void TeX__tail(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *comment, section *S) ; #line 417 "inweb/Chapter 5/TeX Format.w" @@ -3621,35 +3628,33 @@ void HTMLFormat__display_line(weave_format *self, text_stream *OUT, weave_targe void HTMLFormat__item(weave_format *self, text_stream *OUT, weave_target *wv, int depth, text_stream *label) ; #line 371 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__bar(weave_format *self, text_stream *OUT, weave_target *wv) ; -#line 384 "inweb/Chapter 5/HTML Formats.w" +#line 377 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__figure(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *figname, int w, int h, programming_language *pl) ; -#line 416 "inweb/Chapter 5/HTML Formats.w" -void HTMLFormat__text_file_helper(text_stream *text, text_file_position *tfp, void *state) ; -#line 430 "inweb/Chapter 5/HTML Formats.w" +#line 392 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__para_macro(weave_format *self, text_stream *OUT, weave_target *wv, para_macro *pmac, int defn) ; -#line 445 "inweb/Chapter 5/HTML Formats.w" +#line 407 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__pagebreak(weave_format *self, text_stream *OUT, weave_target *wv) ; -#line 450 "inweb/Chapter 5/HTML Formats.w" +#line 412 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__blank_line(weave_format *self, text_stream *OUT, weave_target *wv, int in_comment) ; -#line 463 "inweb/Chapter 5/HTML Formats.w" -void HTMLFormat__change_material(weave_format *self, text_stream *OUT, weave_target *wv, int old_material, int new_material, int content) ; -#line 531 "inweb/Chapter 5/HTML Formats.w" +#line 425 "inweb/Chapter 5/HTML Formats.w" +void HTMLFormat__change_material(weave_format *self, text_stream *OUT, weave_target *wv, int old_material, int new_material, int content, int plainly) ; +#line 494 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__change_colour(weave_format *self, text_stream *OUT, weave_target *wv, int col, int in_code) ; -#line 552 "inweb/Chapter 5/HTML Formats.w" +#line 515 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__endnote(weave_format *self, text_stream *OUT, weave_target *wv, int end) ; -#line 562 "inweb/Chapter 5/HTML Formats.w" +#line 525 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__commentary_text(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *id) ; -#line 583 "inweb/Chapter 5/HTML Formats.w" +#line 546 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__locale(weave_format *self, text_stream *OUT, weave_target *wv, paragraph *par1, paragraph *par2) ; -#line 597 "inweb/Chapter 5/HTML Formats.w" +#line 560 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__xref(OUTPUT_STREAM, weave_target *wv, paragraph *P, section *from, int a_link) ; -#line 618 "inweb/Chapter 5/HTML Formats.w" +#line 581 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__tail(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *comment, section *this_S) ; -#line 665 "inweb/Chapter 5/HTML Formats.w" +#line 628 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__sref(OUTPUT_STREAM, weave_target *wv, section *S) ; -#line 678 "inweb/Chapter 5/HTML Formats.w" +#line 641 "inweb/Chapter 5/HTML Formats.w" int HTMLFormat__begin_weaving_EPUB(weave_format *wf, web *W, weave_pattern *pattern) ; -#line 693 "inweb/Chapter 5/HTML Formats.w" +#line 656 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__end_weaving_EPUB(weave_format *wf, web *W, weave_pattern *pattern) ; #line 22 "inweb/Chapter 5/Running Through TeX.w" void RunningTeX__post_process_weave(weave_target *wv, int open_afterwards, int to_DVI) ; @@ -4159,8 +4164,6 @@ text_stream *TL_IS_455 = NULL; text_stream *TL_IS_456 = NULL; text_stream *TL_IS_457 = NULL; text_stream *TL_IS_458 = NULL; -text_stream *TL_IS_459 = NULL; -text_stream *TL_IS_460 = NULL; void register_tangled_text_literals(void); #line 57 "inweb/foundation-module/Chapter 2/Streams.w" #define WRITE(args...) Writers__printf(OUT, args) @@ -13153,7 +13156,7 @@ void Main__follow_instructions(inweb_instructions *ins) { if (no_inweb_errors == 0) { if (ins->inweb_mode == TRANSLATE_MODE) { -#line 110 "inweb/Chapter 1/Program Control.w" +#line 111 "inweb/Chapter 1/Program Control.w" if ((ins->makefile_setting) && (ins->prototype_setting == NULL)) ins->prototype_setting = Filenames__from_text(TL_IS_69); if ((ins->gitignore_setting) && (ins->prototype_setting == NULL)) @@ -13175,20 +13178,39 @@ void Main__follow_instructions(inweb_instructions *ins) { else if (ins->show_languages_switch) { -#line 129 "inweb/Chapter 1/Program Control.w" +#line 130 "inweb/Chapter 1/Program Control.w" Languages__read_definitions(NULL); Languages__show(STDOUT); } #line 102 "inweb/Chapter 1/Program Control.w" + else if ((ins->test_language_setting) || (ins->test_language_on_setting)) +{ +#line 136 "inweb/Chapter 1/Program Control.w" + if ((ins->test_language_setting) && (ins->test_language_on_setting)) { + TEMPORARY_TEXT(matter); + TEMPORARY_TEXT(coloured); + Painter__colour_file(ins->test_language_setting, ins->test_language_on_setting, + matter, coloured); + PRINT("Test of colouring for language %S:\n%S\n%S\n", + ins->test_language_setting->language_name, matter, coloured); + DISCARD_TEXT(matter); + DISCARD_TEXT(coloured); + } else { + Errors__fatal("-test-language and -test-language-on must both be given"); + } + +} +#line 103 "inweb/Chapter 1/Program Control.w" + else if (ins->inweb_mode != NO_MODE) { -#line 135 "inweb/Chapter 1/Program Control.w" +#line 152 "inweb/Chapter 1/Program Control.w" Reader__print_web_statistics(W); if (ins->inweb_mode == ANALYSE_MODE) { -#line 143 "inweb/Chapter 1/Program Control.w" +#line 160 "inweb/Chapter 1/Program Control.w" if (ins->swarm_mode != SWARM_OFF_SWM) Errors__fatal("only specific parts of the web can be analysed"); if (ins->catalogue_switch) @@ -13208,17 +13230,17 @@ void Main__follow_instructions(inweb_instructions *ins) { Analyser__scan_line_categories(W, ins->chosen_range); } -#line 136 "inweb/Chapter 1/Program Control.w" +#line 153 "inweb/Chapter 1/Program Control.w" ; if (ins->inweb_mode == TANGLE_MODE) { -#line 176 "inweb/Chapter 1/Program Control.w" +#line 193 "inweb/Chapter 1/Program Control.w" TEMPORARY_TEXT(tangle_leaf); tangle_target *tn = NULL; if (Str__eq_wide_string(ins->chosen_range, L"0")) { { -#line 199 "inweb/Chapter 1/Program Control.w" +#line 216 "inweb/Chapter 1/Program Control.w" tn = NULL; if (Bibliographic__data_exists(W->md, TL_IS_72)) Str__copy(tangle_leaf, Bibliographic__get_datum(W->md, TL_IS_73)); @@ -13227,19 +13249,19 @@ void Main__follow_instructions(inweb_instructions *ins) { Str__concatenate(tangle_leaf, W->main_language->file_extension); } -#line 179 "inweb/Chapter 1/Program Control.w" +#line 196 "inweb/Chapter 1/Program Control.w" ; } else if (Reader__get_section_for_range(W, ins->chosen_range)) { { -#line 209 "inweb/Chapter 1/Program Control.w" +#line 226 "inweb/Chapter 1/Program Control.w" section *S = Reader__get_section_for_range(W, ins->chosen_range); tn = S->sect_target; if (tn == NULL) Errors__fatal("section cannot be independently tangled"); Str__copy(tangle_leaf, Filenames__get_leafname(S->md->source_file_for_section)); } -#line 181 "inweb/Chapter 1/Program Control.w" +#line 198 "inweb/Chapter 1/Program Control.w" ; } if (Str__len(tangle_leaf) == 0) { Errors__fatal("no tangle destination known"); } @@ -13255,15 +13277,15 @@ void Main__follow_instructions(inweb_instructions *ins) { DISCARD_TEXT(tangle_leaf); } -#line 137 "inweb/Chapter 1/Program Control.w" +#line 154 "inweb/Chapter 1/Program Control.w" ; if (ins->inweb_mode == WEAVE_MODE) { -#line 217 "inweb/Chapter 1/Program Control.w" +#line 234 "inweb/Chapter 1/Program Control.w" Numbering__number_web(W); if (ins->weave_docs) { -#line 251 "inweb/Chapter 1/Program Control.w" +#line 268 "inweb/Chapter 1/Program Control.w" if (ins->weave_into_setting == NULL) { pathname *docs = Pathnames__subfolder(W->md->path_to_web, TL_IS_75); Pathnames__create_in_file_system(docs); @@ -13283,7 +13305,7 @@ void Main__follow_instructions(inweb_instructions *ins) { ins->weave_pattern = TL_IS_79; } -#line 218 "inweb/Chapter 1/Program Control.w" +#line 235 "inweb/Chapter 1/Program Control.w" ; theme_tag *tag = Tags__find_by_name(ins->tag_setting, FALSE); @@ -13298,14 +13320,14 @@ void Main__follow_instructions(inweb_instructions *ins) { if (r != SWARM_OFF_SWM) ins->swarm_mode = r; { -#line 270 "inweb/Chapter 1/Program Control.w" +#line 287 "inweb/Chapter 1/Program Control.w" section *S; int k = 1; LOOP_OVER(S, section) if (Reader__range_within(S->sect_range, ins->chosen_range)) S->printed_number = k++; } -#line 230 "inweb/Chapter 1/Program Control.w" +#line 247 "inweb/Chapter 1/Program Control.w" ; if (ins->swarm_mode == SWARM_OFF_SWM) { int shall_we_open = ins->open_pdf_switch; @@ -13324,16 +13346,16 @@ void Main__follow_instructions(inweb_instructions *ins) { Formats__end_weaving(W, pattern); } -#line 138 "inweb/Chapter 1/Program Control.w" +#line 155 "inweb/Chapter 1/Program Control.w" ; } -#line 103 "inweb/Chapter 1/Program Control.w" +#line 104 "inweb/Chapter 1/Program Control.w" ; } } -#line 281 "inweb/Chapter 1/Program Control.w" +#line 298 "inweb/Chapter 1/Program Control.w" void Main__error_in_web(text_stream *message, source_line *sl) { if (sl) { Errors__in_text_file_S(message, &(sl->source)); @@ -13344,16 +13366,16 @@ void Main__error_in_web(text_stream *message, source_line *sl) { no_inweb_errors++; } -#line 47 "inweb/Chapter 1/Configuration.w" +#line 50 "inweb/Chapter 1/Configuration.w" -#line 53 "inweb/Chapter 1/Configuration.w" +#line 56 "inweb/Chapter 1/Configuration.w" -#line 60 "inweb/Chapter 1/Configuration.w" +#line 63 "inweb/Chapter 1/Configuration.w" inweb_instructions Configuration__read(int argc, char **argv) { inweb_instructions args; { -#line 78 "inweb/Chapter 1/Configuration.w" +#line 81 "inweb/Chapter 1/Configuration.w" args.inweb_mode = NO_MODE; args.swarm_mode = SWARM_OFF_SWM; args.show_languages_switch = FALSE; @@ -13384,13 +13406,15 @@ inweb_instructions Configuration__read(int argc, char **argv) { args.weave_docs = FALSE; args.import_setting = NULL; args.targets = 0; + args.test_language_setting = NULL; + args.test_language_on_setting = NULL; } -#line 62 "inweb/Chapter 1/Configuration.w" +#line 65 "inweb/Chapter 1/Configuration.w" ; { -#line 154 "inweb/Chapter 1/Configuration.w" +#line 161 "inweb/Chapter 1/Configuration.w" CommandLine__declare_heading(L"inweb: a tool for literate programming\n\n" L"Usage: inweb WEB OPTIONS RANGE\n\n" L"WEB must be a directory holding a literate program (a 'web')\n\n" @@ -13413,6 +13437,10 @@ inweb_instructions Configuration__read(int argc, char **argv) { L"read all language definitions in path X"); CommandLine__declare_switch(SHOW_LANGUAGES_CLSW, L"show-languages", 1, L"list programming languages supported by Inweb"); + CommandLine__declare_switch(TEST_LANGUAGE_CLSW, L"test-language", 2, + L"test language X on..."); + CommandLine__declare_switch(TEST_LANGUAGE_ON_CLSW, L"test-language-on", 2, + L"...the code in the file X"); CommandLine__end_group(); CommandLine__begin_group(ANALYSIS_CLSG, @@ -13479,7 +13507,7 @@ inweb_instructions Configuration__read(int argc, char **argv) { L"specify that imported modules are at pathname X"); } -#line 63 "inweb/Chapter 1/Configuration.w" +#line 66 "inweb/Chapter 1/Configuration.w" ; CommandLine__read(argc, argv, &args, &Configuration__switch, &Configuration__bareword); if ((args.chosen_web == NULL) && (args.chosen_file == NULL)) { @@ -13494,25 +13522,25 @@ inweb_instructions Configuration__read(int argc, char **argv) { return args; } -#line 115 "inweb/Chapter 1/Configuration.w" +#line 120 "inweb/Chapter 1/Configuration.w" -#line 117 "inweb/Chapter 1/Configuration.w" +#line 122 "inweb/Chapter 1/Configuration.w" -#line 121 "inweb/Chapter 1/Configuration.w" +#line 128 "inweb/Chapter 1/Configuration.w" -#line 123 "inweb/Chapter 1/Configuration.w" +#line 130 "inweb/Chapter 1/Configuration.w" -#line 134 "inweb/Chapter 1/Configuration.w" +#line 141 "inweb/Chapter 1/Configuration.w" -#line 136 "inweb/Chapter 1/Configuration.w" +#line 143 "inweb/Chapter 1/Configuration.w" -#line 147 "inweb/Chapter 1/Configuration.w" +#line 154 "inweb/Chapter 1/Configuration.w" -#line 149 "inweb/Chapter 1/Configuration.w" +#line 156 "inweb/Chapter 1/Configuration.w" -#line 152 "inweb/Chapter 1/Configuration.w" +#line 159 "inweb/Chapter 1/Configuration.w" -#line 244 "inweb/Chapter 1/Configuration.w" +#line 255 "inweb/Chapter 1/Configuration.w" void Configuration__switch(int id, int val, text_stream *arg, void *state) { inweb_instructions *args = (inweb_instructions *) state; switch (id) { @@ -13528,6 +13556,13 @@ void Configuration__switch(int id, int val, text_stream *arg, void *state) { case SHOW_LANGUAGES_CLSW: args->show_languages_switch = TRUE; Configuration__set_fundamental_mode(args, ANALYSE_MODE); break; + case TEST_LANGUAGE_CLSW: + args->test_language_setting = + Languages__read_definition(Filenames__from_text(arg)); + Configuration__set_fundamental_mode(args, ANALYSE_MODE); break; + case TEST_LANGUAGE_ON_CLSW: + args->test_language_on_setting = Filenames__from_text(arg); + Configuration__set_fundamental_mode(args, ANALYSE_MODE); break; case CATALOGUE_CLSW: args->catalogue_switch = TRUE; Configuration__set_fundamental_mode(args, ANALYSE_MODE); break; @@ -13622,7 +13657,7 @@ breadcrumb_request *Configuration__breadcrumb(text_stream *arg) { return BR; } -#line 358 "inweb/Chapter 1/Configuration.w" +#line 376 "inweb/Chapter 1/Configuration.w" void Configuration__bareword(int id, text_stream *opt, void *state) { inweb_instructions *args = (inweb_instructions *) state; if ((args->chosen_web == NULL) && (args->chosen_file == NULL)) { @@ -13633,7 +13668,7 @@ void Configuration__bareword(int id, text_stream *opt, void *state) { } else Configuration__set_range(args, opt); } -#line 373 "inweb/Chapter 1/Configuration.w" +#line 391 "inweb/Chapter 1/Configuration.w" void Configuration__set_range(inweb_instructions *args, text_stream *opt) { match_results mr = Regexp__create_mr(); if (Str__eq_wide_string(opt, L"index")) { @@ -13663,7 +13698,7 @@ void Configuration__set_range(inweb_instructions *args, text_stream *opt) { Regexp__dispose_of(&mr); } -#line 405 "inweb/Chapter 1/Configuration.w" +#line 423 "inweb/Chapter 1/Configuration.w" void Configuration__set_fundamental_mode(inweb_instructions *args, int new_material) { if ((args->inweb_mode != NO_MODE) && (args->inweb_mode != new_material)) Errors__fatal("can only do one at a time - weaving, tangling or analysing"); @@ -14255,9 +14290,9 @@ void Reader__print_web_statistics(web *W) { -#line 41 "inweb/Chapter 2/Line Categories.w" +#line 42 "inweb/Chapter 2/Line Categories.w" -#line 43 "inweb/Chapter 2/Line Categories.w" +#line 44 "inweb/Chapter 2/Line Categories.w" source_line *Lines__new_source_line(text_stream *line, text_file_position *tfp) { source_line *sl = CREATE(source_line); sl->text = Str__duplicate(line); @@ -14267,6 +14302,7 @@ source_line *Lines__new_source_line(text_stream *line, text_file_position *tfp) sl->category = NO_LCAT; /* that is, unknown category as yet */ sl->command_code = NO_CMD; sl->default_defn = FALSE; + sl->plainer = FALSE; sl->colour_as = NULL; sl->is_commentary = FALSE; sl->function_defined = NULL; @@ -14282,11 +14318,11 @@ source_line *Lines__new_source_line(text_stream *line, text_file_position *tfp) return sl; } -#line 75 "inweb/Chapter 2/Line Categories.w" +#line 77 "inweb/Chapter 2/Line Categories.w" -#line 100 "inweb/Chapter 2/Line Categories.w" +#line 102 "inweb/Chapter 2/Line Categories.w" -#line 105 "inweb/Chapter 2/Line Categories.w" +#line 107 "inweb/Chapter 2/Line Categories.w" char *Lines__category_name(int cat) { switch (cat) { case NO_LCAT: return "(uncategorised)"; @@ -14319,7 +14355,7 @@ char *Lines__category_name(int cat) { return "(?unknown)"; } -#line 146 "inweb/Chapter 2/Line Categories.w" +#line 148 "inweb/Chapter 2/Line Categories.w" #line 17 "inweb/Chapter 2/The Parser.w" void Parser__parse_web(web *W, int inweb_mode, int sequential) { @@ -14730,14 +14766,101 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { code_lcat_for_body = TEXT_EXTRACT_LCAT; code_pl_for_body = NULL; extract_mode = TRUE; - } else if ((current_paragraph) && (Regexp__match(&mr2, mr.exp[0], L"%(sample (%c+) code%)"))) { + } else if ((current_paragraph) && + (Regexp__match(&mr2, mr.exp[0], L"%(sample (%c+) code%)"))) { code_lcat_for_body = TEXT_EXTRACT_LCAT; code_pl_for_body = Languages__find_by_name(mr2.exp[0], W); extract_mode = TRUE; - } else if ((current_paragraph) && (Regexp__match(&mr2, mr.exp[0], L"%(sample code%)"))) { + } else if ((current_paragraph) && + (Regexp__match(&mr2, mr.exp[0], L"%(sample code%)"))) { code_lcat_for_body = TEXT_EXTRACT_LCAT; code_pl_for_body = S->sect_language; extract_mode = TRUE; + } else if ((current_paragraph) && + (Regexp__match(&mr2, mr.exp[0], L"%(text from (%c+) as (%c+)%)"))) { + code_pl_for_body = Languages__find_by_name(mr2.exp[1], W); + +{ +#line 424 "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[0]); + linked_list *lines = Painter__lines(F); + text_stream *T; + source_line *latest = L; + LOOP_OVER_LINKED_LIST(T, text_stream, lines) { + source_line *TL = Lines__new_source_line(T, &(L->source)); + TL->next_line = latest->next_line; + TL->plainer = L->plainer; + latest->next_line = TL; + latest = TL; + } + source_line *EEL = Lines__new_source_line(TL_IS_122, &(L->source)); + EEL->next_line = latest->next_line; + latest->next_line = EEL; + code_lcat_for_body = TEXT_EXTRACT_LCAT; + extract_mode = TRUE; + +} +#line 403 "inweb/Chapter 2/The Parser.w" +; + } else if ((current_paragraph) && + (Regexp__match(&mr2, mr.exp[0], L"%(text from (%c+)%)"))) { + code_pl_for_body = NULL; + +{ +#line 424 "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[0]); + linked_list *lines = Painter__lines(F); + text_stream *T; + source_line *latest = L; + LOOP_OVER_LINKED_LIST(T, text_stream, lines) { + source_line *TL = Lines__new_source_line(T, &(L->source)); + TL->next_line = latest->next_line; + TL->plainer = L->plainer; + latest->next_line = TL; + latest = TL; + } + source_line *EEL = Lines__new_source_line(TL_IS_122, &(L->source)); + EEL->next_line = latest->next_line; + latest->next_line = EEL; + code_lcat_for_body = TEXT_EXTRACT_LCAT; + extract_mode = TRUE; + +} +#line 407 "inweb/Chapter 2/The Parser.w" +; + } else if ((current_paragraph) && + (Regexp__match(&mr2, mr.exp[0], L"%(undisplayed text from (%c+)%)"))) { + code_pl_for_body = NULL; + L->plainer = TRUE; + +{ +#line 424 "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[0]); + linked_list *lines = Painter__lines(F); + text_stream *T; + source_line *latest = L; + LOOP_OVER_LINKED_LIST(T, text_stream, lines) { + source_line *TL = Lines__new_source_line(T, &(L->source)); + TL->next_line = latest->next_line; + TL->plainer = L->plainer; + latest->next_line = TL; + latest = TL; + } + source_line *EEL = Lines__new_source_line(TL_IS_122, &(L->source)); + EEL->next_line = latest->next_line; + latest->next_line = EEL; + code_lcat_for_body = TEXT_EXTRACT_LCAT; + extract_mode = TRUE; + +} +#line 412 "inweb/Chapter 2/The Parser.w" +; } else { Main__error_in_web(TL_IS_120, L); } @@ -14769,12 +14892,12 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { } { -#line 415 "inweb/Chapter 2/The Parser.w" +#line 450 "inweb/Chapter 2/The Parser.w" extract_mode = FALSE; if (Str__eq_wide_string(command_text, L"Purpose:")) { -#line 463 "inweb/Chapter 2/The Parser.w" - if (before_bar == FALSE) Main__error_in_web(TL_IS_123, L); +#line 498 "inweb/Chapter 2/The Parser.w" + if (before_bar == FALSE) Main__error_in_web(TL_IS_124, L); if (S->md->using_syntax >= V2_SYNTAX) Parser__wrong_version(S->md->using_syntax, L, "'@Purpose'", V1_SYNTAX); L->category = PURPOSE_LCAT; @@ -14783,14 +14906,14 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { S->sect_purpose = Parser__extract_purpose(remainder, L->next_line, L->owning_section, &L); } -#line 416 "inweb/Chapter 2/The Parser.w" +#line 451 "inweb/Chapter 2/The Parser.w" else if (Str__eq_wide_string(command_text, L"Interface:")) { -#line 472 "inweb/Chapter 2/The Parser.w" +#line 507 "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_124, L); + if (before_bar == FALSE) Main__error_in_web(TL_IS_125, L); L->category = INTERFACE_LCAT; L->is_commentary = TRUE; source_line *XL = L->next_line; @@ -14802,28 +14925,28 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { } } -#line 417 "inweb/Chapter 2/The Parser.w" +#line 452 "inweb/Chapter 2/The Parser.w" else if (Str__eq_wide_string(command_text, L"Definitions:")) { -#line 486 "inweb/Chapter 2/The Parser.w" +#line 521 "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_125, L); + if (before_bar == FALSE) Main__error_in_web(TL_IS_126, L); L->category = DEFINITIONS_LCAT; L->is_commentary = TRUE; before_bar = TRUE; next_par_number = 1; } -#line 418 "inweb/Chapter 2/The Parser.w" +#line 453 "inweb/Chapter 2/The Parser.w" else if (Regexp__match(&mr, command_text, L"----+")) { -#line 498 "inweb/Chapter 2/The Parser.w" +#line 533 "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_126, L); + if (before_bar == FALSE) Main__error_in_web(TL_IS_127, L); L->category = BAR_LCAT; L->is_commentary = TRUE; comment_mode = TRUE; @@ -14832,14 +14955,14 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { next_par_number = 1; } -#line 419 "inweb/Chapter 2/The Parser.w" +#line 454 "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 515 "inweb/Chapter 2/The Parser.w" +#line 550 "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; @@ -14851,11 +14974,11 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { comment_mode = FALSE; } -#line 423 "inweb/Chapter 2/The Parser.w" +#line 458 "inweb/Chapter 2/The Parser.w" else if (Str__eq_wide_string(command_text, L"d")) { -#line 529 "inweb/Chapter 2/The Parser.w" +#line 564 "inweb/Chapter 2/The Parser.w" L->category = BEGIN_DEFINITION_LCAT; code_lcat_for_body = CONT_DEFINITION_LCAT; code_pl_for_body = NULL; @@ -14873,14 +14996,14 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { Regexp__dispose_of(&mr); } -#line 424 "inweb/Chapter 2/The Parser.w" +#line 459 "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 529 "inweb/Chapter 2/The Parser.w" +#line 564 "inweb/Chapter 2/The Parser.w" L->category = BEGIN_DEFINITION_LCAT; code_lcat_for_body = CONT_DEFINITION_LCAT; code_pl_for_body = NULL; @@ -14898,7 +15021,7 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { Regexp__dispose_of(&mr); } -#line 428 "inweb/Chapter 2/The Parser.w" +#line 463 "inweb/Chapter 2/The Parser.w" ; } else if (Str__eq_wide_string(command_text, L"default")) { if (S->md->using_syntax < V2_SYNTAX) @@ -14906,7 +15029,7 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { L->default_defn = TRUE; { -#line 529 "inweb/Chapter 2/The Parser.w" +#line 564 "inweb/Chapter 2/The Parser.w" L->category = BEGIN_DEFINITION_LCAT; code_lcat_for_body = CONT_DEFINITION_LCAT; code_pl_for_body = NULL; @@ -14924,11 +15047,11 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { Regexp__dispose_of(&mr); } -#line 433 "inweb/Chapter 2/The Parser.w" +#line 468 "inweb/Chapter 2/The Parser.w" ; } else if (Str__eq_wide_string(command_text, L"enum")) { -#line 549 "inweb/Chapter 2/The Parser.w" +#line 584 "inweb/Chapter 2/The Parser.w" L->category = BEGIN_DEFINITION_LCAT; text_stream *from = NULL; match_results mr = Regexp__create_mr(); @@ -14946,7 +15069,7 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { 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_127, L); + Main__error_in_web(TL_IS_128, L); } L->text_operand2 = Str__new(); if (inweb_mode == TANGLE_MODE) @@ -14957,12 +15080,12 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { Regexp__dispose_of(&mr); } -#line 434 "inweb/Chapter 2/The Parser.w" +#line 469 "inweb/Chapter 2/The Parser.w" else if ((Str__eq_wide_string(command_text, L"e")) && (S->md->using_syntax >= V2_SYNTAX)) { -#line 549 "inweb/Chapter 2/The Parser.w" +#line 584 "inweb/Chapter 2/The Parser.w" L->category = BEGIN_DEFINITION_LCAT; text_stream *from = NULL; match_results mr = Regexp__create_mr(); @@ -14980,7 +15103,7 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { 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_127, L); + Main__error_in_web(TL_IS_128, L); } L->text_operand2 = Str__new(); if (inweb_mode == TANGLE_MODE) @@ -14991,7 +15114,7 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { Regexp__dispose_of(&mr); } -#line 436 "inweb/Chapter 2/The Parser.w" +#line 471 "inweb/Chapter 2/The Parser.w" else { int weight = -1, new_page = FALSE; @@ -15013,7 +15136,7 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { } if (weight >= 0) { -#line 601 "inweb/Chapter 2/The Parser.w" +#line 636 "inweb/Chapter 2/The Parser.w" comment_mode = TRUE; L->is_commentary = TRUE; L->category = PARAGRAPH_START_LCAT; @@ -15032,7 +15155,7 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { } { -#line 648 "inweb/Chapter 2/The Parser.w" +#line 683 "inweb/Chapter 2/The Parser.w" paragraph *P = CREATE(paragraph); if (S->md->using_syntax > V1_SYNTAX) { P->above_bar = FALSE; @@ -15044,9 +15167,9 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { P->placed_very_early = FALSE; } if ((S->md->using_syntax == V1_SYNTAX) && (before_bar)) - P->ornament = Str__duplicate(TL_IS_128); - else P->ornament = Str__duplicate(TL_IS_129); + else + P->ornament = Str__duplicate(TL_IS_130); WRITE_TO(P->paragraph_number, "%d", next_par_number++); P->parent_paragraph = NULL; P->next_child_number = 1; @@ -15065,7 +15188,7 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { current_paragraph = P; } -#line 617 "inweb/Chapter 2/The Parser.w" +#line 652 "inweb/Chapter 2/The Parser.w" ; L->owning_paragraph = current_paragraph; @@ -15073,9 +15196,9 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { Regexp__dispose_of(&mr); } -#line 455 "inweb/Chapter 2/The Parser.w" +#line 490 "inweb/Chapter 2/The Parser.w" - else Main__error_in_web(TL_IS_122, L); + else Main__error_in_web(TL_IS_123, L); } } @@ -15091,7 +15214,7 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { ; if (comment_mode) { -#line 682 "inweb/Chapter 2/The Parser.w" +#line 717 "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; @@ -15104,7 +15227,7 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { ; if (comment_mode == FALSE) { -#line 694 "inweb/Chapter 2/The Parser.w" +#line 729 "inweb/Chapter 2/The Parser.w" if ((L->category != BEGIN_DEFINITION_LCAT) && (L->category != COMMAND_LCAT)) { L->category = code_lcat_for_body; if (L->category == TEXT_EXTRACT_LCAT) L->colour_as = code_pl_for_body; @@ -15162,9 +15285,9 @@ void Parser__parse_web(web *W, int inweb_mode, int sequential) { LanguageMethods__further_parsing(W, W->main_language); } -#line 646 "inweb/Chapter 2/The Parser.w" +#line 681 "inweb/Chapter 2/The Parser.w" -#line 713 "inweb/Chapter 2/The Parser.w" +#line 748 "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) && @@ -15180,7 +15303,7 @@ text_stream *Parser__extract_purpose(text_stream *prologue, source_line *XL, sec return P; } -#line 734 "inweb/Chapter 2/The Parser.w" +#line 769 "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)", @@ -15225,10 +15348,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_130, 6)) { + if (Str__prefix_eq(name, TL_IS_131, 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_131, 7)) { + } else if (Str__prefix_eq(name, TL_IS_132, 7)) { Str__substr(tag->ifdef_symbol, Str__at(name, 7), Str__end(name)); tag->ifdef_positive = FALSE; } @@ -15322,20 +15445,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_133); - } else { Formats__text(OUT, wv, TL_IS_134); + } else { + Formats__text(OUT, wv, TL_IS_135); } } else { - Formats__text(OUT, wv, TL_IS_135); + Formats__text(OUT, wv, TL_IS_136); } Formats__text(OUT, wv, pt->the_tag->ifdef_symbol); } if (c > 0) { - if (c == 1) Formats__text(OUT, wv, TL_IS_136); - else Formats__text(OUT, wv, TL_IS_137); - if (sense) Formats__text(OUT, wv, TL_IS_138); - else Formats__text(OUT, wv, TL_IS_139); + if (c == 1) Formats__text(OUT, wv, TL_IS_137); + else Formats__text(OUT, wv, TL_IS_138); + if (sense) Formats__text(OUT, wv, TL_IS_139); + else Formats__text(OUT, wv, TL_IS_140); } } @@ -15353,27 +15476,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_133); - } else { Formats__text(OUT, wv, TL_IS_134); + } else { + Formats__text(OUT, wv, TL_IS_135); } } else { - Formats__text(OUT, wv, TL_IS_135); + Formats__text(OUT, wv, TL_IS_136); } Formats__text(OUT, wv, pt->the_tag->ifdef_symbol); } if (c > 0) { - if (c == 1) Formats__text(OUT, wv, TL_IS_136); - else Formats__text(OUT, wv, TL_IS_137); - if (sense) Formats__text(OUT, wv, TL_IS_138); - else Formats__text(OUT, wv, TL_IS_139); + if (c == 1) Formats__text(OUT, wv, TL_IS_137); + else Formats__text(OUT, wv, TL_IS_138); + if (sense) Formats__text(OUT, wv, TL_IS_139); + else Formats__text(OUT, wv, TL_IS_140); } } #line 139 "inweb/Chapter 2/Tags.w" ; if (d > 0) { - Formats__text(OUT, wv, TL_IS_132); + Formats__text(OUT, wv, TL_IS_133); Formats__endnote(OUT, wv, 2); } } @@ -15399,7 +15522,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_140, L); + Main__error_in_web(TL_IS_141, L); WRITE_TO(pf, "BOGUS"); } Regexp__dispose_of(&mr); @@ -15415,7 +15538,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_141, L); + } else Main__error_in_web(TL_IS_142, L); } #line 45 "inweb/Chapter 2/Enumerated Constants.w" @@ -15423,7 +15546,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_142, L); + if (es) Main__error_in_web(TL_IS_143, L); else { es = CREATE(enumeration_set); es->postfix = Str__duplicate(pf); @@ -15714,7 +15837,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_143, L); + Main__error_in_web(TL_IS_144, L); } #line 110 "inweb/Chapter 3/The Analyser.w" @@ -15895,16 +16018,16 @@ void Analyser__analyse_find(web *W, source_line *L, text_stream *identifier, int #line 362 "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_144); + filename *prototype = Filenames__in_folder(W->md->path_to_web, TL_IS_145); if (!(TextFiles__exists(prototype))) - prototype = Filenames__in_folder(path_to_inweb_materials, TL_IS_145); + prototype = Filenames__in_folder(path_to_inweb_materials, TL_IS_146); 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_146); + filename *prototype = Filenames__in_folder(W->md->path_to_web, TL_IS_147); if (!(TextFiles__exists(prototype))) - prototype = Filenames__in_folder(path_to_inweb_materials, TL_IS_147); + prototype = Filenames__in_folder(path_to_inweb_materials, TL_IS_148); Git__write_gitignore(W, prototype, F); } @@ -15962,7 +16085,7 @@ weave_target *Swarm__weave_subset(web *W, text_stream *range, int open_afterward wt->navigation = navigation; wt->breadcrumbs = breadcrumbs; if (Reader__web_has_one_section(W)) wt->self_contained = TRUE; - Str__copy(wt->cover_sheet_to_use, TL_IS_148); + Str__copy(wt->cover_sheet_to_use, TL_IS_149); TEMPORARY_TEXT(leafname); @@ -16050,14 +16173,14 @@ weave_target *Swarm__weave_subset(web *W, text_stream *range, int open_afterward #line 172 "inweb/Chapter 3/The Swarm.w" void Swarm__weave_index_templates(web *W, text_stream *range, weave_pattern *pattern, int self_contained, pathname *into, filename *F, linked_list *crumbs, int docs) { - if (!(Bibliographic__data_exists(W->md, TL_IS_149))) - Bibliographic__set_datum(W->md, TL_IS_150, TL_IS_151); + if (!(Bibliographic__data_exists(W->md, TL_IS_150))) + Bibliographic__set_datum(W->md, TL_IS_151, TL_IS_152); text_stream *index_leaf = NULL; - if (W->md->chaptered) index_leaf = TL_IS_152; - else index_leaf = TL_IS_153; + if (W->md->chaptered) index_leaf = TL_IS_153; + else index_leaf = TL_IS_154; filename *OUT = Patterns__obtain_filename(pattern, index_leaf); - if (OUT == NULL) OUT = Patterns__obtain_filename(pattern, TL_IS_154); - if (OUT) Indexer__run(W, range, OUT, TL_IS_155, NULL, pattern, into, F, crumbs, docs); + if (OUT == NULL) OUT = Patterns__obtain_filename(pattern, TL_IS_155); + if (OUT) Indexer__run(W, range, OUT, TL_IS_156, NULL, pattern, into, F, crumbs, docs); if (self_contained == FALSE) Patterns__copy_payloads_into_weave(W, pattern); } @@ -16125,7 +16248,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_156, state->target, + TL_IS_157, state->target, (state->halves & (WEAVE_FIRST_HALF + WEAVE_SECOND_HALF))); state->target->pattern = saved; } else { @@ -16197,11 +16320,11 @@ void Indexer__nav_column(OUTPUT_STREAM, pathname *P, web *W, text_stream *range, Errors__fatal_with_file("unable to find navigation file", nav); } else { if (pattern->hierarchical) { - filename *F = Filenames__in_folder(Pathnames__up(P), TL_IS_157); + filename *F = Filenames__in_folder(Pathnames__up(P), TL_IS_158); if (TextFiles__exists(F)) Indexer__run(W, range, F, NULL, OUT, pattern, P, NULL, NULL, FALSE); } - filename *F = Filenames__in_folder(P, TL_IS_158); + filename *F = Filenames__in_folder(P, TL_IS_159); if (TextFiles__exists(F)) Indexer__run(W, range, F, NULL, OUT, pattern, P, NULL, NULL, FALSE); } @@ -16253,7 +16376,7 @@ void Indexer__run(web *W, text_stream *range, 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_159, TL_IS_160); + Epub__note_page(W->as_ebook, Contents, TL_IS_160, TL_IS_161); PRINT("[Index file: %f]\n", Contents); } @@ -16613,7 +16736,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_161); + Readme__write_var(OUT, url, TL_IS_162); DISCARD_TEXT(url); WRITE("

  • "); } @@ -16657,8 +16780,8 @@ int Weaver__weave_source(web *W, weave_target *wv) { { #line 43 "inweb/Chapter 3/The Weaver.w" - if (!(Bibliographic__data_exists(W->md, TL_IS_162))) - Bibliographic__set_datum(W->md, TL_IS_163, wv->booklet_title); + if (!(Bibliographic__data_exists(W->md, TL_IS_163))) + Bibliographic__set_datum(W->md, TL_IS_164, wv->booklet_title); Indexer__cover_sheet_maker(OUT, W, wv->cover_sheet_to_use, wv, WEAVE_FIRST_HALF); } @@ -16718,6 +16841,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { if (L->category == END_EXTRACT_LCAT) continue; if (L->category == BEGIN_CODE_LCAT) { state->line_break_pending = FALSE; + LanguageMethods__reset_syntax_colouring(S->sect_language); continue; } @@ -16726,13 +16850,13 @@ int Weaver__weave_source(web *W, weave_target *wv) { ; { -#line 162 "inweb/Chapter 3/The Weaver.w" +#line 163 "inweb/Chapter 3/The Weaver.w" if (L->category == COMMAND_LCAT) { if (L->command_code == PAGEBREAK_CMD) Formats__pagebreak(OUT, wv); if (L->command_code == GRAMMAR_INDEX_CMD) InCSupport__weave_grammar_index(OUT); if (L->command_code == FIGURE_CMD) { -#line 171 "inweb/Chapter 3/The Weaver.w" +#line 172 "inweb/Chapter 3/The Weaver.w" text_stream *figname = L->text_operand; match_results mr = Regexp__create_mr(); if (Regexp__match(&mr, figname, L"(%d+)cm: (%c+)")) { @@ -16758,7 +16882,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { Regexp__dispose_of(&mr); } -#line 165 "inweb/Chapter 3/The Weaver.w" +#line 166 "inweb/Chapter 3/The Weaver.w" ; /* Otherwise assume it was a tangler command, and ignore it here */ continue; @@ -16771,7 +16895,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { /* Some of the more baroque front matter of a section... */ { -#line 201 "inweb/Chapter 3/The Weaver.w" +#line 202 "inweb/Chapter 3/The Weaver.w" if (L->category == PURPOSE_LCAT) { Formats__subheading(OUT, wv, 2, S->sect_purpose, NULL); Weaver__weave_table_of_contents(OUT, wv, S); @@ -16783,7 +16907,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { ; { -#line 210 "inweb/Chapter 3/The Weaver.w" +#line 211 "inweb/Chapter 3/The Weaver.w" if ((state->show_section_toc_soon == 1) && (Regexp__string_is_white_space(L->text))) { state->show_section_toc_soon = FALSE; if (Weaver__weave_table_of_contents(OUT, wv, S)) @@ -16797,7 +16921,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { ; { -#line 222 "inweb/Chapter 3/The Weaver.w" +#line 223 "inweb/Chapter 3/The Weaver.w" if (L->category == INTERFACE_LCAT) { state->horizontal_rule_just_drawn = FALSE; continue; @@ -16808,9 +16932,9 @@ int Weaver__weave_source(web *W, weave_target *wv) { ; { -#line 230 "inweb/Chapter 3/The Weaver.w" +#line 231 "inweb/Chapter 3/The Weaver.w" if (L->category == DEFINITIONS_LCAT) { - Formats__subheading(OUT, wv, 2, TL_IS_166, NULL); + Formats__subheading(OUT, wv, 2, TL_IS_167, NULL); state->next_heading_without_vertical_skip = TRUE; state->horizontal_rule_just_drawn = FALSE; continue; @@ -16821,15 +16945,16 @@ int Weaver__weave_source(web *W, weave_target *wv) { ; { -#line 242 "inweb/Chapter 3/The Weaver.w" +#line 243 "inweb/Chapter 3/The Weaver.w" if (L->category == BAR_LCAT) { { -#line 647 "inweb/Chapter 3/The Weaver.w" +#line 651 "inweb/Chapter 3/The Weaver.w" int mode_now = state->kind_of_material; if (state->kind_of_material != REGULAR_MATERIAL) { state->kind_of_material = REGULAR_MATERIAL; - Formats__change_material(OUT, wv, mode_now, state->kind_of_material, TRUE); + Formats__change_material(OUT, wv, mode_now, state->kind_of_material, + TRUE, L?(L->plainer):FALSE); } if ((current_paragraph) && (current_paragraph != state->last_endnoted_para)) { state->last_endnoted_para = current_paragraph; @@ -16838,7 +16963,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { if (L) current_paragraph = L->owning_paragraph; } -#line 243 "inweb/Chapter 3/The Weaver.w" +#line 244 "inweb/Chapter 3/The Weaver.w" ; state->kind_of_material = REGULAR_MATERIAL; state->next_heading_without_vertical_skip = TRUE; @@ -16853,7 +16978,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { /* The crucial junction point between modes... */ { -#line 496 "inweb/Chapter 3/The Weaver.w" +#line 500 "inweb/Chapter 3/The Weaver.w" if ((L->category == HEADING_START_LCAT) || (L->category == PARAGRAPH_START_LCAT) || (L->category == CHAPTER_HEADING_LCAT) || @@ -16861,11 +16986,12 @@ int Weaver__weave_source(web *W, weave_target *wv) { state->in_run_of_definitions = FALSE; { -#line 647 "inweb/Chapter 3/The Weaver.w" +#line 651 "inweb/Chapter 3/The Weaver.w" int mode_now = state->kind_of_material; if (state->kind_of_material != REGULAR_MATERIAL) { state->kind_of_material = REGULAR_MATERIAL; - Formats__change_material(OUT, wv, mode_now, state->kind_of_material, TRUE); + Formats__change_material(OUT, wv, mode_now, state->kind_of_material, + TRUE, L?(L->plainer):FALSE); } if ((current_paragraph) && (current_paragraph != state->last_endnoted_para)) { state->last_endnoted_para = current_paragraph; @@ -16874,19 +17000,19 @@ int Weaver__weave_source(web *W, weave_target *wv) { if (L) current_paragraph = L->owning_paragraph; } -#line 501 "inweb/Chapter 3/The Weaver.w" +#line 505 "inweb/Chapter 3/The Weaver.w" ; if (wv->theme_match) { -#line 531 "inweb/Chapter 3/The Weaver.w" +#line 535 "inweb/Chapter 3/The Weaver.w" if ((L->owning_paragraph) && (L->owning_paragraph->starts_on_new_page)) Formats__pagebreak(OUT, wv); } -#line 503 "inweb/Chapter 3/The Weaver.w" +#line 507 "inweb/Chapter 3/The Weaver.w" ; - LanguageMethods__reset_syntax_colouring(S->sect_language); /* a precaution: limits bad colouring accidents to one para */ + LanguageMethods__reset_syntax_colouring(S->sect_language); int weight = 0; if (L->category == HEADING_START_LCAT) weight = 1; if (L->category == SECTION_HEADING_LCAT) weight = 2; @@ -16894,7 +17020,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { { -#line 544 "inweb/Chapter 3/The Weaver.w" +#line 548 "inweb/Chapter 3/The Weaver.w" if (weight == 3) { Str__copy(state->chaptermark, L->text_operand); Str__clear(state->sectionmark); @@ -16910,27 +17036,27 @@ int Weaver__weave_source(web *W, weave_target *wv) { } } -#line 510 "inweb/Chapter 3/The Weaver.w" +#line 514 "inweb/Chapter 3/The Weaver.w" ; text_stream *TeX_macro = NULL; { -#line 574 "inweb/Chapter 3/The Weaver.w" +#line 578 "inweb/Chapter 3/The Weaver.w" switch (weight) { - case 0: TeX_macro = TL_IS_173; break; - case 1: TeX_macro = TL_IS_174; break; - case 2: TeX_macro = TL_IS_175; break; - default: TeX_macro = TL_IS_176; break; + case 0: TeX_macro = TL_IS_174; break; + case 1: TeX_macro = TL_IS_175; break; + case 2: TeX_macro = TL_IS_176; break; + default: TeX_macro = TL_IS_177; break; } if (wv->theme_match) { -#line 593 "inweb/Chapter 3/The Weaver.w" +#line 597 "inweb/Chapter 3/The Weaver.w" switch (weight) { - case 0: TeX_macro = TL_IS_179; break; - case 1: TeX_macro = TL_IS_180; break; - case 2: TeX_macro = TL_IS_181; break; - default: TeX_macro = TL_IS_182; break; + case 0: TeX_macro = TL_IS_180; break; + case 1: TeX_macro = TL_IS_181; break; + case 2: TeX_macro = TL_IS_182; break; + default: TeX_macro = TL_IS_183; break; } if (weight >= 0) { weight = 0; } text_stream *cap = Tags__retrieve_caption(L->owning_paragraph, wv->theme_match); @@ -16946,24 +17072,24 @@ int Weaver__weave_source(web *W, weave_target *wv) { } } -#line 580 "inweb/Chapter 3/The Weaver.w" +#line 584 "inweb/Chapter 3/The Weaver.w" ; if ((state->next_heading_without_vertical_skip) && (weight < 2)) { state->next_heading_without_vertical_skip = FALSE; switch (weight) { - case 0: TeX_macro = TL_IS_177; break; - case 1: TeX_macro = TL_IS_178; break; + case 0: TeX_macro = TL_IS_178; break; + case 1: TeX_macro = TL_IS_179; break; } } } -#line 513 "inweb/Chapter 3/The Weaver.w" +#line 517 "inweb/Chapter 3/The Weaver.w" ; TEMPORARY_TEXT(heading_text); { -#line 613 "inweb/Chapter 3/The Weaver.w" +#line 617 "inweb/Chapter 3/The Weaver.w" if (weight == 3) { TEMPORARY_TEXT(brief_title); match_results mr = Regexp__create_mr(); @@ -16975,7 +17101,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_183)); + Str__copy(heading_text, Bibliographic__get_datum(W->md, TL_IS_184)); } else { if ((weight == 2) && (wv->pattern->number_sections) && (S->printed_number >= 0)) WRITE_TO(heading_text, "%d. ", S->printed_number); @@ -16983,7 +17109,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { } } -#line 516 "inweb/Chapter 3/The Weaver.w" +#line 520 "inweb/Chapter 3/The Weaver.w" ; Formats__paragraph_heading(OUT, wv, TeX_macro, S, L->owning_paragraph, heading_text, state->chaptermark, state->sectionmark, weight); @@ -16994,7 +17120,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { { -#line 635 "inweb/Chapter 3/The Weaver.w" +#line 639 "inweb/Chapter 3/The Weaver.w" if (Str__len(L->text_operand2) > 0) { TEMPORARY_TEXT(matter); WRITE_TO(matter, "%S\n", L->text_operand2); @@ -17004,7 +17130,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { } } -#line 524 "inweb/Chapter 3/The Weaver.w" +#line 528 "inweb/Chapter 3/The Weaver.w" ; if (weight == 3) Formats__chapter_title_page(OUT, wv, C); @@ -17019,21 +17145,21 @@ int Weaver__weave_source(web *W, weave_target *wv) { TEMPORARY_TEXT(matter); Str__copy(matter, L->text); if (L->is_commentary) { -#line 255 "inweb/Chapter 3/The Weaver.w" +#line 256 "inweb/Chapter 3/The Weaver.w" { -#line 267 "inweb/Chapter 3/The Weaver.w" +#line 268 "inweb/Chapter 3/The Weaver.w" if (L->category == SOURCE_DISPLAY_LCAT) { Formats__display_line(OUT, wv, L->text_operand); continue; } } -#line 255 "inweb/Chapter 3/The Weaver.w" +#line 256 "inweb/Chapter 3/The Weaver.w" ; { -#line 276 "inweb/Chapter 3/The Weaver.w" +#line 277 "inweb/Chapter 3/The Weaver.w" if (Regexp__string_is_white_space(matter)) { if ((L->next_line) && (L->next_line->category == COMMENT_BODY_LCAT) && (state->substantive_comment)) { @@ -17047,33 +17173,33 @@ int Weaver__weave_source(web *W, weave_target *wv) { } } -#line 256 "inweb/Chapter 3/The Weaver.w" +#line 257 "inweb/Chapter 3/The Weaver.w" ; { -#line 292 "inweb/Chapter 3/The Weaver.w" +#line 293 "inweb/Chapter 3/The Weaver.w" match_results mr = Regexp__create_mr(); if (Regexp__match(&mr, matter, L"%(...%) (%c*)")) { /* continue single */ Formats__change_material(OUT, wv, state->kind_of_material, REGULAR_MATERIAL, - state->substantive_comment); + state->substantive_comment, FALSE); state->kind_of_material = REGULAR_MATERIAL; - Formats__item(OUT, wv, 1, TL_IS_167); + Formats__item(OUT, wv, 1, TL_IS_168); 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); + state->substantive_comment, FALSE); state->kind_of_material = REGULAR_MATERIAL; - Formats__item(OUT, wv, 2, TL_IS_168); + Formats__item(OUT, wv, 2, TL_IS_169); 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, - state->substantive_comment); + state->substantive_comment, FALSE); state->kind_of_material = REGULAR_MATERIAL; Formats__item(OUT, wv, 1, mr.exp[0]); Str__copy(matter, mr.exp[1]); } else if (Regexp__match(&mr, matter, L"%(-(%i+)%) (%c*)")) { /* begin double */ Formats__change_material(OUT, wv, state->kind_of_material, REGULAR_MATERIAL, - state->substantive_comment); + state->substantive_comment, FALSE); state->kind_of_material = REGULAR_MATERIAL; Formats__item(OUT, wv, 2, mr.exp[0]); Str__copy(matter, mr.exp[1]); @@ -17081,15 +17207,16 @@ int Weaver__weave_source(web *W, weave_target *wv) { Regexp__dispose_of(&mr); } -#line 257 "inweb/Chapter 3/The Weaver.w" +#line 258 "inweb/Chapter 3/The Weaver.w" ; { -#line 324 "inweb/Chapter 3/The Weaver.w" +#line 325 "inweb/Chapter 3/The Weaver.w" match_results mr = Regexp__create_mr(); if (Regexp__match(&mr, matter, L"\t|(%c*)|(%c*?)")) { if (state->kind_of_material != CODE_MATERIAL) { - Formats__change_material(OUT, wv, state->kind_of_material, CODE_MATERIAL, TRUE); + Formats__change_material(OUT, wv, state->kind_of_material, CODE_MATERIAL, + TRUE, L->plainer); state->kind_of_material = CODE_MATERIAL; } TEMPORARY_TEXT(original); @@ -17097,19 +17224,20 @@ int Weaver__weave_source(web *W, weave_target *wv) { Str__copy(matter, mr.exp[1]); TEMPORARY_TEXT(colouring); for (int i=0; ikind_of_material != REGULAR_MATERIAL) { - Formats__change_material(OUT, wv, state->kind_of_material, REGULAR_MATERIAL, TRUE); + Formats__change_material(OUT, wv, state->kind_of_material, REGULAR_MATERIAL, + TRUE, FALSE); state->kind_of_material = REGULAR_MATERIAL; } Regexp__dispose_of(&mr); } -#line 258 "inweb/Chapter 3/The Weaver.w" +#line 259 "inweb/Chapter 3/The Weaver.w" ; state->substantive_comment = TRUE; WRITE_TO(matter, "\n"); @@ -17121,10 +17249,10 @@ int Weaver__weave_source(web *W, weave_target *wv) { else { -#line 352 "inweb/Chapter 3/The Weaver.w" +#line 355 "inweb/Chapter 3/The Weaver.w" { -#line 388 "inweb/Chapter 3/The Weaver.w" +#line 392 "inweb/Chapter 3/The Weaver.w" int mode_now = state->kind_of_material; if (state->kind_of_material != CODE_MATERIAL) { if (L->category == MACRO_DEFINITION_LCAT) @@ -17139,16 +17267,16 @@ int Weaver__weave_source(web *W, weave_target *wv) { else state->kind_of_material = CODE_MATERIAL; Formats__change_material(OUT, wv, mode_now, state->kind_of_material, - state->substantive_comment); + state->substantive_comment, L->plainer); state->line_break_pending = FALSE; } } -#line 352 "inweb/Chapter 3/The Weaver.w" +#line 355 "inweb/Chapter 3/The Weaver.w" ; { -#line 410 "inweb/Chapter 3/The Weaver.w" +#line 414 "inweb/Chapter 3/The Weaver.w" if (state->line_break_pending) { Formats__blank_line(OUT, wv, FALSE); state->line_break_pending = FALSE; @@ -17159,13 +17287,13 @@ int Weaver__weave_source(web *W, weave_target *wv) { } } -#line 353 "inweb/Chapter 3/The Weaver.w" +#line 356 "inweb/Chapter 3/The Weaver.w" ; int tab_stops_of_indentation = 0; { -#line 423 "inweb/Chapter 3/The Weaver.w" +#line 427 "inweb/Chapter 3/The Weaver.w" int spaces_in = 0; while (Characters__is_space_or_tab(Str__get_first_char(matter))) { if (Str__get_first_char(matter) == '\t') { @@ -17182,14 +17310,14 @@ int Weaver__weave_source(web *W, weave_target *wv) { } } -#line 356 "inweb/Chapter 3/The Weaver.w" +#line 359 "inweb/Chapter 3/The Weaver.w" ; TEMPORARY_TEXT(prefatory); TEMPORARY_TEXT(concluding_comment); { -#line 443 "inweb/Chapter 3/The Weaver.w" +#line 447 "inweb/Chapter 3/The Weaver.w" TEMPORARY_TEXT(part_before_comment); TEMPORARY_TEXT(part_within_comment); programming_language *pl = S->sect_language; @@ -17203,35 +17331,36 @@ int Weaver__weave_source(web *W, weave_target *wv) { DISCARD_TEXT(part_within_comment); } -#line 360 "inweb/Chapter 3/The Weaver.w" +#line 363 "inweb/Chapter 3/The Weaver.w" ; { -#line 458 "inweb/Chapter 3/The Weaver.w" +#line 462 "inweb/Chapter 3/The Weaver.w" 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_171); + Str__copy(prefatory, TL_IS_172); 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_172); + Str__copy(prefatory, TL_IS_173); Str__copy(matter, mr.exp[0]); } Regexp__dispose_of(&mr); } -#line 361 "inweb/Chapter 3/The Weaver.w" +#line 364 "inweb/Chapter 3/The Weaver.w" ; if (LanguageMethods__weave_code_line(OUT, S->sect_language, wv, W, C, S, L, matter, concluding_comment)) continue; TEMPORARY_TEXT(colouring); - LanguageMethods__syntax_colour(OUT, S->sect_language, wv, W, C, S, L, matter, colouring); + LanguageMethods__syntax_colour(OUT, S->sect_language, wv, W, C, S, L, + matter, colouring); int found = 0; { -#line 469 "inweb/Chapter 3/The Weaver.w" +#line 473 "inweb/Chapter 3/The Weaver.w" match_results mr = Regexp__create_mr(); while (Regexp__match(&mr, matter, L"(%c*?)%@%<(%c*?)%@%>(%c*)")) { para_macro *pmac = Macros__find_by_name(mr.exp[1], S); @@ -17257,7 +17386,7 @@ int Weaver__weave_source(web *W, weave_target *wv) { Regexp__dispose_of(&mr); } -#line 370 "inweb/Chapter 3/The Weaver.w" +#line 374 "inweb/Chapter 3/The Weaver.w" ; if (Str__len(prefatory) > 0) { state->in_run_of_definitions = TRUE; @@ -17285,11 +17414,12 @@ int Weaver__weave_source(web *W, weave_target *wv) { source_line *L = NULL; { -#line 647 "inweb/Chapter 3/The Weaver.w" +#line 651 "inweb/Chapter 3/The Weaver.w" int mode_now = state->kind_of_material; if (state->kind_of_material != REGULAR_MATERIAL) { state->kind_of_material = REGULAR_MATERIAL; - Formats__change_material(OUT, wv, mode_now, state->kind_of_material, TRUE); + Formats__change_material(OUT, wv, mode_now, state->kind_of_material, + TRUE, L?(L->plainer):FALSE); } if ((current_paragraph) && (current_paragraph != state->last_endnoted_para)) { state->last_endnoted_para = current_paragraph; @@ -17314,8 +17444,8 @@ int Weaver__weave_source(web *W, weave_target *wv) { { #line 65 "inweb/Chapter 3/The Weaver.w" - if (!(Bibliographic__data_exists(W->md, TL_IS_164))) - Bibliographic__set_datum(W->md, TL_IS_165, wv->booklet_title); + if (!(Bibliographic__data_exists(W->md, TL_IS_165))) + Bibliographic__set_datum(W->md, TL_IS_166, wv->booklet_title); Indexer__cover_sheet_maker(OUT, W, wv->cover_sheet_to_use, wv, WEAVE_SECOND_HALF); } @@ -17341,38 +17471,38 @@ int Weaver__weave_source(web *W, weave_target *wv) { #line 97 "inweb/Chapter 3/The Weaver.w" -#line 663 "inweb/Chapter 3/The Weaver.w" +#line 668 "inweb/Chapter 3/The Weaver.w" void Weaver__show_endnotes_on_previous_paragraph(OUTPUT_STREAM, weave_target *wv, paragraph *P) { Tags__show_endnote_on_ifdefs(OUT, wv, P); if (P->defines_macro) { -#line 676 "inweb/Chapter 3/The Weaver.w" +#line 681 "inweb/Chapter 3/The Weaver.w" Formats__endnote(OUT, wv, 1); - Formats__text(OUT, wv, TL_IS_184); + Formats__text(OUT, wv, TL_IS_185); 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_185); + if (ct == 1) Formats__text(OUT, wv, TL_IS_186); 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_186); - else Formats__text(OUT, wv, TL_IS_187); + if (k < ct-1) Formats__text(OUT, wv, TL_IS_187); + else Formats__text(OUT, wv, TL_IS_188); } else { - Formats__text(OUT, wv, TL_IS_188); + Formats__text(OUT, wv, TL_IS_189); } 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_189); break; - case 3: Formats__text(OUT, wv, TL_IS_190); break; - case 4: Formats__text(OUT, wv, TL_IS_191); break; - case 5: Formats__text(OUT, wv, TL_IS_192); break; + case 2: Formats__text(OUT, wv, TL_IS_190); break; + case 3: Formats__text(OUT, wv, TL_IS_191); break; + case 4: Formats__text(OUT, wv, TL_IS_192); break; + case 5: Formats__text(OUT, wv, TL_IS_193); break; default: { TEMPORARY_TEXT(mt); WRITE_TO(mt, " (%d times)", mu->multiplicity); @@ -17383,22 +17513,22 @@ void Weaver__show_endnotes_on_previous_paragraph(OUTPUT_STREAM, weave_target *wv } } } - Formats__text(OUT, wv, TL_IS_193); + Formats__text(OUT, wv, TL_IS_194); Formats__endnote(OUT, wv, 2); } -#line 666 "inweb/Chapter 3/The Weaver.w" +#line 671 "inweb/Chapter 3/The Weaver.w" ; function *fn; LOOP_OVER_LINKED_LIST(fn, function, P->functions) { -#line 715 "inweb/Chapter 3/The Weaver.w" +#line 720 "inweb/Chapter 3/The Weaver.w" Formats__endnote(OUT, wv, 1); hash_table_entry *hte = Analyser__find_hash_entry_for_section(fn->function_header_at->owning_section, fn->function_name, FALSE); - Formats__text(OUT, wv, TL_IS_194); + Formats__text(OUT, wv, TL_IS_195); Formats__text(OUT, wv, fn->function_name); int used_flag = FALSE; hash_table_entry_usage *hteu = NULL; @@ -17409,66 +17539,66 @@ void Weaver__show_endnotes_on_previous_paragraph(OUTPUT_STREAM, weave_target *wv (P->under_section == hteu->usage_recorded_at->under_section)) { -#line 739 "inweb/Chapter 3/The Weaver.w" - if (used_flag == FALSE) Formats__text(OUT, wv, TL_IS_198); +#line 744 "inweb/Chapter 3/The Weaver.w" + if (used_flag == FALSE) Formats__text(OUT, wv, TL_IS_199); used_flag = TRUE; section *S = hteu->usage_recorded_at->under_section; if ((S != last_cited_in) && (S != P->under_section)) { count_under = 0; if (last_cited_in) { - if (last_cited_in != P->under_section) Formats__text(OUT, wv, TL_IS_199); - else Formats__text(OUT, wv, TL_IS_200); + if (last_cited_in != P->under_section) Formats__text(OUT, wv, TL_IS_200); + else Formats__text(OUT, wv, TL_IS_201); } Formats__text(OUT, wv, hteu->usage_recorded_at->under_section->sect_range); - Formats__text(OUT, wv, TL_IS_201); + Formats__text(OUT, wv, TL_IS_202); } - if (count_under++ > 0) Formats__text(OUT, wv, TL_IS_202); + if (count_under++ > 0) Formats__text(OUT, wv, TL_IS_203); Formats__locale(OUT, wv, hteu->usage_recorded_at, NULL); last_cited_in = hteu->usage_recorded_at->under_section; } -#line 728 "inweb/Chapter 3/The Weaver.w" +#line 733 "inweb/Chapter 3/The Weaver.w" ; LOOP_OVER_LINKED_LIST(hteu, hash_table_entry_usage, hte->usages) if (P->under_section != hteu->usage_recorded_at->under_section) { -#line 739 "inweb/Chapter 3/The Weaver.w" - if (used_flag == FALSE) Formats__text(OUT, wv, TL_IS_198); +#line 744 "inweb/Chapter 3/The Weaver.w" + if (used_flag == FALSE) Formats__text(OUT, wv, TL_IS_199); used_flag = TRUE; section *S = hteu->usage_recorded_at->under_section; if ((S != last_cited_in) && (S != P->under_section)) { count_under = 0; if (last_cited_in) { - if (last_cited_in != P->under_section) Formats__text(OUT, wv, TL_IS_199); - else Formats__text(OUT, wv, TL_IS_200); + if (last_cited_in != P->under_section) Formats__text(OUT, wv, TL_IS_200); + else Formats__text(OUT, wv, TL_IS_201); } Formats__text(OUT, wv, hteu->usage_recorded_at->under_section->sect_range); - Formats__text(OUT, wv, TL_IS_201); + Formats__text(OUT, wv, TL_IS_202); } - if (count_under++ > 0) Formats__text(OUT, wv, TL_IS_202); + if (count_under++ > 0) Formats__text(OUT, wv, TL_IS_203); Formats__locale(OUT, wv, hteu->usage_recorded_at, NULL); last_cited_in = hteu->usage_recorded_at->under_section; } -#line 731 "inweb/Chapter 3/The Weaver.w" +#line 736 "inweb/Chapter 3/The Weaver.w" ; - if (used_flag == FALSE) Formats__text(OUT, wv, TL_IS_195); + if (used_flag == FALSE) Formats__text(OUT, wv, TL_IS_196); if ((last_cited_in != P->under_section) && (last_cited_in)) - Formats__text(OUT, wv, TL_IS_196); - Formats__text(OUT, wv, TL_IS_197); + Formats__text(OUT, wv, TL_IS_197); + Formats__text(OUT, wv, TL_IS_198); Formats__endnote(OUT, wv, 2); } -#line 669 "inweb/Chapter 3/The Weaver.w" +#line 674 "inweb/Chapter 3/The Weaver.w" ; c_structure *st; LOOP_OVER_LINKED_LIST(st, c_structure, P->structures) { -#line 756 "inweb/Chapter 3/The Weaver.w" +#line 761 "inweb/Chapter 3/The Weaver.w" Formats__endnote(OUT, wv, 1); - Formats__text(OUT, wv, TL_IS_203); + Formats__text(OUT, wv, TL_IS_204); Formats__text(OUT, wv, st->structure_name); section *S; @@ -17492,26 +17622,26 @@ void Weaver__show_endnotes_on_previous_paragraph(OUTPUT_STREAM, weave_target *wv usage_count++; if (S != P->under_section) external++; } - if (external == 0) Formats__text(OUT, wv, TL_IS_204); + if (external == 0) Formats__text(OUT, wv, TL_IS_205); else { - Formats__text(OUT, wv, TL_IS_205); + Formats__text(OUT, wv, TL_IS_206); int c = 0; LOOP_OVER(S, section) if ((S->scratch_flag) && (S != P->under_section)) { - if (c++ > 0) Formats__text(OUT, wv, TL_IS_206); + if (c++ > 0) Formats__text(OUT, wv, TL_IS_207); Formats__text(OUT, wv, S->sect_range); } - if (P->under_section->scratch_flag) Formats__text(OUT, wv, TL_IS_207); + if (P->under_section->scratch_flag) Formats__text(OUT, wv, TL_IS_208); } - Formats__text(OUT, wv, TL_IS_208); + Formats__text(OUT, wv, TL_IS_209); Formats__endnote(OUT, wv, 2); } -#line 672 "inweb/Chapter 3/The Weaver.w" +#line 677 "inweb/Chapter 3/The Weaver.w" ; } -#line 800 "inweb/Chapter 3/The Weaver.w" +#line 805 "inweb/Chapter 3/The Weaver.w" int Weaver__weave_table_of_contents(OUTPUT_STREAM, weave_target *wv, section *S) { int noteworthy = 0; paragraph *P; @@ -17520,18 +17650,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->sect_range, TL_IS_209, NULL); + Formats__toc(OUT, wv, 1, S->sect_range, TL_IS_210, 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_210, TL_IS_211, NULL); + if (noteworthy > 0) Formats__toc(OUT, wv, 2, TL_IS_211, TL_IS_212, 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_212, TL_IS_213, NULL); + Formats__toc(OUT, wv, 4, TL_IS_213, TL_IS_214, NULL); return TRUE; } @@ -17568,7 +17698,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_214, L); + if (L->owning_paragraph == NULL) Main__error_in_web(TL_IS_215, L); else Tags__open_ifdefs(OUT, L->owning_paragraph); LanguageMethods__start_definition(OUT, lang, L->text_operand, @@ -17590,7 +17720,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_214, L); + if (L->owning_paragraph == NULL) Main__error_in_web(TL_IS_215, L); else Tags__open_ifdefs(OUT, L->owning_paragraph); LanguageMethods__start_definition(OUT, lang, L->text_operand, @@ -17711,7 +17841,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_215, L); + Main__error_in_web(TL_IS_216, L); WRITE_TO(STDERR, "Macro is '%S'\n", temp); LanguageMethods__comment(OUT, lang, temp); /* recover by putting macro name in comment */ } @@ -17780,7 +17910,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_216); + pathname *P = Pathnames__subfolder(W->md->path_to_web, TL_IS_217); { #line 39 "inweb/Chapter 4/Programming Languages.w" @@ -17827,7 +17957,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_217, W); + return Languages__find_by_name(TL_IS_218, W); } void Languages__show(OUTPUT_STREAM) { @@ -17853,7 +17983,7 @@ void Languages__read_definitions(pathname *P) { } pathname *Languages__default_directory(void) { - return Pathnames__subfolder(path_to_inweb, TL_IS_218); + return Pathnames__subfolder(path_to_inweb, TL_IS_219); } #line 125 "inweb/Chapter 4/Programming Languages.w" @@ -17911,7 +18041,7 @@ programming_language *Languages__read_definition(filename *F) { { #line 194 "inweb/Chapter 4/Programming Languages.w" if (pl->C_like) CLike__make_c_like(pl); - if (Str__eq(pl->language_name, TL_IS_219)) InCSupport__add_features(pl); + if (Str__eq(pl->language_name, TL_IS_220)) InCSupport__add_features(pl); ACMESupport__add_fallbacks(pl); } @@ -17933,7 +18063,7 @@ void Languages__read_definition_line(text_stream *line, text_file_position *tfp, if (state->current_block) { #line 298 "inweb/Chapter 4/Programming Languages.w" - if (Str__eq(line, TL_IS_249)) { + if (Str__eq(line, TL_IS_250)) { state->current_block = state->current_block->parent; } else if (Regexp__match(&mr, line, L"characters {")) { colouring_rule *rule = Languages__new_rule(state->current_block); @@ -17949,7 +18079,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_250)) r = Languages__colour(mr.exp[0], tfp); + if (Str__ne(mr.exp[0], TL_IS_251)) 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+) {")) { @@ -18004,62 +18134,62 @@ 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_220)) pl->language_name = Languages__text(value, tfp, TRUE); - else if (Str__eq(key, TL_IS_221)) - pl->language_details = Languages__text(value, tfp, TRUE); + if (Str__eq(key, TL_IS_221)) pl->language_name = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_222)) - pl->file_extension = Languages__text(value, tfp, TRUE); + pl->language_details = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_223)) - pl->line_comment = Languages__text(value, tfp, TRUE); + pl->file_extension = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_224)) - pl->whole_line_comment = Languages__text(value, tfp, TRUE); + pl->line_comment = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_225)) - 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_226)) - 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_227)) - pl->string_literal = Languages__text(value, tfp, TRUE); + pl->multiline_comment_close = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_228)) - pl->string_literal_escape = Languages__text(value, tfp, TRUE); + pl->string_literal = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_229)) - pl->character_literal = Languages__text(value, tfp, TRUE); + pl->string_literal_escape = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_230)) - pl->character_literal_escape = Languages__text(value, tfp, TRUE); + pl->character_literal = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_231)) - 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_232)) - 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_233)) - 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_234)) - 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_235)) - pl->shebang = Languages__text(value, tfp, TRUE); + pl->negative_literal_prefix = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_236)) - pl->line_marker = Languages__text(value, tfp, TRUE); + pl->shebang = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_237)) - pl->before_macro_expansion = Languages__text(value, tfp, TRUE); + pl->line_marker = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_238)) - 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_239)) - pl->start_definition = Languages__text(value, tfp, TRUE); + pl->after_macro_expansion = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_240)) - pl->prolong_definition = Languages__text(value, tfp, TRUE); + pl->start_definition = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_241)) - pl->end_definition = Languages__text(value, tfp, TRUE); + pl->prolong_definition = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_242)) - pl->start_ifdef = Languages__text(value, tfp, TRUE); + pl->end_definition = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_243)) - pl->start_ifndef = Languages__text(value, tfp, TRUE); + pl->start_ifdef = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_244)) - pl->end_ifdef = Languages__text(value, tfp, TRUE); + pl->start_ifndef = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_245)) - pl->end_ifndef = Languages__text(value, tfp, TRUE); + pl->end_ifdef = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_246)) - pl->C_like = Languages__boolean(value, tfp); + pl->end_ifndef = Languages__text(value, tfp, TRUE); else if (Str__eq(key, TL_IS_247)) - pl->suppress_disclaimer = Languages__boolean(value, tfp); + pl->C_like = Languages__boolean(value, tfp); else if (Str__eq(key, TL_IS_248)) + pl->suppress_disclaimer = Languages__boolean(value, tfp); + else if (Str__eq(key, TL_IS_249)) pl->supports_namespaces = Languages__boolean(value, tfp); else { Errors__in_text_file("unknown property name before ':'", tfp); @@ -18089,9 +18219,9 @@ colouring_language_block *Languages__new_block(colouring_language_block *within, return block; } -#line 430 "inweb/Chapter 4/Programming Languages.w" +#line 431 "inweb/Chapter 4/Programming Languages.w" -#line 432 "inweb/Chapter 4/Programming Languages.w" +#line 433 "inweb/Chapter 4/Programming Languages.w" colouring_rule *Languages__new_rule(colouring_language_block *within) { if (within == NULL) internal_error("rule outside block"); colouring_rule *rule = CREATE(colouring_rule); @@ -18103,6 +18233,7 @@ colouring_rule *Languages__new_rule(colouring_language_block *within) { rule->match_keyword_of_colour = NOT_A_COLOUR; rule->match_regexp_text[0] = 0; rule->number = 0; + rule->number_of = 0; rule->set_to_colour = NOT_A_COLOUR; rule->set_prefix_to_colour = NOT_A_COLOUR; @@ -18114,7 +18245,7 @@ colouring_rule *Languages__new_rule(colouring_language_block *within) { return rule; } -#line 455 "inweb/Chapter 4/Programming Languages.w" +#line 457 "inweb/Chapter 4/Programming Languages.w" void Languages__parse_rule(language_reader_state *state, text_stream *premiss, text_stream *action, text_file_position *tfp) { match_results mr = Regexp__create_mr(); @@ -18122,13 +18253,16 @@ void Languages__parse_rule(language_reader_state *state, text_stream *premiss, Str__trim_white_space(premiss); Str__trim_white_space(action); { -#line 466 "inweb/Chapter 4/Programming Languages.w" +#line 468 "inweb/Chapter 4/Programming Languages.w" while (Regexp__match(&mr, premiss, L"not (%c+)")) { rule->sense = (rule->sense)?FALSE:TRUE; Str__clear(premiss); Str__copy(premiss, mr.exp[0]); } if (Regexp__match(&mr, premiss, L"number (%d+)")) { rule->number = Str__atoi(mr.exp[0], 0); + } else if (Regexp__match(&mr, premiss, L"number (%d+) of (%d+)")) { + rule->number = Str__atoi(mr.exp[0], 0); + rule->number_of = Str__atoi(mr.exp[1], 0); } else if (Regexp__match(&mr, premiss, L"keyword of (%c+)")) { rule->match_keyword_of_colour = Languages__colour(mr.exp[0], tfp); } else if (Regexp__match(&mr, premiss, L"keyword")) { @@ -18160,12 +18294,12 @@ void Languages__parse_rule(language_reader_state *state, text_stream *premiss, } } -#line 460 "inweb/Chapter 4/Programming Languages.w" +#line 462 "inweb/Chapter 4/Programming Languages.w" ; { -#line 503 "inweb/Chapter 4/Programming Languages.w" - if (Str__eq(action, TL_IS_251)) { +#line 508 "inweb/Chapter 4/Programming Languages.w" + if (Str__eq(action, TL_IS_252)) { rule->execute_block = Languages__new_block(state->current_block, WHOLE_LINE_CRULE_RUN); state->current_block = rule->execute_block; @@ -18178,19 +18312,19 @@ 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_252)) { + } else if (Str__eq(action, TL_IS_253)) { rule->debug = TRUE; } else { Errors__in_text_file("action after '=>' illegible", tfp); } } -#line 461 "inweb/Chapter 4/Programming Languages.w" +#line 463 "inweb/Chapter 4/Programming Languages.w" ; Regexp__dispose_of(&mr); } -#line 531 "inweb/Chapter 4/Programming Languages.w" +#line 536 "inweb/Chapter 4/Programming Languages.w" reserved_word *Languages__reserved(programming_language *pl, text_stream *W, int C, text_file_position *tfp) { @@ -18207,40 +18341,40 @@ reserved_word *Languages__reserved(programming_language *pl, text_stream *W, int return rw; } -#line 568 "inweb/Chapter 4/Programming Languages.w" +#line 574 "inweb/Chapter 4/Programming Languages.w" int Languages__colour(text_stream *T, text_file_position *tfp) { if (Str__get_first_char(T) != '!') { Errors__in_text_file("colour names must begin with !", tfp); return PLAIN_COLOUR; } - if (Str__eq(T, TL_IS_253)) return STRING_COLOUR; - else if (Str__eq(T, TL_IS_254)) return FUNCTION_COLOUR; - else if (Str__eq(T, TL_IS_255)) return DEFINITION_COLOUR; - else if (Str__eq(T, TL_IS_256)) return RESERVED_COLOUR; - else if (Str__eq(T, TL_IS_257)) return ELEMENT_COLOUR; - else if (Str__eq(T, TL_IS_258)) return IDENTIFIER_COLOUR; - else if (Str__eq(T, TL_IS_259)) return CHAR_LITERAL_COLOUR; - else if (Str__eq(T, TL_IS_260)) return CONSTANT_COLOUR; - else if (Str__eq(T, TL_IS_261)) return PLAIN_COLOUR; - else if (Str__eq(T, TL_IS_262)) return EXTRACT_COLOUR; - else if (Str__eq(T, TL_IS_263)) return COMMENT_COLOUR; + if (Str__eq(T, TL_IS_254)) return STRING_COLOUR; + else if (Str__eq(T, TL_IS_255)) return FUNCTION_COLOUR; + else if (Str__eq(T, TL_IS_256)) return DEFINITION_COLOUR; + else if (Str__eq(T, TL_IS_257)) return RESERVED_COLOUR; + else if (Str__eq(T, TL_IS_258)) return ELEMENT_COLOUR; + else if (Str__eq(T, TL_IS_259)) return IDENTIFIER_COLOUR; + else if (Str__eq(T, TL_IS_260)) return CHAR_LITERAL_COLOUR; + else if (Str__eq(T, TL_IS_261)) return CONSTANT_COLOUR; + else if (Str__eq(T, TL_IS_262)) return PLAIN_COLOUR; + else if (Str__eq(T, TL_IS_263)) return EXTRACT_COLOUR; + else if (Str__eq(T, TL_IS_264)) return COMMENT_COLOUR; else { Errors__in_text_file("no such !colour", tfp); return PLAIN_COLOUR; } } -#line 593 "inweb/Chapter 4/Programming Languages.w" +#line 599 "inweb/Chapter 4/Programming Languages.w" int Languages__boolean(text_stream *T, text_file_position *tfp) { - if (Str__eq(T, TL_IS_264)) return TRUE; - else if (Str__eq(T, TL_IS_265)) return FALSE; + if (Str__eq(T, TL_IS_265)) return TRUE; + else if (Str__eq(T, TL_IS_266)) return FALSE; else { Errors__in_text_file("must be true or false", tfp); return FALSE; } } -#line 607 "inweb/Chapter 4/Programming Languages.w" +#line 613 "inweb/Chapter 4/Programming Languages.w" text_stream *Languages__text(text_stream *T, text_file_position *tfp, int allow) { text_stream *V = Str__new(); if (Str__len(T) > 0) { @@ -18291,7 +18425,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_266)) rw = TRUE; if (Str__eq(V, TL_IS_267)) rw = TRUE; if (Str__eq(V, TL_IS_268)) rw = TRUE; if (Str__eq(V, TL_IS_269)) rw = TRUE; @@ -18313,6 +18446,7 @@ text_stream *Languages__text(text_stream *T, text_file_position *tfp, int allow) if (Str__eq(V, TL_IS_285)) rw = TRUE; if (Str__eq(V, TL_IS_286)) rw = TRUE; if (Str__eq(V, TL_IS_287)) rw = TRUE; + if (Str__eq(V, TL_IS_288)) rw = TRUE; if (rw) { TEMPORARY_TEXT(err); @@ -18325,7 +18459,7 @@ text_stream *Languages__text(text_stream *T, text_file_position *tfp, int allow) return V; } -#line 694 "inweb/Chapter 4/Programming Languages.w" +#line 700 "inweb/Chapter 4/Programming Languages.w" void Languages__regexp(wchar_t *write_to, text_stream *T, text_file_position *tfp) { if (write_to == NULL) internal_error("no buffer"); write_to[0] = 0; @@ -18429,7 +18563,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_288); + LanguageMethods__comment(OUT, pl, TL_IS_289); } #line 107 "inweb/Chapter 4/Language Methods.w" @@ -18452,7 +18586,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_289, L); + Main__error_in_web(TL_IS_290, L); } void LanguageMethods__prolong_definition(OUTPUT_STREAM, programming_language *pl, @@ -18460,7 +18594,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_290, L); + Main__error_in_web(TL_IS_291, L); } void LanguageMethods__end_definition(OUTPUT_STREAM, programming_language *pl, @@ -18903,16 +19037,18 @@ int ACMESupport__syntax_colour(programming_language *pl, text_stream *OUT, weave hash_table *ht = &(S->sect_target->symbols); if ((L->category == TEXT_EXTRACT_LCAT) && (pl != S->sect_language)) ht = &(pl->built_in_keywords); - return Painter__syntax_colour(pl, OUT, ht, matter, colouring, FALSE); + return Painter__syntax_colour(pl, ht, matter, colouring, FALSE); } #line 16 "inweb/Chapter 4/The Painter.w" +int painter_count = 1; void Painter__reset_syntax_colouring(programming_language *pl) { colouring_state = PLAIN_COLOUR; + painter_count = 1; } -#line 36 "inweb/Chapter 4/The Painter.w" -int Painter__syntax_colour(programming_language *pl, text_stream *OUT, +#line 38 "inweb/Chapter 4/The Painter.w" +int Painter__syntax_colour(programming_language *pl, hash_table *HT, text_stream *matter, text_stream *colouring, int with_comments) { int from = 0, to = Str__len(matter) - 1; if (with_comments) { @@ -18928,15 +19064,15 @@ int Painter__syntax_colour(programming_language *pl, text_stream *OUT, DISCARD_TEXT(part_before_comment); DISCARD_TEXT(part_within_comment); } - Painter__syntax_colour_inner(pl, OUT, HT, matter, colouring, from, to); + Painter__syntax_colour_inner(pl, HT, matter, colouring, from, to); return FALSE; } -void Painter__syntax_colour_inner(programming_language *pl, text_stream *OUT, +void Painter__syntax_colour_inner(programming_language *pl, hash_table *HT, text_stream *matter, text_stream *colouring, int from, int to) { { -#line 64 "inweb/Chapter 4/The Painter.w" +#line 66 "inweb/Chapter 4/The Painter.w" int squote = Str__get_first_char(pl->character_literal); int squote_escape = Str__get_first_char(pl->character_literal_escape); int dquote = Str__get_first_char(pl->string_literal); @@ -18980,11 +19116,11 @@ void Painter__syntax_colour_inner(programming_language *pl, text_stream *OUT, } } -#line 58 "inweb/Chapter 4/The Painter.w" +#line 60 "inweb/Chapter 4/The Painter.w" ; { -#line 107 "inweb/Chapter 4/The Painter.w" +#line 109 "inweb/Chapter 4/The Painter.w" int base = -1, dec_possible = TRUE; for (int i=from; i <= to; i++) { if ((Str__get_at(colouring, i) == PLAIN_COLOUR) || @@ -19041,20 +19177,20 @@ void Painter__syntax_colour_inner(programming_language *pl, text_stream *OUT, } } -#line 59 "inweb/Chapter 4/The Painter.w" +#line 61 "inweb/Chapter 4/The Painter.w" ; { -#line 192 "inweb/Chapter 4/The Painter.w" +#line 194 "inweb/Chapter 4/The Painter.w" if (pl->program) - Painter__execute(HT, pl->program, matter, colouring, from, to); + Painter__execute(HT, pl->program, matter, colouring, from, to, painter_count++); } -#line 60 "inweb/Chapter 4/The Painter.w" +#line 62 "inweb/Chapter 4/The Painter.w" ; } -#line 168 "inweb/Chapter 4/The Painter.w" +#line 170 "inweb/Chapter 4/The Painter.w" int Painter__identifier_at(programming_language *pl, text_stream *matter, text_stream *colouring, int i) { wchar_t c = Str__get_at(matter, i); @@ -19075,9 +19211,9 @@ int Painter__identifier_at(programming_language *pl, return FALSE; } -#line 201 "inweb/Chapter 4/The Painter.w" +#line 203 "inweb/Chapter 4/The Painter.w" void Painter__execute(hash_table *HT, colouring_language_block *block, text_stream *matter, - text_stream *colouring, int from, int to) { + text_stream *colouring, int from, int to, int N) { if (block == NULL) internal_error("no block"); TEMPORARY_TEXT(colouring_at_start); Str__copy(colouring_at_start, colouring); @@ -19085,7 +19221,8 @@ void Painter__execute(hash_table *HT, colouring_language_block *block, text_stre LOOP_OVER_LINKED_LIST(rule, colouring_rule, block->rules) { switch (block->run) { case WHOLE_LINE_CRULE_RUN: - Painter__execute_rule(HT, rule, matter, colouring, from, to, 1); + Painter__execute_rule(HT, rule, matter, colouring, from, to, + (N == 0)?1:N); break; case CHARACTERS_CRULE_RUN: for (int i=from; i<=to; i++) @@ -19153,18 +19290,22 @@ void Painter__execute(hash_table *HT, colouring_language_block *block, text_stre DISCARD_TEXT(colouring_at_start); } -#line 281 "inweb/Chapter 4/The Painter.w" +#line 284 "inweb/Chapter 4/The Painter.w" void Painter__execute_rule(hash_table *HT, colouring_rule *rule, text_stream *matter, text_stream *colouring, int from, int to, int N) { if (Painter__satisfies(HT, rule, matter, colouring, from, to, N) == rule->sense) Painter__follow(HT, rule, matter, colouring, from, to); } -#line 298 "inweb/Chapter 4/The Painter.w" +#line 301 "inweb/Chapter 4/The Painter.w" int Painter__satisfies(hash_table *HT, colouring_rule *rule, text_stream *matter, text_stream *colouring, int from, int to, int N) { if (rule->number > 0) { - if (rule->number != N) return FALSE; + if (rule->number_of > 0) { + if (rule->number != ((N-1)%(rule->number_of)) + 1) return FALSE; + } else { + if (rule->number != N) return FALSE; + } } else if (rule->match_regexp_text[0]) { if (Regexp__match(&(rule->mr), matter, rule->match_regexp_text) == FALSE) return FALSE; @@ -19215,14 +19356,14 @@ int Painter__satisfies(hash_table *HT, colouring_rule *rule, text_stream *matter return TRUE; } -#line 355 "inweb/Chapter 4/The Painter.w" +#line 362 "inweb/Chapter 4/The Painter.w" void Painter__follow(hash_table *HT, colouring_rule *rule, text_stream *matter, text_stream *colouring, int from, int to) { if (rule->execute_block) - Painter__execute(HT, rule->execute_block, matter, colouring, from, to); + Painter__execute(HT, rule->execute_block, matter, colouring, from, to, 0); else if (rule->debug) { -#line 371 "inweb/Chapter 4/The Painter.w" +#line 378 "inweb/Chapter 4/The Painter.w" PRINT("[%d, %d] text: ", from, to); for (int i=from; i<=to; i++) PUT_TO(STDOUT, Str__get_at(matter, i)); @@ -19232,7 +19373,7 @@ void Painter__follow(hash_table *HT, colouring_rule *rule, text_stream *matter, PRINT("\n"); } -#line 359 "inweb/Chapter 4/The Painter.w" +#line 366 "inweb/Chapter 4/The Painter.w" else { if (rule->set_to_colour != NOT_A_COLOUR) @@ -19244,6 +19385,61 @@ void Painter__follow(hash_table *HT, colouring_rule *rule, text_stream *matter, } } +#line 389 "inweb/Chapter 4/The Painter.w" +linked_list *Painter__lines(filename *F) { + linked_list *L = NEW_LINKED_LIST(text_stream); + TextFiles__read(F, FALSE, "unable to read file of textual extract", TRUE, + &Painter__text_file_helper, NULL, L); + int n = -1, c = 0; + text_stream *T; + LOOP_OVER_LINKED_LIST(T, text_stream, L) { + c++; + if (Str__is_whitespace(T) == FALSE) + n = c; + } + if (n >= 0) { + linked_list *R = NEW_LINKED_LIST(text_stream); + c = 0; + LOOP_OVER_LINKED_LIST(T, text_stream, L) + if (++c <= n) + ADD_TO_LINKED_LIST(T, text_stream, R); + return R; + } + return L; +} + +void Painter__text_file_helper(text_stream *text, text_file_position *tfp, void *state) { + linked_list *L = (linked_list *) state; + ADD_TO_LINKED_LIST(Str__duplicate(text), text_stream, L); +} + +void Painter__colour_file(programming_language *pl, filename *F, text_stream *to, text_stream *coloured) { + linked_list *L = Painter__lines(F); + if (pl) Painter__reset_syntax_colouring(pl); + int c = 1; + text_stream *T; + LOOP_OVER_LINKED_LIST(T, text_stream, L) { + if (c++ > 1) { PUT_TO(to, '\n'); PUT_TO(coloured, NEWLINE_COLOUR); } + Str__trim_white_space_at_end(T); + TEMPORARY_TEXT(ST); + TEMPORARY_TEXT(SC); + LOOP_THROUGH_TEXT(pos, T) + if (Str__get(pos) == '\t') + WRITE_TO(ST, " "); + else + PUT_TO(ST, Str__get(pos)); + if (pl) { + Painter__syntax_colour(pl, (pl)?(&(pl->built_in_keywords)):NULL, ST, SC, TRUE); + } else { + LOOP_THROUGH_TEXT(pos, ST) + PUT_TO(SC, PLAIN_COLOUR); + } + WRITE_TO(to, "%S", ST); + WRITE_TO(coloured, "%S", SC); + } + if (c > 0) { PUT_TO(to, '\n'); PUT_TO(coloured, NEWLINE_COLOUR); } +} + #line 9 "inweb/Chapter 4/C-Like Languages.w" void CLike__make_c_like(programming_language *pl) { METHOD_ADD(pl, FURTHER_PARSING_PAR_MTID, CLike__further_parsing); @@ -19334,7 +19530,7 @@ void CLike__further_parsing(programming_language *self, web *W) { } #line 104 "inweb/Chapter 4/C-Like Languages.w" ; - Tags__add_by_name(L->owning_paragraph, TL_IS_294); + Tags__add_by_name(L->owning_paragraph, TL_IS_295); } else if ((Str__get_first_char(L->text) == '}') && (current_str)) { current_str->typedef_ends = L; current_str = NULL; @@ -19475,14 +19671,14 @@ void CLike__further_parsing(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_292, L); + Main__error_in_web(TL_IS_293, 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_293, L); + Main__error_in_web(TL_IS_294, L); else cc_sp--; } @@ -19592,7 +19788,7 @@ void CLike__further_parsing(programming_language *self, web *W) { declared_namespace = mr.exp[0]; fn->within_namespace = TRUE; } else if ((Str__eq_wide_string(fname, L"main")) && (Str__eq_wide_string(S->sect_namespace, L"Main::"))) - declared_namespace = TL_IS_295; + declared_namespace = TL_IS_296; if ((Str__ne(declared_namespace, S->sect_namespace)) && (L->owning_paragraph->placed_very_early == FALSE)) { TEMPORARY_TEXT(err_mess); @@ -19632,7 +19828,7 @@ void CLike__further_parsing(programming_language *self, web *W) { ; } if (cc_sp > 0) - Main__error_in_web(TL_IS_291, NULL); + Main__error_in_web(TL_IS_292, NULL); } #line 132 "inweb/Chapter 4/C-Like Languages.w" @@ -19794,7 +19990,7 @@ void CLike__analyse_code(programming_language *self, web *W) { #line 665 "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_296), L"On")) check_namespaces = TRUE; + if (Str__eq_wide_string(Bibliographic__get_datum(W->md, TL_IS_297), L"On")) check_namespaces = TRUE; function *fn; LOOP_OVER(fn, function) { hash_table_entry *hte = @@ -19813,11 +20009,11 @@ void CLike__post_analysis(programming_language *self, web *W) { && (fn->call_freely == FALSE)) { if (fn->within_namespace) Main__error_in_web( - TL_IS_297, + TL_IS_298, fn->function_header_at); else Main__error_in_web( - TL_IS_298, + TL_IS_299, fn->function_header_at); } } @@ -20389,8 +20585,8 @@ preform_nonterminal *InCSupport__nonterminal_by_name(text_stream *name) { #line 770 "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_303; - if (Str__eq_wide_string(name, L"rp")) return TL_IS_304; + if (Str__eq_wide_string(name, L"r")) return TL_IS_304; + if (Str__eq_wide_string(name, L"rp")) return TL_IS_305; nonterminal_variable *ntv; LOOP_OVER(ntv, nonterminal_variable) if (Str__eq(ntv->ntv_name, name)) @@ -20402,7 +20598,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_305); + filename *Syntax = Filenames__in_folder(P, TL_IS_306); text_stream TO_struct; text_stream *OUT = &TO_struct; @@ -20413,8 +20609,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_306)) - WRITE("language %S\n", Bibliographic__get_datum(W->md, TL_IS_307)); + if (Bibliographic__data_exists(W->md, TL_IS_307)) + WRITE("language %S\n", Bibliographic__get_datum(W->md, TL_IS_308)); { @@ -20698,7 +20894,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_308, fragment, colouring, TL_IS_309, FALSE, FALSE, TRUE); + Formats__source_code(OUT, wv, 0, TL_IS_309, fragment, colouring, TL_IS_310, FALSE, FALSE, TRUE); DISCARD_TEXT(colouring); VMETHOD_CALL(wf, INLINE_CODE_FOR_MTID, OUT, wv, FALSE); } @@ -20784,16 +20980,17 @@ void Formats__after_definitions(OUTPUT_STREAM, weave_target *wv) { #line 342 "inweb/Chapter 5/Weave Formats.w" VMETHOD_TYPE(CHANGE_MATERIAL_FOR_MTID, weave_format *wf, text_stream *OUT, - weave_target *wv, int old_material, int new_material, int content) + weave_target *wv, int old_material, int new_material, int content, int plainly) void Formats__change_material(OUTPUT_STREAM, weave_target *wv, - int old_material, int new_material, int content) { + int old_material, int new_material, int content, int plainly) { weave_format *wf = wv->format; - VMETHOD_CALL(wf, CHANGE_MATERIAL_FOR_MTID, OUT, wv, old_material, new_material, content); + VMETHOD_CALL(wf, CHANGE_MATERIAL_FOR_MTID, OUT, wv, old_material, new_material, + content, plainly); } -#line 356 "inweb/Chapter 5/Weave Formats.w" +#line 357 "inweb/Chapter 5/Weave Formats.w" -#line 358 "inweb/Chapter 5/Weave Formats.w" +#line 359 "inweb/Chapter 5/Weave Formats.w" VMETHOD_TYPE(CHANGE_COLOUR_FOR_MTID, weave_format *wf, text_stream *OUT, weave_target *wv, int col, int in_code) void Formats__change_colour(OUTPUT_STREAM, weave_target *wv, int col, int in_code) { @@ -20801,7 +20998,7 @@ void Formats__change_colour(OUTPUT_STREAM, weave_target *wv, int col, int in_cod VMETHOD_CALL(wf, CHANGE_COLOUR_FOR_MTID, OUT, wv, col, in_code); } -#line 371 "inweb/Chapter 5/Weave Formats.w" +#line 372 "inweb/Chapter 5/Weave Formats.w" void Formats__text(OUTPUT_STREAM, weave_target *wv, text_stream *id) { Formats__text_r(OUT, wv, id, FALSE); } @@ -20828,9 +21025,9 @@ void Formats__text_r(OUTPUT_STREAM, weave_target *wv, text_stream *id, int withi } } -#line 405 "inweb/Chapter 5/Weave Formats.w" +#line 406 "inweb/Chapter 5/Weave Formats.w" -#line 407 "inweb/Chapter 5/Weave Formats.w" +#line 408 "inweb/Chapter 5/Weave Formats.w" IMETHOD_TYPE(PRESERVE_MATH_MODE_FOR_MTID, weave_format *wf, text_stream *matter, text_stream *id) VMETHOD_TYPE(COMMENTARY_TEXT_FOR_MTID, weave_format *wf, text_stream *OUT, @@ -20847,9 +21044,9 @@ void Formats__text_fragment(OUTPUT_STREAM, weave_target *wv, text_stream *fragme DISCARD_TEXT(matter); } -#line 428 "inweb/Chapter 5/Weave Formats.w" +#line 429 "inweb/Chapter 5/Weave Formats.w" -#line 430 "inweb/Chapter 5/Weave Formats.w" +#line 431 "inweb/Chapter 5/Weave Formats.w" IMETHOD_TYPE(PREFORM_DOCUMENT_FOR_MTID, weave_format *wf, text_stream *OUT, weave_target *wv, web *W, chapter *C, section *S, source_line *L, text_stream *matter, text_stream *concluding_comment) @@ -20863,18 +21060,18 @@ int Formats__preform_document(OUTPUT_STREAM, weave_target *wv, web *W, return rv; } -#line 448 "inweb/Chapter 5/Weave Formats.w" +#line 449 "inweb/Chapter 5/Weave Formats.w" -#line 450 "inweb/Chapter 5/Weave Formats.w" +#line 451 "inweb/Chapter 5/Weave Formats.w" VMETHOD_TYPE(ENDNOTE_FOR_MTID, weave_format *wf, text_stream *OUT, weave_target *wv, int end) void Formats__endnote(OUTPUT_STREAM, weave_target *wv, int end) { weave_format *wf = wv->format; VMETHOD_CALL(wf, ENDNOTE_FOR_MTID, OUT, wv, end); } -#line 462 "inweb/Chapter 5/Weave Formats.w" +#line 463 "inweb/Chapter 5/Weave Formats.w" -#line 464 "inweb/Chapter 5/Weave Formats.w" +#line 465 "inweb/Chapter 5/Weave Formats.w" VMETHOD_TYPE(LOCALE_FOR_MTID, weave_format *wf, text_stream *OUT, weave_target *wv, paragraph *par1, paragraph *par2) void Formats__locale(OUTPUT_STREAM, weave_target *wv, paragraph *par1, paragraph *par2) { @@ -20882,9 +21079,9 @@ void Formats__locale(OUTPUT_STREAM, weave_target *wv, paragraph *par1, paragraph VMETHOD_CALL(wf, LOCALE_FOR_MTID, OUT, wv, par1, par2); } -#line 475 "inweb/Chapter 5/Weave Formats.w" +#line 476 "inweb/Chapter 5/Weave Formats.w" -#line 477 "inweb/Chapter 5/Weave Formats.w" +#line 478 "inweb/Chapter 5/Weave Formats.w" VMETHOD_TYPE(TAIL_FOR_MTID, weave_format *wf, text_stream *OUT, weave_target *wv, text_stream *comment, section *S) void Formats__tail(OUTPUT_STREAM, weave_target *wv, text_stream *comment, section *S) { @@ -20892,25 +21089,25 @@ void Formats__tail(OUTPUT_STREAM, weave_target *wv, text_stream *comment, sectio VMETHOD_CALL(wf, TAIL_FOR_MTID, OUT, wv, comment, S); } -#line 492 "inweb/Chapter 5/Weave Formats.w" +#line 493 "inweb/Chapter 5/Weave Formats.w" -#line 494 "inweb/Chapter 5/Weave Formats.w" +#line 495 "inweb/Chapter 5/Weave Formats.w" VMETHOD_TYPE(POST_PROCESS_POS_MTID, weave_format *wf, weave_target *wv, int open_afterwards) void Formats__post_process_weave(weave_target *wv, int open_afterwards) { VMETHOD_CALL(wv->format, POST_PROCESS_POS_MTID, wv, open_afterwards); } -#line 503 "inweb/Chapter 5/Weave Formats.w" +#line 504 "inweb/Chapter 5/Weave Formats.w" -#line 505 "inweb/Chapter 5/Weave Formats.w" +#line 506 "inweb/Chapter 5/Weave Formats.w" VMETHOD_TYPE(POST_PROCESS_REPORT_POS_MTID, weave_format *wf, weave_target *wv) void Formats__report_on_post_processing(weave_target *wv) { VMETHOD_CALL(wv->format, POST_PROCESS_REPORT_POS_MTID, wv); } -#line 515 "inweb/Chapter 5/Weave Formats.w" +#line 516 "inweb/Chapter 5/Weave Formats.w" -#line 517 "inweb/Chapter 5/Weave Formats.w" +#line 518 "inweb/Chapter 5/Weave Formats.w" IMETHOD_TYPE(INDEX_PDFS_POS_MTID, weave_format *wf) int Formats__index_pdfs(text_stream *format) { weave_format *wf = Formats__find_by_name(format); @@ -20920,9 +21117,9 @@ int Formats__index_pdfs(text_stream *format) { return rv; } -#line 530 "inweb/Chapter 5/Weave Formats.w" +#line 531 "inweb/Chapter 5/Weave Formats.w" -#line 532 "inweb/Chapter 5/Weave Formats.w" +#line 533 "inweb/Chapter 5/Weave Formats.w" IMETHOD_TYPE(POST_PROCESS_SUBSTITUTE_POS_MTID, weave_format *wf, text_stream *OUT, weave_target *wv, text_stream *detail, weave_pattern *pattern) int Formats__substitute_post_processing_data(OUTPUT_STREAM, weave_target *wv, @@ -20934,7 +21131,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_310, TL_IS_311); + weave_format *wf = Formats__create_weave_format(TL_IS_311, TL_IS_312); METHOD_ADD(wf, TOP_FOR_MTID, PlainText__top); METHOD_ADD(wf, SUBHEADING_FOR_MTID, PlainText__subheading); METHOD_ADD(wf, TOC_FOR_MTID, PlainText__toc); @@ -21078,7 +21275,7 @@ void TeX__create(void) { { #line 16 "inweb/Chapter 5/TeX Format.w" - weave_format *wf = Formats__create_weave_format(TL_IS_312, TL_IS_313); + weave_format *wf = Formats__create_weave_format(TL_IS_313, TL_IS_314); { #line 40 "inweb/Chapter 5/TeX Format.w" @@ -21115,7 +21312,7 @@ void TeX__create(void) { { #line 20 "inweb/Chapter 5/TeX Format.w" - weave_format *wf = Formats__create_weave_format(TL_IS_314, TL_IS_315); + weave_format *wf = Formats__create_weave_format(TL_IS_315, TL_IS_316); { #line 40 "inweb/Chapter 5/TeX Format.w" @@ -21156,7 +21353,7 @@ void TeX__create(void) { { #line 28 "inweb/Chapter 5/TeX Format.w" - weave_format *wf = Formats__create_weave_format(TL_IS_316, TL_IS_317); + weave_format *wf = Formats__create_weave_format(TL_IS_317, TL_IS_318); METHOD_ADD(wf, PARA_MACRO_FOR_MTID, TeX__para_macro_PDF_1); { @@ -21211,7 +21408,7 @@ void TeX__top(weave_format *self, text_stream *OUT, weave_target *wv, text_strea { #line 85 "inweb/Chapter 5/TeX Format.w" - filename *Macros = Patterns__obtain_filename(wv->pattern, TL_IS_318); + filename *Macros = Patterns__obtain_filename(wv->pattern, TL_IS_319); FILE *MACROS = Filenames__fopen(Macros, "r"); if (MACROS == NULL) Errors__fatal_with_file("can't open file of TeX macros", Macros); while (TRUE) { @@ -21509,7 +21706,7 @@ void TeX__locale(weave_format *self, text_stream *OUT, weave_target *wv, #line 381 "inweb/Chapter 5/TeX Format.w" void TeX__change_material(weave_format *self, text_stream *OUT, weave_target *wv, - int old_material, int new_material, int content) { + int old_material, int new_material, int content, int change_material) { if (old_material != new_material) { switch (old_material) { case REGULAR_MATERIAL: @@ -21765,7 +21962,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_319)) + if (Str__eq(macro, TL_IS_320)) { #line 749 "inweb/Chapter 5/TeX Format.w" if (Str__get_at(text, i) == '\\') { @@ -21773,8 +21970,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_413)) PUT((wchar_t) 0x2204); - else if (Str__eq(macro, TL_IS_414)) { PUT((wchar_t) 0x00AC); PUT((wchar_t) 0x2200); } + if (Str__eq(macro, TL_IS_414)) PUT((wchar_t) 0x2204); + else if (Str__eq(macro, TL_IS_415)) { PUT((wchar_t) 0x00AC); PUT((wchar_t) 0x2200); } else { PRINT("Don't know how to apply '\\not' to '\\%S'\n", macro); } @@ -21788,99 +21985,99 @@ void TeX__remove_math_mode_range(OUTPUT_STREAM, text_stream *text, int from, int else { #line 647 "inweb/Chapter 5/TeX Format.w" - if (Str__eq(macro, TL_IS_320)) WRITE("<="); - else if (Str__eq(macro, TL_IS_321)) WRITE(">="); - else if (Str__eq(macro, TL_IS_322)) WRITE("~"); - else if (Str__eq(macro, TL_IS_323)) WRITE(""); + if (Str__eq(macro, TL_IS_321)) WRITE("<="); + else if (Str__eq(macro, TL_IS_322)) WRITE(">="); + else if (Str__eq(macro, TL_IS_323)) WRITE("~"); else if (Str__eq(macro, TL_IS_324)) WRITE(""); else if (Str__eq(macro, TL_IS_325)) WRITE(""); - else if (Str__eq(macro, TL_IS_326)) WRITE("=>"); - else if (Str__eq(macro, TL_IS_327)) WRITE("<=>"); - else if (Str__eq(macro, TL_IS_328)) WRITE("-->"); + else if (Str__eq(macro, TL_IS_326)) WRITE(""); + else if (Str__eq(macro, TL_IS_327)) WRITE("=>"); + else if (Str__eq(macro, TL_IS_328)) WRITE("<=>"); else if (Str__eq(macro, TL_IS_329)) WRITE("-->"); else if (Str__eq(macro, TL_IS_330)) WRITE("-->"); - else if (Str__eq(macro, TL_IS_331)) WRITE("<--"); + else if (Str__eq(macro, TL_IS_331)) WRITE("-->"); else if (Str__eq(macro, TL_IS_332)) WRITE("<--"); - else if (Str__eq(macro, TL_IS_333)) WRITE("{"); - else if (Str__eq(macro, TL_IS_334)) WRITE("|"); - else if (Str__eq(macro, TL_IS_335)) WRITE("}"); - else if (Str__eq(macro, TL_IS_336)) WRITE("."); - else if (Str__eq(macro, TL_IS_337)) WRITE("..."); + else if (Str__eq(macro, TL_IS_333)) WRITE("<--"); + else if (Str__eq(macro, TL_IS_334)) WRITE("{"); + else if (Str__eq(macro, TL_IS_335)) WRITE("|"); + else if (Str__eq(macro, TL_IS_336)) WRITE("}"); + else if (Str__eq(macro, TL_IS_337)) WRITE("."); else if (Str__eq(macro, TL_IS_338)) WRITE("..."); - else if (Str__eq(macro, TL_IS_339)) WRITE("*"); - else if (Str__eq(macro, TL_IS_340)) WRITE(" "); - else if (Str__eq(macro, TL_IS_341)) WRITE(" "); - else if (Str__eq(macro, TL_IS_342)) WRITE("TeX"); - else if (Str__eq(macro, TL_IS_343)) WRITE("!="); + else if (Str__eq(macro, TL_IS_339)) WRITE("..."); + else if (Str__eq(macro, TL_IS_340)) WRITE("*"); + else if (Str__eq(macro, TL_IS_341)) WRITE(" "); + else if (Str__eq(macro, TL_IS_342)) WRITE(" "); + else if (Str__eq(macro, TL_IS_343)) WRITE("TeX"); else if (Str__eq(macro, TL_IS_344)) WRITE("!="); - else if (Str__eq(macro, TL_IS_345)) WRITE("l"); - else if (Str__eq(macro, TL_IS_346)) WRITE("log"); - else if (Str__eq(macro, TL_IS_347)) WRITE("exp"); - else if (Str__eq(macro, TL_IS_348)) WRITE("sin"); - else if (Str__eq(macro, TL_IS_349)) WRITE("cos"); - else if (Str__eq(macro, TL_IS_350)) WRITE("tan"); - else if (Str__eq(macro, TL_IS_351)) WRITE("T"); - else if (Str__eq(macro, TL_IS_352)) PUT((wchar_t) 0x0391); - else if (Str__eq(macro, TL_IS_353)) PUT((wchar_t) 0x0392); - else if (Str__eq(macro, TL_IS_354)) PUT((wchar_t) 0x0393); - else if (Str__eq(macro, TL_IS_355)) PUT((wchar_t) 0x0394); - else if (Str__eq(macro, TL_IS_356)) PUT((wchar_t) 0x0395); - else if (Str__eq(macro, TL_IS_357)) PUT((wchar_t) 0x0396); - else if (Str__eq(macro, TL_IS_358)) PUT((wchar_t) 0x0397); - else if (Str__eq(macro, TL_IS_359)) PUT((wchar_t) 0x0398); - else if (Str__eq(macro, TL_IS_360)) PUT((wchar_t) 0x0399); - else if (Str__eq(macro, TL_IS_361)) PUT((wchar_t) 0x039A); - else if (Str__eq(macro, TL_IS_362)) PUT((wchar_t) 0x039B); - else if (Str__eq(macro, TL_IS_363)) PUT((wchar_t) 0x039C); - else if (Str__eq(macro, TL_IS_364)) PUT((wchar_t) 0x039D); - else if (Str__eq(macro, TL_IS_365)) PUT((wchar_t) 0x039E); - else if (Str__eq(macro, TL_IS_366)) PUT((wchar_t) 0x039F); - else if (Str__eq(macro, TL_IS_367)) PUT((wchar_t) 0x03A0); - else if (Str__eq(macro, TL_IS_368)) PUT((wchar_t) 0x03A1); - else if (Str__eq(macro, TL_IS_369)) PUT((wchar_t) 0x03A2); - else if (Str__eq(macro, TL_IS_370)) PUT((wchar_t) 0x03A3); - else if (Str__eq(macro, TL_IS_371)) PUT((wchar_t) 0x03A4); - else if (Str__eq(macro, TL_IS_372)) PUT((wchar_t) 0x03A5); - else if (Str__eq(macro, TL_IS_373)) PUT((wchar_t) 0x03A6); - else if (Str__eq(macro, TL_IS_374)) PUT((wchar_t) 0x03A7); - else if (Str__eq(macro, TL_IS_375)) PUT((wchar_t) 0x03A8); - else if (Str__eq(macro, TL_IS_376)) PUT((wchar_t) 0x03A9); - else if (Str__eq(macro, TL_IS_377)) PUT((wchar_t) 0x03B1); - else if (Str__eq(macro, TL_IS_378)) PUT((wchar_t) 0x03B2); - else if (Str__eq(macro, TL_IS_379)) PUT((wchar_t) 0x03B3); - else if (Str__eq(macro, TL_IS_380)) PUT((wchar_t) 0x03B4); - else if (Str__eq(macro, TL_IS_381)) PUT((wchar_t) 0x03B5); - else if (Str__eq(macro, TL_IS_382)) PUT((wchar_t) 0x03B6); - else if (Str__eq(macro, TL_IS_383)) PUT((wchar_t) 0x03B7); - else if (Str__eq(macro, TL_IS_384)) PUT((wchar_t) 0x03B8); - else if (Str__eq(macro, TL_IS_385)) PUT((wchar_t) 0x03B9); - else if (Str__eq(macro, TL_IS_386)) PUT((wchar_t) 0x03BA); - else if (Str__eq(macro, TL_IS_387)) PUT((wchar_t) 0x03BB); - else if (Str__eq(macro, TL_IS_388)) PUT((wchar_t) 0x03BC); - else if (Str__eq(macro, TL_IS_389)) PUT((wchar_t) 0x03BD); - else if (Str__eq(macro, TL_IS_390)) PUT((wchar_t) 0x03BE); - else if (Str__eq(macro, TL_IS_391)) PUT((wchar_t) 0x03BF); - else if (Str__eq(macro, TL_IS_392)) PUT((wchar_t) 0x03C0); - else if (Str__eq(macro, TL_IS_393)) PUT((wchar_t) 0x03C1); - else if (Str__eq(macro, TL_IS_394)) PUT((wchar_t) 0x03C2); - else if (Str__eq(macro, TL_IS_395)) PUT((wchar_t) 0x03C3); - else if (Str__eq(macro, TL_IS_396)) PUT((wchar_t) 0x03C4); - else if (Str__eq(macro, TL_IS_397)) PUT((wchar_t) 0x03C5); - else if (Str__eq(macro, TL_IS_398)) PUT((wchar_t) 0x03C6); - else if (Str__eq(macro, TL_IS_399)) PUT((wchar_t) 0x03C7); - else if (Str__eq(macro, TL_IS_400)) PUT((wchar_t) 0x03C8); - else if (Str__eq(macro, TL_IS_401)) PUT((wchar_t) 0x03C9); - else if (Str__eq(macro, TL_IS_402)) PUT((wchar_t) 0x2203); - else if (Str__eq(macro, TL_IS_403)) PUT((wchar_t) 0x2208); - else if (Str__eq(macro, TL_IS_404)) PUT((wchar_t) 0x2200); - else if (Str__eq(macro, TL_IS_405)) PUT((wchar_t) 0x2229); - else if (Str__eq(macro, TL_IS_406)) PUT((wchar_t) 0x2205); - else if (Str__eq(macro, TL_IS_407)) PUT((wchar_t) 0x2286); - else if (Str__eq(macro, TL_IS_408)) PUT((wchar_t) 0x2227); - else if (Str__eq(macro, TL_IS_409)) PUT((wchar_t) 0x2228); - else if (Str__eq(macro, TL_IS_410)) PUT((wchar_t) 0x00AC); - else if (Str__eq(macro, TL_IS_411)) PUT((wchar_t) 0x03A3); - else if (Str__eq(macro, TL_IS_412)) PUT((wchar_t) 0x03A0); + else if (Str__eq(macro, TL_IS_345)) WRITE("!="); + else if (Str__eq(macro, TL_IS_346)) WRITE("l"); + else if (Str__eq(macro, TL_IS_347)) WRITE("log"); + else if (Str__eq(macro, TL_IS_348)) WRITE("exp"); + else if (Str__eq(macro, TL_IS_349)) WRITE("sin"); + else if (Str__eq(macro, TL_IS_350)) WRITE("cos"); + else if (Str__eq(macro, TL_IS_351)) WRITE("tan"); + else if (Str__eq(macro, TL_IS_352)) WRITE("T"); + else if (Str__eq(macro, TL_IS_353)) PUT((wchar_t) 0x0391); + else if (Str__eq(macro, TL_IS_354)) PUT((wchar_t) 0x0392); + else if (Str__eq(macro, TL_IS_355)) PUT((wchar_t) 0x0393); + else if (Str__eq(macro, TL_IS_356)) PUT((wchar_t) 0x0394); + else if (Str__eq(macro, TL_IS_357)) PUT((wchar_t) 0x0395); + else if (Str__eq(macro, TL_IS_358)) PUT((wchar_t) 0x0396); + else if (Str__eq(macro, TL_IS_359)) PUT((wchar_t) 0x0397); + else if (Str__eq(macro, TL_IS_360)) PUT((wchar_t) 0x0398); + else if (Str__eq(macro, TL_IS_361)) PUT((wchar_t) 0x0399); + else if (Str__eq(macro, TL_IS_362)) PUT((wchar_t) 0x039A); + else if (Str__eq(macro, TL_IS_363)) PUT((wchar_t) 0x039B); + else if (Str__eq(macro, TL_IS_364)) PUT((wchar_t) 0x039C); + else if (Str__eq(macro, TL_IS_365)) PUT((wchar_t) 0x039D); + else if (Str__eq(macro, TL_IS_366)) PUT((wchar_t) 0x039E); + else if (Str__eq(macro, TL_IS_367)) PUT((wchar_t) 0x039F); + else if (Str__eq(macro, TL_IS_368)) PUT((wchar_t) 0x03A0); + else if (Str__eq(macro, TL_IS_369)) PUT((wchar_t) 0x03A1); + else if (Str__eq(macro, TL_IS_370)) PUT((wchar_t) 0x03A2); + else if (Str__eq(macro, TL_IS_371)) PUT((wchar_t) 0x03A3); + else if (Str__eq(macro, TL_IS_372)) PUT((wchar_t) 0x03A4); + else if (Str__eq(macro, TL_IS_373)) PUT((wchar_t) 0x03A5); + else if (Str__eq(macro, TL_IS_374)) PUT((wchar_t) 0x03A6); + else if (Str__eq(macro, TL_IS_375)) PUT((wchar_t) 0x03A7); + else if (Str__eq(macro, TL_IS_376)) PUT((wchar_t) 0x03A8); + else if (Str__eq(macro, TL_IS_377)) PUT((wchar_t) 0x03A9); + else if (Str__eq(macro, TL_IS_378)) PUT((wchar_t) 0x03B1); + else if (Str__eq(macro, TL_IS_379)) PUT((wchar_t) 0x03B2); + else if (Str__eq(macro, TL_IS_380)) PUT((wchar_t) 0x03B3); + else if (Str__eq(macro, TL_IS_381)) PUT((wchar_t) 0x03B4); + else if (Str__eq(macro, TL_IS_382)) PUT((wchar_t) 0x03B5); + else if (Str__eq(macro, TL_IS_383)) PUT((wchar_t) 0x03B6); + else if (Str__eq(macro, TL_IS_384)) PUT((wchar_t) 0x03B7); + else if (Str__eq(macro, TL_IS_385)) PUT((wchar_t) 0x03B8); + else if (Str__eq(macro, TL_IS_386)) PUT((wchar_t) 0x03B9); + else if (Str__eq(macro, TL_IS_387)) PUT((wchar_t) 0x03BA); + else if (Str__eq(macro, TL_IS_388)) PUT((wchar_t) 0x03BB); + else if (Str__eq(macro, TL_IS_389)) PUT((wchar_t) 0x03BC); + else if (Str__eq(macro, TL_IS_390)) PUT((wchar_t) 0x03BD); + else if (Str__eq(macro, TL_IS_391)) PUT((wchar_t) 0x03BE); + else if (Str__eq(macro, TL_IS_392)) PUT((wchar_t) 0x03BF); + else if (Str__eq(macro, TL_IS_393)) PUT((wchar_t) 0x03C0); + else if (Str__eq(macro, TL_IS_394)) PUT((wchar_t) 0x03C1); + else if (Str__eq(macro, TL_IS_395)) PUT((wchar_t) 0x03C2); + else if (Str__eq(macro, TL_IS_396)) PUT((wchar_t) 0x03C3); + else if (Str__eq(macro, TL_IS_397)) PUT((wchar_t) 0x03C4); + else if (Str__eq(macro, TL_IS_398)) PUT((wchar_t) 0x03C5); + else if (Str__eq(macro, TL_IS_399)) PUT((wchar_t) 0x03C6); + else if (Str__eq(macro, TL_IS_400)) PUT((wchar_t) 0x03C7); + else if (Str__eq(macro, TL_IS_401)) PUT((wchar_t) 0x03C8); + else if (Str__eq(macro, TL_IS_402)) PUT((wchar_t) 0x03C9); + else if (Str__eq(macro, TL_IS_403)) PUT((wchar_t) 0x2203); + else if (Str__eq(macro, TL_IS_404)) PUT((wchar_t) 0x2208); + else if (Str__eq(macro, TL_IS_405)) PUT((wchar_t) 0x2200); + else if (Str__eq(macro, TL_IS_406)) PUT((wchar_t) 0x2229); + else if (Str__eq(macro, TL_IS_407)) PUT((wchar_t) 0x2205); + else if (Str__eq(macro, TL_IS_408)) PUT((wchar_t) 0x2286); + else if (Str__eq(macro, TL_IS_409)) PUT((wchar_t) 0x2227); + else if (Str__eq(macro, TL_IS_410)) PUT((wchar_t) 0x2228); + else if (Str__eq(macro, TL_IS_411)) PUT((wchar_t) 0x00AC); + else if (Str__eq(macro, TL_IS_412)) PUT((wchar_t) 0x03A3); + else if (Str__eq(macro, TL_IS_413)) PUT((wchar_t) 0x03A0); else { if (Str__len(macro) > 0) PRINT("Passing through unknown TeX macro \\%S: %S", macro, text); @@ -21906,7 +22103,7 @@ void HTMLFormat__create(void) { { #line 12 "inweb/Chapter 5/HTML Formats.w" - weave_format *wf = Formats__create_weave_format(TL_IS_415, TL_IS_416); + weave_format *wf = Formats__create_weave_format(TL_IS_416, TL_IS_417); METHOD_ADD(wf, TOP_FOR_MTID, HTMLFormat__top); { @@ -21940,7 +22137,7 @@ void HTMLFormat__create(void) { { #line 17 "inweb/Chapter 5/HTML Formats.w" - weave_format *wf = Formats__create_weave_format(TL_IS_417, TL_IS_418); + weave_format *wf = Formats__create_weave_format(TL_IS_418, TL_IS_419); METHOD_ADD(wf, TOP_FOR_MTID, HTMLFormat__top_EPUB); { @@ -22054,9 +22251,9 @@ void HTMLFormat__breadcrumb(OUTPUT_STREAM, text_stream *text, text_stream *link) #line 142 "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_419, wv, WEAVE_FIRST_HALF); + Indexer__cover_sheet_maker(OUT, wv->weave_web, TL_IS_420, wv, WEAVE_FIRST_HALF); if (wv->self_contained == FALSE) { - filename *CSS = Patterns__obtain_filename(wv->pattern, TL_IS_420); + filename *CSS = Patterns__obtain_filename(wv->pattern, TL_IS_421); if (wv->pattern->hierarchical) Patterns__copy_up_file_into_weave(wv->weave_web, CSS); else @@ -22068,8 +22265,8 @@ void HTMLFormat__top(weave_format *self, text_stream *OUT, weave_target *wv, tex void HTMLFormat__top_EPUB(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *comment) { HTML__declare_as_HTML(OUT, TRUE); - Epub__note_page(wv->weave_web->as_ebook, wv->weave_to, wv->booklet_title, TL_IS_421); - Indexer__cover_sheet_maker(OUT, wv->weave_web, TL_IS_422, wv, WEAVE_FIRST_HALF); + Epub__note_page(wv->weave_web->as_ebook, wv->weave_to, wv->booklet_title, TL_IS_422); + Indexer__cover_sheet_maker(OUT, wv->weave_web, TL_IS_423, wv, WEAVE_FIRST_HALF); HTML__comment(OUT, comment); html_in_para = HTML_OUT; } @@ -22148,7 +22345,7 @@ void HTMLFormat__paragraph_heading(weave_format *self, text_stream *OUT, } else { if (wv->self_contained == FALSE) { if (crumbs_dropped == FALSE) { - filename *C = Patterns__obtain_filename(wv->pattern, TL_IS_423); + filename *C = Patterns__obtain_filename(wv->pattern, TL_IS_424); if (wv->pattern->hierarchical) Patterns__copy_up_file_into_weave(wv->weave_web, C); else @@ -22157,11 +22354,11 @@ void HTMLFormat__paragraph_heading(weave_format *self, text_stream *OUT, } HTML_OPEN_WITH("ul", "class=\"crumbs\""); HTMLFormat__drop_initial_breadcrumbs(OUT, wv->breadcrumbs, wv->docs_mode); - text_stream *bct = Bibliographic__get_datum(wv->weave_web->md, TL_IS_424); - if (Str__len(Bibliographic__get_datum(wv->weave_web->md, TL_IS_425)) > 0) { - bct = Bibliographic__get_datum(wv->weave_web->md, TL_IS_426); + text_stream *bct = Bibliographic__get_datum(wv->weave_web->md, TL_IS_425); + if (Str__len(Bibliographic__get_datum(wv->weave_web->md, TL_IS_426)) > 0) { + bct = Bibliographic__get_datum(wv->weave_web->md, TL_IS_427); } - HTMLFormat__breadcrumb(OUT, bct, TL_IS_427); + HTMLFormat__breadcrumb(OUT, bct, TL_IS_428); if (wv->weave_web->md->chaptered) { TEMPORARY_TEXT(chapter_link); @@ -22188,7 +22385,7 @@ void HTMLFormat__drop_initial_breadcrumbs(OUTPUT_STREAM, linked_list *crumbs, in HTMLFormat__breadcrumb(OUT, BR->breadcrumb_text, BR->breadcrumb_link); } } else if (docs_mode) - HTMLFormat__breadcrumb(OUT, TL_IS_428, TL_IS_429); + HTMLFormat__breadcrumb(OUT, TL_IS_429, TL_IS_430); } #line 282 "inweb/Chapter 5/HTML Formats.w" @@ -22202,7 +22399,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_430)) { + if (Str__eq(prefatory, TL_IS_431)) { 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, @@ -22290,54 +22487,22 @@ void HTMLFormat__bar(weave_format *self, text_stream *OUT, weave_target *wv) { HTML__hr(OUT, NULL); } -#line 383 "inweb/Chapter 5/HTML Formats.w" - +#line 377 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__figure(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *figname, int w, int h, programming_language *pl) { HTMLFormat__exit_current_paragraph(OUT); filename *F = Filenames__in_folder( - Pathnames__subfolder(wv->weave_web->md->path_to_web, TL_IS_431), + Pathnames__subfolder(wv->weave_web->md->path_to_web, TL_IS_432), figname); filename *RF = Filenames__from_text(figname); - TEMPORARY_TEXT(ext); - Filenames__write_extension(ext, RF); - if ((pl) || (Str__eq_insensitive(ext, TL_IS_432))) { - if (pl == NULL) HTMLFormat__pre(OUT, NULL); - else HTMLFormat__pre(OUT, "display"); - if (pl) Painter__reset_syntax_colouring(pl); - HTML_figure_state hfs; - hfs.OUT = OUT; - hfs.colour_as = pl; - hfs.wv = wv; - hfs.keywords = (pl)?(&(pl->built_in_keywords)):NULL; - TextFiles__read(F, FALSE, "unable to read file of textual figure", TRUE, - &HTMLFormat__text_file_helper, NULL, &hfs); - if (pl == NULL) HTMLFormat__cpre(OUT); - else HTMLFormat__cpre(OUT); - } else { - HTML_OPEN("center"); - HTML__image(OUT, RF); - Patterns__copy_file_into_weave(wv->weave_web, F); - HTML_CLOSE("center"); - } - DISCARD_TEXT(ext); + HTML_OPEN("center"); + HTML__image(OUT, RF); + Patterns__copy_file_into_weave(wv->weave_web, F); + HTML_CLOSE("center"); WRITE("\n"); } -void HTMLFormat__text_file_helper(text_stream *text, text_file_position *tfp, void *state) { - HTML_figure_state *hfs = (HTML_figure_state *) state; - TEMPORARY_TEXT(colouring); - LOOP_THROUGH_TEXT(pos, text) PUT_TO(colouring, PLAIN_COLOUR); - if (hfs->colour_as) { - Painter__syntax_colour(hfs->colour_as, hfs->OUT, hfs->keywords, text, colouring, TRUE); - Formats__source_code(hfs->OUT, hfs->wv, 0, TL_IS_433, text, colouring, TL_IS_434, TRUE, TRUE, TRUE); - } else { - WRITE_TO(hfs->OUT, "%S\n", text); - } - DISCARD_TEXT(colouring); -} - -#line 430 "inweb/Chapter 5/HTML Formats.w" +#line 392 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__para_macro(weave_format *self, text_stream *OUT, weave_target *wv, para_macro *pmac, int defn) { paragraph *P = pmac->defining_paragraph; @@ -22352,12 +22517,12 @@ void HTMLFormat__para_macro(weave_format *self, text_stream *OUT, weave_target * WRITE(">%s", (defn)?" =":""); } -#line 445 "inweb/Chapter 5/HTML Formats.w" +#line 407 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__pagebreak(weave_format *self, text_stream *OUT, weave_target *wv) { HTMLFormat__exit_current_paragraph(OUT); } -#line 450 "inweb/Chapter 5/HTML Formats.w" +#line 412 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__blank_line(weave_format *self, text_stream *OUT, weave_target *wv, int in_comment) { if (html_in_para == HTML_IN_PRE) { @@ -22370,9 +22535,9 @@ void HTMLFormat__blank_line(weave_format *self, text_stream *OUT, weave_target * } } -#line 463 "inweb/Chapter 5/HTML Formats.w" +#line 425 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__change_material(weave_format *self, text_stream *OUT, weave_target *wv, - int old_material, int new_material, int content) { + int old_material, int new_material, int content, int plainly) { if (old_material != new_material) { if (old_material == MACRO_MATERIAL) HTML_CLOSE("code"); if ((content) || (new_material != MACRO_MATERIAL)) @@ -22382,8 +22547,8 @@ void HTMLFormat__change_material(weave_format *self, text_stream *OUT, weave_tar case REGULAR_MATERIAL: switch (new_material) { case CODE_MATERIAL: - WRITE("\n"); - HTMLFormat__pre(OUT, "display"); + if (plainly) HTMLFormat__pre(OUT, NULL); + else HTMLFormat__pre(OUT, "display"); break; case DEFINITION_MATERIAL: WRITE("\n"); @@ -22421,7 +22586,8 @@ void HTMLFormat__change_material(weave_format *self, text_stream *OUT, weave_tar switch (new_material) { case CODE_MATERIAL: WRITE("\n"); - HTMLFormat__pre(OUT, "display"); + if (plainly) HTMLFormat__pre(OUT, NULL); + else HTMLFormat__pre(OUT, "display"); break; case MACRO_MATERIAL: WRITE("\n"); @@ -22438,7 +22604,7 @@ void HTMLFormat__change_material(weave_format *self, text_stream *OUT, weave_tar } } -#line 531 "inweb/Chapter 5/HTML Formats.w" +#line 494 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__change_colour(weave_format *self, text_stream *OUT, weave_target *wv, int col, int in_code) { char *cl = "plain"; @@ -22459,7 +22625,7 @@ void HTMLFormat__change_colour(weave_format *self, text_stream *OUT, weave_targe HTML_OPEN_WITH("span", "class=\"%s\"", cl); } -#line 552 "inweb/Chapter 5/HTML Formats.w" +#line 515 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__endnote(weave_format *self, text_stream *OUT, weave_target *wv, int end) { if (end == 1) { HTMLFormat__exit_current_paragraph(OUT); @@ -22469,7 +22635,7 @@ void HTMLFormat__endnote(weave_format *self, text_stream *OUT, weave_target *wv, } } -#line 562 "inweb/Chapter 5/HTML Formats.w" +#line 525 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__commentary_text(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *id) { for (int i=0; i < Str__len(id); i++) { @@ -22490,7 +22656,7 @@ void HTMLFormat__commentary_text(weave_format *self, text_stream *OUT, weave_tar } } -#line 583 "inweb/Chapter 5/HTML Formats.w" +#line 546 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__locale(weave_format *self, text_stream *OUT, weave_target *wv, paragraph *par1, paragraph *par2) { TEMPORARY_TEXT(TEMP) @@ -22504,7 +22670,7 @@ void HTMLFormat__locale(weave_format *self, text_stream *OUT, weave_target *wv, HTML__end_link(OUT); } -#line 597 "inweb/Chapter 5/HTML Formats.w" +#line 560 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__xref(OUTPUT_STREAM, weave_target *wv, paragraph *P, section *from, int a_link) { TEMPORARY_TEXT(linkto); @@ -22525,7 +22691,7 @@ void HTMLFormat__xref(OUTPUT_STREAM, weave_target *wv, paragraph *P, section *fr else PUT(Str__get(pos)); } -#line 618 "inweb/Chapter 5/HTML Formats.w" +#line 581 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__tail(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *comment, section *this_S) { HTMLFormat__exit_current_paragraph(OUT); @@ -22568,11 +22734,11 @@ void HTMLFormat__tail(weave_format *self, text_stream *OUT, weave_target *wv, } HTML__comment(OUT, comment); HTML__completed(OUT); - Bibliographic__set_datum(wv->weave_web->md, TL_IS_435, wv->booklet_title); - Indexer__cover_sheet_maker(OUT, wv->weave_web, TL_IS_436, wv, WEAVE_SECOND_HALF); + Bibliographic__set_datum(wv->weave_web->md, TL_IS_433, wv->booklet_title); + Indexer__cover_sheet_maker(OUT, wv->weave_web, TL_IS_434, wv, WEAVE_SECOND_HALF); } -#line 665 "inweb/Chapter 5/HTML Formats.w" +#line 628 "inweb/Chapter 5/HTML Formats.w" void HTMLFormat__sref(OUTPUT_STREAM, weave_target *wv, section *S) { if (S == NULL) internal_error("unwoven section"); LOOP_THROUGH_TEXT(pos, S->sect_range) @@ -22583,12 +22749,12 @@ void HTMLFormat__sref(OUTPUT_STREAM, weave_target *wv, section *S) { WRITE(".html"); } -#line 678 "inweb/Chapter 5/HTML Formats.w" +#line 641 "inweb/Chapter 5/HTML Formats.w" int HTMLFormat__begin_weaving_EPUB(weave_format *wf, web *W, weave_pattern *pattern) { TEMPORARY_TEXT(T) - WRITE_TO(T, "%S", Bibliographic__get_datum(W->md, TL_IS_437)); + WRITE_TO(T, "%S", Bibliographic__get_datum(W->md, TL_IS_435)); W->as_ebook = Epub__new(T, "P"); - filename *CSS = Patterns__obtain_filename(pattern, TL_IS_438); + filename *CSS = Patterns__obtain_filename(pattern, TL_IS_436); Epub__use_CSS_throughout(W->as_ebook, CSS); Epub__attach_metadata(W->as_ebook, L"identifier", T); DISCARD_TEXT(T) @@ -22885,7 +23051,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v { #line 139 "inweb/Chapter 6/Makefiles.w" WRITE("%S", mr.exp[0]); - Makefiles__repeat(OUT, TL_IS_439, FALSE, mr.exp[1], FALSE, NULL, tfp, MS, marker, TL_IS_440); + Makefiles__repeat(OUT, TL_IS_437, FALSE, mr.exp[1], FALSE, NULL, tfp, MS, marker, TL_IS_438); WRITE("%S\n", mr.exp[2]); MS->last_line_was_blank = FALSE; Regexp__dispose_of(&mr); @@ -22907,7 +23073,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v { #line 139 "inweb/Chapter 6/Makefiles.w" WRITE("%S", mr.exp[0]); - Makefiles__repeat(OUT, TL_IS_439, FALSE, mr.exp[1], FALSE, NULL, tfp, MS, marker, TL_IS_440); + Makefiles__repeat(OUT, TL_IS_437, FALSE, mr.exp[1], FALSE, NULL, tfp, MS, marker, TL_IS_438); WRITE("%S\n", mr.exp[2]); MS->last_line_was_blank = FALSE; Regexp__dispose_of(&mr); @@ -22929,7 +23095,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v { #line 139 "inweb/Chapter 6/Makefiles.w" WRITE("%S", mr.exp[0]); - Makefiles__repeat(OUT, TL_IS_439, FALSE, mr.exp[1], FALSE, NULL, tfp, MS, marker, TL_IS_440); + Makefiles__repeat(OUT, TL_IS_437, FALSE, mr.exp[1], FALSE, NULL, tfp, MS, marker, TL_IS_438); WRITE("%S\n", mr.exp[2]); MS->last_line_was_blank = FALSE; Regexp__dispose_of(&mr); @@ -22947,7 +23113,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v { #line 156 "inweb/Chapter 6/Makefiles.w" WRITE("INWEB = "); Makefiles__pathname_slashed(OUT, path_to_inweb); WRITE("/Tangled/inweb\n"); - pathname *path_to_intest = Pathnames__subfolder(Pathnames__up(path_to_inweb), TL_IS_442); + pathname *path_to_intest = Pathnames__subfolder(Pathnames__up(path_to_inweb), TL_IS_440); WRITE("INTEST = "); Makefiles__pathname_slashed(OUT, path_to_intest); WRITE("/Tangled/intest\n"); if (MS->for_web) { WRITE("MYNAME = %S\n", Pathnames__directory_name(MS->for_web->md->path_to_web)); @@ -22964,7 +23130,7 @@ void Makefiles__scan_makefile_line(text_stream *line, text_file_position *tfp, v if (Regexp__match(&mr, line, L" *{platform-settings} *")) { #line 147 "inweb/Chapter 6/Makefiles.w" - filename *prototype = Filenames__in_folder(path_to_inweb, TL_IS_441); + filename *prototype = Filenames__in_folder(path_to_inweb, TL_IS_439); MS->allow_commands = FALSE; TextFiles__read(prototype, FALSE, "can't open make settings file", TRUE, Makefiles__scan_makefile_line, NULL, MS); @@ -23247,7 +23413,7 @@ void Makefiles__repeat(OUTPUT_STREAM, text_stream *prefix, int every_time, text_ int c = 0; LOOP_OVER(M, module) { if ((M->origin_marker == over) && - ((Str__eq(tag, TL_IS_443)) || (Str__eq(tag, M->module_tag)))) { + ((Str__eq(tag, TL_IS_441)) || (Str__eq(tag, M->module_tag)))) { if ((prefix) && ((c++ > 0) || (every_time))) WRITE("%S", prefix); if (matter) { TEMPORARY_TEXT(line); @@ -23301,7 +23467,7 @@ void Git__copy_gitignore_line(text_stream *line, text_file_position *tfp, void * { #line 44 "inweb/Chapter 6/Git Support.w" filename *prototype = - Filenames__in_folder(path_to_inweb_materials, TL_IS_444); + Filenames__in_folder(path_to_inweb_materials, TL_IS_442); TextFiles__read(prototype, FALSE, "can't open make settings file", TRUE, Git__copy_gitignore_line, NULL, MS); Regexp__dispose_of(&mr); @@ -23335,11 +23501,11 @@ void Readme__write(filename *from, filename *to) { write_state ws; ws.current_definition = NULL; ws.known_macros = NEW_LINKED_LIST(macro); - macro *V = Readme__new_macro(TL_IS_445, NULL, NULL); + macro *V = Readme__new_macro(TL_IS_443, NULL, NULL); ADD_TO_LINKED_LIST(V, macro, ws.known_macros); - macro *P = Readme__new_macro(TL_IS_446, NULL, NULL); + macro *P = Readme__new_macro(TL_IS_444, NULL, NULL); ADD_TO_LINKED_LIST(P, macro, ws.known_macros); - macro *A = Readme__new_macro(TL_IS_447, NULL, NULL); + macro *A = Readme__new_macro(TL_IS_445, NULL, NULL); ADD_TO_LINKED_LIST(A, macro, ws.known_macros); ws.stack_frame = NULL; text_stream file_to; @@ -23375,7 +23541,7 @@ void Readme__write_helper(text_stream *text, text_file_position *tfp, void *stat } } else { Readme__expand_material(ws, OUT, text, tfp); - Readme__expand_material(ws, OUT, TL_IS_448, tfp); + Readme__expand_material(ws, OUT, TL_IS_446, tfp); } Regexp__dispose_of(&mr); } @@ -23506,7 +23672,7 @@ void Readme__expand_at(write_state *ws, text_stream *OUT, text_stream *macro_nam #line 204 "inweb/Chapter 6/Readme Writeme.w" void Readme__expand_macro(write_state *ws, text_stream *OUT, macro *M, text_file_position *tfp) { - if (Str__eq(M->name, TL_IS_449)) + if (Str__eq(M->name, TL_IS_447)) { #line 215 "inweb/Chapter 6/Readme Writeme.w" if (ws->stack_frame->no_pars != 1) @@ -23514,14 +23680,14 @@ void Readme__expand_macro(write_state *ws, text_stream *OUT, macro *M, text_file else { TEMPORARY_TEXT(program); Readme__expand_material(ws, program, ws->stack_frame->pars[0], tfp); - Readme__write_var(OUT, program, TL_IS_452); + Readme__write_var(OUT, program, TL_IS_450); DISCARD_TEXT(program); } } #line 205 "inweb/Chapter 6/Readme Writeme.w" - else if (Str__eq(M->name, TL_IS_450)) + else if (Str__eq(M->name, TL_IS_448)) { #line 225 "inweb/Chapter 6/Readme Writeme.w" if (ws->stack_frame->no_pars != 1) @@ -23529,14 +23695,14 @@ void Readme__expand_macro(write_state *ws, text_stream *OUT, macro *M, text_file else { TEMPORARY_TEXT(program); Readme__expand_material(ws, program, ws->stack_frame->pars[0], tfp); - Readme__write_var(OUT, program, TL_IS_453); + Readme__write_var(OUT, program, TL_IS_451); DISCARD_TEXT(program); } } #line 206 "inweb/Chapter 6/Readme Writeme.w" - else if (Str__eq(M->name, TL_IS_451)) + else if (Str__eq(M->name, TL_IS_449)) { #line 235 "inweb/Chapter 6/Readme Writeme.w" if (ws->stack_frame->no_pars != 2) @@ -23565,8 +23731,8 @@ void Readme__expand_macro(write_state *ws, text_stream *OUT, macro *M, text_file void Readme__write_var(text_stream *OUT, text_stream *program, text_stream *datum) { writeme_asset *A = Readme__find_asset(program); if (A->if_web) WRITE("%S", Bibliographic__get_datum(A->if_web, datum)); - else if (Str__eq(datum, TL_IS_454)) WRITE("%S", A->date); - else if (Str__eq(datum, TL_IS_455)) WRITE("%S", A->version); + else if (Str__eq(datum, TL_IS_452)) WRITE("%S", A->date); + else if (Str__eq(datum, TL_IS_453)) WRITE("%S", A->version); } #line 273 "inweb/Chapter 6/Readme Writeme.w" @@ -23597,7 +23763,7 @@ writeme_asset *Readme__find_asset(text_stream *program) { A->if_web = WebMetadata__get_without_modules(Pathnames__from_text(program), NULL); } else { filename *I6_vn = Filenames__in_folder( - Pathnames__subfolder(Pathnames__from_text(program), TL_IS_456), TL_IS_457); + Pathnames__subfolder(Pathnames__from_text(program), TL_IS_454), TL_IS_455); if (TextFiles__exists(I6_vn)) { #line 310 "inweb/Chapter 6/Readme Writeme.w" @@ -23607,7 +23773,7 @@ writeme_asset *Readme__find_asset(text_stream *program) { } #line 295 "inweb/Chapter 6/Readme Writeme.w" ; - filename *template_vn = Filenames__in_folder(Pathnames__from_text(program), TL_IS_458); + filename *template_vn = Filenames__in_folder(Pathnames__from_text(program), TL_IS_456); if (TextFiles__exists(template_vn)) { #line 314 "inweb/Chapter 6/Readme Writeme.w" @@ -23617,7 +23783,7 @@ writeme_asset *Readme__find_asset(text_stream *program) { } #line 297 "inweb/Chapter 6/Readme Writeme.w" ; - filename *rmt_vn = Filenames__in_folder(Pathnames__from_text(program), TL_IS_459); + filename *rmt_vn = Filenames__in_folder(Pathnames__from_text(program), TL_IS_457); if (TextFiles__exists(rmt_vn)) { #line 318 "inweb/Chapter 6/Readme Writeme.w" @@ -23627,7 +23793,7 @@ writeme_asset *Readme__find_asset(text_stream *program) { } #line 299 "inweb/Chapter 6/Readme Writeme.w" ; - rmt_vn = Filenames__in_folder(Pathnames__from_text(program), TL_IS_460); + rmt_vn = Filenames__in_folder(Pathnames__from_text(program), TL_IS_458); if (TextFiles__exists(rmt_vn)) { #line 318 "inweb/Chapter 6/Readme Writeme.w" @@ -23818,343 +23984,341 @@ void register_tangled_text_literals(void) { TL_IS_119 = Str__literal(L"(not code)"); TL_IS_120 = Str__literal(L"unknown bracketed annotation"); TL_IS_121 = Str__literal(L"unknown material after '='"); - TL_IS_122 = Str__literal(L"don't understand @command"); - TL_IS_123 = Str__literal(L"Purpose used after bar"); - TL_IS_124 = Str__literal(L"Interface used after bar"); - TL_IS_125 = Str__literal(L"Definitions used after bar"); - TL_IS_126 = Str__literal(L"second bar in the same section"); - TL_IS_127 = Str__literal(L"enumeration constants can't supply a value"); - TL_IS_128 = Str__literal(L"P"); - TL_IS_129 = Str__literal(L"S"); - TL_IS_130 = Str__literal(L"ifdef-"); - TL_IS_131 = Str__literal(L"ifndef-"); - TL_IS_132 = Str__literal(L"."); - TL_IS_133 = Str__literal(L"This paragraph is used only if "); - TL_IS_134 = Str__literal(L" and if "); - TL_IS_135 = Str__literal(L" and "); - TL_IS_136 = Str__literal(L" is"); - TL_IS_137 = Str__literal(L" are"); - TL_IS_138 = Str__literal(L" defined"); - TL_IS_139 = Str__literal(L" undefined"); - TL_IS_140 = Str__literal(L"enumeration constants must belong to a _FAMILY"); - TL_IS_141 = Str__literal(L"this enumeration _FAMILY is unknown"); - TL_IS_142 = Str__literal(L"this enumeration _FAMILY already exists"); - TL_IS_143 = Str__literal(L"unrecognised interface line"); - TL_IS_144 = Str__literal(L"makescript.txt"); + TL_IS_122 = Str__literal(L"="); + TL_IS_123 = Str__literal(L"don't understand @command"); + TL_IS_124 = Str__literal(L"Purpose used after bar"); + TL_IS_125 = Str__literal(L"Interface used after bar"); + TL_IS_126 = Str__literal(L"Definitions used after bar"); + TL_IS_127 = Str__literal(L"second bar in the same section"); + TL_IS_128 = Str__literal(L"enumeration constants can't supply a value"); + TL_IS_129 = Str__literal(L"P"); + TL_IS_130 = Str__literal(L"S"); + TL_IS_131 = Str__literal(L"ifdef-"); + TL_IS_132 = Str__literal(L"ifndef-"); + TL_IS_133 = Str__literal(L"."); + TL_IS_134 = Str__literal(L"This paragraph is used only if "); + TL_IS_135 = Str__literal(L" and if "); + TL_IS_136 = Str__literal(L" and "); + TL_IS_137 = Str__literal(L" is"); + TL_IS_138 = Str__literal(L" are"); + TL_IS_139 = Str__literal(L" defined"); + TL_IS_140 = Str__literal(L" undefined"); + TL_IS_141 = Str__literal(L"enumeration constants must belong to a _FAMILY"); + TL_IS_142 = Str__literal(L"this enumeration _FAMILY is unknown"); + TL_IS_143 = Str__literal(L"this enumeration _FAMILY already exists"); + TL_IS_144 = Str__literal(L"unrecognised interface line"); TL_IS_145 = Str__literal(L"makescript.txt"); - TL_IS_146 = Str__literal(L"gitignorescript.txt"); + TL_IS_146 = Str__literal(L"makescript.txt"); TL_IS_147 = Str__literal(L"gitignorescript.txt"); - TL_IS_148 = Str__literal(L"cover-sheet"); - TL_IS_149 = Str__literal(L"Version Number"); + TL_IS_148 = Str__literal(L"gitignorescript.txt"); + TL_IS_149 = Str__literal(L"cover-sheet"); TL_IS_150 = Str__literal(L"Version Number"); - TL_IS_151 = Str__literal(L" "); - TL_IS_152 = Str__literal(L"chaptered-index.html"); - TL_IS_153 = Str__literal(L"unchaptered-index.html"); - TL_IS_154 = Str__literal(L"index.html"); + TL_IS_151 = Str__literal(L"Version Number"); + TL_IS_152 = Str__literal(L" "); + TL_IS_153 = Str__literal(L"chaptered-index.html"); + TL_IS_154 = Str__literal(L"unchaptered-index.html"); TL_IS_155 = Str__literal(L"index.html"); - TL_IS_156 = Str__literal(L"cover-sheet"); - TL_IS_157 = Str__literal(L"nav.html"); + TL_IS_156 = Str__literal(L"index.html"); + TL_IS_157 = Str__literal(L"cover-sheet"); TL_IS_158 = Str__literal(L"nav.html"); - TL_IS_159 = Str__literal(L"Index"); - TL_IS_160 = Str__literal(L"index"); - TL_IS_161 = Str__literal(L"Purpose"); - TL_IS_162 = Str__literal(L"Booklet Title"); + TL_IS_159 = Str__literal(L"nav.html"); + TL_IS_160 = Str__literal(L"Index"); + TL_IS_161 = Str__literal(L"index"); + TL_IS_162 = Str__literal(L"Purpose"); TL_IS_163 = Str__literal(L"Booklet Title"); TL_IS_164 = Str__literal(L"Booklet Title"); TL_IS_165 = Str__literal(L"Booklet Title"); - TL_IS_166 = Str__literal(L"Definitions"); - TL_IS_167 = Str__literal(L""); + TL_IS_166 = Str__literal(L"Booklet Title"); + TL_IS_167 = Str__literal(L"Definitions"); TL_IS_168 = Str__literal(L""); TL_IS_169 = Str__literal(L""); TL_IS_170 = Str__literal(L""); - TL_IS_171 = Str__literal(L"define"); - TL_IS_172 = Str__literal(L"enum"); - TL_IS_173 = Str__literal(L"weavesection"); - TL_IS_174 = Str__literal(L"weavesections"); - TL_IS_175 = Str__literal(L"weavesectionss"); - TL_IS_176 = Str__literal(L"weavesectionsss"); - TL_IS_177 = Str__literal(L"nsweavesection"); - TL_IS_178 = Str__literal(L"nsweavesections"); - TL_IS_179 = Str__literal(L"tweavesection"); - TL_IS_180 = Str__literal(L"tweavesections"); - TL_IS_181 = Str__literal(L"tweavesectionss"); - TL_IS_182 = Str__literal(L"tweavesectionsss"); - TL_IS_183 = Str__literal(L"Title"); - TL_IS_184 = Str__literal(L"This code is "); - TL_IS_185 = Str__literal(L"never used"); - TL_IS_186 = Str__literal(L", "); - TL_IS_187 = Str__literal(L" and "); - TL_IS_188 = Str__literal(L"used in "); - TL_IS_189 = Str__literal(L" (twice)"); - TL_IS_190 = Str__literal(L" (three times)"); - TL_IS_191 = Str__literal(L" (four times)"); - TL_IS_192 = Str__literal(L" (five times)"); - TL_IS_193 = Str__literal(L"."); - TL_IS_194 = Str__literal(L"The function "); - TL_IS_195 = Str__literal(L" appears nowhere else"); - TL_IS_196 = Str__literal(L")"); - TL_IS_197 = Str__literal(L"."); - TL_IS_198 = Str__literal(L" is used in "); - TL_IS_199 = Str__literal(L"), "); - TL_IS_200 = Str__literal(L", "); - TL_IS_201 = Str__literal(L" ("); - TL_IS_202 = Str__literal(L", "); - TL_IS_203 = Str__literal(L"The structure "); - TL_IS_204 = Str__literal(L" is private to this section"); - TL_IS_205 = Str__literal(L" is accessed in "); - TL_IS_206 = Str__literal(L", "); - TL_IS_207 = Str__literal(L" and here"); - TL_IS_208 = Str__literal(L"."); - TL_IS_209 = Str__literal(L""); + TL_IS_171 = Str__literal(L""); + TL_IS_172 = Str__literal(L"define"); + TL_IS_173 = Str__literal(L"enum"); + TL_IS_174 = Str__literal(L"weavesection"); + TL_IS_175 = Str__literal(L"weavesections"); + TL_IS_176 = Str__literal(L"weavesectionss"); + TL_IS_177 = Str__literal(L"weavesectionsss"); + TL_IS_178 = Str__literal(L"nsweavesection"); + TL_IS_179 = Str__literal(L"nsweavesections"); + TL_IS_180 = Str__literal(L"tweavesection"); + TL_IS_181 = Str__literal(L"tweavesections"); + TL_IS_182 = Str__literal(L"tweavesectionss"); + TL_IS_183 = Str__literal(L"tweavesectionsss"); + TL_IS_184 = Str__literal(L"Title"); + TL_IS_185 = Str__literal(L"This code is "); + TL_IS_186 = Str__literal(L"never used"); + TL_IS_187 = Str__literal(L", "); + TL_IS_188 = Str__literal(L" and "); + TL_IS_189 = Str__literal(L"used in "); + TL_IS_190 = Str__literal(L" (twice)"); + TL_IS_191 = Str__literal(L" (three times)"); + TL_IS_192 = Str__literal(L" (four times)"); + TL_IS_193 = Str__literal(L" (five times)"); + TL_IS_194 = Str__literal(L"."); + TL_IS_195 = Str__literal(L"The function "); + TL_IS_196 = Str__literal(L" appears nowhere else"); + TL_IS_197 = Str__literal(L")"); + TL_IS_198 = Str__literal(L"."); + TL_IS_199 = Str__literal(L" is used in "); + TL_IS_200 = Str__literal(L"), "); + TL_IS_201 = Str__literal(L", "); + TL_IS_202 = Str__literal(L" ("); + TL_IS_203 = Str__literal(L", "); + TL_IS_204 = Str__literal(L"The structure "); + TL_IS_205 = Str__literal(L" is private to this section"); + TL_IS_206 = Str__literal(L" is accessed in "); + TL_IS_207 = Str__literal(L", "); + TL_IS_208 = Str__literal(L" and here"); + TL_IS_209 = Str__literal(L"."); TL_IS_210 = Str__literal(L""); TL_IS_211 = Str__literal(L""); TL_IS_212 = Str__literal(L""); TL_IS_213 = Str__literal(L""); - TL_IS_214 = Str__literal(L"misplaced definition"); - TL_IS_215 = Str__literal(L"unknown macro"); - TL_IS_216 = Str__literal(L"Private Languages"); - TL_IS_217 = Str__literal(L"C"); - TL_IS_218 = Str__literal(L"Languages"); - TL_IS_219 = Str__literal(L"InC"); - TL_IS_220 = Str__literal(L"Name"); - TL_IS_221 = Str__literal(L"Details"); - TL_IS_222 = Str__literal(L"Extension"); - TL_IS_223 = Str__literal(L"Line Comment"); - TL_IS_224 = Str__literal(L"Whole Line Comment"); - TL_IS_225 = Str__literal(L"Multiline Comment Open"); - TL_IS_226 = Str__literal(L"Multiline Comment Close"); - TL_IS_227 = Str__literal(L"String Literal"); - TL_IS_228 = Str__literal(L"String Literal Escape"); - TL_IS_229 = Str__literal(L"Character Literal"); - TL_IS_230 = Str__literal(L"Character Literal Escape"); - TL_IS_231 = Str__literal(L"Binary Literal Prefix"); - TL_IS_232 = Str__literal(L"Octal Literal Prefix"); - TL_IS_233 = Str__literal(L"Hexadecimal Literal Prefix"); - TL_IS_234 = Str__literal(L"Negative Literal Prefix"); - TL_IS_235 = Str__literal(L"Shebang"); - TL_IS_236 = Str__literal(L"Line Marker"); - TL_IS_237 = Str__literal(L"Before Named Paragraph Expansion"); - TL_IS_238 = Str__literal(L"After Named Paragraph Expansion"); - TL_IS_239 = Str__literal(L"Start Definition"); - TL_IS_240 = Str__literal(L"Prolong Definition"); - TL_IS_241 = Str__literal(L"End Definition"); - TL_IS_242 = Str__literal(L"Start Ifdef"); - TL_IS_243 = Str__literal(L"Start Ifndef"); - TL_IS_244 = Str__literal(L"End Ifdef"); - TL_IS_245 = Str__literal(L"End Ifndef"); - TL_IS_246 = Str__literal(L"C-Like"); - TL_IS_247 = Str__literal(L"Suppress Disclaimer"); - TL_IS_248 = Str__literal(L"Supports Namespaces"); - TL_IS_249 = Str__literal(L"}"); - TL_IS_250 = Str__literal(L"unquoted"); - TL_IS_251 = Str__literal(L"{"); - TL_IS_252 = Str__literal(L"debug"); - TL_IS_253 = Str__literal(L"!string"); - TL_IS_254 = Str__literal(L"!function"); - TL_IS_255 = Str__literal(L"!definition"); - TL_IS_256 = Str__literal(L"!reserved"); - TL_IS_257 = Str__literal(L"!element"); - TL_IS_258 = Str__literal(L"!identifier"); - TL_IS_259 = Str__literal(L"!character"); - TL_IS_260 = Str__literal(L"!constant"); - TL_IS_261 = Str__literal(L"!plain"); - TL_IS_262 = Str__literal(L"!extract"); - TL_IS_263 = Str__literal(L"!comment"); - TL_IS_264 = Str__literal(L"true"); - TL_IS_265 = Str__literal(L"false"); - TL_IS_266 = Str__literal(L"both"); - TL_IS_267 = Str__literal(L"brackets"); - TL_IS_268 = Str__literal(L"characters"); - TL_IS_269 = Str__literal(L"coloured"); - TL_IS_270 = Str__literal(L"colouring"); - TL_IS_271 = Str__literal(L"debug"); - TL_IS_272 = Str__literal(L"false"); - TL_IS_273 = Str__literal(L"in"); - TL_IS_274 = Str__literal(L"instances"); - TL_IS_275 = Str__literal(L"keyword"); - TL_IS_276 = Str__literal(L"matches"); - TL_IS_277 = Str__literal(L"matching"); - TL_IS_278 = Str__literal(L"not"); - TL_IS_279 = Str__literal(L"of"); - TL_IS_280 = Str__literal(L"on"); - TL_IS_281 = Str__literal(L"optionally"); - TL_IS_282 = Str__literal(L"prefix"); - TL_IS_283 = Str__literal(L"runs"); - TL_IS_284 = Str__literal(L"spaced"); - TL_IS_285 = Str__literal(L"suffix"); - TL_IS_286 = Str__literal(L"true"); - TL_IS_287 = Str__literal(L"unquoted"); - TL_IS_288 = Str__literal(L"Tangled output generated by inweb: do not edit"); - TL_IS_289 = Str__literal(L"this programming language does not support @d"); - TL_IS_290 = Str__literal(L"this programming language does not support multiline @d"); - TL_IS_291 = Str__literal(L"program ended with conditional compilation open"); - TL_IS_292 = Str__literal(L"conditional compilation too deeply nested"); - TL_IS_293 = Str__literal(L"found #endif without #ifdef or #ifndef"); - TL_IS_294 = Str__literal(L"Structures"); - TL_IS_295 = Str__literal(L"Main::"); - TL_IS_296 = Str__literal(L"Namespaces"); - TL_IS_297 = Str__literal(L"Being internally called, this function mustn't belong to a :: namespace"); - TL_IS_298 = Str__literal(L"Being externally called, this function must belong to a :: namespace"); - TL_IS_299 = Str__literal(L"quartz"); + TL_IS_214 = Str__literal(L""); + TL_IS_215 = Str__literal(L"misplaced definition"); + TL_IS_216 = Str__literal(L"unknown macro"); + TL_IS_217 = Str__literal(L"Dialects"); + TL_IS_218 = Str__literal(L"C"); + TL_IS_219 = Str__literal(L"Languages"); + TL_IS_220 = Str__literal(L"InC"); + TL_IS_221 = Str__literal(L"Name"); + TL_IS_222 = Str__literal(L"Details"); + TL_IS_223 = Str__literal(L"Extension"); + TL_IS_224 = Str__literal(L"Line Comment"); + TL_IS_225 = Str__literal(L"Whole Line Comment"); + TL_IS_226 = Str__literal(L"Multiline Comment Open"); + TL_IS_227 = Str__literal(L"Multiline Comment Close"); + TL_IS_228 = Str__literal(L"String Literal"); + TL_IS_229 = Str__literal(L"String Literal Escape"); + TL_IS_230 = Str__literal(L"Character Literal"); + TL_IS_231 = Str__literal(L"Character Literal Escape"); + TL_IS_232 = Str__literal(L"Binary Literal Prefix"); + TL_IS_233 = Str__literal(L"Octal Literal Prefix"); + TL_IS_234 = Str__literal(L"Hexadecimal Literal Prefix"); + TL_IS_235 = Str__literal(L"Negative Literal Prefix"); + TL_IS_236 = Str__literal(L"Shebang"); + TL_IS_237 = Str__literal(L"Line Marker"); + TL_IS_238 = Str__literal(L"Before Named Paragraph Expansion"); + TL_IS_239 = Str__literal(L"After Named Paragraph Expansion"); + TL_IS_240 = Str__literal(L"Start Definition"); + TL_IS_241 = Str__literal(L"Prolong Definition"); + TL_IS_242 = Str__literal(L"End Definition"); + TL_IS_243 = Str__literal(L"Start Ifdef"); + TL_IS_244 = Str__literal(L"Start Ifndef"); + TL_IS_245 = Str__literal(L"End Ifdef"); + TL_IS_246 = Str__literal(L"End Ifndef"); + TL_IS_247 = Str__literal(L"C-Like"); + TL_IS_248 = Str__literal(L"Suppress Disclaimer"); + TL_IS_249 = Str__literal(L"Supports Namespaces"); + TL_IS_250 = Str__literal(L"}"); + TL_IS_251 = Str__literal(L"unquoted"); + TL_IS_252 = Str__literal(L"{"); + TL_IS_253 = Str__literal(L"debug"); + TL_IS_254 = Str__literal(L"!string"); + TL_IS_255 = Str__literal(L"!function"); + TL_IS_256 = Str__literal(L"!definition"); + TL_IS_257 = Str__literal(L"!reserved"); + TL_IS_258 = Str__literal(L"!element"); + TL_IS_259 = Str__literal(L"!identifier"); + TL_IS_260 = Str__literal(L"!character"); + TL_IS_261 = Str__literal(L"!constant"); + TL_IS_262 = Str__literal(L"!plain"); + TL_IS_263 = Str__literal(L"!extract"); + TL_IS_264 = Str__literal(L"!comment"); + TL_IS_265 = Str__literal(L"true"); + TL_IS_266 = Str__literal(L"false"); + TL_IS_267 = Str__literal(L"both"); + TL_IS_268 = Str__literal(L"brackets"); + TL_IS_269 = Str__literal(L"characters"); + TL_IS_270 = Str__literal(L"coloured"); + TL_IS_271 = Str__literal(L"colouring"); + TL_IS_272 = Str__literal(L"debug"); + TL_IS_273 = Str__literal(L"false"); + TL_IS_274 = Str__literal(L"in"); + TL_IS_275 = Str__literal(L"instances"); + TL_IS_276 = Str__literal(L"keyword"); + TL_IS_277 = Str__literal(L"matches"); + TL_IS_278 = Str__literal(L"matching"); + TL_IS_279 = Str__literal(L"not"); + TL_IS_280 = Str__literal(L"of"); + TL_IS_281 = Str__literal(L"on"); + TL_IS_282 = Str__literal(L"optionally"); + TL_IS_283 = Str__literal(L"prefix"); + TL_IS_284 = Str__literal(L"runs"); + TL_IS_285 = Str__literal(L"spaced"); + TL_IS_286 = Str__literal(L"suffix"); + TL_IS_287 = Str__literal(L"true"); + TL_IS_288 = Str__literal(L"unquoted"); + TL_IS_289 = Str__literal(L"Tangled output generated by inweb: do not edit"); + TL_IS_290 = Str__literal(L"this programming language does not support @d"); + TL_IS_291 = Str__literal(L"this programming language does not support multiline @d"); + TL_IS_292 = Str__literal(L"program ended with conditional compilation open"); + TL_IS_293 = Str__literal(L"conditional compilation too deeply nested"); + TL_IS_294 = Str__literal(L"found #endif without #ifdef or #ifndef"); + TL_IS_295 = Str__literal(L"Structures"); + TL_IS_296 = Str__literal(L"Main::"); + TL_IS_297 = Str__literal(L"Namespaces"); + TL_IS_298 = Str__literal(L"Being internally called, this function mustn't belong to a :: namespace"); + TL_IS_299 = Str__literal(L"Being externally called, this function must belong to a :: namespace"); TL_IS_300 = Str__literal(L"quartz"); TL_IS_301 = Str__literal(L"quartz"); - TL_IS_302 = Str__literal(L"like this"); - TL_IS_303 = Str__literal(L"most_recent_result"); - TL_IS_304 = Str__literal(L"most_recent_result_p"); - TL_IS_305 = Str__literal(L"Syntax.preform"); - TL_IS_306 = Str__literal(L"Preform Language"); + TL_IS_302 = Str__literal(L"quartz"); + TL_IS_303 = Str__literal(L"like this"); + TL_IS_304 = Str__literal(L"most_recent_result"); + TL_IS_305 = Str__literal(L"most_recent_result_p"); + TL_IS_306 = Str__literal(L"Syntax.preform"); TL_IS_307 = Str__literal(L"Preform Language"); - TL_IS_308 = Str__literal(L""); + TL_IS_308 = Str__literal(L"Preform Language"); TL_IS_309 = Str__literal(L""); - TL_IS_310 = Str__literal(L"plain"); - TL_IS_311 = Str__literal(L".txt"); - TL_IS_312 = Str__literal(L"TeX"); - TL_IS_313 = Str__literal(L".tex"); - TL_IS_314 = Str__literal(L"DVI"); - TL_IS_315 = Str__literal(L".tex"); - TL_IS_316 = Str__literal(L"PDF"); - TL_IS_317 = Str__literal(L".tex"); - TL_IS_318 = Str__literal(L"inweb-macros.tex"); - TL_IS_319 = Str__literal(L"not"); - TL_IS_320 = Str__literal(L"leq"); - TL_IS_321 = Str__literal(L"geq"); - TL_IS_322 = Str__literal(L"sim"); - TL_IS_323 = Str__literal(L"hbox"); - TL_IS_324 = Str__literal(L"left"); - TL_IS_325 = Str__literal(L"right"); - TL_IS_326 = Str__literal(L"Rightarrow"); - TL_IS_327 = Str__literal(L"Leftrightarrow"); - TL_IS_328 = Str__literal(L"to"); - TL_IS_329 = Str__literal(L"rightarrow"); - TL_IS_330 = Str__literal(L"longrightarrow"); - TL_IS_331 = Str__literal(L"leftarrow"); - TL_IS_332 = Str__literal(L"longleftarrow"); - TL_IS_333 = Str__literal(L"lbrace"); - TL_IS_334 = Str__literal(L"mid"); - TL_IS_335 = Str__literal(L"rbrace"); - TL_IS_336 = Str__literal(L"cdot"); - TL_IS_337 = Str__literal(L"cdots"); - TL_IS_338 = Str__literal(L"dots"); - TL_IS_339 = Str__literal(L"times"); - TL_IS_340 = Str__literal(L"quad"); - TL_IS_341 = Str__literal(L"qquad"); - TL_IS_342 = Str__literal(L"TeX"); - TL_IS_343 = Str__literal(L"neq"); - TL_IS_344 = Str__literal(L"noteq"); - TL_IS_345 = Str__literal(L"ell"); - TL_IS_346 = Str__literal(L"log"); - TL_IS_347 = Str__literal(L"exp"); - TL_IS_348 = Str__literal(L"sin"); - TL_IS_349 = Str__literal(L"cos"); - TL_IS_350 = Str__literal(L"tan"); - TL_IS_351 = Str__literal(L"top"); - TL_IS_352 = Str__literal(L"Alpha"); - TL_IS_353 = Str__literal(L"Beta"); - TL_IS_354 = Str__literal(L"Gamma"); - TL_IS_355 = Str__literal(L"Delta"); - TL_IS_356 = Str__literal(L"Epsilon"); - TL_IS_357 = Str__literal(L"Zeta"); - TL_IS_358 = Str__literal(L"Eta"); - TL_IS_359 = Str__literal(L"Theta"); - TL_IS_360 = Str__literal(L"Iota"); - TL_IS_361 = Str__literal(L"Kappa"); - TL_IS_362 = Str__literal(L"Lambda"); - TL_IS_363 = Str__literal(L"Mu"); - TL_IS_364 = Str__literal(L"Nu"); - TL_IS_365 = Str__literal(L"Xi"); - TL_IS_366 = Str__literal(L"Omicron"); - TL_IS_367 = Str__literal(L"Pi"); - TL_IS_368 = Str__literal(L"Rho"); - TL_IS_369 = Str__literal(L"Varsigma"); - TL_IS_370 = Str__literal(L"Sigma"); - TL_IS_371 = Str__literal(L"Tau"); - TL_IS_372 = Str__literal(L"Upsilon"); - TL_IS_373 = Str__literal(L"Phi"); - TL_IS_374 = Str__literal(L"Chi"); - TL_IS_375 = Str__literal(L"Psi"); - TL_IS_376 = Str__literal(L"Omega"); - TL_IS_377 = Str__literal(L"alpha"); - TL_IS_378 = Str__literal(L"beta"); - TL_IS_379 = Str__literal(L"gamma"); - TL_IS_380 = Str__literal(L"delta"); - TL_IS_381 = Str__literal(L"epsilon"); - TL_IS_382 = Str__literal(L"zeta"); - TL_IS_383 = Str__literal(L"eta"); - TL_IS_384 = Str__literal(L"theta"); - TL_IS_385 = Str__literal(L"iota"); - TL_IS_386 = Str__literal(L"kappa"); - TL_IS_387 = Str__literal(L"lambda"); - TL_IS_388 = Str__literal(L"mu"); - TL_IS_389 = Str__literal(L"nu"); - TL_IS_390 = Str__literal(L"xi"); - TL_IS_391 = Str__literal(L"omicron"); - TL_IS_392 = Str__literal(L"pi"); - TL_IS_393 = Str__literal(L"rho"); - TL_IS_394 = Str__literal(L"varsigma"); - TL_IS_395 = Str__literal(L"sigma"); - TL_IS_396 = Str__literal(L"tau"); - TL_IS_397 = Str__literal(L"upsilon"); - TL_IS_398 = Str__literal(L"phi"); - TL_IS_399 = Str__literal(L"chi"); - TL_IS_400 = Str__literal(L"psi"); - TL_IS_401 = Str__literal(L"omega"); - TL_IS_402 = Str__literal(L"exists"); - TL_IS_403 = Str__literal(L"in"); - TL_IS_404 = Str__literal(L"forall"); - TL_IS_405 = Str__literal(L"cap"); - TL_IS_406 = Str__literal(L"emptyset"); - TL_IS_407 = Str__literal(L"subseteq"); - TL_IS_408 = Str__literal(L"land"); - TL_IS_409 = Str__literal(L"lor"); - TL_IS_410 = Str__literal(L"lnot"); - TL_IS_411 = Str__literal(L"sum"); - TL_IS_412 = Str__literal(L"prod"); - TL_IS_413 = Str__literal(L"exists"); - TL_IS_414 = Str__literal(L"forall"); - TL_IS_415 = Str__literal(L"HTML"); - TL_IS_416 = Str__literal(L".html"); - TL_IS_417 = Str__literal(L"ePub"); - TL_IS_418 = Str__literal(L".html"); - TL_IS_419 = Str__literal(L"template"); - TL_IS_420 = Str__literal(L"inweb.css"); - TL_IS_421 = Str__literal(L""); - TL_IS_422 = Str__literal(L"template"); - TL_IS_423 = Str__literal(L"crumbs.gif"); - TL_IS_424 = Str__literal(L"Title"); - TL_IS_425 = Str__literal(L"Short Title"); + TL_IS_310 = Str__literal(L""); + TL_IS_311 = Str__literal(L"plain"); + TL_IS_312 = Str__literal(L".txt"); + TL_IS_313 = Str__literal(L"TeX"); + TL_IS_314 = Str__literal(L".tex"); + TL_IS_315 = Str__literal(L"DVI"); + TL_IS_316 = Str__literal(L".tex"); + TL_IS_317 = Str__literal(L"PDF"); + TL_IS_318 = Str__literal(L".tex"); + TL_IS_319 = Str__literal(L"inweb-macros.tex"); + TL_IS_320 = Str__literal(L"not"); + TL_IS_321 = Str__literal(L"leq"); + TL_IS_322 = Str__literal(L"geq"); + TL_IS_323 = Str__literal(L"sim"); + TL_IS_324 = Str__literal(L"hbox"); + TL_IS_325 = Str__literal(L"left"); + TL_IS_326 = Str__literal(L"right"); + TL_IS_327 = Str__literal(L"Rightarrow"); + TL_IS_328 = Str__literal(L"Leftrightarrow"); + TL_IS_329 = Str__literal(L"to"); + TL_IS_330 = Str__literal(L"rightarrow"); + TL_IS_331 = Str__literal(L"longrightarrow"); + TL_IS_332 = Str__literal(L"leftarrow"); + TL_IS_333 = Str__literal(L"longleftarrow"); + TL_IS_334 = Str__literal(L"lbrace"); + TL_IS_335 = Str__literal(L"mid"); + TL_IS_336 = Str__literal(L"rbrace"); + TL_IS_337 = Str__literal(L"cdot"); + TL_IS_338 = Str__literal(L"cdots"); + TL_IS_339 = Str__literal(L"dots"); + TL_IS_340 = Str__literal(L"times"); + TL_IS_341 = Str__literal(L"quad"); + TL_IS_342 = Str__literal(L"qquad"); + TL_IS_343 = Str__literal(L"TeX"); + TL_IS_344 = Str__literal(L"neq"); + TL_IS_345 = Str__literal(L"noteq"); + TL_IS_346 = Str__literal(L"ell"); + TL_IS_347 = Str__literal(L"log"); + TL_IS_348 = Str__literal(L"exp"); + TL_IS_349 = Str__literal(L"sin"); + TL_IS_350 = Str__literal(L"cos"); + TL_IS_351 = Str__literal(L"tan"); + TL_IS_352 = Str__literal(L"top"); + TL_IS_353 = Str__literal(L"Alpha"); + TL_IS_354 = Str__literal(L"Beta"); + TL_IS_355 = Str__literal(L"Gamma"); + TL_IS_356 = Str__literal(L"Delta"); + TL_IS_357 = Str__literal(L"Epsilon"); + TL_IS_358 = Str__literal(L"Zeta"); + TL_IS_359 = Str__literal(L"Eta"); + TL_IS_360 = Str__literal(L"Theta"); + TL_IS_361 = Str__literal(L"Iota"); + TL_IS_362 = Str__literal(L"Kappa"); + TL_IS_363 = Str__literal(L"Lambda"); + TL_IS_364 = Str__literal(L"Mu"); + TL_IS_365 = Str__literal(L"Nu"); + TL_IS_366 = Str__literal(L"Xi"); + TL_IS_367 = Str__literal(L"Omicron"); + TL_IS_368 = Str__literal(L"Pi"); + TL_IS_369 = Str__literal(L"Rho"); + TL_IS_370 = Str__literal(L"Varsigma"); + TL_IS_371 = Str__literal(L"Sigma"); + TL_IS_372 = Str__literal(L"Tau"); + TL_IS_373 = Str__literal(L"Upsilon"); + TL_IS_374 = Str__literal(L"Phi"); + TL_IS_375 = Str__literal(L"Chi"); + TL_IS_376 = Str__literal(L"Psi"); + TL_IS_377 = Str__literal(L"Omega"); + TL_IS_378 = Str__literal(L"alpha"); + TL_IS_379 = Str__literal(L"beta"); + TL_IS_380 = Str__literal(L"gamma"); + TL_IS_381 = Str__literal(L"delta"); + TL_IS_382 = Str__literal(L"epsilon"); + TL_IS_383 = Str__literal(L"zeta"); + TL_IS_384 = Str__literal(L"eta"); + TL_IS_385 = Str__literal(L"theta"); + TL_IS_386 = Str__literal(L"iota"); + TL_IS_387 = Str__literal(L"kappa"); + TL_IS_388 = Str__literal(L"lambda"); + TL_IS_389 = Str__literal(L"mu"); + TL_IS_390 = Str__literal(L"nu"); + TL_IS_391 = Str__literal(L"xi"); + TL_IS_392 = Str__literal(L"omicron"); + TL_IS_393 = Str__literal(L"pi"); + TL_IS_394 = Str__literal(L"rho"); + TL_IS_395 = Str__literal(L"varsigma"); + TL_IS_396 = Str__literal(L"sigma"); + TL_IS_397 = Str__literal(L"tau"); + TL_IS_398 = Str__literal(L"upsilon"); + TL_IS_399 = Str__literal(L"phi"); + TL_IS_400 = Str__literal(L"chi"); + TL_IS_401 = Str__literal(L"psi"); + TL_IS_402 = Str__literal(L"omega"); + TL_IS_403 = Str__literal(L"exists"); + TL_IS_404 = Str__literal(L"in"); + TL_IS_405 = Str__literal(L"forall"); + TL_IS_406 = Str__literal(L"cap"); + TL_IS_407 = Str__literal(L"emptyset"); + TL_IS_408 = Str__literal(L"subseteq"); + TL_IS_409 = Str__literal(L"land"); + TL_IS_410 = Str__literal(L"lor"); + TL_IS_411 = Str__literal(L"lnot"); + TL_IS_412 = Str__literal(L"sum"); + TL_IS_413 = Str__literal(L"prod"); + TL_IS_414 = Str__literal(L"exists"); + TL_IS_415 = Str__literal(L"forall"); + TL_IS_416 = Str__literal(L"HTML"); + TL_IS_417 = Str__literal(L".html"); + TL_IS_418 = Str__literal(L"ePub"); + TL_IS_419 = Str__literal(L".html"); + TL_IS_420 = Str__literal(L"template"); + TL_IS_421 = Str__literal(L"inweb.css"); + TL_IS_422 = Str__literal(L""); + TL_IS_423 = Str__literal(L"template"); + TL_IS_424 = Str__literal(L"crumbs.gif"); + TL_IS_425 = Str__literal(L"Title"); TL_IS_426 = Str__literal(L"Short Title"); - TL_IS_427 = Str__literal(L"index.html"); - TL_IS_428 = Str__literal(L"★"); - TL_IS_429 = Str__literal(L"../webs.html"); - TL_IS_430 = Str__literal(L"enum"); - TL_IS_431 = Str__literal(L"Figures"); - TL_IS_432 = Str__literal(L".txt"); - TL_IS_433 = Str__literal(L""); - TL_IS_434 = Str__literal(L""); - TL_IS_435 = Str__literal(L"Booklet Title"); - TL_IS_436 = Str__literal(L"template"); - TL_IS_437 = Str__literal(L"Title"); - TL_IS_438 = Str__literal(L"inweb.css"); - TL_IS_439 = Str__literal(L" "); - TL_IS_440 = Str__literal(L"all"); - TL_IS_441 = Str__literal(L"platform-settings.mk"); - TL_IS_442 = Str__literal(L"intest"); - TL_IS_443 = Str__literal(L"all"); - TL_IS_444 = Str__literal(L"gitignorescript.txt"); - TL_IS_445 = Str__literal(L"version"); - TL_IS_446 = Str__literal(L"purpose"); - TL_IS_447 = Str__literal(L"var"); - TL_IS_448 = Str__literal(L"\n"); - TL_IS_449 = Str__literal(L"version"); - TL_IS_450 = Str__literal(L"purpose"); - TL_IS_451 = Str__literal(L"var"); - TL_IS_452 = Str__literal(L"Version Number"); - TL_IS_453 = Str__literal(L"Purpose"); - TL_IS_454 = Str__literal(L"Build Date"); - TL_IS_455 = Str__literal(L"Version Number"); - TL_IS_456 = Str__literal(L"inform6"); - TL_IS_457 = Str__literal(L"header.h"); - TL_IS_458 = Str__literal(L"(manifest).txt"); - TL_IS_459 = Str__literal(L"README.txt"); - TL_IS_460 = Str__literal(L"README.md"); + TL_IS_427 = Str__literal(L"Short Title"); + TL_IS_428 = Str__literal(L"index.html"); + TL_IS_429 = Str__literal(L"★"); + TL_IS_430 = Str__literal(L"../webs.html"); + TL_IS_431 = Str__literal(L"enum"); + TL_IS_432 = Str__literal(L"Figures"); + TL_IS_433 = Str__literal(L"Booklet Title"); + TL_IS_434 = Str__literal(L"template"); + TL_IS_435 = Str__literal(L"Title"); + TL_IS_436 = Str__literal(L"inweb.css"); + TL_IS_437 = Str__literal(L" "); + TL_IS_438 = Str__literal(L"all"); + TL_IS_439 = Str__literal(L"platform-settings.mk"); + TL_IS_440 = Str__literal(L"intest"); + TL_IS_441 = Str__literal(L"all"); + TL_IS_442 = Str__literal(L"gitignorescript.txt"); + TL_IS_443 = Str__literal(L"version"); + TL_IS_444 = Str__literal(L"purpose"); + TL_IS_445 = Str__literal(L"var"); + TL_IS_446 = Str__literal(L"\n"); + TL_IS_447 = Str__literal(L"version"); + TL_IS_448 = Str__literal(L"purpose"); + TL_IS_449 = Str__literal(L"var"); + TL_IS_450 = Str__literal(L"Version Number"); + TL_IS_451 = Str__literal(L"Purpose"); + TL_IS_452 = Str__literal(L"Build Date"); + TL_IS_453 = Str__literal(L"Version Number"); + TL_IS_454 = Str__literal(L"inform6"); + TL_IS_455 = Str__literal(L"header.h"); + TL_IS_456 = Str__literal(L"(manifest).txt"); + TL_IS_457 = Str__literal(L"README.txt"); + TL_IS_458 = Str__literal(L"README.md"); } diff --git a/Tests/Test Cases/_Tangled_Ideal/conditional.txt b/Tests/Test Cases/_Tangled_Ideal/conditional.txt index 3bd3953..707ba15 100644 --- a/Tests/Test Cases/_Tangled_Ideal/conditional.txt +++ b/Tests/Test Cases/_Tangled_Ideal/conditional.txt @@ -1,6 +1,3 @@ -#ifndef PLATFORM_WINDOWS -#define PLATFORM_POSIX -#endif /* Tangled output generated by inweb: do not edit */ #include #ifdef PLATFORM_WINDOWS diff --git a/Tests/Test Cases/_Tangled_Ideal/empty.txt b/Tests/Test Cases/_Tangled_Ideal/empty.txt index 24e39b9..9b23418 100644 --- a/Tests/Test Cases/_Tangled_Ideal/empty.txt +++ b/Tests/Test Cases/_Tangled_Ideal/empty.txt @@ -1,4 +1 @@ -#ifndef PLATFORM_WINDOWS -#define PLATFORM_POSIX -#endif /* Tangled output generated by inweb: do not edit */ diff --git a/Tests/Test Cases/_Tangled_Ideal/hellow.txt b/Tests/Test Cases/_Tangled_Ideal/hellow.txt index 4752ffe..7642c56 100644 --- a/Tests/Test Cases/_Tangled_Ideal/hellow.txt +++ b/Tests/Test Cases/_Tangled_Ideal/hellow.txt @@ -1,6 +1,3 @@ -#ifndef PLATFORM_WINDOWS -#define PLATFORM_POSIX -#endif /* Tangled output generated by inweb: do not edit */ #include #line 9 "inweb/Tests/Test Cases/hellow.inweb" diff --git a/Tests/Test Cases/_Tangled_Ideal/twinprimes.txt b/Tests/Test Cases/_Tangled_Ideal/twinprimes.txt index 06b4df7..30549ae 100644 --- a/Tests/Test Cases/_Tangled_Ideal/twinprimes.txt +++ b/Tests/Test Cases/_Tangled_Ideal/twinprimes.txt @@ -1,6 +1,3 @@ -#ifndef PLATFORM_WINDOWS -#define PLATFORM_POSIX -#endif /* Tangled output generated by inweb: do not edit */ #include #define RANGE 100 diff --git a/Tests/Test Cases/_Woven_Ideal/conditional.html b/Tests/Test Cases/_Woven_Ideal/conditional.html index fc17407..54c1e22 100644 --- a/Tests/Test Cases/_Woven_Ideal/conditional.html +++ b/Tests/Test Cases/_Woven_Ideal/conditional.html @@ -455,12 +455,11 @@ main {
    • hellow

    §1.

    -
         #include <stdio.h>
     
         int main(int argc, char *argv[]) {
    -        printf("Hello world!\n");
    +        printf("Hello world!\n");
         }
     
    @@ -472,7 +471,7 @@ main {
    -    define PEACH 1
    +    define PEACH 1
         enum A_COM from 1
         enum B_COM
         enum C_COM
    @@ -499,7 +498,6 @@ main {
     
     

    §3.

    -
         #include "existent.h"
     
    diff --git a/Tests/Test Cases/_Woven_Ideal/empty.html b/Tests/Test Cases/_Woven_Ideal/empty.html
    index 1fa8a16..8fa49f8 100644
    --- a/Tests/Test Cases/_Woven_Ideal/empty.html	
    +++ b/Tests/Test Cases/_Woven_Ideal/empty.html	
    @@ -459,7 +459,6 @@ Ipsum. But identifier
     
     

    -
             Green.
             Blue.
    diff --git a/Tests/Test Cases/_Woven_Ideal/hellow.html b/Tests/Test Cases/_Woven_Ideal/hellow.html
    index 0724261..d783fea 100644
    --- a/Tests/Test Cases/_Woven_Ideal/hellow.html	
    +++ b/Tests/Test Cases/_Woven_Ideal/hellow.html	
    @@ -455,12 +455,11 @@ main {
     
     
    • hellow

    §1.

    -
         #include <stdio.h>
     
         int main(int argc, char *argv[]) {
    -        printf("Hello world!\n");
    +        printf("Hello world!\n");
         }
     
    diff --git a/Tests/Test Cases/_Woven_Ideal/perl.html b/Tests/Test Cases/_Woven_Ideal/perl.html index 77777f2..6fa9df5 100644 --- a/Tests/Test Cases/_Woven_Ideal/perl.html +++ b/Tests/Test Cases/_Woven_Ideal/perl.html @@ -455,21 +455,19 @@ main {
    • perl

    §1.

    -
    -    print recolour("Santa likes red and green socks.\n");
    +    print recolour("Santa likes red and green socks.\n");
     

    §2.

    -
    -    sub recolour {
    -        my $text = $_[0];
    +    sub recolour {
    +        my $text = $_[0];
             <Change the hues 2.1>;
    -        return $text;
    +        return $text;
         }
     
    @@ -481,8 +479,8 @@ main {
    -        $text =~ s/red/blue/;
    -        $text =~ s/green/purple/;
    +        $text =~ s/red/blue/;
    +        $text =~ s/green/purple/;
     

    diff --git a/Tests/Test Cases/_Woven_Ideal/plain.html b/Tests/Test Cases/_Woven_Ideal/plain.html index 12a19ca..81f46d5 100644 --- a/Tests/Test Cases/_Woven_Ideal/plain.html +++ b/Tests/Test Cases/_Woven_Ideal/plain.html @@ -455,7 +455,6 @@ main {
    • plain

    §1.

    -
         <Titling 1.1>
         No one would have believed in the last years of the
    @@ -485,7 +484,6 @@ main {
     
     

    §2.

    -
         With infinite complacency men went to and fro over this globe about
         their little affairs, serene in their assurance of their empire over matter.
    diff --git a/Tests/Test Cases/_Woven_Ideal/twinprimes.html b/Tests/Test Cases/_Woven_Ideal/twinprimes.html
    index f30fc06..7a1b09c 100644
    --- a/Tests/Test Cases/_Woven_Ideal/twinprimes.html	
    +++ b/Tests/Test Cases/_Woven_Ideal/twinprimes.html	
    @@ -463,7 +463,7 @@ simplest method possible.
     
     
     
    -    define RANGE 100
    +    define RANGE 100
     
    @@ -486,7 +486,7 @@ simplest method possible.
     
     
             if ((isprime(i)) && (isprime(i+2)))
    -            printf("%d and %d\n", i, i+2);
    +            printf("%d and %d\n", i, i+2);
     

    @@ -496,7 +496,6 @@ simplest method possible.

    §2. This ought to print:

    -
             3 and 5
             5 and 7
    @@ -512,15 +511,15 @@ simplest method possible.
     
     
     
    -    define TRUE 1
    -    define FALSE 0
    +    define TRUE 1
    +    define FALSE 0
     
         int isprime(int n) {
    -        if (n <= 1) return FALSE;
    -        for (int m = 2; m*m <= n; m++)
    -            if (n % m == 0)
    +        if (n <= 1) return FALSE;
    +        for (int m = 2; m*m <= n; m++)
    +            if (n % m == 0)
                     return FALSE;
             return TRUE;
         }
    diff --git a/Tests/Test Painter/AssemblageExample.txt b/Tests/Test Painter/AssemblageExample.txt
    new file mode 100644
    index 0000000..6daf4d5
    --- /dev/null
    +++ b/Tests/Test Painter/AssemblageExample.txt	
    @@ -0,0 +1,5 @@
    +		JSR .initialise
    +		LDR A, #.data
    +		RTS
    +	.initialise
    +		TAX
    diff --git a/Tests/Test Painter/EquationsExample.txt b/Tests/Test Painter/EquationsExample.txt
    new file mode 100644
    index 0000000..98bfadb
    --- /dev/null
    +++ b/Tests/Test Painter/EquationsExample.txt	
    @@ -0,0 +1,4 @@
    +	A = 2716
    +	B=3
    +	C =715 + B
    +	D < 14
    diff --git a/Tests/Test Painter/LineageExample.txt b/Tests/Test Painter/LineageExample.txt
    new file mode 100644
    index 0000000..bcb36d9
    --- /dev/null
    +++ b/Tests/Test Painter/LineageExample.txt	
    @@ -0,0 +1,2 @@
    +Jacob first appears in the Book of Genesis, the son of Isaac and Rebecca, the
    +grandson of Abraham, Sarah and Bethuel, the nephew of Ishmael.
    diff --git a/Tests/Test Painter/PainterOutput.txt b/Tests/Test Painter/PainterOutput.txt
    new file mode 100644
    index 0000000..afac0b9
    --- /dev/null
    +++ b/Tests/Test Painter/PainterOutput.txt	
    @@ -0,0 +1,4 @@
    +	int x = 55; /* a magic number */
    +	rrrpipppnnpp!!!!!!!!!!!!!!!!!!!!
    +	Imaginary::function(x, beta);
    +	fffffffffffffffffffpippiiiipp
    diff --git a/Tests/Test Painter/RunningExample.txt b/Tests/Test Painter/RunningExample.txt
    new file mode 100644
    index 0000000..8d2d2d9
    --- /dev/null
    +++ b/Tests/Test Painter/RunningExample.txt	
    @@ -0,0 +1,2 @@
    +Napoleon Bonaparte (1769-1821) took 167 scientists to Egypt in 1798,
    +who published their so-called Memoirs over the period 1798-1801.
    diff --git a/Tests/Test Painter/StdioExample.txt b/Tests/Test Painter/StdioExample.txt
    new file mode 100644
    index 0000000..2d9727b
    --- /dev/null
    +++ b/Tests/Test Painter/StdioExample.txt	
    @@ -0,0 +1 @@
    +if (x == 1) printf("Hello!");
    diff --git a/Tests/Test Painter/ThirdExample.txt b/Tests/Test Painter/ThirdExample.txt
    new file mode 100644
    index 0000000..6d7414a
    --- /dev/null
    +++ b/Tests/Test Painter/ThirdExample.txt	
    @@ -0,0 +1,14 @@
    +With how sad steps, O Moon, thou climb'st the skies! 
    +How silently, and with how wan a face! 
    +What, may it be that even in heav'nly place 
    +That busy archer his sharp arrows tries! 
    +Sure, if that long-with love-acquainted eyes 
    +Can judge of love, thou feel'st a lover's case, 
    +I read it in thy looks; thy languish'd grace 
    +To me, that feel the like, thy state descries. 
    +Then, ev'n of fellowship, O Moon, tell me, 
    +Is constant love deem'd there but want of wit? 
    +Are beauties there as proud as here they be? 
    +Do they above love to be lov'd, and yet 
    +Those lovers scorn whom that love doth possess? 
    +Do they call virtue there ungratefulness?
    diff --git a/Tests/Test Painter/VowelsExample.txt b/Tests/Test Painter/VowelsExample.txt
    new file mode 100644
    index 0000000..06539b2
    --- /dev/null
    +++ b/Tests/Test Painter/VowelsExample.txt	
    @@ -0,0 +1,4 @@
    +A noir, E blanc, I rouge, U vert, O bleu : voyelles,
    +Je dirai quelque jour vos naissances latentes :
    +A, noir corset velu des mouches éclatantes
    +Qui bombinent autour des puanteurs cruelles,
    diff --git a/Tests/Test Painter/_Results_Ideal/AssemblageExample.txt b/Tests/Test Painter/_Results_Ideal/AssemblageExample.txt
    new file mode 100644
    index 0000000..cfb18e4
    --- /dev/null
    +++ b/Tests/Test Painter/_Results_Ideal/AssemblageExample.txt	
    @@ -0,0 +1,13 @@
    +Test of colouring for language AssemblageExample:
    +        JSR .initialise
    +        LDR A, #.data
    +        RTS
    +    .initialise
    +        TAX
    +
    +ppppppppiiipfffffffffff
    +ppppppppiiipipppfffff
    +ppppppppiii
    +ppppfffffffffff
    +ppppppppiii
    +
    diff --git a/Tests/Test Painter/_Results_Ideal/EquationsExample.txt b/Tests/Test Painter/_Results_Ideal/EquationsExample.txt
    new file mode 100644
    index 0000000..3feb850
    --- /dev/null
    +++ b/Tests/Test Painter/_Results_Ideal/EquationsExample.txt	
    @@ -0,0 +1,11 @@
    +Test of colouring for language EquationsExample:
    +    A = 2716
    +    B=3
    +    C =715 + B
    +    D < 14
    +
    +ppppfpppffff
    +ppppfpf
    +ppppfppfffpppp
    +pppppppppp
    +
    diff --git a/Tests/Test Painter/_Results_Ideal/LineageExample.txt b/Tests/Test Painter/_Results_Ideal/LineageExample.txt
    new file mode 100644
    index 0000000..aedaf3d
    --- /dev/null
    +++ b/Tests/Test Painter/_Results_Ideal/LineageExample.txt	
    @@ -0,0 +1,7 @@
    +Test of colouring for language LineageExample:
    +Jacob first appears in the Book of Genesis, the son of Isaac and Rebecca, the
    +grandson of Abraham, Sarah and Bethuel, the nephew of Ishmael.
    +
    +ppppppppppppppppppppppppppppppppppppppppppppppppfffpppppppppppppppppppppppppp
    +pppppfffpppppppppppppppppppppppppppppppppppppppppppppppppppppp
    +
    diff --git a/Tests/Test Painter/_Results_Ideal/PainterOutput.txt b/Tests/Test Painter/_Results_Ideal/PainterOutput.txt
    new file mode 100644
    index 0000000..a939178
    --- /dev/null
    +++ b/Tests/Test Painter/_Results_Ideal/PainterOutput.txt	
    @@ -0,0 +1,11 @@
    +Test of colouring for language PainterOutput:
    +    int x = 55; /* a magic number */
    +    rrrpipppnnpp!!!!!!!!!!!!!!!!!!!!
    +    Imaginary::function(x, beta);
    +    fffffffffffffffffffpippiiiipp
    +
    +pppppppppppppppppppppppppppppppppppp
    +pppprrrpipppnnpp!!!!!!!!!!!!!!!!!!!!
    +ppppppppppppppppppppppppppppppppp
    +ppppfffffffffffffffffffpippiiiipp
    +
    diff --git a/Tests/Test Painter/_Results_Ideal/RunningExample.txt b/Tests/Test Painter/_Results_Ideal/RunningExample.txt
    new file mode 100644
    index 0000000..a01d92b
    --- /dev/null
    +++ b/Tests/Test Painter/_Results_Ideal/RunningExample.txt	
    @@ -0,0 +1,7 @@
    +Test of colouring for language RunningExample:
    +Napoleon Bonaparte (1769-1821) took 167 scientists to Egypt in 1798,
    +who published their so-called Memoirs over the period 1798-1801.
    +
    +ppppppppppppppppppppfffffffffpppppppfffppppppppppppppppppppppppffffp
    +ppppppppppppppppppppppppppppppppppppppppppppppppppppppfffffffffp
    +
    diff --git a/Tests/Test Painter/_Results_Ideal/StdioExample.txt b/Tests/Test Painter/_Results_Ideal/StdioExample.txt
    new file mode 100644
    index 0000000..0c667b2
    --- /dev/null
    +++ b/Tests/Test Painter/_Results_Ideal/StdioExample.txt	
    @@ -0,0 +1,5 @@
    +Test of colouring for language StdioExample:
    +if (x == 1) printf("Hello!");
    +
    +iippippppnppffffffppiiiiipppp
    +
    diff --git a/Tests/Test Painter/_Results_Ideal/ThirdExample.txt b/Tests/Test Painter/_Results_Ideal/ThirdExample.txt
    new file mode 100644
    index 0000000..51dd421
    --- /dev/null
    +++ b/Tests/Test Painter/_Results_Ideal/ThirdExample.txt	
    @@ -0,0 +1,31 @@
    +Test of colouring for language ThirdExample:
    +With how sad steps, O Moon, thou climb'st the skies!
    +How silently, and with how wan a face!
    +What, may it be that even in heav'nly place
    +That busy archer his sharp arrows tries!
    +Sure, if that long-with love-acquainted eyes
    +Can judge of love, thou feel'st a lover's case,
    +I read it in thy looks; thy languish'd grace
    +To me, that feel the like, thy state descries.
    +Then, ev'n of fellowship, O Moon, tell me,
    +Is constant love deem'd there but want of wit?
    +Are beauties there as proud as here they be?
    +Do they above love to be lov'd, and yet
    +Those lovers scorn whom that love doth possess?
    +Do they call virtue there ungratefulness?
    +
    +pppppppppfffpppppppppppppppppppppppppppppppppppppppp
    +ppppppppppppppfffppppppppppppppppppppp
    +ppppppppppffppppppppppppppppppppppppppppppp
    +ppppppppppffffffpppppppppppppppppppppppp
    +pppppppppffffppppppppppppppppppppppppppppppp
    +ppppppppppffppppppppppppppppppppppppppppppppppp
    +pppppppffppppppppppppppppppppppppppppppppppp
    +pppppppffffppppppppppppppppppppppppppppppppppp
    +pppppppppppffppppppppppppppppppppppppppppp
    +ppppppppppppffffpppppppppppppppppppppppppppppp
    +pppppppppppppfffffpppppppppppppppppppppppppp
    +ppppppppfffffpppppppppppppppppppppppppp
    +pppppppppppppfffffppppppppppppppppppppppppppppp
    +ppppppppffffppppppppppppppppppppppppppppp
    +
    diff --git a/Tests/Test Painter/_Results_Ideal/VowelsExample.txt b/Tests/Test Painter/_Results_Ideal/VowelsExample.txt
    new file mode 100644
    index 0000000..7c776a5
    --- /dev/null
    +++ b/Tests/Test Painter/_Results_Ideal/VowelsExample.txt	
    @@ -0,0 +1,11 @@
    +Test of colouring for language VowelsExample:
    +A noir, E blanc, I rouge, U vert, O bleu : voyelles,
    +Je dirai quelque jour vos naissances latentes :
    +A, noir corset velu des mouches éclatantes
    +Qui bombinent autour des puanteurs cruelles,
    +
    +fppffpppfpppfppppfppffpfppfppfppppfpppffppppfpfppfpp
    +pfppfpffppffppffppffpppfpppffppfppfpppfpfppfppp
    +fpppffpppfppfpppfpfppfpppffppfpppppfpfppfp
    +pffppfppfpfpppffpffpppfpppffppffpppppffppfpp
    +
    diff --git a/Tests/inweb.intest b/Tests/inweb.intest
    index 21e1010..549e5e8 100644
    --- a/Tests/inweb.intest
    +++ b/Tests/inweb.intest
    @@ -1,4 +1,5 @@
     -cases [Inweb] 'inweb/Tests/Test Cases'
    +-cases [Painter] 'inweb/Tests/Test Painter'
     
     -recipe [Inweb]
     	set: $INWEB = inweb/Tangled/inweb
    @@ -42,3 +43,24 @@
     	pass: 'passed'
     
     -end
    +
    +-recipe [Painter]
    +	set: $INWEB = inweb/Tangled/inweb
    +	set: $LANGUAGES = inweb/Dialects
    +	set: $INTERNAL = Internal
    +
    +	set: $CANVAS = $PATH/$CASE.txt
    +	mkdir: $PATH/_Results_Actual
    +	mkdir: $PATH/_Results_Ideal
    +	mkdir: $PATH/_Results_Console
    +	set: $A = $PATH/_Results_Actual/$CASE.txt
    +	set: $I = $PATH/_Results_Ideal/$CASE.txt
    +	step: $INWEB -test-language-on $CANVAS -test-language $LANGUAGES/$CASE.ildf >$A 2>&1
    +	or: 'failed inweb' $A
    +	show: $A
    +	match text: $A $I
    +	or: 'produced the wrong painting'
    +
    +	pass: 'passed'
    +
    +-end
    diff --git a/build.txt b/build.txt
    index 4fbf756..ace473b 100644
    --- a/build.txt
    +++ b/build.txt
    @@ -1,3 +1,3 @@
     Prerelease: alpha.1
    -Build Date: 6 April 2020
    -Build Number: 1A12
    +Build Date: 7 April 2020
    +Build Number: 1A13
    diff --git a/docs/foundation-module/1-fnd.html b/docs/foundation-module/1-fnd.html
    index 3d25034..6a80d5b 100644
    --- a/docs/foundation-module/1-fnd.html
    +++ b/docs/foundation-module/1-fnd.html
    @@ -47,7 +47,6 @@ other tools or libraries to speak of, you could do worse.
     
     

    -
             Import: foundation
     
    @@ -70,7 +69,6 @@ Because pthread is not normally available on Windows, a special header is supplied instead for that case.

    -
         #include <ctype.h>
         #include <stdarg.h>
    @@ -86,7 +84,6 @@ supplied instead for that case.
     
     

    §3.

    -
         text_stream *DL = NULL; Current destination of debugging text: kept NULL until opened
     
    @@ -128,7 +125,6 @@ compromise in practice:

    §7. Very occasionally we'll store a pointer as data:

    -
         typedef long int pointer_sized_int;
     
    @@ -143,7 +139,6 @@ shutting down. that is, literal text_stream * values written as I"strings".

    -
         void Foundation::start(void) {
             Memory::start();
    @@ -278,7 +273,6 @@ an early termination due to a fatal error, as this may lead to thread
     safety problems.
     

    -
         void Foundation::end(void) {
             if (Log::aspect_switched_on(MEMORY_USAGE_DA)) Memory::log_statistics();
    diff --git a/docs/foundation-module/1-pp.html b/docs/foundation-module/1-pp.html
    index 4c0450b..9930622 100644
    --- a/docs/foundation-module/1-pp.html
    +++ b/docs/foundation-module/1-pp.html
    @@ -143,7 +143,6 @@ of files are encoded (as ASCII, as ISO Latin-1, as UTF-8, etc.). The default
     here is UTF-8 since OS X and Linux both adopt this.
     

    -
         #ifndef LOCALE_IS_ISO
         #ifndef LOCALE_IS_UTF8
    @@ -158,7 +157,6 @@ here is UTF-8 since OS X and Linux both adopt this.
     
     

    §8. Environment variables.

    -
         char *Platform::getenv(const char *name) {
             return getenv(name);
    @@ -179,7 +177,6 @@ always be unavailable: that doesn't mean we can't run on those platforms,
     just that installation and use of Foundation-built tools is less convenient.)
     

    -
         void Platform::where_am_i(wchar_t *p, size_t length) {
             char buffer[PATH_MAX + 1];
    @@ -243,7 +240,6 @@ string.
     

    §9.1.1. And now the Mac version:

    -
         int _NSGetExecutablePath(char* buf, uint32_t* bufsize);
     
    @@ -278,7 +274,6 @@ string.
     

    §9.1.2. For Unix, there's nothing we can generically do.

    -
         void Platform::where_am_i(wchar_t *p, size_t length) {
             <Fail 9.1.4>;
    @@ -294,7 +289,6 @@ string.
     

    §9.1.3. On Android, there's no real need for this.

    -
         void Platform::where_am_i(wchar_t *p, size_t length) {
             <Fail 9.1.4>;
    @@ -329,7 +323,6 @@ string.
     
     

    §10. Shell commands.

    -
         int Platform::system(const char *cmd) {
             return system(cmd);
    @@ -363,7 +356,6 @@ bugs in Intest, with the worker threads apparently writing on each other's
     memory space. Using posix_spawn() instead appears to work better.
     

    -
         #include <spawn.h>
         #include <sys/wait.h>
    @@ -393,7 +385,6 @@ memory space. Using posix_spawn()§12. Directory handling. 

    -
         int Platform::mkdir(char *transcoded_pathname) {
             errno = 0;
    @@ -448,7 +439,6 @@ is one which is earlier than any possible timestamp on the files we'll
     be dealing with.
     

    -
         time_t Platform::never_time(void) {
             return (time_t) 0;
    @@ -477,7 +467,6 @@ anything different which was originally in In POSIX world, we can fairly well depend on rsync being around:
     

    -
         void Platform::rsync(char *transcoded_source, char *transcoded_dest) {
             char rsync_command[10*MAX_FILENAME_LENGTH];
    @@ -512,7 +501,6 @@ anything different which was originally in §15. Sleep. 

    -
         void Platform::sleep(int seconds) {
             sleep((unsigned int) seconds);
    @@ -537,7 +525,6 @@ to survive, given the MacOS team's current hostility to scripting; we're
     actually running a one-line AppleScript here.
     

    -
         void Platform::notification(text_stream *text, int happy) {
             char *sound_name = "Bell.aiff";
    @@ -558,7 +545,6 @@ actually running a one-line AppleScript here.
     
     

    §17.

    -
         void Platform::notification(text_stream *text, int happy) {
         }
    @@ -572,7 +558,6 @@ actually running a one-line AppleScript here.
     
     

    §18. Concurrency.

    -
         typedef pthread_t foundation_thread;
         typedef pthread_attr_t foundation_thread_attributes;
    @@ -584,7 +569,6 @@ actually running a one-line AppleScript here.
     
     

    §19.

    -
         int Platform::create_thread(foundation_thread *pt,
             const foundation_thread_attributes *pa, void *(*fn)(void *), void *arg) {
    diff --git a/docs/foundation-module/1-wp.html b/docs/foundation-module/1-wp.html
    index 118edf7..3283812 100644
    --- a/docs/foundation-module/1-wp.html
    +++ b/docs/foundation-module/1-wp.html
    @@ -96,7 +96,6 @@ And with Windows GCC, isdigit(-23)§4. Environment variables. 

    -
         unsigned long __stdcall GetCurrentDirectoryA(unsigned long len, char* buffer);
         unsigned long __stdcall SHGetFolderPathA(unsigned long wnd, int folder,
    @@ -132,7 +131,6 @@ always be unavailable: that doesn't mean we can't run on those platforms,
     just that installation and use of Foundation-built tools is less convenient.)
     

    -
         void Platform::where_am_i(wchar_t *p, size_t length) {
             DWORD result = GetModuleFileNameW(NULL, p, length);
    @@ -148,7 +146,6 @@ just that installation and use of Foundation-built tools is less convenient.)
     
     

    §6. Shell commands.

    -
         struct Win32_Startup_Info {
             long v1; char* v2; char* v3; char* v4; long v5; long v6;
    @@ -208,7 +205,6 @@ just that installation and use of Foundation-built tools is less convenient.)
     
     

    §7. Directory handling.

    -
         int Platform::mkdir(char *transcoded_pathname) {
             errno = 0;
    @@ -262,7 +258,6 @@ just that installation and use of Foundation-built tools is less convenient.)
     POSIX sleep is for seconds.
     

    -
         void __stdcall Sleep(unsigned long ms);
         void Platform::sleep(int seconds) {
    @@ -278,7 +273,6 @@ POSIX sleep is for sec
     
     

    §9. Notifications.

    -
         void Platform::notification(text_stream *text, int happy) {
         }
    @@ -293,7 +287,6 @@ POSIX sleep is for sec
     

    §10. Concurrency. The following predeclarations come from the Windows SDK.

    -
         unsigned long __stdcall CreateThread(void* attrs, unsigned long stack,
             void* func, void* param, unsigned long flags, unsigned long* id);
    @@ -313,7 +306,6 @@ POSIX sleep is for sec
     
     

    §11.

    -
         unsigned long __stdcall Platform::Win32_Thread_Func(unsigned long param) {
             struct Win32_Thread_Start* start = (struct Win32_Thread_Start*)param;
    @@ -370,7 +362,6 @@ is one which is earlier than any possible timestamp on the files we'll
     be dealing with.
     

    -
         time_t Platform::never_time(void) {
             return (time_t) 0;
    diff --git a/docs/foundation-module/2-dct.html b/docs/foundation-module/2-dct.html
    index 34d3aed..dc17f84 100644
    --- a/docs/foundation-module/2-dct.html
    +++ b/docs/foundation-module/2-dct.html
    @@ -34,7 +34,6 @@ pointers to some external structure. Often these will also be texts, but
     not necessarily.
     

    -
         typedef struct dictionary {
             int textual; values are texts?
    @@ -62,7 +61,6 @@ not necessarily.
     efficiency's sake the caller can set them up with an initial size of her choice.
     

    -
         dictionary *Dictionaries::new(int S, int textual) {
             if (S < 2) internal_error("dictionary too small");
    @@ -86,7 +84,6 @@ efficiency's sake the caller can set them up with an initial size of her choice.
     
     

    §3. Logging.

    -
         void Dictionaries::log(OUTPUT_STREAM, dictionary *D) {
             WRITE("Dictionary:\n", (unsigned int) D); INDENT;
    @@ -112,7 +109,6 @@ here. If there are N s
     (from 0 to N-1) a given key value belongs in.
     

    -
         int Dictionaries::hash(text_stream *K, int N) {
             unsigned int hash = 0;
    @@ -132,7 +128,6 @@ remain valid only until somebody writes a new value into the dictionary;
     so be careful if thread safety's an issue.
     

    -
         dict_entry *Dictionaries::find(dictionary *D, text_stream *K) {
             return Dictionaries::find_p(D, K, 0);
    @@ -158,7 +153,6 @@ as wide text (so that we can use literals like _literal:
     

    -
         dict_entry *Dictionaries::find_literal(dictionary *D, wchar_t *lit) {
             TEMPORARY_TEXT(K);
    @@ -194,7 +188,6 @@ streams. So we also offer versions suffixed -1).
     

    -
         dict_entry *Dictionaries::find_p(dictionary *D, text_stream *K, int change) {
             if (D == NULL) <Handle the null dictionary 7.1>;
    @@ -335,7 +328,6 @@ same dictionary if deletions are a possibility.
     values which are arbitrary pointers, so we have to use void pointers:
     

    -
         void *Dictionaries::read_value(dictionary *D, text_stream *key) {
             if (D == NULL) return NULL;
    @@ -386,7 +378,6 @@ values which are arbitrary pointers, so we have to use void pointers:
     so we provide convenient wrappers with the correct C types.
     

    -
         text_stream *Dictionaries::create_text(dictionary *D, text_stream *key) {
             if (D == NULL) internal_error("wrote to null dictionary");
    @@ -412,7 +403,6 @@ so we provide convenient wrappers with the correct C types.
     entry by reading the text pointer and then using WRITE_TO.
     

    -
         text_stream *Dictionaries::get_text(dictionary *D, text_stream *key) {
             if (D == NULL) return NULL;
    @@ -441,7 +431,6 @@ entry by reading the text pointer and then using 
     
    -
     
         void Dictionaries::dispose_of(dictionary *D) {
             if (D->textual)
    diff --git a/docs/foundation-module/2-dl.html b/docs/foundation-module/2-dl.html
    index aa003a4..e8672f3 100644
    --- a/docs/foundation-module/2-dl.html
    +++ b/docs/foundation-module/2-dl.html
    @@ -31,7 +31,6 @@
     

    §1. The DL stream. The debugging log file occupies the following stream:

    -
         text_stream debug_log_file_struct; The actual debugging log file
         text_stream *debug_log_file = &debug_log_file_struct; The actual debugging log file
    @@ -51,7 +50,6 @@ instance, the pseudo-function-call
     
     

    -
             LOGIF(WHATEVER, "Heading %d skipped\n", n);
     
    @@ -76,7 +74,6 @@ not, as we please. Each has a unique number and a name of up to three words in length.

    -
         typedef struct debugging_aspect {
             struct text_stream *hyphenated_name; e.g., "memory-usage"
    @@ -181,7 +178,6 @@ is possible this has been switched to be 
         filename *debug_log_filename = NULL;
     
    @@ -239,7 +235,6 @@ the debugging log can be divided into "phases", subdivided into "stages".
     This is how.
     

    -
         char debug_log_phase[32];
         int debug_log_subheading = 1;
    @@ -272,7 +267,6 @@ being logged, and is used by our main macros. Aspect 0 mandates writing to the
     debug log, and is used when errors occur.
     

    -
         int Log::aspect_switched_on(int aspect) {
             int decision = the_debugging_aspects[aspect].on_or_off;
    @@ -295,7 +289,6 @@ debug log, and is used when errors occur.
     

    §8. We sometimes want to switch everything on, or switch everything off:

    -
         void Log::set_all_aspects(int new_state) {
             if (DL) LOGIF(DEBUGGING_LOG_INCLUSIONS, "Set debugging aspect: everything -> %s\n",
    @@ -321,7 +314,6 @@ every space with a hyphen: for instance, STDOUT.
     

    -
         int Log::set_aspect_from_command_line(text_stream *name, int give_error) {
             int list_mode = FALSE;
    @@ -358,7 +350,6 @@ print out a list of debugging aspects to 
         void Log::tracing_on(int starred, text_stream *heading) {
             if (starred) {
    @@ -384,7 +375,6 @@ the reader with a list of other things which could have been put into it,
     but weren't.
     

    -
         void Log::show_debugging_settings_with_state(int state) {
             int c = 0;
    diff --git a/docs/foundation-module/2-llas.html b/docs/foundation-module/2-llas.html
    index c79ee02..5057ce3 100644
    --- a/docs/foundation-module/2-llas.html
    +++ b/docs/foundation-module/2-llas.html
    @@ -62,7 +62,6 @@ a few items, only one call to the memory manager is needed.
     
     

    §2.

    -
         linked_list *LinkedLists::new(void) {
             linked_list *ll = CREATE(linked_list);
    @@ -81,7 +80,6 @@ a few items, only one call to the memory manager is needed.
     want speed rather than memory efficiency.
     

    -
         void LinkedLists::add(linked_list *L, void *P, int to_end) {
             if (L == NULL) internal_error("null list");
    @@ -117,7 +115,6 @@ want speed rather than memory efficiency.
     

    §4. Because of the direction of the links, only removing from the front is quick:

    -
         void *LinkedLists::remove_from_front(linked_list *L) {
             if (L == NULL) internal_error("null list");
    @@ -137,7 +134,6 @@ want speed rather than memory efficiency.
     

    §5. It's rather slower to delete from a known position in the middle:

    -
         void *LinkedLists::delete(int N, linked_list *L) {
             if (L == NULL) internal_error("null list");
    @@ -166,7 +162,6 @@ want speed rather than memory efficiency.
     
     

    §6. A function call API.

    -
         int LinkedLists::len(linked_list *L) {
             return L?(L->linked_list_length):0;
    diff --git a/docs/foundation-module/2-mmr.html b/docs/foundation-module/2-mmr.html
    index 0fde398..03b7664 100644
    --- a/docs/foundation-module/2-mmr.html
    +++ b/docs/foundation-module/2-mmr.html
    @@ -45,7 +45,6 @@ structures of type thingummy<
     
     

    -
             typedef struct thingummy {
                 int whatsit;
    @@ -121,7 +120,6 @@ to the number of objects in each completed array (so, typically 100) and
     the doubly linked list is of the arrays.
     

    -
         typedef struct allocation_status_structure {
             actually needed for allocation purposes:
    @@ -146,7 +144,6 @@ fairly small array of the structures defined above. The allocator can safely
     begin as soon as this is initialised.
     

    -
         allocation_status_structure alloc_status[NO_DEFINED_MT_VALUES];
     
    @@ -229,7 +226,6 @@ Each memory block consists of a header structure, followed by 
         typedef struct memblock_header {
             int block_number;
    @@ -244,7 +240,6 @@ null bytes, followed by actual data.
     
     

    §10.

    -
         memblock_header *first_memblock_header = NULL; head of list of memory blocks
         memblock_header *current_memblock_header = NULL; tail of list of memory blocks
    @@ -258,7 +253,6 @@ null bytes, followed by actual data.
     pair of routines.
     

    -
         void Memory::allocate_another_block(void) {
             unsigned char *cp;
    @@ -334,7 +328,6 @@ in turn, but of course being careful to avoid following links in a just-freed
     block.
     

    -
         void Memory::free(void) {
             Memory::free_ssas();
    @@ -382,7 +375,6 @@ a single large object, or a single array of small objects.
     blocks, but we don't need to worry about that.)
     

    -
         memory_frame *first_memory_frame = NULL; earliest memory frame ever allocated
         memory_frame *last_memory_frame = NULL;  most recent memory frame allocated
    @@ -398,7 +390,6 @@ memory usage, we would implicitly have an O(n^2) running time in the
     amount of storage n allocated.
     

    -
         int calls_to_cmi = 0;
         void Memory::check_memory_integrity(void) {
    @@ -436,7 +427,6 @@ list is checked for integrity; but we not seen how it is built. Every
     memory frame is created by the following function:
     

    -
         void *Memory::allocate(int mem_type, int extent) {
             CREATE_MUTEX(mutex);
    @@ -720,7 +710,6 @@ used in the lower levels.
     

    Here goes, then.

    -
         ALLOCATE_INDIVIDUALLY(filename)
         ALLOCATE_INDIVIDUALLY(pathname)
    @@ -789,7 +778,6 @@ we need to use the equivalent of traditional §23.  And here is the (very simple) implementation.
     

    -
         char *memory_needs[NO_DEFINED_MREASON_VALUES];
     
    @@ -818,7 +806,6 @@ therefore the best estimate of how well we're doing is the "maximum memory
     claimed" — the highest recorded net usage count over the run.
     

    -
         int max_memory_at_once_for_each_need[NO_DEFINED_MREASON_VALUES],
             memory_claimed_for_each_need[NO_DEFINED_MREASON_VALUES],
    @@ -835,7 +822,6 @@ exit on any such failure, so that the caller can be certain that the return
     values of these functions are always non-NULL pointers.
     

    -
         void *Memory::I7_calloc(int how_many, int size_in_bytes, int reason) {
             return Memory::I7_alloc(how_many, size_in_bytes, reason);
    @@ -854,7 +840,6 @@ values of these functions are always non-§26.  And this, then, is the joint routine implementing both.
     

    -
         void *Memory::I7_alloc(int N, int S, int R) {
             CREATE_MUTEX(mutex);
    @@ -946,7 +931,6 @@ rarely and to allocate large blocks of memory.
     

    §27. We also provide our own wrapper for free:

    -
         void Memory::I7_free(void *pointer, int R, int bytes_freed) {
             if ((R < 0) || (R >= NO_DEFINED_MREASON_VALUES)) internal_error("no such memory reason");
    @@ -996,7 +980,6 @@ safe in memory. Since the length can't be extended, it's usually unsafe
     to write to the result.
     

    -
         char *Memory::new_string(char *from) {
             CREATE_MUTEX(mutex);
    @@ -1023,7 +1006,6 @@ to write to the result.
     

    §30. And here we free any SSAs needed in the course of the run.

    -
         void Memory::free_ssas(void) {
             string_storage_area *ssa;
    @@ -1040,7 +1022,6 @@ to write to the result.
     report in the debugging log (for which, see below).
     

    -
         int Memory::log_usage(int total) {
             if (total_claimed_simply == 0) return 0;
    @@ -1065,7 +1046,6 @@ report in the debugging log (for which, see below).
     

    §32. Memory usage report. A small utility routine to help keep track of our unquestioned profligacy.

    -
         void Memory::log_statistics(void) {
             int total_for_objects = MEMORY_GRANULARITY*no_blocks_allocated; usage in bytes
    @@ -1177,7 +1157,6 @@ order of total number of bytes allocated.
     
     

    §33.

    -
         int Memory::compare_usage(const void *ent1, const void *ent2) {
             int ix1 = *((const int *) ent1);
    @@ -1194,7 +1173,6 @@ order of total number of bytes allocated.
     usage. Recall that bytes is measured in bytes, but total in kilobytes.
     

    -
         int Memory::proportion(int bytes, int total) {
             float B = (float) bytes, T = (float) total;
    @@ -1209,7 +1187,6 @@ usage. Recall that bytes§35.  

    -
         void *Memory::paranoid_calloc(size_t N, size_t S) {
             CREATE_MUTEX(mutex);
    @@ -1329,7 +1306,6 @@ which is other than void *char * pointers:
     

    -
         MAKE_REFERENCE_ROUTINES(char, 1000)
     
    diff --git a/docs/foundation-module/2-mth.html b/docs/foundation-module/2-mth.html index 136732a..0a25d68 100644 --- a/docs/foundation-module/2-mth.html +++ b/docs/foundation-module/2-mth.html @@ -64,7 +64,6 @@ tagged functions attached to it dynamically: those, we'll call "methods".

    §3. A "method set" is simply a linked list of methods:

    -
         typedef struct method_set {
             struct method *first_method;
    @@ -181,7 +180,6 @@ attach it to an object with a method set, using the 

    -
             IMETHOD_CALL(some_object, UNUSED_METHOD_ID_MTID, I"Hello", 17)
     
    diff --git a/docs/foundation-module/2-str.html b/docs/foundation-module/2-str.html index 142ac84..cf96e13 100644 --- a/docs/foundation-module/2-str.html +++ b/docs/foundation-module/2-str.html @@ -87,7 +87,6 @@ formatted text to the current stream, which could be either a string or a file. PRINT does the same but to STDOUT, and is thus essentially printf.

    -
         #define WRITE(args...) Writers::printf(OUT, args)
     
    @@ -339,7 +338,6 @@ so out of the chars_capacity<
     

    §18. A statistic we keep, since it costs little:

    -
         int total_file_writes = 0; number of text files opened for writing during the run
     
    @@ -358,7 +356,6 @@ grow is the debugging file, and if it should reach 2 GB then it deserves to be truncated and we will shed no tears.

    -
         void Streams::initialise(text_stream *stream, int from) {
             if (stream == NULL) internal_error("tried to initialise NULL stream");
    @@ -383,7 +380,6 @@ angle brackets, will be used automatically on writing. By default this flag
     is clear, that is, no conversion is made.
     

    -
         void Streams::enable_XML_escapes(text_stream *stream) {
             if (stream) stream->stream_flags |= USES_XML_ESCAPES_STRF;
    @@ -456,7 +452,6 @@ is clear, that is, no conversion is made.
     
     

    §21. Logging.

    -
         void Streams::log(OUTPUT_STREAM, void *vS) {
             text_stream *stream = (text_stream *) vS;
    @@ -484,7 +479,6 @@ is clear, that is, no conversion is made.
     and returns a text_stream * pointer to it; subsequent calls just return this wrapper.
     

    -
         text_stream STDOUT_struct; int stdout_wrapper_initialised = FALSE;
         text_stream *Streams::get_stdout(void) {
    @@ -509,7 +503,6 @@ and returns a text_stream *§23.  And similarly for the standard error file.
     

    -
         text_stream STDERR_struct; int stderr_wrapper_initialised = FALSE;
         text_stream *Streams::get_stderr(void) {
    @@ -535,7 +528,6 @@ and returns a text_stream *TRUE if and only if successful.
     

    -
         int Streams::open_to_file(text_stream *stream, filename *name, int encoding) {
             if (stream == NULL) internal_error("tried to open NULL stream");
    @@ -561,7 +553,6 @@ so we return TRUE if a
     

    §25. Similarly for appending:

    -
         int Streams::open_to_file_append(text_stream *stream, filename *name, int encoding) {
             if (stream == NULL) internal_error("tried to open NULL stream");
    @@ -588,7 +579,6 @@ the text of the stream; this too can fail for host platform reasons, so again
     we return a success code.
     

    -
         int Streams::open_to_memory(text_stream *stream, int capacity) {
             CREATE_MUTEX(mutex);
    @@ -614,7 +604,6 @@ we return a success code.
     If called validly, this cannot fail.
     

    -
         text_stream Streams::new_buffer(int capacity, wchar_t *at) {
             if (at == NULL) internal_error("tried to make stream wrapper for NULL string");
    @@ -638,7 +627,6 @@ by a C string. First, a wide string (a sequence of 32-bit Unicode code
     points, null terminated):
     

    -
         int Streams::open_from_wide_string(text_stream *stream, wchar_t *c_string) {
             if (stream == NULL) internal_error("tried to open NULL stream");
    @@ -663,7 +651,6 @@ points, null terminated):
     page of the Unicode set, null terminated):
     

    -
         int Streams::open_from_ISO_string(text_stream *stream, char *c_string) {
             if (stream == NULL) internal_error("tried to open NULL stream");
    @@ -687,7 +674,6 @@ page of the Unicode set, null terminated):
     

    §28.2. Finally, a UTF-8 encoded C string:

    -
         int Streams::open_from_UTF8_string(text_stream *stream, char *c_string) {
             if (stream == NULL) internal_error("tried to open NULL stream");
    @@ -734,7 +720,6 @@ page of the Unicode set, null terminated):
     

    §29. Converting to C strings. Now for the converse problem.

    -
         void Streams::write_as_wide_string(wchar_t *C_string, text_stream *stream, int buffer_size) {
             if (buffer_size == 0) return;
    @@ -760,7 +745,6 @@ page of the Unicode set, null terminated):
     ISO string:
     

    -
         void Streams::write_as_ISO_string(char *C_string, text_stream *stream, int buffer_size) {
             if (buffer_size == 0) return;
    @@ -785,7 +769,6 @@ ISO string:
     
     

    §31.

    -
         void Streams::write_as_UTF8_string(char *C_string, text_stream *stream, int buffer_size) {
             if (buffer_size == 0) return;
    @@ -822,7 +805,6 @@ ISO string:
     
     

    §32. Locale versions.

    -
         int Streams::open_from_locale_string(text_stream *stream, char *C_string) {
             #ifdef LOCALE_IS_UTF8
    @@ -864,7 +846,6 @@ ISO string:
     NULL:
     

    -
         void Streams::flush(text_stream *stream) {
             if (stream == NULL) return;
    @@ -879,7 +860,6 @@ ISO string:
     

    §34. But closing is not allowed for NULL or the standard I/O wrappers:

    -
         void Streams::close(text_stream *stream) {
             if (stream == NULL) internal_error("tried to close NULL stream");
    @@ -962,7 +942,6 @@ how continuations are made, below.
     

    §35. Writing. Our equivalent of fputc reads:

    -
         void Streams::putc(int c_int, text_stream *stream) {
             unsigned int c;
    @@ -1100,7 +1079,6 @@ hold any escape sequence when opened.
     

    §36. Literal printing is just printing with XML escapes switched off:

    -
         void Streams::literal(text_stream *stream, char *p) {
             if (stream == NULL) return;
    @@ -1121,7 +1099,6 @@ problem messages and then leave what they're doing incomplete, so we will
     be a little cautious about assuming that a mismatch means an error.
     

    -
         void Streams::indent(text_stream *stream) {
             if (stream == NULL) return;
    @@ -1161,7 +1138,6 @@ how much is written to NULL
     
    -
     
         int Streams::get_position(text_stream *stream) {
             int t = 0;
    @@ -1181,7 +1157,6 @@ field.
     no point, since it is used only in concert with backspacing.
     

    -
         int Streams::latest(text_stream *stream) {
             if (stream == NULL) return 0;
    @@ -1204,7 +1179,6 @@ no point, since it is used only in concert with backspacing.
     zero byte found, so that putting a zero truncates it.
     

    -
         wchar_t Streams::get_char_at_index(text_stream *stream, int position) {
             if (stream == NULL) internal_error("examining null stream");
    @@ -1251,7 +1225,6 @@ such continuation blocks (which would be inefficient if we immediately had
     to open similar ones again).
     

    -
         void Streams::set_position(text_stream *stream, int position) {
             if (stream == NULL) return;
    @@ -1282,7 +1255,6 @@ to open similar ones again).
     NULL) but to can be anything (including NULL).
     

    -
         void Streams::copy(text_stream *to, text_stream *from) {
             if ((from == NULL) || (to == NULL)) return;
    @@ -1304,7 +1276,6 @@ to open similar ones again).
     

    §43. Writer. This writes one stream into another one, which implements %S.

    -
         void Streams::writer(OUTPUT_STREAM, char *format_string, void *vS) {
             text_stream *S = (text_stream *) vS;
    diff --git a/docs/foundation-module/2-wal.html b/docs/foundation-module/2-wal.html
    index cae7b65..ea328bd 100644
    --- a/docs/foundation-module/2-wal.html
    +++ b/docs/foundation-module/2-wal.html
    @@ -64,7 +64,6 @@ so we have to do everything three times. (And then we have to do all that twice,
     because the loggers don't use format strings.)
     

    -
         int escapes_registered = FALSE;
         int escapes_category[2][128]; one of the *_ECAT values above
    @@ -84,7 +83,6 @@ because the loggers don't use format strings.)
     
     

    §3.

    -
         void Writers::log_escape_usage(void) {
             for (int cat = 0; cat < 2; cat++) {
    @@ -107,7 +105,6 @@ because the loggers don't use format strings.)
     

    §4. That gives us a number of front doors:

    -
         void Writers::register_writer(int esc, void (*f)(text_stream *, char *, void *)) {
             Writers::register_writer_p(0, esc, (void *) f, POINTER_ECAT);
    @@ -140,7 +137,6 @@ because the loggers don't use format strings.)
     

    §5. All leading to:

    -
         void Writers::register_writer_p(int set, int esc, void *f, int cat) {
             if (escapes_registered == FALSE) <Initialise the table of escapes 5.1>;
    @@ -201,7 +197,6 @@ for wide strings.
     waiting for:
     

    -
         void Writers::printf(text_stream *stream, char *fmt, ...) {
             va_list ap; the variable argument list signified by the dots
    diff --git a/docs/foundation-module/3-cf.html b/docs/foundation-module/3-cf.html
    index 88839a0..3dc3cfb 100644
    --- a/docs/foundation-module/3-cf.html
    +++ b/docs/foundation-module/3-cf.html
    @@ -73,7 +73,6 @@ different casing; and then repeat within that directory for the extension
     file itself.
     

    -
         FILE *CIFilingSystem::fopen(const char *path, const char *mode) {
             char *topdirpath = NULL, *ciextdirpath = NULL, *cistring = NULL, *ciextname = NULL;
    @@ -279,7 +278,6 @@ return from the function.
     
     

    -
             /Users/bobama/Library/Inform/Extensions/Hillary Clinton/Health Care.i7x
     
    @@ -289,7 +287,6 @@ return from the function.

    -
             topdirpath| is |/Users/bobama/Library/Inform/Extensions
         , and its casing is correct    ciextdirpath| is |Hillary Clinton
    @@ -346,7 +343,6 @@ that many contemporary implementations of 
         int CIFilingSystem::match_in_directory(void *vd,
             char *name, char *last_match) {
    @@ -372,7 +368,6 @@ and in any case the code above contains much larger buffers than needed.)
     

    §5. Non-POSIX tail. On platforms without POSIX directory handling, we revert to regular fopen.

    -
         FILE *CIFilingSystem::fopen(const char *path, const char *mode) {
             return fopen(path, mode);
    diff --git a/docs/foundation-module/3-cla.html b/docs/foundation-module/3-cla.html
    index 137a40e..27bb259 100644
    --- a/docs/foundation-module/3-cla.html
    +++ b/docs/foundation-module/3-cla.html
    @@ -36,7 +36,6 @@ a "bareword". For example, in
     
     

    -
             -log no-memory-usage -fixtime jam marmalade
     
    @@ -101,7 +100,6 @@ in -help. Groups are e we'll hash the switch names into the following:

    -
         dictionary *cls_dictionary = NULL;
     
    @@ -114,7 +112,6 @@ A new *_CLSW value sho swtich, and then the client should call:

    -
         int current_switch_group = -1;
         text_stream *switch_group_names[NO_DEFINED_CLSG_VALUES+1];
    @@ -193,7 +190,6 @@ section. So the sorting version of n
     -no-destroy-world:
     

    -
         command_line_switch *CommandLine::declare_boolean_switch(int id,
             wchar_t *name_literal, int val, wchar_t *help_literal, int active) {
    @@ -317,7 +313,6 @@ through the file if one has by that point been provided.
     holds the filename to read from.
     

    -
         filename *command_line_file = NULL;
         void CommandLine::also_read_file(filename *F) {
    @@ -335,7 +330,6 @@ might not exist as early as now, we have to record any log entries, and play
     them back later (i.e., when the debugging log does exist).
     

    -
         linked_list *command_line_logs = NULL;
         void CommandLine::record_log(text_stream *line) {
    @@ -368,7 +362,6 @@ is equivalent to -greet 'Fred Smith'
     problem with internal space characters in arguments.
     

    -
         void CommandLine::read_file(clf_reader_state *crs) {
             text_stream *logline = Str::new();
    @@ -428,7 +421,6 @@ problem with internal space characters in arguments.
     

    §12. We also allow -setting=X as equivalent to -setting X.

    -
         int CommandLine::read_pair(clf_reader_state *crs, text_stream *opt, text_stream *arg) {
             TEMPORARY_TEXT(opt_p);
    @@ -459,7 +451,6 @@ problem with internal space characters in arguments.
     

    §13. So at this point we have definitely found what looks like a switch:

    -
         int CommandLine::read_pair_p(text_stream *opt, text_stream *opt_val, int N,
             text_stream *arg, void *state,
    @@ -577,7 +568,6 @@ bottom one. (Those are the dull ones.)
     a brief description of the tool's name and purpose.
     

    -
         text_stream *cls_heading = NULL;
     
    @@ -661,7 +651,6 @@ a brief description of the tool's name and purpose.
     
     

    §15.

    -
         int CommandLine::compare_names(const void *ent1, const void *ent2) {
             text_stream *tx1 = (*((const command_line_switch **) ent1))->switch_sort_name;
    diff --git a/docs/foundation-module/3-drc.html b/docs/foundation-module/3-drc.html
    index c1d8c75..706abee 100644
    --- a/docs/foundation-module/3-drc.html
    +++ b/docs/foundation-module/3-drc.html
    @@ -29,7 +29,6 @@
     

    §1. All of this abstracts the code already found in the platform definitions.

    -
         typedef struct scan_directory {
             void *directory_handle;
    @@ -47,7 +46,6 @@ whatever the locale encoding is; the filenames coming back have to be
     transcoded the other way.
     

    -
         scan_directory *Directories::open(pathname *P) {
             scan_directory *D = CREATE(scan_directory);
    diff --git a/docs/foundation-module/3-em.html b/docs/foundation-module/3-em.html
    index 054a399..d2c1c3d 100644
    --- a/docs/foundation-module/3-em.html
    +++ b/docs/foundation-module/3-em.html
    @@ -32,7 +32,6 @@
     issued. If this returns FALSE, nothing is printed to stderr.
     

    -
         int (*errors_handler)(text_stream *, int) = NULL;
         void (*internal_errors_handler)(void *, char *, char *, int) = NULL;
    @@ -75,7 +74,6 @@ or streams systems, and therefore must be written with a little care to use
     the temporary stream, not some other string which might need fresh allocation.
     

    -
         void Errors::fatal(char *message) {
             TEMPORARY_TEXT(ERM)
    @@ -155,7 +153,6 @@ occurs unexpectedly, and one way to do that is to force a division by zero.
     (This is only enabled by -crash at the command line and is for debugging only.)
     

    -
         int debugger_mode = FALSE;
         void Errors::enter_debugger_mode(void) {
    @@ -185,7 +182,6 @@ occurs unexpectedly, and one way to do that is to force a division by zero.
     specify this at three levels of abstraction:
     

    -
         void Errors::nowhere(char *message) {
             Errors::in_text_file(message, NULL);
    @@ -217,7 +213,6 @@ specify this at three levels of abstraction:
     

    §6. Which funnel through:

    -
         void Errors::at_position(char *message, filename *file, int line) {
             TEMPORARY_TEXT(ERM)
    @@ -247,7 +242,6 @@ specify this at three levels of abstraction:
     

    §7. Lastly:

    -
         void Errors::with_file(char *message, filename *F) {
             TEMPORARY_TEXT(ERM)
    diff --git a/docs/foundation-module/3-fln.html b/docs/foundation-module/3-fln.html
    index 3b3460c..6d50d74 100644
    --- a/docs/foundation-module/3-fln.html
    +++ b/docs/foundation-module/3-fln.html
    @@ -34,7 +34,6 @@ are a single instance of the following. (Note that the text part is stored
     as Unicode code points, regardless of what text encoding the locale has.)
     

    -
         typedef struct filename {
             struct pathname *pathname_of_location;
    @@ -50,7 +49,6 @@ as Unicode code points, regardless of what text encoding the locale has.)
     

    §2. Creation. A filename is made by supplying a pathname and a leafname.

    -
         filename *Filenames::in_folder(pathname *P, text_stream *file_name) {
             return Filenames::primitive(file_name, 0, Str::len(file_name), P);
    @@ -78,7 +76,6 @@ as Unicode code points, regardless of what text encoding the locale has.)
     

    §3. Strings to filenames. The following takes a textual name and returns a filename.

    -
         filename *Filenames::from_text(text_stream *path) {
             int i = 0, pos = -1;
    @@ -119,7 +116,6 @@ as Unicode code points, regardless of what text encoding the locale has.)
     

    §4. The writer. And conversely:

    -
         void Filenames::writer(OUTPUT_STREAM, char *format_string, void *vF) {
             filename *F = (filename *) vF;
    @@ -142,7 +138,6 @@ as Unicode code points, regardless of what text encoding the locale has.)
     

    §5. And again relative to a given pathname:

    -
         void Filenames::to_text_relative(OUTPUT_STREAM, filename *F, pathname *P) {
             TEMPORARY_TEXT(ft);
    @@ -165,7 +160,6 @@ as Unicode code points, regardless of what text encoding the locale has.)
     
     

    §6. Reading off the folder.

    -
         pathname *Filenames::get_path_to(filename *F) {
             if (F == NULL) return NULL;
    @@ -179,7 +173,6 @@ as Unicode code points, regardless of what text encoding the locale has.)
     
     

    §7. Reading off the leafname.

    -
         filename *Filenames::without_path(filename *F) {
             return Filenames::in_folder(NULL, F->leafname);
    @@ -214,7 +207,6 @@ an accidental brush of the keyboard. Thus frog.jpg when deciding the likely file format.
     

    -
         void Filenames::write_extension(OUTPUT_STREAM, filename *F) {
             int on = FALSE;
    @@ -316,7 +308,6 @@ that we must transcode the filename to whatever the locale expects before
     we call fopen, which is the main reason for the wrapper.
     

    -
         FILE *Filenames::fopen(filename *F, char *usage) {
             char transcoded_pathname[4*MAX_FILENAME_LENGTH];
    @@ -348,7 +339,6 @@ compare two filenames by seeing if they have the same canonical form
     when printed out.
     

    -
         int Filenames::eq(filename *F1, filename *F2) {
             if (F1 == F2) return TRUE;
    @@ -369,7 +359,6 @@ when printed out.
     
     

    §12. Timestamps.

    -
         time_t Filenames::timestamp(filename *F) {
             char transcoded_pathname[4*MAX_FILENAME_LENGTH];
    diff --git a/docs/foundation-module/3-pth.html b/docs/foundation-module/3-pth.html
    index 81d962d..d7b0d5f 100644
    --- a/docs/foundation-module/3-pth.html
    +++ b/docs/foundation-module/3-pth.html
    @@ -34,7 +34,6 @@ directory), and "filename" to mean a location of a file. For example:
     
     

    -
             /Users/rblackmore/Documents/Fireball
     
    @@ -44,7 +43,6 @@ directory), and "filename" to mean a location of a file. For example:

    -
             /Users/rblackmore/Documents/Fireball/whoosh.aiff
     
    @@ -64,7 +62,6 @@ describe a folder which doesn't exist on disc.

    -
             /Users/rblackmore/Documents/
     
    @@ -81,7 +78,6 @@ to begin with FOLDER_SEPARATOR -
         typedef struct pathname {
             struct text_stream *intermediate;
    @@ -99,7 +95,6 @@ host file system.
     HOME, if it exists.
     

    -
         pathname *home_path = NULL;
         void Pathnames::start(void) {
    @@ -118,7 +113,6 @@ host file system.
     
     

    §3. Installation folder.

    -
         pathname *installation_path = NULL;
         void Pathnames::set_installation_path(pathname *P) {
    @@ -159,7 +153,6 @@ host file system.
     then going one level deeper, using the supplied name.
     

    -
         pathname *Pathnames::subfolder(pathname *P, text_stream *folder_name) {
             return Pathnames::primitive(folder_name, 0, Str::len(folder_name), P);
    @@ -191,7 +184,6 @@ except possibly for an initial slash, so for example /paris/roubaix is different.
     

    -
         pathname *Pathnames::from_text(text_stream *path) {
             return Pathnames::from_text_relative(NULL, path);
    @@ -220,7 +212,6 @@ except possibly for an initial slash, so for example §6. Writer. Conversely, by the miracle of depth-first recursion:
     

    -
         void Pathnames::writer(OUTPUT_STREAM, char *format_string, void *vP) {
             pathname *P = (pathname *) vP;
    @@ -250,7 +241,6 @@ for example,
     
     

    -
             /Users/rblackmore/Documents/Fireball/tablature
     
    @@ -260,7 +250,6 @@ for example,

    -
             /Users/rblackmore/Documents/
     
    @@ -270,7 +259,6 @@ for example,

    -
             Fireball/tablature
     
    @@ -280,7 +268,6 @@ so it's probably not wise to use it with filenames typed in at the command line.

    -
         void Pathnames::to_text_relative(OUTPUT_STREAM, pathname *P, pathname *R) {
             TEMPORARY_TEXT(rt);
    @@ -319,7 +306,6 @@ line.
     on the file system with that path.
     

    -
         int Pathnames::create_in_file_system(pathname *P) {
             if (P == NULL) return TRUE; the root of the file system always exists
    @@ -343,7 +329,6 @@ the dest tree an exact
     anything different which was originally in dest).
     

    -
         void Pathnames::rsync(pathname *source, pathname *dest) {
             char transcoded_source[4*MAX_FILENAME_LENGTH];
    diff --git a/docs/foundation-module/3-shl.html b/docs/foundation-module/3-shl.html
    index 5a06e72..da2e74a 100644
    --- a/docs/foundation-module/3-shl.html
    +++ b/docs/foundation-module/3-shl.html
    @@ -35,7 +35,6 @@ standard for POSIX, so will work on MacOS and Linux, but on a Windows system
     they would need to be read in a POSIX-style environment like Cygwin.
     

    -
         void Shell::quote_path(OUTPUT_STREAM, pathname *P) {
             TEMPORARY_TEXT(FN);
    @@ -86,7 +85,6 @@ they would need to be read in a POSIX-style environment like Cygwin.
     

    §2. The generic shell code to apply command to a file F:

    -
         void Shell::apply(char *command, filename *F) {
             TEMPORARY_TEXT(COMMAND)
    @@ -115,7 +113,6 @@ they would need to be read in a POSIX-style environment like Cygwin.
     

    §3. Applications to using rm and cp:

    -
         void Shell::rm(filename *F) {
             Shell::apply("rm", F);
    @@ -143,7 +140,6 @@ they would need to be read in a POSIX-style environment like Cygwin.
     from both stdout and stderr to the same named file.
     

    -
         void Shell::redirect(OUTPUT_STREAM, filename *F) {
             Shell::plain(OUT, ">");
    diff --git a/docs/foundation-module/3-tm.html b/docs/foundation-module/3-tm.html
    index f308787..5afbe2a 100644
    --- a/docs/foundation-module/3-tm.html
    +++ b/docs/foundation-module/3-tm.html
    @@ -31,7 +31,6 @@
     

    §1. Clock. From the local environment, we'll extract the time at which we're running.

    -
         time_t right_now;
         struct tm *the_present = NULL;
    @@ -55,7 +54,6 @@ in one session with output generated another, even though that was on two
     different dates.
     

    -
         void Time::fix(void) {
             struct tm start;
    diff --git a/docs/foundation-module/4-chr.html b/docs/foundation-module/4-chr.html
    index 5500aab..3618248 100644
    --- a/docs/foundation-module/4-chr.html
    +++ b/docs/foundation-module/4-chr.html
    @@ -30,7 +30,6 @@
     
     

    §1. Character classes.

    -
         wchar_t Characters::tolower(wchar_t c) {
             return (wchar_t) tolower((int) c);
    @@ -80,7 +79,6 @@
     

    §2. White space classes:

    -
         int Characters::is_space_or_tab(int c) {
             if ((c == ' ') || (c == '\t')) return TRUE;
    @@ -103,7 +101,6 @@ sense of the Treaty of Babel rules on leading and trailing spaces in
     iFiction records.
     

    -
         int Characters::is_babel_whitespace(int c) {
             if ((c == ' ') || (c == '\t') || (c == '\x0a')
    @@ -120,7 +117,6 @@ iFiction records.
     sufficient correctly to handle all characters in the ZSCII set.
     

    -
         int Characters::combine_accent(int accent, int letter) {
             switch(accent) {
    @@ -180,7 +176,6 @@ sufficient correctly to handle all characters in the ZSCII set.
     the more obvious accents from it.
     

    -
         int Characters::make_filename_safe(int charcode) {
             charcode = Characters::remove_accent(charcode);
    @@ -196,7 +191,6 @@ the more obvious accents from it.
     

    §6. The following strips the accent, if present, from an ISO Latin-1 character:

    -
         int Characters::remove_accent(int charcode) {
             switch (charcode) {
    diff --git a/docs/foundation-module/4-cst.html b/docs/foundation-module/4-cst.html
    index e8a7a35..578d8c0 100644
    --- a/docs/foundation-module/4-cst.html
    +++ b/docs/foundation-module/4-cst.html
    @@ -55,7 +55,6 @@ the maximum length of a pathname, which is 1024 on Mac OS X.
     

    §2. Occasionally we need access to the real, unbounded strlen:

    -
         int CStrings::strlen_unbounded(const char *p) {
             return (int) strlen(p);
    @@ -72,7 +71,6 @@ result in a malformatted shell command being passed to the operating system,
     which we cannot risk.
     

    -
         int CStrings::check_len(int n) {
             if ((n > MAX_STRING_LENGTH) || (n < 0)) Errors::fatal("String overflow\n");
    @@ -88,7 +86,6 @@ which we cannot risk.
     non-terminated string, though this should never actually happen.
     

    -
         int CStrings::len(char *str) {
             for (int i=0; i<=MAX_STRING_LENGTH; i++)
    @@ -106,7 +103,6 @@ non-terminated string, though this should never actually happen.
     bounds-checked:
     

    -
         void CStrings::copy(char *to, char *from) {
             CStrings::check_len(CStrings::len(from));
    @@ -123,7 +119,6 @@ bounds-checked:
     

    §6. String comparisons will be done with the following, not strcmp directly:

    -
         int CStrings::ne(char *A, char *B) {
             return (CStrings::cmp(A, B) == 0)?FALSE:TRUE;
    @@ -137,7 +132,6 @@ bounds-checked:
     

    §7. On the rare occasions when we need to sort alphabetically we'll also call:

    -
         int CStrings::cmp(char *A, char *B) {
             if ((A == NULL) || (A[0] == 0)) {
    @@ -157,7 +151,6 @@ bounds-checked:
     whose locale is encoded as UTF-8.
     

    -
         void CStrings::transcode_ISO_string_to_UTF8(char *p, char *dest) {
             int i, j;
    @@ -185,7 +178,6 @@ result is therefore not a well-formed string and we have to fix matters by
     hand. This I think makes for opaque code. So:
     

    -
         void CStrings::truncated_strcpy(char *to, char *from, int max) {
             int i;
    diff --git a/docs/foundation-module/4-pm.html b/docs/foundation-module/4-pm.html
    index 9d2a40b..f56b424 100644
    --- a/docs/foundation-module/4-pm.html
    +++ b/docs/foundation-module/4-pm.html
    @@ -32,7 +32,6 @@
     of line terminator will always be stripped out before this is applied.
     

    -
         int Regexp::white_space(int c) {
             if ((c == ' ') || (c == '\t')) return TRUE;
    @@ -49,7 +48,6 @@ C and has other meanings in other languages, but it's legal in C-for-Inform
     identifiers.
     

    -
         int Regexp::identifier_char(int c) {
             if ((c == '_') || (c == ':') ||
    @@ -70,7 +68,6 @@ easily be done as a regular expression using 
         int Regexp::find_expansion(text_stream *text, wchar_t on1, wchar_t on2,
             wchar_t off1, wchar_t off2, int *len) {
    @@ -93,7 +90,6 @@ here is much quicker.
     

    §4. Still more simply:

    -
         int Regexp::find_open_brace(text_stream *text) {
             for (int i=0; i < Str::len(text); i++)
    @@ -111,7 +107,6 @@ here is much quicker.
     equivalent to Regexp::match(p, " *"), but much faster.
     

    -
         int Regexp::string_is_white_space(text_stream *text) {
             LOOP_THROUGH_TEXT(P, text)
    @@ -137,7 +132,6 @@ short texts against particularly simple patterns. Here is an example of use:
     
     

    -
             match_results mr = Regexp::create_mr();
             if (Regexp::match(&mr, text, L"fish (%d+) ([a-zA-Z_][a-zA-Z0-9_]*) *") {
    @@ -176,7 +170,6 @@ terms would be subexpressions 0 and 1.
     

    §7. The internal state of the matcher is stored as follows:

    -
         typedef struct match_position {
             int tpos; position within text being matched
    @@ -212,6 +205,7 @@ are not. They are simply a little faster to access if short.
             int no_matched_texts;
             struct match_result exp_storage[MAX_BRACKETED_SUBEXPRESSIONS];
             struct text_stream *exp[MAX_BRACKETED_SUBEXPRESSIONS];
    +        int exp_at[MAX_BRACKETED_SUBEXPRESSIONS];
         } match_results;
     
    @@ -228,13 +222,14 @@ result strings grow very large), so that it's very quick to allocate and deallocate.

    -
         match_results Regexp::create_mr(void) {
             match_results mr;
             mr.no_matched_texts = 0;
    -        for (int i=0; i<MAX_BRACKETED_SUBEXPRESSIONS; i++)
    +        for (int i=0; i<MAX_BRACKETED_SUBEXPRESSIONS; i++) {
                 mr.exp[i] = NULL;
    +            mr.exp_at[i] = -1;
    +        }
             return mr;
         }
     
    @@ -259,7 +254,6 @@ deallocate.
     

    §10. So, then: the matcher itself.

    -
         int Regexp::match(match_results *mr, text_stream *text, wchar_t *pattern) {
             if (mr) Regexp::prepare(mr);
    @@ -268,10 +262,27 @@ deallocate.
             return rv;
         }
     
    +    int Regexp::match_from(match_results *mr, text_stream *text, wchar_t *pattern,
    +        int x, int allow_partial) {
    +        int match_to = x;
    +        if (x < Str::len(text)) {
    +            if (mr) Regexp::prepare(mr);
    +            match_position at;
    +            at.tpos = x; at.ppos = 0; at.bc = 0; at.bl = 0;
    +            match_to = Regexp::match_r(mr, text, pattern, &at, allow_partial);
    +            if (match_to == -1) {
    +                match_to = x;
    +                if (mr) Regexp::dispose_of(mr);
    +            }
    +        }
    +        return match_to - x;
    +    }
    +
         void Regexp::prepare(match_results *mr) {
             if (mr) {
                 mr->no_matched_texts = 0;
                 for (int i=0; i<MAX_BRACKETED_SUBEXPRESSIONS; i++) {
    +                mr->exp_at[i] = -1;
                     if (mr->exp[i]) STREAM_CLOSE(mr->exp[i]);
                     mr->exp_storage[i].match_text_struct =
                         Streams::new_buffer(
    @@ -287,11 +298,12 @@ deallocate.
     
     

    The function Regexp::match is used in 3/cla (§11, §12), 8/ws (§7.3.2, §7.3.3.2, §7.3.3.2.1, §7.2.2.1, §7.2.2.3), 8/bf (§3).

    +

    The function Regexp::match_from appears nowhere else.

    +

    The function Regexp::prepare is used in §14.

    §11.

    -
         int Regexp::match_r(match_results *mr, text_stream *text, wchar_t *pattern,
             match_position *scan_from, int allow_partial) {
    @@ -447,6 +459,7 @@ to implement numeric repetition counts, which we won't need:
                     Str::clear(mr->exp[i]);
                     for (int j = at.brackets_start[i]; j <= at.brackets_end[i]; j++)
                         PUT_TO(mr->exp[i], Str::get_at(text, j));
    +                mr->exp_at[i] = at.brackets_start[i];
                 }
                 mr->no_matched_texts = at.bc;
             }
    @@ -514,9 +527,10 @@ is literal.
                     }
                     *from = ppos; *to = ppos; return LITERAL_CLASS;
                 case '[':
    -                *from = ppos+2;
    +                *from = ppos+1;
    +                ppos += 2;
                     while ((pattern[ppos]) && (pattern[ppos] != ']')) ppos++;
    -                *to = ppos - 1; *len = ppos - *from + 1;
    +                *to = ppos - 1; *len = ppos - *from + 2;
                     return LITERAL_CLASS;
                 case ' ':
                     *len = 1; return WHITESPACE_CLASS;
    @@ -531,7 +545,6 @@ is literal.
     
     

    §13.

    -
         int Regexp::test_cclass(int c, int chcl, int range_from, int range_to, wchar_t *drawn_from, int reverse) {
             int match = FALSE;
    @@ -550,6 +563,9 @@ is literal.
                     ((c >= 'a') && (c <= 'z')) ||
                     ((c >= '0') && (c <= '9'))) match = TRUE; break;
                 case LITERAL_CLASS:
    +                if ((range_to > range_from) && (drawn_from[range_from] == '^')) {
    +                    range_from++; reverse = reverse?FALSE:TRUE;
    +                }
                     for (int j = range_from; j <= range_to; j++) {
                         int c1 = drawn_from[j], c2 = c1;
                         if ((j+1 < range_to) && (drawn_from[j+1] == '-')) { c2 = drawn_from[j+2]; j += 2; }
    @@ -576,7 +592,6 @@ For example,
     
     

    -
             Regexp::replace(text, L"[aeiou]", L"!", REP_REPEATING);
     
    diff --git a/docs/foundation-module/4-sm.html b/docs/foundation-module/4-sm.html index eb019de..355f311 100644 --- a/docs/foundation-module/4-sm.html +++ b/docs/foundation-module/4-sm.html @@ -63,7 +63,6 @@ here is just the size of the initial memory block, which is fastest to access.

    -
         text_stream *Str::new(void) {
             return Str::new_with_capacity(32);
    @@ -93,7 +92,6 @@ we want the duplicate always to be writeable, so that NULL.
     

    -
         text_stream *Str::duplicate(text_stream *E) {
             if (E == NULL) return Str::new();
    @@ -115,7 +113,6 @@ with the capacity of the initial block large enough to hold the whole
     thing plus a little extra, for efficiency's sake.
     

    -
         text_stream *Str::new_from_wide_string(wchar_t *C_string) {
             text_stream *S = CREATE(text_stream);
    @@ -155,7 +152,6 @@ thing plus a little extra, for efficiency's sake.
     

    §5. And sometimes we want to use an existing stream object:

    -
         text_stream *Str::from_wide_string(text_stream *S, wchar_t *c_string) {
             if (Streams::open_from_wide_string(S, c_string) == FALSE) return NULL;
    @@ -176,7 +172,6 @@ thing plus a little extra, for efficiency's sake.
     
     

    §6. Converting to C strings.

    -
         void Str::copy_to_ISO_string(char *C_string, text_stream *S, int buffer_size) {
             Streams::write_as_ISO_string(C_string, S, buffer_size);
    @@ -207,7 +202,6 @@ thing plus a little extra, for efficiency's sake.
     
     

    §7. Converting to integers.

    -
         int Str::atoi(text_stream *S, int index) {
             char buffer[32];
    @@ -227,7 +221,6 @@ thing plus a little extra, for efficiency's sake.
     

    §8. Length. A puritan would return a size_t here, but I am not a puritan.

    -
         int Str::len(text_stream *S) {
             return Streams::get_position(S);
    @@ -236,7 +229,7 @@ thing plus a little extra, for efficiency's sake.
     
     

    -

    The function Str::len is used in §3, §7, §10, §11, §12, §13, §14, §15, §16, §18, §19, §20, §21, §23, §24, §25, 2/dl (§9), 3/cla (§13, §14, §14.1), 3/pth (§4, §5, §7), 3/fln (§2, §3, §5, §9), 4/taa (§2.1), 4/pm (§3, §4, §11.3, §14), 5/htm (§7, §15), 5/ee (§7.1, §7.2.3, §7.2.4), 7/vn (§7, §7.1, §10), 8/ws (§7.3, §7.3.3.1, §7.2.2.3.1, §7.2.2.4), 8/bdfw (§5, §6), 8/bf (§3, §4, §5, §6, §9).

    +

    The function Str::len is used in §3, §7, §10, §11, §12, §13, §14, §15, §16, §18, §19, §20, §21, §23, §24, §25, 2/dl (§9), 3/cla (§13, §14, §14.1), 3/pth (§4, §5, §7), 3/fln (§2, §3, §5, §9), 4/taa (§2.1), 4/pm (§3, §4, §10, §11.3, §14), 5/htm (§7, §15), 5/ee (§7.1, §7.2.3, §7.2.4), 7/vn (§7, §7.1, §10), 8/ws (§7.3, §7.3.3.1, §7.2.2.3.1, §7.2.2.4), 8/bdfw (§5, §6), 8/bf (§3, §4, §5, §6, §9).

    §9. Position markers. A position marker is a lightweight way to refer to a particular position in a given string. Position 0 is before the first character; if, for @@ -246,7 +239,6 @@ but positive ones well past the end of the string are legal. (Doing things at those positions may well not be, of course.)

    -
         typedef struct string_position {
             struct text_stream *S;
    @@ -261,7 +253,6 @@ at those positions may well not be, of course.)
     

    §10. You can then find a position in a given string thus:

    -
         string_position Str::start(text_stream *S) {
             string_position P; P.S = S; P.index = 0; return P;
    @@ -289,7 +280,6 @@ at those positions may well not be, of course.)
     

    §11. And you can step forwards or backwards:

    -
         string_position Str::back(string_position P) {
             if (P.index > 0) P.index--; return P;
    @@ -345,7 +335,6 @@ at those positions may well not be, of course.)
     

    §13. Character operations. How to get at individual characters, then, now that we can refer to positions:

    -
         wchar_t Str::get(string_position P) {
             if ((P.S == NULL) || (P.index < 0)) return 0;
    @@ -380,7 +369,6 @@ at those positions may well not be, of course.)
     
     

    §14.

    -
         void Str::put(string_position P, wchar_t C) {
             if (P.index < 0) internal_error("wrote before start of string");
    @@ -407,7 +395,6 @@ at those positions may well not be, of course.)
     
     

    §15. Truncation.

    -
         void Str::clear(text_stream *S) {
             Str::truncate(S, 0);
    @@ -427,7 +414,6 @@ at those positions may well not be, of course.)
     
     

    §16. Copying.

    -
         void Str::concatenate(text_stream *S1, text_stream *S2) {
             Streams::copy(S1, S2);
    @@ -459,7 +445,6 @@ at those positions may well not be, of course.)
     

    §17. A subtly different operation is to set a string equal to a given C string:

    -
         void Str::copy_ISO_string(text_stream *S, char *C_string) {
             Str::clear(S);
    @@ -488,7 +473,6 @@ at those positions may well not be, of course.)
     

    §18. Comparisons. We provide both case sensitive and insensitive versions.

    -
         int Str::eq(text_stream *S1, text_stream *S2) {
             if ((Str::len(S1) == Str::len(S2)) && (Str::cmp(S1, S2) == 0)) return TRUE;
    @@ -525,7 +509,6 @@ at those positions may well not be, of course.)
     alphabetic sorting, like strlen in the C standard library.
     

    -
         int Str::cmp(text_stream *S1, text_stream *S2) {
             for (string_position P = Str::start(S1), Q = Str::start(S2);
    @@ -560,7 +543,6 @@ alphabetic sorting, like strlen

    -
             Str::suffix_eq(I"wayzgoose", I"snow goose", N)
     
    @@ -572,7 +554,6 @@ alphabetic sorting, like strlen -
         int Str::prefix_eq(text_stream *S1, text_stream *S2, int N) {
             int L1 = Str::len(S1), L2 = Str::len(S2);
    @@ -623,7 +604,6 @@ for the staff of a publishing house.)
     
     

    §21.

    -
         int Str::eq_wide_string(text_stream *S1, wchar_t *S2) {
             if (Str::len(S1) == (int) wcslen(S2)) {
    @@ -660,7 +640,6 @@ for the staff of a publishing house.)
     
     

    §22. White space.

    -
         int Str::is_whitespace(text_stream *S) {
             LOOP_THROUGH_TEXT(pos, S)
    @@ -677,7 +656,6 @@ for the staff of a publishing house.)
     

    §23. This removes spaces and tabs from both ends:

    -
         void Str::trim_white_space(text_stream *S) {
             int len = Str::len(S), i = 0, j = 0;
    @@ -741,7 +719,6 @@ for the staff of a publishing house.)
     
     

    §24. Deleting characters.

    -
         void Str::delete_first_character(text_stream *S) {
             Str::delete_nth_character(S, 0);
    @@ -780,7 +757,6 @@ for the staff of a publishing house.)
     
     

    §25. Substrings.

    -
         void Str::substr(OUTPUT_STREAM, string_position from, string_position to) {
             if (from.S != to.S) internal_error("substr on two different strings");
    @@ -853,7 +829,6 @@ a mutex. There's no real performance concern because the following routine
     is run just once per I-literal in the source code, when the program starts up.
     

    -
         dictionary *string_literals_dictionary = NULL;
     
    diff --git a/docs/foundation-module/4-taa.html b/docs/foundation-module/4-taa.html
    index 79394a3..993bdf6 100644
    --- a/docs/foundation-module/4-taa.html
    +++ b/docs/foundation-module/4-taa.html
    @@ -348,7 +348,6 @@ it there.
     

    §3. Single nodes are matched thus:

    -
         int Tries::matches(match_trie *pos, int c) {
             if (pos->match_character == TRIE_ANYTHING) return TRUE;
    @@ -387,7 +386,6 @@ it there.
     

    §4. Where:

    -
         match_trie *Tries::new(int mc) {
             match_trie *T = CREATE(match_trie);
    @@ -410,7 +408,6 @@ start again with the next, and so on. Inform therefore often matches text
     against a linked list of tries: we'll call that an "avinue".
     

    -
         typedef struct match_avinue {
             struct match_trie *the_trie;
    @@ -426,7 +423,6 @@ against a linked list of tries: we'll call that an "avinue".
     head node (of either sort).
     

    -
         match_avinue *Tries::new_avinue(int from_start) {
             match_avinue *A = CREATE(match_avinue);
    @@ -451,7 +447,6 @@ head node (of either sort).
     tries.
     

    -
         match_avinue *Tries::duplicate_avinue(match_avinue *A) {
             match_avinue *F = NULL, *FL = NULL;
    @@ -476,7 +471,6 @@ tries.
     trie in turn until one matches (if it does).
     

    -
         wchar_t *Tries::search_avinue(match_avinue *T, text_stream *p) {
             wchar_t *result = NULL;
    @@ -494,7 +488,6 @@ trie in turn until one matches (if it does).
     
     

    §9. Logging.

    -
         void Tries::log_avinue(OUTPUT_STREAM, void *vA) {
             match_avinue *A = (match_avinue *) vA;
    diff --git a/docs/foundation-module/4-tf.html b/docs/foundation-module/4-tf.html
    index 6be7656..fbc66dc 100644
    --- a/docs/foundation-module/4-tf.html
    +++ b/docs/foundation-module/4-tf.html
    @@ -38,7 +38,6 @@ standard way to read in and iterate through lines of a text file.
     file actually exists on disc at a given filename:
     

    -
         int TextFiles::exists(filename *F) {
             FILE *HANDLE = Filenames::fopen(F, "rb");
    @@ -55,7 +54,6 @@ file actually exists on disc at a given filename:
     

    §2. Text file positions. Here's how we record a position in a text file:

    -
         typedef struct text_file_position {
             struct filename *text_file_filename;
    @@ -75,7 +73,6 @@ file actually exists on disc at a given filename:
     

    §3. For access:

    -
         int TextFiles::get_line_count(text_file_position *tfp) {
             if (tfp == NULL) return 0;
    @@ -90,7 +87,6 @@ file actually exists on disc at a given filename:
     

    §4. And this is for a real nowhere man:

    -
         text_file_position TextFiles::nowhere(void) {
             text_file_position tfp;
    @@ -113,7 +109,6 @@ we preserve a pointer called state
     
    -
     
         int TextFiles::read(filename *F, int escape_oddities, char *message, int serious,
             void (iterator)(text_stream *, text_file_position *, void *),
    @@ -272,7 +267,6 @@ Text files seldom come that large.
     
     

    §6.

    -
         void TextFiles::read_line(OUTPUT_STREAM, int escape_oddities, text_file_position *tfp) {
             Str::clear(OUT);
    @@ -303,7 +297,6 @@ Text files seldom come that large.
     calling the following:
     

    -
         void TextFiles::lose_interest(text_file_position *tfp) {
             tfp->actively_scanning = FALSE;
    @@ -339,7 +332,6 @@ check the return value for EOF
     
    -
     
         typedef struct unicode_file_buffer {
             char unicode_feed_buffer[32]; holds a single escape such as "[unicode 3106]"
    diff --git a/docs/foundation-module/4-ws.html b/docs/foundation-module/4-ws.html
    index 13e37fb..bc6767c 100644
    --- a/docs/foundation-module/4-ws.html
    +++ b/docs/foundation-module/4-ws.html
    @@ -36,7 +36,6 @@ words instead of bytes. The character values should be Unicode code points.
     wrappers simply abstract the standard C library's handling.
     

    -
         int Wide::len(wchar_t *p) {
             return (int) wcslen(p);
    @@ -50,7 +49,6 @@ wrappers simply abstract the standard C library's handling.
     

    §2. On the rare occasions when we need to sort alphabetically we'll also call:

    -
         int Wide::cmp(wchar_t *A, wchar_t *B) {
             return wcscmp(A, B);
    @@ -63,7 +61,6 @@ wrappers simply abstract the standard C library's handling.
     
     

    §3.

    -
         int Wide::atoi(wchar_t *p) {
             return (int) wcstol(p, NULL, 10);
    diff --git a/docs/foundation-module/5-ee.html b/docs/foundation-module/5-ee.html
    index f249846..bbf0d7c 100644
    --- a/docs/foundation-module/5-ee.html
    +++ b/docs/foundation-module/5-ee.html
    @@ -47,7 +47,6 @@ of "volumes" (possibly only one), each of which is a series of "chapters"
     essentially individual HTML files, plus some images.
     

    -
         typedef struct ebook {
             struct linked_list *metadata_list; of ebook_datum: DCMI-standard bibliographic data
    @@ -79,7 +78,6 @@ identify ebooks; we need to maintain a small dictionary, and so small that a
     list is entirely sufficient.
     

    -
         typedef struct ebook_datum {
             struct text_stream *key;
    @@ -95,7 +93,6 @@ list is entirely sufficient.
     

    §3. As noted above, we use the following to stratify the book:

    -
         typedef struct ebook_volume {
             struct text_stream *volume_title;
    @@ -124,7 +121,6 @@ list is entirely sufficient.
     pages:
     

    -
         typedef struct ebook_page {
             struct text_stream *page_title;
    @@ -163,7 +159,6 @@ pages:
     
     

    §5. Creation.

    -
         ebook *Epub::new(text_stream *title, char *prefix) {
             ebook *B = CREATE(ebook);
    @@ -306,7 +301,6 @@ image separately. (This is a little inconvenient, but indoc wants to do it
     that way.)
     

    -
         pathname *Epub::begin_construction(ebook *B, pathname *P, filename *cover_image) {
             if (Pathnames::create_in_file_system(P) == FALSE) return NULL;
    @@ -430,7 +424,6 @@ images" at the ThreePress Consulting blog.)
     
     

    §7.

    -
         void Epub::end_construction(ebook *B) {
             <Attach default metadata 7.1>;
    diff --git a/docs/foundation-module/5-htm.html b/docs/foundation-module/5-htm.html
    index 4e3f9a8..bd363ec 100644
    --- a/docs/foundation-module/5-htm.html
    +++ b/docs/foundation-module/5-htm.html
    @@ -45,7 +45,6 @@ this auditing. To do that, we atach an 
         typedef struct HTML_file_state {
             int XHTML_flag; writing strict XHTML for use in epubs
    @@ -76,7 +75,6 @@ and in the right order. Thus we can't open body, open div, close body, because
     that would be a div tag which was pushed but not pulled.
     

    -
         int unique_xref = 0;
         typedef struct HTML_tag {
    @@ -106,7 +104,6 @@ that would be a div tag which was pushed but not pulled.
     
     

    §4.

    -
         void HTML::pop_tag(OUTPUT_STREAM, char *tag) {
             HTML_file_state *hs = Streams::get_HTML_file_state(OUT);
    @@ -134,7 +131,6 @@ that would be a div tag which was pushed but not pulled.
     

    §5. At the end, therefore, no tags must remain unpulled.

    -
         void HTML::completed(OUTPUT_STREAM) {
             HTML_file_state *hs = Streams::get_HTML_file_state(OUT);
    @@ -188,7 +184,6 @@ of which are variadic and have to be written out the old-fashioned way:
     

    §7. Which themselves depend on these routines:

    -
         void HTML::tag(OUTPUT_STREAM, char *tag, text_stream *details) {
             WRITE("<%s", tag);
    @@ -269,7 +264,6 @@ of which are variadic and have to be written out the old-fashioned way:
     
     

    §8. Head.

    -
         void HTML::begin_head(OUTPUT_STREAM, filename *CSS_file) {
             HTML_file_state *hs = Streams::get_HTML_file_state(OUT);
    @@ -302,7 +296,6 @@ of which are variadic and have to be written out the old-fashioned way:
     
     

    §9.

    -
         void HTML::title(OUTPUT_STREAM, text_stream *title) {
             HTML_OPEN("title");
    @@ -317,7 +310,6 @@ of which are variadic and have to be written out the old-fashioned way:
     
     

    §10. Scripts and styles.

    -
         void HTML::open_javascript(OUTPUT_STREAM, int define_project) {
             HTML_OPEN_WITH("script", "type=\"text/javascript\"");
    @@ -392,7 +384,6 @@ of which are variadic and have to be written out the old-fashioned way:
     

    §11. The helper simply performs a textual copy:

    -
         void HTML::incorporate_helper(text_stream *line_of_template,
             text_file_position *tfp, void *OUT) {
    @@ -406,7 +397,6 @@ of which are variadic and have to be written out the old-fashioned way:
     
     

    §12. Body.

    -
         void HTML::begin_body(OUTPUT_STREAM, text_stream *class) {
             if (class) HTML_OPEN_WITH("body", "class=\"%S\"", class)
    @@ -427,7 +417,6 @@ of which are variadic and have to be written out the old-fashioned way:
     
     

    §13. Divisions.

    -
         void HTML::begin_div_with_id(OUTPUT_STREAM, char *id) {
             HTML_OPEN_WITH("div", "id=\"%s\"", id);
    @@ -487,7 +476,6 @@ of which are variadic and have to be written out the old-fashioned way:
     
     

    §14. Images.

    -
         void HTML::image(OUTPUT_STREAM, filename *F) {
             HTML_TAG_WITH("img", "src=\"%/f\"", F);
    @@ -500,7 +488,6 @@ of which are variadic and have to be written out the old-fashioned way:
     
     

    §15. Links.

    -
         void HTML::anchor(OUTPUT_STREAM, text_stream *id) {
             HTML_OPEN_WITH("a", "id=\"%S\"", id); HTML_CLOSE("a");
    @@ -554,7 +541,6 @@ of which are variadic and have to be written out the old-fashioned way:
     

    §16. Tables. Opening a generic bland table with reasonable column spacing:

    -
         void HTML::begin_plain_html_table(OUTPUT_STREAM) {
             HTML::begin_html_table(OUT, NULL, FALSE, 0, 0, 0, 0, 0);
    @@ -574,7 +560,6 @@ of which are variadic and have to be written out the old-fashioned way:
     

    §17. And some more general code:

    -
         void HTML::begin_html_table(OUTPUT_STREAM, char *colour, int full_width,
             int border, int cellspacing, int cellpadding, int height, int width) {
    @@ -792,7 +777,6 @@ of which are variadic and have to be written out the old-fashioned way:
     
     

    §19. Miscellaneous.

    -
         void HTML::comment(OUTPUT_STREAM, text_stream *text) {
             WRITE("<!--%S-->\n", text);
    @@ -822,7 +806,6 @@ of which are variadic and have to be written out the old-fashioned way:
     

    §20. HTML colours. Inform uses these when constructing the map in the World index.

    -
         typedef struct colour_translation {
             wchar_t *chip_name;
    @@ -985,7 +968,6 @@ of which are variadic and have to be written out the old-fashioned way:
     need to run quickly.
     

    -
         wchar_t *HTML::translate_colour_name(wchar_t *original) {
             for (int j=0; Wide::cmp(table_of_translations[j].chip_name, L""); j++)
    @@ -1001,7 +983,6 @@ need to run quickly.
     
     

    §22.

    -
         void HTML::begin_colour(OUTPUT_STREAM, text_stream *col) {
             HTML_OPEN_WITH("span", "style=\"color:#%S\"", col);
    diff --git a/docs/foundation-module/6-bf.html b/docs/foundation-module/6-bf.html
    index 977987e..beb2b82 100644
    --- a/docs/foundation-module/6-bf.html
    +++ b/docs/foundation-module/6-bf.html
    @@ -32,7 +32,6 @@
     arranged with most significant byte (MSB) first.
     

    -
         int BinaryFiles::read_int8(FILE *binary_file, unsigned int *result) {
             int c1 = getc(binary_file);
    @@ -106,7 +105,6 @@ arranged with most significant byte (MSB) first.
     
     

    §2.

    -
         int BinaryFiles::write_int32(FILE *binary_file, unsigned int val) {
             int c1 = (int) ((val >> 24) & 0xFF);
    @@ -130,7 +128,6 @@ arranged with most significant byte (MSB) first.
     integers 32 or 64 bits wide:
     

    -
         void BinaryFiles::swap_bytes32(unsigned int *value) {
             unsigned int result = (((*value & 0xff) << 24) +
    @@ -165,7 +162,6 @@ of data plus a most significant bit which marks that a continuation byte
     follows:
     

    -
         int BinaryFiles::read_variable_length_integer(FILE *binary_file, unsigned int *result) {
             int c;
    @@ -189,7 +185,6 @@ follows:
     floating-point numbers:
     

    -
         int BinaryFiles::read_float80(FILE *binary_file, unsigned int *result) {
             int c1, c2, exp;
    @@ -221,7 +216,6 @@ then null terminate it to make it valid C string. (length plus 1 bytes long.)
     

    -
         int BinaryFiles::read_string(FILE *binary_file, char *string, unsigned int length) {
             if (length > 0) {
    @@ -239,7 +233,6 @@ be at least length plu
     
     

    §7. Size.

    -
         long int BinaryFiles::size(filename *F) {
             FILE *TEST_FILE = BinaryFiles::try_to_open_for_reading(F);
    @@ -262,7 +255,6 @@ be at least length plu
     
     

    §8. Opening.

    -
         FILE *BinaryFiles::open_for_reading(filename *F) {
             FILE *handle = Filenames::fopen(F, "rb");
    @@ -305,7 +297,6 @@ be at least length plu
     or to system APIs.
     

    -
         int BinaryFiles::copy(filename *from, filename *to, int suppress_error) {
             if ((from == NULL) || (to == NULL))
    diff --git a/docs/foundation-module/6-id.html b/docs/foundation-module/6-id.html
    index 2ec9c6a..b62343f 100644
    --- a/docs/foundation-module/6-id.html
    +++ b/docs/foundation-module/6-id.html
    @@ -47,7 +47,6 @@ actual image: this can have many forms, but in all cases tells us the
     height and width.
     

    -
         int ImageFiles::get_JPEG_dimensions(FILE *JPEG_file, unsigned int *width, unsigned int *height) {
             unsigned int sig, length;
    @@ -106,7 +105,6 @@ need to scan the IHDR chunk, of which the pixel width and height are the
     first two words (section 11.2.2).
     

    -
         int ImageFiles::get_PNG_dimensions(FILE *PNG_file, unsigned int *width, unsigned int *height) {
             unsigned int sig1, sig2, length, type;
    diff --git a/docs/foundation-module/6-sd.html b/docs/foundation-module/6-sd.html
    index cb182e6..c0eb1d4 100644
    --- a/docs/foundation-module/6-sd.html
    +++ b/docs/foundation-module/6-sd.html
    @@ -33,7 +33,6 @@ explicate the following, see the specifications for AIFF and OGG headers.
     Durations are measured in centiseconds.
     

    -
         int SoundFiles::get_AIFF_duration(FILE *pFile, unsigned int *pDuration,
             unsigned int *pBitsPerSecond, unsigned int *pChannels, unsigned int *pSampleRate) {
    @@ -86,7 +85,6 @@ Durations are measured in centiseconds.
     
     

    §2. OGG Vorbis files.

    -
         int SoundFiles::get_OggVorbis_duration(FILE *pFile, unsigned int *pDuration,
             unsigned int *pBitsPerSecond, unsigned int *pChannels, unsigned int *pSampleRate) {
    @@ -215,7 +213,6 @@ compiles for will allow. At present, the Glulx virtual machine does not
     officially support MIDI, which makes the question moot.
     

    -
         int SoundFiles::get_MIDI_information(FILE *pFile, unsigned int *pType,
             unsigned int *pNumTracks) {
    diff --git a/docs/foundation-module/7-vn.html b/docs/foundation-module/7-vn.html
    index 1a7b7aa..0ee4646 100644
    --- a/docs/foundation-module/7-vn.html
    +++ b/docs/foundation-module/7-vn.html
    @@ -62,7 +62,6 @@ time of the Reykjavik summit between Presidents Gorbachev and Reagan:
     
     

    -
             Moonmist
             Infocom interactive fiction - a mystery story
    @@ -126,7 +125,6 @@ Instead they are used to represent the absence of a version number.
     (In particular, a string of -1s is null.)
     

    -
         semantic_version_number VersionNumbers::null(void) {
         #pragma clang diagnostic push
    @@ -159,7 +157,6 @@ Instead they are used to represent the absence of a version number.
     

    §5. Printing and parsing. Printing is simple enough:

    -
         void VersionNumbers::to_text(OUTPUT_STREAM, semantic_version_number V) {
             if (VersionNumbers::is_null(V)) { WRITE("null"); return; }
    @@ -189,7 +186,6 @@ variadic macros are not carefully enough type-checked by <
     to catch this sort of slip.
     

    -
         void VersionNumbers::writer(OUTPUT_STREAM, char *format_string, void *vE) {
             semantic_version_number *V = (semantic_version_number *) vE;
    @@ -303,7 +299,6 @@ of digits only, and alphabetically otherwise; and finally the number of
     prerelease elements. Build metadata is disregarded entirely.
     

    -
         int VersionNumbers::le(semantic_version_number V1, semantic_version_number V2) {
             for (int i=0; i<SEMVER_NUMBER_DEPTH; i++) {
    @@ -346,7 +341,6 @@ prerelease elements. Build metadata is disregarded entirely.
     as if they were 0:
     

    -
         int VersionNumbers::floor(int N) {
             if (N < 0) return 0;
    @@ -363,7 +357,6 @@ otherwise. If the value has more than about 10 digits, then the result will
     not be meaningful, which I think is a technical violation of the standard.
     

    -
         int VersionNumbers::strict_atoi(text_stream *T) {
             LOOP_THROUGH_TEXT(pos, T)
    @@ -385,7 +378,6 @@ These are trichotomous, that is, for each pair 
     
    -
     
         int VersionNumbers::eq(semantic_version_number V1, semantic_version_number V2) {
             if ((VersionNumbers::le(V1, V2)) && (VersionNumbers::le(V2, V1)))
    @@ -425,7 +417,6 @@ is true.
     

    §12. And the following can be used for sorting, following the strcmp convention.

    -
         int VersionNumbers::cmp(semantic_version_number V1, semantic_version_number V2) {
             if (VersionNumbers::eq(V1, V2)) return 0;
    diff --git a/docs/foundation-module/7-vnr.html b/docs/foundation-module/7-vnr.html
    index 8c9953c..4534768 100644
    --- a/docs/foundation-module/7-vnr.html
    +++ b/docs/foundation-module/7-vnr.html
    @@ -73,7 +73,6 @@ no sense for an interval to be empty seen from one end but not the other.
     and ) for open ones.
     

    -
         void VersionNumberRanges::write_range(OUTPUT_STREAM, semver_range *R) {
             if (R == NULL) internal_error("no range");
    @@ -99,7 +98,6 @@ and ) for open ones.
     number lies in this range.
     

    -
         semver_range *VersionNumberRanges::any_range(void) {
             semver_range *R = CREATE(semver_range);
    @@ -138,7 +136,6 @@ alphanumeric string gives it lower precendence than all other prerelease
     versions.
     

    -
         semver_range *VersionNumberRanges::compatibility_range(semantic_version_number V) {
             semver_range *R = VersionNumberRanges::any_range();
    @@ -164,7 +161,6 @@ versions.
     inclusive:
     

    -
         semver_range *VersionNumberRanges::at_least_range(semantic_version_number V) {
             semver_range *R = VersionNumberRanges::any_range();
    @@ -190,7 +186,6 @@ inclusive:
     

    §6. Here we test whether V is at least a given end, and then at most:

    -
         int VersionNumberRanges::version_ge_end(semantic_version_number V, range_end E) {
             switch (E.end_type) {
    @@ -234,7 +229,6 @@ inclusive:
     

    §7. This allows a simple way to write:

    -
         int VersionNumberRanges::in_range(semantic_version_number V, semver_range *R) {
             if (R == NULL) return TRUE;
    @@ -264,7 +258,6 @@ upper end of [..., 4]
     the boundary value is the same, open ends are stricter than closed ends.
     

    -
         int VersionNumberRanges::stricter(range_end E1, range_end E2, int lower) {
             if ((E1.end_type == EMPTY_RANGE_END) && (E2.end_type == EMPTY_RANGE_END)) return 0;
    @@ -295,7 +288,6 @@ different version needs.) The return value is true if an actual change took
     place, and false otherwise.
     

    -
         int VersionNumberRanges::intersect_range(semver_range *R1, semver_range *R2) {
             int lc = VersionNumberRanges::stricter(R1->lower, R2->lower, TRUE);
    diff --git a/docs/foundation-module/8-bdfw.html b/docs/foundation-module/8-bdfw.html
    index 9363f6f..b25c1ec 100644
    --- a/docs/foundation-module/8-bdfw.html
    +++ b/docs/foundation-module/8-bdfw.html
    @@ -32,7 +32,6 @@
     convenient to store them directly here than to use a dictionary.
     

    -
         typedef struct web_bibliographic_datum {
             struct text_stream *key;
    @@ -60,7 +59,6 @@ convenient to store them directly here than to use a dictionary.
     

    §3. The following check the rules:

    -
         int Bibliographic::datum_can_be_declared(web_md *Wm, text_stream *key) {
             web_bibliographic_datum *bd = Bibliographic::look_up_datum(Wm, key);
    @@ -84,7 +82,6 @@ convenient to store them directly here than to use a dictionary.
     

    §4. Initialising a web. Each web has the following slate of data:

    -
         void Bibliographic::initialise_data(web_md *Wm) {
             web_bibliographic_datum *bd;
    @@ -123,7 +120,6 @@ convenient to store them directly here than to use a dictionary.
     to check that all the mandatory declarations have indeed been made:
     

    -
         void Bibliographic::check_required_data(web_md *Wm) {
             web_bibliographic_datum *bd;
    @@ -142,7 +138,6 @@ to check that all the mandatory declarations have indeed been made:
     

    §6. Reading bibliographic data. Key names are case-sensitive.

    -
         text_stream *Bibliographic::get_datum(web_md *Wm, text_stream *key) {
             web_bibliographic_datum *bd = Bibliographic::look_up_datum(Wm, key);
    @@ -179,7 +174,6 @@ to check that all the mandatory declarations have indeed been made:
     so this routine never fails.
     

    -
         web_bibliographic_datum *Bibliographic::set_datum(web_md *Wm, text_stream *key, text_stream *val) {
             web_bibliographic_datum *bd = Bibliographic::look_up_datum(Wm, key);
    diff --git a/docs/foundation-module/8-bf.html b/docs/foundation-module/8-bf.html
    index 4210ce4..54f0a08 100644
    --- a/docs/foundation-module/8-bf.html
    +++ b/docs/foundation-module/8-bf.html
    @@ -32,7 +32,6 @@
     file exists, we look for the same thing in the current working directory.
     

    -
         filename *BuildFiles::build_file_for_web(web_md *WS) {
             filename *F = Filenames::in_folder(WS->path_to_web, I"build.txt");
    @@ -50,7 +49,6 @@ file exists, we look for the same thing in the current working directory.
     

    §2. The format of such a file is very simple: up to three text fields:

    -
         typedef struct build_file_data {
             struct text_stream *prerelease_text;
    @@ -66,7 +64,6 @@ file exists, we look for the same thing in the current working directory.
     

    §3. Here's how to read in a build file:

    -
         build_file_data BuildFiles::read(filename *F) {
             build_file_data bfd;
    @@ -104,7 +101,6 @@ file exists, we look for the same thing in the current working directory.
     

    §4. And here is how to write one:

    -
         void BuildFiles::write(build_file_data bfd, filename *F) {
             text_stream vr_stream;
    @@ -128,7 +124,6 @@ file exists, we look for the same thing in the current working directory.
     set some bibliographic data.
     

    -
         void BuildFiles::set_bibliographic_data_for(web_md *WS) {
             filename *F = BuildFiles::build_file_for_web(WS);
    @@ -158,7 +153,6 @@ the Contents page to specify all of this.
     guaranteed to produce a semver-legal version number.
     

    -
         void BuildFiles::deduce_semver(web_md *WS) {
             TEMPORARY_TEXT(combined);
    @@ -194,7 +188,6 @@ guaranteed to produce a semver-legal version number.
     number if we find that the date has changed.
     

    -
         void BuildFiles::advance_for_web(web_md *WS) {
             filename *F = BuildFiles::build_file_for_web(WS);
    @@ -222,7 +215,6 @@ number if we find that the date has changed.
     rewrite dateline to today and return FALSE.
     

    -
         int BuildFiles::dated_today(text_stream *dateline) {
             char *monthname[12] = { "January", "February", "March", "April", "May", "June",
    @@ -256,7 +248,6 @@ then it rolls back around to A
     
    -
     
         void BuildFiles::increment(text_stream *T) {
             if (Str::len(T) != 4) Errors::with_text("build code malformed: %S", T);
    diff --git a/docs/foundation-module/8-wm.html b/docs/foundation-module/8-wm.html
    index 72d9da3..431a1e0 100644
    --- a/docs/foundation-module/8-wm.html
    +++ b/docs/foundation-module/8-wm.html
    @@ -62,7 +62,6 @@ means.
     
     

    §2.

    -
         module *WebModules::new(text_stream *name, pathname *at, int m) {
             module *M = CREATE(module);
    @@ -90,7 +89,6 @@ main web — which can be tangled, and results in an actual program —
     internally named "(main)", a name which the user will never see.
     

    -
         module *WebModules::create_main_module(web_md *WS) {
             return WebModules::new(I"(main)", WS->path_to_web, READING_WEB_MOM);
    @@ -107,7 +105,6 @@ needed when constructing makefiles, since the source code in B affects the
     program generated by A.
     

    -
         void WebModules::dependency(module *A, module *B) {
             if ((A == NULL) || (B == NULL)) internal_error("no module");
    @@ -123,7 +120,6 @@ program generated by A.
     (At one time there was going to be a more elaborate search hierarchy.)
     

    -
         typedef struct module_search {
             struct pathname *path_to_search;
    @@ -137,7 +133,6 @@ program generated by A.
     
     

    §6.

    -
         module_search *WebModules::make_search_path(pathname *ext_path) {
             module_search *ms = CREATE(module_search);
    @@ -154,7 +149,6 @@ program generated by A.
     called Blah on disc? We try four possibilities in sequence:
     

    -
         module *WebModules::find(web_md *WS, module_search *ms, text_stream *name, pathname *X) {
             TEMPORARY_TEXT(T);
    @@ -202,7 +196,6 @@ and a dependency created from the web's