From 04343a64a5c79fd6d572f909248580c8f9236604 Mon Sep 17 00:00:00 2001 From: Graham Nelson Date: Mon, 25 Apr 2022 16:46:46 +0100 Subject: [PATCH] Allowed parameter-less preprocessor macro definitions --- Figures/colony.txt | 2 +- Figures/help.txt | 1 + README.md | 2 +- Tangled/inweb.c | 161 +++++++++++---------- build.txt | 4 +- colony.txt | 2 +- docs/eastertide/S-rtd.html | 2 +- docs/eastertide/index.html | 2 +- docs/foundation-module/1-fm.html | 2 +- docs/foundation-module/1-pp.html | 2 +- docs/foundation-module/1-wp.html | 2 +- docs/foundation-module/2-dct.html | 2 +- docs/foundation-module/2-dl.html | 2 +- docs/foundation-module/2-fc.html | 2 +- docs/foundation-module/2-lcl.html | 2 +- docs/foundation-module/2-llas.html | 2 +- docs/foundation-module/2-mmr.html | 2 +- docs/foundation-module/2-mth.html | 2 +- docs/foundation-module/2-str.html | 2 +- docs/foundation-module/2-trs.html | 2 +- docs/foundation-module/2-wal.html | 2 +- docs/foundation-module/3-cf.html | 2 +- docs/foundation-module/3-cla.html | 2 +- docs/foundation-module/3-drc.html | 2 +- docs/foundation-module/3-em.html | 4 +- docs/foundation-module/3-fln.html | 2 +- docs/foundation-module/3-pth.html | 2 +- docs/foundation-module/3-shl.html | 2 +- docs/foundation-module/3-tm.html | 2 +- docs/foundation-module/4-chr.html | 2 +- docs/foundation-module/4-cst.html | 2 +- docs/foundation-module/4-pm.html | 4 +- docs/foundation-module/4-prp.html | 35 +++-- docs/foundation-module/4-sm.html | 4 +- docs/foundation-module/4-taa.html | 2 +- docs/foundation-module/4-tf.html | 2 +- docs/foundation-module/4-ws.html | 2 +- docs/foundation-module/5-ee.html | 2 +- docs/foundation-module/5-htm.html | 2 +- docs/foundation-module/6-bf.html | 2 +- docs/foundation-module/6-id.html | 2 +- docs/foundation-module/6-sd.html | 2 +- docs/foundation-module/7-vn.html | 2 +- docs/foundation-module/7-vnr.html | 2 +- docs/foundation-module/8-bdfw.html | 2 +- docs/foundation-module/8-bf.html | 2 +- docs/foundation-module/8-st.html | 2 +- docs/foundation-module/8-wm.html | 2 +- docs/foundation-module/8-ws.html | 2 +- docs/foundation-module/P-abgtf.html | 2 +- docs/foundation-module/index.html | 2 +- docs/foundation-test/S-pc.html | 2 +- docs/foundation-test/S-ut.html | 2 +- docs/foundation-test/index.html | 2 +- docs/goldbach/S-sp.html | 2 +- docs/goldbach/S-tsoe.html | 2 +- docs/goldbach/goldbach.pdf | Bin 251998 -> 251998 bytes docs/goldbach/index.html | 2 +- docs/index.html | 2 +- docs/inweb/1-apacs.html | 2 +- docs/inweb/1-bsc.html | 2 +- docs/inweb/1-cnf.html | 10 +- docs/inweb/1-pc.html | 6 +- docs/inweb/1-ptt.html | 2 +- docs/inweb/1-ts.html | 2 +- docs/inweb/2-ec.html | 2 +- docs/inweb/2-lc.html | 2 +- docs/inweb/2-pm.html | 2 +- docs/inweb/2-pn.html | 2 +- docs/inweb/2-tgs.html | 2 +- docs/inweb/2-tp.html | 2 +- docs/inweb/2-tr.html | 2 +- docs/inweb/3-ta.html | 6 +- docs/inweb/3-tc.html | 2 +- docs/inweb/3-tt.html | 2 +- docs/inweb/3-tw.html | 2 +- docs/inweb/3-twot.html | 2 +- docs/inweb/4-as.html | 2 +- docs/inweb/4-cl.html | 2 +- docs/inweb/4-is.html | 2 +- docs/inweb/4-lm.html | 2 +- docs/inweb/4-pl.html | 2 +- docs/inweb/4-taf.html | 2 +- docs/inweb/4-tp.html | 2 +- docs/inweb/5-df.html | 2 +- docs/inweb/5-fm.html | 2 +- docs/inweb/5-hf.html | 2 +- docs/inweb/5-ptf.html | 2 +- docs/inweb/5-tf.html | 2 +- docs/inweb/5-tu.html | 2 +- docs/inweb/5-wt.html | 2 +- docs/inweb/6-cln.html | 4 +- docs/inweb/6-cs.html | 2 +- docs/inweb/6-gs.html | 2 +- docs/inweb/6-mkf.html | 18 ++- docs/inweb/6-rw.html | 2 +- docs/inweb/M-awwp.html | 2 +- docs/inweb/M-htwaw.html | 2 +- docs/inweb/M-iti.html | 2 +- docs/inweb/M-mwiw.html | 4 +- docs/inweb/M-rc.html | 3 +- docs/inweb/M-spl.html | 2 +- docs/inweb/M-tid.html | 2 +- docs/inweb/M-wtaw.html | 2 +- docs/inweb/P-htpw.html | 2 +- docs/inweb/index.html | 2 +- docs/twinprimes/twinprimes.html | 2 +- foundation-module/Chapter 4/Preprocessor.w | 11 ++ 108 files changed, 258 insertions(+), 201 deletions(-) diff --git a/Figures/colony.txt b/Figures/colony.txt index 09ad969..8170c72 100644 --- a/Figures/colony.txt +++ b/Figures/colony.txt @@ -16,4 +16,4 @@ web: "twinprimes" at "inweb/Examples/twinprimes.inweb" in "inweb/docs/twinprimes web: "eastertide" at "inweb/Examples/eastertide" in "inweb/docs/eastertide" web: "intest" at "intest" in "intest/docs" -web: "inform" at "inform/docs-src/index.inweb" in "inform/docs" +web: "inform" at "inform/docs-src/overview.inweb" in "inform/docs" diff --git a/Figures/help.txt b/Figures/help.txt index f0a932e..f68969a 100644 --- a/Figures/help.txt +++ b/Figures/help.txt @@ -33,6 +33,7 @@ for analysing a web: -functions catalogue the functions in the web -gitignore X write a .gitignore file for this web and store it in X -makefile X write a makefile for this web and store it in X + -platform X use platform X (e.g. 'windows') when making e.g. makefiles -prototype X translate makefile from prototype X -scan scan the web -structures catalogue the structures in the web diff --git a/README.md b/README.md index 853b708..501ff82 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Inweb 7 -v7-alpha.1+1A93 'Escape to Danger' (24 April 2022) +v7-alpha.1+1A94 'Escape to Danger' (25 April 2022) ## About Inweb diff --git a/Tangled/inweb.c b/Tangled/inweb.c index 3df5557..1e192ee 100644 --- a/Tangled/inweb.c +++ b/Tangled/inweb.c @@ -1332,19 +1332,19 @@ typedef struct preprocessor_state { struct general_pointer specifics; wchar_t comment_character; } preprocessor_state; -#line 422 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 433 "inweb/foundation-module/Chapter 4/Preprocessor.w" typedef struct preprocessor_variable { struct text_stream *name; struct text_stream *value; CLASS_DEFINITION } preprocessor_variable; -#line 442 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 453 "inweb/foundation-module/Chapter 4/Preprocessor.w" typedef struct preprocessor_variable_set { struct linked_list *variables; /* of |preprocessor_variable| */ struct preprocessor_variable_set *outer; CLASS_DEFINITION } preprocessor_variable_set; -#line 515 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 526 "inweb/foundation-module/Chapter 4/Preprocessor.w" typedef struct preprocessor_macro { /* syntax */ struct text_stream *identifier; @@ -1368,7 +1368,7 @@ typedef struct preprocessor_macro { CLASS_DEFINITION } preprocessor_macro; -#line 539 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 550 "inweb/foundation-module/Chapter 4/Preprocessor.w" typedef struct preprocessor_macro_parameter { struct text_stream *name; struct text_stream *definition_token; @@ -3426,41 +3426,41 @@ void Preprocessor__set_loop_var_name(preprocessor_loop *loop, text_stream *name void Preprocessor__add_loop_iteration(preprocessor_loop *loop, text_stream *value) ; #line 98 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__scan_line(text_stream *line, text_file_position *tfp, void *X) ; -#line 169 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 180 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__expand(text_stream *text, text_file_position *tfp, preprocessor_state *PPS) ; -#line 408 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 419 "inweb/foundation-module/Chapter 4/Preprocessor.w" int Preprocessor__acceptable_variable_name(text_stream *name) ; -#line 428 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 439 "inweb/foundation-module/Chapter 4/Preprocessor.w" text_stream * Preprocessor__read_variable(preprocessor_variable *var) ; -#line 432 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 443 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__write_variable(preprocessor_variable *var, text_stream *val) ; -#line 448 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 459 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_variable_set * Preprocessor__new_variable_set(preprocessor_variable_set *outer) ; -#line 455 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 466 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_variable * Preprocessor__find_variable_in_one(text_stream *name, preprocessor_variable_set *set) ; -#line 465 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 476 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_variable * Preprocessor__find_variable(text_stream *name, preprocessor_variable_set *set) ; -#line 479 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 490 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_variable * Preprocessor__ensure_variable(text_stream *name, preprocessor_variable_set *in_set) ; -#line 556 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 567 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_macro * Preprocessor__new_macro(linked_list *L, text_stream *name, text_stream *parameter_specification, void (*expander)(preprocessor_macro *, preprocessor_state *, text_stream **, preprocessor_loop *, text_file_position *), text_file_position *tfp) ; -#line 616 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 627 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__add_line_to_macro(preprocessor_macro *mm, text_stream *line, text_file_position *tfp) ; -#line 634 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 645 "inweb/foundation-module/Chapter 4/Preprocessor.w" linked_list * Preprocessor__list_of_reserved_macros(linked_list *special_macros) ; -#line 647 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 658 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__do_not_suppress_whitespace(preprocessor_macro *mm) ; -#line 652 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 663 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__new_loop_macro(linked_list *L, text_stream *name, text_stream *parameter_specification, void (*expander)(preprocessor_macro *, preprocessor_state *, text_stream **, preprocessor_loop *, text_file_position *), text_file_position *tfp) ; -#line 691 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 702 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_macro * Preprocessor__find_macro(linked_list *L, text_stream *name) ; -#line 706 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 717 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__default_expander(preprocessor_macro *mm, preprocessor_state *PPS, text_stream **parameter_values, preprocessor_loop *loop, text_file_position *tfp) ; -#line 723 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 734 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__set_expander(preprocessor_macro *mm, preprocessor_state *PPS, text_stream **parameter_values, preprocessor_loop *loop, text_file_position *tfp) ; -#line 738 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 749 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__repeat_expander(preprocessor_macro *mm, preprocessor_state *PPS, text_stream **parameter_values, preprocessor_loop *loop, text_file_position *tfp) ; -#line 767 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 778 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__end_loop_expander(preprocessor_macro *mm, preprocessor_state *PPS, text_stream **parameter_values, preprocessor_loop *loop, text_file_position *tfp) ; #line 77 "inweb/foundation-module/Chapter 4/Tries and Avinues.w" wchar_t * Tries__search(match_trie *T, text_stream *p, wchar_t *add_outcome) ; @@ -8733,11 +8733,11 @@ int CommandLine__read_pair_p(text_stream *opt, text_stream *opt_val, int N, ; innocuous = TRUE; break; case VERSION_CLSW: { PRINT("inweb"); - char *svn = "7-alpha.1+1A92"; + char *svn = "7-alpha.1+1A93"; if (svn[0]) PRINT(" version %s", svn); char *vname = "Escape to Danger"; if (vname[0]) PRINT(" '%s'", vname); - char *d = "23 April 2022"; + char *d = "24 April 2022"; if (d[0]) PRINT(" (%s)", d); PRINT("\n"); innocuous = TRUE; break; @@ -11244,9 +11244,24 @@ void Preprocessor__scan_line(text_stream *line, text_file_position *tfp, void *X { #line 117 "inweb/foundation-module/Chapter 4/Preprocessor.w" match_results mr = Regexp__create_mr(); + if (Regexp__match(&mr, line, L" *{define: *(%C+) *} *")) +{ +#line 125 "inweb/foundation-module/Chapter 4/Preprocessor.w" + if (PPS->defining) + Errors__in_text_file("nested definitions are not allowed", tfp); + text_stream *name = mr.exp[0]; + text_stream *parameter_specification = Str__new(); + PPS->defining = Preprocessor__new_macro(PPS->known_macros, name, + parameter_specification, Preprocessor__default_expander, tfp); + Regexp__dispose_of(&mr); + return; + +} +#line 118 "inweb/foundation-module/Chapter 4/Preprocessor.w" +; if (Regexp__match(&mr, line, L" *{define: *(%C+) (%c*)} *")) { -#line 124 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 135 "inweb/foundation-module/Chapter 4/Preprocessor.w" if (PPS->defining) Errors__in_text_file("nested definitions are not allowed", tfp); text_stream *name = mr.exp[0]; @@ -11257,11 +11272,11 @@ void Preprocessor__scan_line(text_stream *line, text_file_position *tfp, void *X return; } -#line 118 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 119 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; if (Regexp__match(&mr, line, L" *{end-define} *")) { -#line 139 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 150 "inweb/foundation-module/Chapter 4/Preprocessor.w" if (PPS->defining == NULL) Errors__in_text_file("{end-define} without {define: ...}", tfp); PPS->defining = NULL; @@ -11269,17 +11284,17 @@ void Preprocessor__scan_line(text_stream *line, text_file_position *tfp, void *X return; } -#line 119 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 120 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; if (PPS->defining) { -#line 134 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 145 "inweb/foundation-module/Chapter 4/Preprocessor.w" Preprocessor__add_line_to_macro(PPS->defining, line, tfp); Regexp__dispose_of(&mr); return; } -#line 120 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 121 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; Regexp__dispose_of(&mr); @@ -11289,7 +11304,7 @@ void Preprocessor__scan_line(text_stream *line, text_file_position *tfp, void *X Preprocessor__expand(line, tfp, PPS); { -#line 146 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 157 "inweb/foundation-module/Chapter 4/Preprocessor.w" if (PPS->suppress_newline == FALSE) { text_stream *OUT = PPS->dest; if (Str__len(line) == 0) { @@ -11307,7 +11322,7 @@ void Preprocessor__scan_line(text_stream *line, text_file_position *tfp, void *X ; } -#line 169 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 180 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__expand(text_stream *text, text_file_position *tfp, preprocessor_state *PPS) { TEMPORARY_TEXT(before_matter) TEMPORARY_TEXT(braced_matter) @@ -11333,18 +11348,18 @@ void Preprocessor__expand(text_stream *text, text_file_position *tfp, preprocess if (after_times) { { -#line 206 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 217 "inweb/foundation-module/Chapter 4/Preprocessor.w" if (Preprocessor__acceptable_variable_name(braced_matter)) { { -#line 267 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 278 "inweb/foundation-module/Chapter 4/Preprocessor.w" Preprocessor__expand(before_matter, tfp, PPS); if (PPS->repeat_sp > 0) { WRITE_TO(PPS->dest, "{%S}", braced_matter); } else { { -#line 312 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 323 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_variable *var = Preprocessor__find_variable(braced_matter, PPS->stack_frame); if (var) { @@ -11357,13 +11372,13 @@ void Preprocessor__expand(text_stream *text, text_file_position *tfp, preprocess } } -#line 271 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 282 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; } Preprocessor__expand(after_matter, tfp, PPS); } -#line 207 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 218 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; } else { text_stream *identifier = braced_matter; @@ -11375,7 +11390,7 @@ void Preprocessor__expand(text_stream *text, text_file_position *tfp, preprocess } { -#line 234 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 245 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_macro *loop_mm; LOOP_OVER_LINKED_LIST(loop_mm, preprocessor_macro, PPS->known_macros) if (Str__len(loop_mm->loop_name) > 0) { @@ -11404,7 +11419,7 @@ void Preprocessor__expand(text_stream *text, text_file_position *tfp, preprocess } } -#line 216 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 227 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; preprocessor_macro *mm = Preprocessor__find_macro(PPS->known_macros, identifier); @@ -11416,7 +11431,7 @@ void Preprocessor__expand(text_stream *text, text_file_position *tfp, preprocess } else { { -#line 283 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 294 "inweb/foundation-module/Chapter 4/Preprocessor.w" if (mm->suppress_whitespace_when_expanding) { while (Characters__is_whitespace(Str__get_last_char(before_matter))) Str__delete_last_character(before_matter); @@ -11438,12 +11453,12 @@ void Preprocessor__expand(text_stream *text, text_file_position *tfp, preprocess } else { { -#line 327 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 338 "inweb/foundation-module/Chapter 4/Preprocessor.w" text_stream *parameter_values[MAX_PP_MACRO_PARAMETERS]; for (int i=0; ino_parameters; i++) if (parameter_values[i] == NULL) if (mm->parameters[i]->optional == FALSE) { @@ -11494,13 +11509,13 @@ void Preprocessor__expand(text_stream *text, text_file_position *tfp, preprocess } } -#line 330 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 341 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; preprocessor_loop *loop = NULL; if (mm->begins_loop) { -#line 391 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 402 "inweb/foundation-module/Chapter 4/Preprocessor.w" if (PPS->repeat_sp >= MAX_PREPROCESSOR_LOOP_DEPTH) { Errors__in_text_file("repetition too deep", tfp); } else { @@ -11515,27 +11530,27 @@ void Preprocessor__expand(text_stream *text, text_file_position *tfp, preprocess } } -#line 333 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 344 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; (*(mm->expander))(mm, PPS, parameter_values, loop, tfp); } -#line 302 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 313 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; if (mm->suppress_newline_after_expanding) PPS->suppress_newline = TRUE; } Preprocessor__expand(after_matter, tfp, PPS); } -#line 225 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 236 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; } Regexp__dispose_of(&mr); } } -#line 192 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 203 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; } else { WRITE_TO(PPS->dest, "%S", text); @@ -11545,7 +11560,7 @@ void Preprocessor__expand(text_stream *text, text_file_position *tfp, preprocess DISCARD_TEXT(after_matter) } -#line 408 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 419 "inweb/foundation-module/Chapter 4/Preprocessor.w" int Preprocessor__acceptable_variable_name(text_stream *name) { LOOP_THROUGH_TEXT(pos, name) { wchar_t c = Str__get(pos); @@ -11557,7 +11572,7 @@ int Preprocessor__acceptable_variable_name(text_stream *name) { return TRUE; } -#line 427 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 438 "inweb/foundation-module/Chapter 4/Preprocessor.w" text_stream *Preprocessor__read_variable(preprocessor_variable *var) { if (var == NULL) internal_error("no such pp variable"); @@ -11568,7 +11583,7 @@ void Preprocessor__write_variable(preprocessor_variable *var, text_stream *val) var->value = Str__duplicate(val); } -#line 447 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 458 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_variable_set *Preprocessor__new_variable_set(preprocessor_variable_set *outer) { preprocessor_variable_set *set = CREATE(preprocessor_variable_set); @@ -11597,7 +11612,7 @@ preprocessor_variable *Preprocessor__find_variable(text_stream *name, return NULL; } -#line 479 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 490 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_variable *Preprocessor__ensure_variable(text_stream *name, preprocessor_variable_set *in_set) { if (in_set == NULL) internal_error("variable without set"); @@ -11611,11 +11626,11 @@ preprocessor_variable *Preprocessor__ensure_variable(text_stream *name, return var; } -#line 538 "inweb/foundation-module/Chapter 4/Preprocessor.w" - -#line 545 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 549 "inweb/foundation-module/Chapter 4/Preprocessor.w" #line 556 "inweb/foundation-module/Chapter 4/Preprocessor.w" + +#line 567 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_macro *Preprocessor__new_macro(linked_list *L, text_stream *name, text_stream *parameter_specification, void (*expander)(preprocessor_macro *, preprocessor_state *, text_stream **, preprocessor_loop *, text_file_position *), @@ -11625,7 +11640,7 @@ preprocessor_macro *Preprocessor__new_macro(linked_list *L, text_stream *name, preprocessor_macro *new_macro = CREATE(preprocessor_macro); { -#line 570 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 581 "inweb/foundation-module/Chapter 4/Preprocessor.w" new_macro->identifier = Str__duplicate(name); new_macro->no_parameters = 0; @@ -11640,11 +11655,11 @@ preprocessor_macro *Preprocessor__new_macro(linked_list *L, text_stream *name, new_macro->suppress_whitespace_when_expanding = TRUE; } -#line 563 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 574 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; { -#line 584 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 595 "inweb/foundation-module/Chapter 4/Preprocessor.w" text_stream *spec = Str__duplicate(parameter_specification); match_results mr = Regexp__create_mr(); while (Regexp__match(&mr, spec, L" *(%C+): *(%C+) *(%c*)")) { @@ -11657,7 +11672,7 @@ preprocessor_macro *Preprocessor__new_macro(linked_list *L, text_stream *name, } else { { -#line 602 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 613 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_macro_parameter *new_parameter = CREATE(preprocessor_macro_parameter); new_parameter->name = Str__duplicate(par_name); new_parameter->definition_token = Str__duplicate(token_name); @@ -11669,7 +11684,7 @@ preprocessor_macro *Preprocessor__new_macro(linked_list *L, text_stream *name, new_macro->parameters[new_macro->no_parameters++] = new_parameter; } -#line 594 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 605 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; } } @@ -11678,13 +11693,13 @@ preprocessor_macro *Preprocessor__new_macro(linked_list *L, text_stream *name, Errors__in_text_file("parameter list for this definition is malformed", tfp); } -#line 564 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 575 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; ADD_TO_LINKED_LIST(new_macro, preprocessor_macro, L); return new_macro; } -#line 616 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 627 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__add_line_to_macro(preprocessor_macro *mm, text_stream *line, text_file_position *tfp) { if (mm->no_lines >= MAX_PP_MACRO_LINES) { @@ -11694,7 +11709,7 @@ void Preprocessor__add_line_to_macro(preprocessor_macro *mm, text_stream *line, } } -#line 634 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 645 "inweb/foundation-module/Chapter 4/Preprocessor.w" linked_list *Preprocessor__list_of_reserved_macros(linked_list *special_macros) { linked_list *L = NEW_LINKED_LIST(preprocessor_macro); Preprocessor__new_loop_macro(L, TL_IS_5, TL_IS_6, @@ -11749,7 +11764,7 @@ void Preprocessor__new_loop_macro(linked_list *L, text_stream *name, DISCARD_TEXT(subname) } -#line 691 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 702 "inweb/foundation-module/Chapter 4/Preprocessor.w" preprocessor_macro *Preprocessor__find_macro(linked_list *L, text_stream *name) { preprocessor_macro *mm; LOOP_OVER_LINKED_LIST(mm, preprocessor_macro, L) @@ -11758,7 +11773,7 @@ preprocessor_macro *Preprocessor__find_macro(linked_list *L, text_stream *name) return NULL; } -#line 706 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 717 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__default_expander(preprocessor_macro *mm, preprocessor_state *PPS, text_stream **parameter_values, preprocessor_loop *loop, text_file_position *tfp) { PPS->stack_frame = Preprocessor__new_variable_set(PPS->stack_frame); @@ -11772,7 +11787,7 @@ void Preprocessor__default_expander(preprocessor_macro *mm, preprocessor_state * PPS->stack_frame = PPS->stack_frame->outer; } -#line 723 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 734 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__set_expander(preprocessor_macro *mm, preprocessor_state *PPS, text_stream **parameter_values, preprocessor_loop *loop, text_file_position *tfp) { text_stream *name = parameter_values[0]; @@ -11785,7 +11800,7 @@ void Preprocessor__set_expander(preprocessor_macro *mm, preprocessor_state *PPS, Preprocessor__write_variable(var, value); } -#line 738 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 749 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__repeat_expander(preprocessor_macro *mm, preprocessor_state *PPS, text_stream **parameter_values, preprocessor_loop *loop, text_file_position *tfp) { text_stream *with = parameter_values[0]; @@ -11805,7 +11820,7 @@ void Preprocessor__repeat_expander(preprocessor_macro *mm, preprocessor_state *P Preprocessor__add_loop_iteration(loop, value); } -#line 767 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 778 "inweb/foundation-module/Chapter 4/Preprocessor.w" void Preprocessor__end_loop_expander(preprocessor_macro *mm, preprocessor_state *PPS, text_stream **parameter_values, preprocessor_loop *loop, text_file_position *tfp) { PPS->shadow_sp = 0; @@ -11821,7 +11836,7 @@ void Preprocessor__end_loop_expander(preprocessor_macro *mm, preprocessor_state LOOP_OVER_LINKED_LIST(value, text_stream, loop->iterations) { -#line 786 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 797 "inweb/foundation-module/Chapter 4/Preprocessor.w" Preprocessor__write_variable(loop_var, value); if (mm->span) { Preprocessor__expand(matter, tfp, PPS); @@ -11839,7 +11854,7 @@ void Preprocessor__end_loop_expander(preprocessor_macro *mm, preprocessor_state } } -#line 780 "inweb/foundation-module/Chapter 4/Preprocessor.w" +#line 791 "inweb/foundation-module/Chapter 4/Preprocessor.w" ; PPS->stack_frame = PPS->stack_frame->outer; } @@ -31631,7 +31646,7 @@ void Ctags__write(web *W, filename *F) { WRITE("!_TAG_FILE_SORTED\t0\t/0=unsorted, 1=sorted, 2=foldcase/\n"); WRITE("!_TAG_PROGRAM_AUTHOR\tGraham Nelson\t/graham.nelson@mod-langs.ox.ac.uk/\n"); WRITE("!_TAG_PROGRAM_NAME\tinweb\t//\n"); - WRITE("!_TAG_PROGRAM_VERSION\t7-alpha.1+1A92\t/built 23 April 2022/\n"); + WRITE("!_TAG_PROGRAM_VERSION\t7-alpha.1+1A93\t/built 24 April 2022/\n"); } #line 47 "inweb/Chapter 6/Ctags Support.w" diff --git a/build.txt b/build.txt index 301e834..f977eaf 100644 --- a/build.txt +++ b/build.txt @@ -1,3 +1,3 @@ Prerelease: alpha.1 -Build Date: 24 April 2022 -Build Number: 1A93 +Build Date: 25 April 2022 +Build Number: 1A94 diff --git a/colony.txt b/colony.txt index 09ad969..8170c72 100644 --- a/colony.txt +++ b/colony.txt @@ -16,4 +16,4 @@ web: "twinprimes" at "inweb/Examples/twinprimes.inweb" in "inweb/docs/twinprimes web: "eastertide" at "inweb/Examples/eastertide" in "inweb/docs/eastertide" web: "intest" at "intest" in "intest/docs" -web: "inform" at "inform/docs-src/index.inweb" in "inform/docs" +web: "inform" at "inform/docs-src/overview.inweb" in "inform/docs" diff --git a/docs/eastertide/S-rtd.html b/docs/eastertide/S-rtd.html index ff57aaf..6b196b2 100644 --- a/docs/eastertide/S-rtd.html +++ b/docs/eastertide/S-rtd.html @@ -40,7 +40,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/eastertide/index.html b/docs/eastertide/index.html index aae4d3d..16d6973 100644 --- a/docs/eastertide/index.html +++ b/docs/eastertide/index.html @@ -29,7 +29,7 @@

Repository

Related Projects

diff --git a/docs/foundation-module/1-fm.html b/docs/foundation-module/1-fm.html index 6471e77..79c8fd1 100644 --- a/docs/foundation-module/1-fm.html +++ b/docs/foundation-module/1-fm.html @@ -31,7 +31,7 @@

Repository

Related Projects

diff --git a/docs/foundation-module/1-pp.html b/docs/foundation-module/1-pp.html index e7068bd..7934ca8 100644 --- a/docs/foundation-module/1-pp.html +++ b/docs/foundation-module/1-pp.html @@ -31,7 +31,7 @@

Repository

Related Projects

diff --git a/docs/foundation-module/1-wp.html b/docs/foundation-module/1-wp.html index 2d231b3..1be37f7 100644 --- a/docs/foundation-module/1-wp.html +++ b/docs/foundation-module/1-wp.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/2-dct.html b/docs/foundation-module/2-dct.html index 6155465..cb61bb9 100644 --- a/docs/foundation-module/2-dct.html +++ b/docs/foundation-module/2-dct.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/2-dl.html b/docs/foundation-module/2-dl.html index 689d60c..592311f 100644 --- a/docs/foundation-module/2-dl.html +++ b/docs/foundation-module/2-dl.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/2-fc.html b/docs/foundation-module/2-fc.html index 34f77f5..1004bb9 100644 --- a/docs/foundation-module/2-fc.html +++ b/docs/foundation-module/2-fc.html @@ -31,7 +31,7 @@

Repository

Related Projects

diff --git a/docs/foundation-module/2-lcl.html b/docs/foundation-module/2-lcl.html index 40901a5..eaf1391 100644 --- a/docs/foundation-module/2-lcl.html +++ b/docs/foundation-module/2-lcl.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/2-llas.html b/docs/foundation-module/2-llas.html index 3a6bdd1..1734cb2 100644 --- a/docs/foundation-module/2-llas.html +++ b/docs/foundation-module/2-llas.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/2-mmr.html b/docs/foundation-module/2-mmr.html index 22a84a8..5795e85 100644 --- a/docs/foundation-module/2-mmr.html +++ b/docs/foundation-module/2-mmr.html @@ -53,7 +53,7 @@ MathJax = {

Repository

Related Projects

diff --git a/docs/foundation-module/2-mth.html b/docs/foundation-module/2-mth.html index 5441acd..3dc41cd 100644 --- a/docs/foundation-module/2-mth.html +++ b/docs/foundation-module/2-mth.html @@ -31,7 +31,7 @@

Repository

Related Projects

diff --git a/docs/foundation-module/2-str.html b/docs/foundation-module/2-str.html index be6f054..f3692b4 100644 --- a/docs/foundation-module/2-str.html +++ b/docs/foundation-module/2-str.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/2-trs.html b/docs/foundation-module/2-trs.html index cfc536f..68f3edc 100644 --- a/docs/foundation-module/2-trs.html +++ b/docs/foundation-module/2-trs.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/2-wal.html b/docs/foundation-module/2-wal.html index 9f85d73..612c38c 100644 --- a/docs/foundation-module/2-wal.html +++ b/docs/foundation-module/2-wal.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/3-cf.html b/docs/foundation-module/3-cf.html index fda6e49..7e957df 100644 --- a/docs/foundation-module/3-cf.html +++ b/docs/foundation-module/3-cf.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/3-cla.html b/docs/foundation-module/3-cla.html index 3456872..72f1aa0 100644 --- a/docs/foundation-module/3-cla.html +++ b/docs/foundation-module/3-cla.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/3-drc.html b/docs/foundation-module/3-drc.html index 189542a..81fd7f1 100644 --- a/docs/foundation-module/3-drc.html +++ b/docs/foundation-module/3-drc.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/3-em.html b/docs/foundation-module/3-em.html index 05fad47..6b4a7f0 100644 --- a/docs/foundation-module/3-em.html +++ b/docs/foundation-module/3-em.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

@@ -179,7 +179,7 @@ specify this at three levels of abstraction: Errors::in_text_file(message, NULL); } -void Errors::in_text_file(char *message, text_file_position *here) { +void Errors::in_text_file(char *message, text_file_position *here) { if (here) Errors::at_position(message, here->text_file_filename, here->line_count); else diff --git a/docs/foundation-module/3-fln.html b/docs/foundation-module/3-fln.html index 43e7f1c..9894312 100644 --- a/docs/foundation-module/3-fln.html +++ b/docs/foundation-module/3-fln.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/3-pth.html b/docs/foundation-module/3-pth.html index f2efb87..3d6ea6f 100644 --- a/docs/foundation-module/3-pth.html +++ b/docs/foundation-module/3-pth.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/3-shl.html b/docs/foundation-module/3-shl.html index 6a40ddf..39cf1f0 100644 --- a/docs/foundation-module/3-shl.html +++ b/docs/foundation-module/3-shl.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/3-tm.html b/docs/foundation-module/3-tm.html index 9b714c9..3e4434d 100644 --- a/docs/foundation-module/3-tm.html +++ b/docs/foundation-module/3-tm.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/4-chr.html b/docs/foundation-module/4-chr.html index 009cb65..bfe4401 100644 --- a/docs/foundation-module/4-chr.html +++ b/docs/foundation-module/4-chr.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/4-cst.html b/docs/foundation-module/4-cst.html index 6cd0f16..80c50b9 100644 --- a/docs/foundation-module/4-cst.html +++ b/docs/foundation-module/4-cst.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/4-pm.html b/docs/foundation-module/4-pm.html index f94403b..0916016 100644 --- a/docs/foundation-module/4-pm.html +++ b/docs/foundation-module/4-pm.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

@@ -214,7 +214,7 @@ deallocate. return mr; } -void Regexp::dispose_of(match_results *mr) { +void Regexp::dispose_of(match_results *mr) { if (mr) { for (int i=0; i<MAX_BRACKETED_SUBEXPRESSIONS; i++) if (mr->exp[i]) { diff --git a/docs/foundation-module/4-prp.html b/docs/foundation-module/4-prp.html index b545520..ea301dc 100644 --- a/docs/foundation-module/4-prp.html +++ b/docs/foundation-module/4-prp.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

@@ -185,13 +185,28 @@ is the special comment character: often match_results mr = Regexp::create_mr(); - if (Regexp::match(&mr, line, L" *{define: *(%C+) (%c*)} *")) Begin a definition3.2.1; - if (Regexp::match(&mr, line, L" *{end-define} *")) End a definition3.2.3; - if (PPS->defining) Continue a definition3.2.2; + if (Regexp::match(&mr, line, L" *{define: *(%C+) *} *")) Begin a bare definition3.2.1; + if (Regexp::match(&mr, line, L" *{define: *(%C+) (%c*)} *")) Begin a definition3.2.2; + if (Regexp::match(&mr, line, L" *{end-define} *")) End a definition3.2.4; + if (PPS->defining) Continue a definition3.2.3; Regexp::dispose_of(&mr);
  • This code is used in §3.
-

§3.2.1. Begin a definition3.2.1 = +

§3.2.1. Begin a bare definition3.2.1 = +

+ +
+    if (PPS->defining)
+        Errors::in_text_file("nested definitions are not allowed", tfp);
+    text_stream *name = mr.exp[0];
+    text_stream *parameter_specification = Str::new();
+    PPS->defining = Preprocessor::new_macro(PPS->known_macros, name,
+        parameter_specification, Preprocessor::default_expander, tfp);
+    Regexp::dispose_of(&mr);
+    return;
+
+
  • This code is used in §3.2.
+

§3.2.2. Begin a definition3.2.2 =

@@ -205,7 +220,7 @@ is the special comment character: often     return;
 
  • This code is used in §3.2.
-

§3.2.2. Continue a definition3.2.2 = +

§3.2.3. Continue a definition3.2.3 =

@@ -214,7 +229,7 @@ is the special comment character: often     return;
 
  • This code is used in §3.2.
-

§3.2.3. End a definition3.2.3 = +

§3.2.4. End a definition3.2.4 =

@@ -695,7 +710,7 @@ fact we expect more like 10.
 

-preprocessor_macro *Preprocessor::new_macro(linked_list *L, text_stream *name,
+preprocessor_macro *Preprocessor::new_macro(linked_list *L, text_stream *name,
     text_stream *parameter_specification,
     void (*expander)(preprocessor_macro *, preprocessor_state *, text_stream **, preprocessor_loop *, text_file_position *),
     text_file_position *tfp) {
@@ -768,7 +783,7 @@ expander function is Preprocessor::de
 

-void Preprocessor::add_line_to_macro(preprocessor_macro *mm, text_stream *line,
+void Preprocessor::add_line_to_macro(preprocessor_macro *mm, text_stream *line,
     text_file_position *tfp) {
     if (mm->no_lines >= MAX_PP_MACRO_LINES) {
         Errors::in_text_file("too many lines in this definition", tfp);
@@ -860,7 +875,7 @@ frame again.
 

-void Preprocessor::default_expander(preprocessor_macro *mm, preprocessor_state *PPS,
+void Preprocessor::default_expander(preprocessor_macro *mm, preprocessor_state *PPS,
     text_stream **parameter_values, preprocessor_loop *loop, text_file_position *tfp) {
     PPS->stack_frame = Preprocessor::new_variable_set(PPS->stack_frame);
     for (int i=0; i<mm->no_parameters; i++) {
diff --git a/docs/foundation-module/4-sm.html b/docs/foundation-module/4-sm.html
index d4b479f..bc8daa4 100644
--- a/docs/foundation-module/4-sm.html
+++ b/docs/foundation-module/4-sm.html
@@ -39,7 +39,7 @@ function togglePopup(material_id) {
 

Repository

Related Projects

@@ -88,7 +88,7 @@ access.

-text_stream *Str::new(void) {
+text_stream *Str::new(void) {
     return Str::new_with_capacity(32);
 }
 
diff --git a/docs/foundation-module/4-taa.html b/docs/foundation-module/4-taa.html
index 4ec344f..d7f641c 100644
--- a/docs/foundation-module/4-taa.html
+++ b/docs/foundation-module/4-taa.html
@@ -39,7 +39,7 @@ function togglePopup(material_id) {
 

Repository

Related Projects

diff --git a/docs/foundation-module/4-tf.html b/docs/foundation-module/4-tf.html index 8fce8ac..1358c42 100644 --- a/docs/foundation-module/4-tf.html +++ b/docs/foundation-module/4-tf.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/4-ws.html b/docs/foundation-module/4-ws.html index 8a6e85c..863932a 100644 --- a/docs/foundation-module/4-ws.html +++ b/docs/foundation-module/4-ws.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/5-ee.html b/docs/foundation-module/5-ee.html index 08a9f9b..945e05c 100644 --- a/docs/foundation-module/5-ee.html +++ b/docs/foundation-module/5-ee.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/5-htm.html b/docs/foundation-module/5-htm.html index b0f9af4..fa2ecbe 100644 --- a/docs/foundation-module/5-htm.html +++ b/docs/foundation-module/5-htm.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/6-bf.html b/docs/foundation-module/6-bf.html index 7e04b60..2a4fb7c 100644 --- a/docs/foundation-module/6-bf.html +++ b/docs/foundation-module/6-bf.html @@ -53,7 +53,7 @@ MathJax = {

Repository

Related Projects

diff --git a/docs/foundation-module/6-id.html b/docs/foundation-module/6-id.html index 6ac6e1c..a0e2042 100644 --- a/docs/foundation-module/6-id.html +++ b/docs/foundation-module/6-id.html @@ -31,7 +31,7 @@

Repository

Related Projects

diff --git a/docs/foundation-module/6-sd.html b/docs/foundation-module/6-sd.html index 4f2ba58..bb54b0e 100644 --- a/docs/foundation-module/6-sd.html +++ b/docs/foundation-module/6-sd.html @@ -31,7 +31,7 @@

Repository

Related Projects

diff --git a/docs/foundation-module/7-vn.html b/docs/foundation-module/7-vn.html index 5177b4c..f6bbffb 100644 --- a/docs/foundation-module/7-vn.html +++ b/docs/foundation-module/7-vn.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/7-vnr.html b/docs/foundation-module/7-vnr.html index bbaf4f5..3114ab2 100644 --- a/docs/foundation-module/7-vnr.html +++ b/docs/foundation-module/7-vnr.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/8-bdfw.html b/docs/foundation-module/8-bdfw.html index 37a8695..71adbc1 100644 --- a/docs/foundation-module/8-bdfw.html +++ b/docs/foundation-module/8-bdfw.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/8-bf.html b/docs/foundation-module/8-bf.html index 7837eb6..9e5e2c2 100644 --- a/docs/foundation-module/8-bf.html +++ b/docs/foundation-module/8-bf.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/8-st.html b/docs/foundation-module/8-st.html index e6cca37..6d5445b 100644 --- a/docs/foundation-module/8-st.html +++ b/docs/foundation-module/8-st.html @@ -44,7 +44,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/8-wm.html b/docs/foundation-module/8-wm.html index ede2746..0d1a319 100644 --- a/docs/foundation-module/8-wm.html +++ b/docs/foundation-module/8-wm.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/8-ws.html b/docs/foundation-module/8-ws.html index e5be965..6a6aa34 100644 --- a/docs/foundation-module/8-ws.html +++ b/docs/foundation-module/8-ws.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-module/P-abgtf.html b/docs/foundation-module/P-abgtf.html index a2c8d68..d0013aa 100644 --- a/docs/foundation-module/P-abgtf.html +++ b/docs/foundation-module/P-abgtf.html @@ -45,7 +45,7 @@ MathJax = {

Repository

Related Projects

diff --git a/docs/foundation-module/index.html b/docs/foundation-module/index.html index 575227c..92647bd 100644 --- a/docs/foundation-module/index.html +++ b/docs/foundation-module/index.html @@ -29,7 +29,7 @@

Repository

Related Projects

diff --git a/docs/foundation-test/S-pc.html b/docs/foundation-test/S-pc.html index 8f28ae1..eb36d98 100644 --- a/docs/foundation-test/S-pc.html +++ b/docs/foundation-test/S-pc.html @@ -31,7 +31,7 @@

Repository

Related Projects

diff --git a/docs/foundation-test/S-ut.html b/docs/foundation-test/S-ut.html index 7b449d4..9ba7a9c 100644 --- a/docs/foundation-test/S-ut.html +++ b/docs/foundation-test/S-ut.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/foundation-test/index.html b/docs/foundation-test/index.html index 49fe033..cad1faf 100644 --- a/docs/foundation-test/index.html +++ b/docs/foundation-test/index.html @@ -29,7 +29,7 @@

Repository

Related Projects

diff --git a/docs/goldbach/S-sp.html b/docs/goldbach/S-sp.html index 81b63fe..72a7281 100644 --- a/docs/goldbach/S-sp.html +++ b/docs/goldbach/S-sp.html @@ -51,7 +51,7 @@ MathJax = {

Repository

Related Projects

diff --git a/docs/goldbach/S-tsoe.html b/docs/goldbach/S-tsoe.html index ff83022..ff1a601 100644 --- a/docs/goldbach/S-tsoe.html +++ b/docs/goldbach/S-tsoe.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/goldbach/goldbach.pdf b/docs/goldbach/goldbach.pdf index 6e3427e12ee71b0fc207d26fbde67a516af77458..745b4864347df915eda848894f34d6c1d97c79c9 100644 GIT binary patch delta 137 zcmcb&f&bnH{)QID7N#xC{3o?c4b4ogZ}=WawsLWaMOIXy|0(>}FgHl(>}>4nY;5RcZfWM|;%a2

Repository

Related Projects

diff --git a/docs/index.html b/docs/index.html index ebf7936..39b81de 100644 --- a/docs/index.html +++ b/docs/index.html @@ -31,7 +31,7 @@

Repository

Related Projects

diff --git a/docs/inweb/1-apacs.html b/docs/inweb/1-apacs.html index e53c3d1..5c5728f 100644 --- a/docs/inweb/1-apacs.html +++ b/docs/inweb/1-apacs.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/1-bsc.html b/docs/inweb/1-bsc.html index c8674d0..c8c5c0f 100644 --- a/docs/inweb/1-bsc.html +++ b/docs/inweb/1-bsc.html @@ -31,7 +31,7 @@

Repository

Related Projects

diff --git a/docs/inweb/1-cnf.html b/docs/inweb/1-cnf.html index 0d1e524..176bed6 100644 --- a/docs/inweb/1-cnf.html +++ b/docs/inweb/1-cnf.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

@@ -89,6 +89,7 @@ command line: there will only ever be one of these. struct filename *colony_setting; -colony X: the filename X, if supplied struct text_stream *member_setting; -member X: sets web to member X of colony struct linked_list *breadcrumb_setting; of breadcrumb_request + struct text_stream *platform_setting; -platform X: sets prevailing platform to X int verbose_switch; -verbose: print names of files read to stdout int targets; used only for parsing @@ -155,6 +156,7 @@ then declare them. args.colony_setting = NULL; args.member_setting = NULL; args.breadcrumb_setting = NEW_LINKED_LIST(breadcrumb_request); + args.platform_setting = NULL; args.tag_setting = Str::new(); args.weave_pattern = Str::new(); args.import_setting = NULL; @@ -184,6 +186,7 @@ provides automatically. enum GITIGNORE_CLSW enum MAKEFILE_CLSW enum WRITEME_CLSW +enum PLATFORM_CLSW enum ADVANCE_FILE_CLSW enum PROTOTYPE_CLSW enum SCAN_CLSW @@ -251,6 +254,8 @@ provides automatically. L"increment daily build code in file X"); CommandLine::declare_switch(WRITEME_CLSW, L"write-me", 2, L"write a read-me file following instructions in file X"); + CommandLine::declare_switch(PLATFORM_CLSW, L"platform", 2, + L"use platform X (e.g. 'windows') when making e.g. makefiles"); CommandLine::declare_switch(PROTOTYPE_CLSW, L"prototype", 2, L"translate makefile from prototype X"); CommandLine::declare_switch(FUNCTIONS_CLSW, L"functions", 1, @@ -357,6 +362,9 @@ provides automatically. if (args->inweb_mode != TRANSLATE_MODE) Configuration::set_fundamental_mode(args, ANALYSE_MODE); break; + case PLATFORM_CLSW: + args->platform_setting = Str::duplicate(arg); + break; case ADVANCE_FILE_CLSW: args->advance_setting = Filenames::from_text(arg); Configuration::set_fundamental_mode(args, TRANSLATE_MODE); diff --git a/docs/inweb/1-pc.html b/docs/inweb/1-pc.html index ea5afc2..976578f 100644 --- a/docs/inweb/1-pc.html +++ b/docs/inweb/1-pc.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

@@ -187,7 +187,7 @@ program: some input, some thinking, a choice of three forms of output. ins->prototype_setting = Filenames::from_text(I"script.rmscript"); if (ins->makefile_setting) Makefiles::write(W, ins->prototype_setting, ins->makefile_setting, - WebModules::make_search_path(ins->import_setting)); + WebModules::make_search_path(ins->import_setting), ins->platform_setting); else if (ins->gitignore_setting) Git::write_gitignore(W, ins->prototype_setting, ins->gitignore_setting); else if (ins->advance_setting) @@ -258,7 +258,7 @@ program: some input, some thinking, a choice of three forms of output. Analyser::catalogue_the_sections(W, ins->chosen_range, STRUCTURES_SECTIONCAT); if (ins->makefile_setting) Analyser::write_makefile(W, ins->makefile_setting, - WebModules::make_search_path(ins->import_setting)); + WebModules::make_search_path(ins->import_setting), ins->platform_setting); if (ins->gitignore_setting) Analyser::write_gitignore(W, ins->gitignore_setting); if (ins->advance_switch) diff --git a/docs/inweb/1-ptt.html b/docs/inweb/1-ptt.html index 954f512..6f072ed 100644 --- a/docs/inweb/1-ptt.html +++ b/docs/inweb/1-ptt.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/1-ts.html b/docs/inweb/1-ts.html index 40a8fbb..8a2edfd 100644 --- a/docs/inweb/1-ts.html +++ b/docs/inweb/1-ts.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/2-ec.html b/docs/inweb/2-ec.html index 6ba24c7..567d6cb 100644 --- a/docs/inweb/2-ec.html +++ b/docs/inweb/2-ec.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/2-lc.html b/docs/inweb/2-lc.html index c34bf4c..d09b03e 100644 --- a/docs/inweb/2-lc.html +++ b/docs/inweb/2-lc.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/2-pm.html b/docs/inweb/2-pm.html index 20fd7f7..7cb96a7 100644 --- a/docs/inweb/2-pm.html +++ b/docs/inweb/2-pm.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/2-pn.html b/docs/inweb/2-pn.html index dcf848c..4009f81 100644 --- a/docs/inweb/2-pn.html +++ b/docs/inweb/2-pn.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/2-tgs.html b/docs/inweb/2-tgs.html index 1c042bd..f354576 100644 --- a/docs/inweb/2-tgs.html +++ b/docs/inweb/2-tgs.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/2-tp.html b/docs/inweb/2-tp.html index 10e524c..f60806e 100644 --- a/docs/inweb/2-tp.html +++ b/docs/inweb/2-tp.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/2-tr.html b/docs/inweb/2-tr.html index 6f5045f..38bfe18 100644 --- a/docs/inweb/2-tr.html +++ b/docs/inweb/2-tr.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/3-ta.html b/docs/inweb/3-ta.html index 9a87df5..0468531 100644 --- a/docs/inweb/3-ta.html +++ b/docs/inweb/3-ta.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

@@ -477,7 +477,7 @@ folder: failing that, we fall back on a default script belonging to Inweb.

-void Analyser::write_makefile(web *W, filename *F, module_search *I) {
+void Analyser::write_makefile(web *W, filename *F, module_search *I, text_stream *platform) {
     pathname *P = W->md->path_to_web;
     text_stream *short_name = Pathnames::directory_name(P);
     if ((Str::len(short_name) == 0) ||
@@ -489,7 +489,7 @@ folder: failing that, we fall back on a default script belonging to Inweb.
     DISCARD_TEXT(leafname)
     if (!(TextFiles::exists(prototype)))
         prototype = Filenames::in(path_to_inweb_materials, I"default.mkscript");
-    Makefiles::write(W, prototype, F, I);
+    Makefiles::write(W, prototype, F, I, platform);
 }
 
 void Analyser::write_gitignore(web *W, filename *F) {
diff --git a/docs/inweb/3-tc.html b/docs/inweb/3-tc.html
index 19a73c9..787eb09 100644
--- a/docs/inweb/3-tc.html
+++ b/docs/inweb/3-tc.html
@@ -39,7 +39,7 @@ function togglePopup(material_id) {
 

Repository

Related Projects

diff --git a/docs/inweb/3-tt.html b/docs/inweb/3-tt.html index 2350a08..5a81400 100644 --- a/docs/inweb/3-tt.html +++ b/docs/inweb/3-tt.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/3-tw.html b/docs/inweb/3-tw.html index 13b4cf1..8d2e565 100644 --- a/docs/inweb/3-tw.html +++ b/docs/inweb/3-tw.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/3-twot.html b/docs/inweb/3-twot.html index 737ee85..157f5f9 100644 --- a/docs/inweb/3-twot.html +++ b/docs/inweb/3-twot.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/4-as.html b/docs/inweb/4-as.html index 695c29c..7c53adb 100644 --- a/docs/inweb/4-as.html +++ b/docs/inweb/4-as.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/4-cl.html b/docs/inweb/4-cl.html index 80003cf..93d9435 100644 --- a/docs/inweb/4-cl.html +++ b/docs/inweb/4-cl.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/4-is.html b/docs/inweb/4-is.html index adc5499..3486832 100644 --- a/docs/inweb/4-is.html +++ b/docs/inweb/4-is.html @@ -53,7 +53,7 @@ MathJax = {

Repository

Related Projects

diff --git a/docs/inweb/4-lm.html b/docs/inweb/4-lm.html index 103252c..7e10186 100644 --- a/docs/inweb/4-lm.html +++ b/docs/inweb/4-lm.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/4-pl.html b/docs/inweb/4-pl.html index 4e3d981..bb0272a 100644 --- a/docs/inweb/4-pl.html +++ b/docs/inweb/4-pl.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/4-taf.html b/docs/inweb/4-taf.html index 5e27a25..be78355 100644 --- a/docs/inweb/4-taf.html +++ b/docs/inweb/4-taf.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/4-tp.html b/docs/inweb/4-tp.html index ecf638d..d403e9a 100644 --- a/docs/inweb/4-tp.html +++ b/docs/inweb/4-tp.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/5-df.html b/docs/inweb/5-df.html index b30f30f..496267b 100644 --- a/docs/inweb/5-df.html +++ b/docs/inweb/5-df.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/5-fm.html b/docs/inweb/5-fm.html index d0cdc6d..92105c2 100644 --- a/docs/inweb/5-fm.html +++ b/docs/inweb/5-fm.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/5-hf.html b/docs/inweb/5-hf.html index ca8c56a..0be8005 100644 --- a/docs/inweb/5-hf.html +++ b/docs/inweb/5-hf.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/5-ptf.html b/docs/inweb/5-ptf.html index cd29411..535b706 100644 --- a/docs/inweb/5-ptf.html +++ b/docs/inweb/5-ptf.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/5-tf.html b/docs/inweb/5-tf.html index d9012db..f81505d 100644 --- a/docs/inweb/5-tf.html +++ b/docs/inweb/5-tf.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/5-tu.html b/docs/inweb/5-tu.html index 6d6f013..acc3012 100644 --- a/docs/inweb/5-tu.html +++ b/docs/inweb/5-tu.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/5-wt.html b/docs/inweb/5-wt.html index fa74d8f..d06e861 100644 --- a/docs/inweb/5-wt.html +++ b/docs/inweb/5-wt.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/6-cln.html b/docs/inweb/6-cln.html index a9efd62..47e7583 100644 --- a/docs/inweb/6-cln.html +++ b/docs/inweb/6-cln.html @@ -44,7 +44,7 @@ function togglePopup(material_id) {

Repository

Related Projects

@@ -134,7 +134,7 @@ at GitHub: web: "eastertide" at "inweb/Examples/eastertide" in "inweb/docs/eastertide" web: "intest" at "intest" in "intest/docs" -web: "inform" at "inform/docs-src/index.inweb" in "inform/docs" +web: "inform" at "inform/docs-src/overview.inweb" in "inform/docs"
 typedef struct colony_reader_state {
diff --git a/docs/inweb/6-cs.html b/docs/inweb/6-cs.html
index d62325d..1f052a3 100644
--- a/docs/inweb/6-cs.html
+++ b/docs/inweb/6-cs.html
@@ -44,7 +44,7 @@ function togglePopup(material_id) {
 

Repository

Related Projects

diff --git a/docs/inweb/6-gs.html b/docs/inweb/6-gs.html index 2c6acf9..3f2a63a 100644 --- a/docs/inweb/6-gs.html +++ b/docs/inweb/6-gs.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/docs/inweb/6-mkf.html b/docs/inweb/6-mkf.html index bf56953..6192ddd 100644 --- a/docs/inweb/6-mkf.html +++ b/docs/inweb/6-mkf.html @@ -39,7 +39,7 @@ function togglePopup(material_id) {

Repository

Related Projects

@@ -60,7 +60,8 @@ special loop construct.

-void Makefiles::write(web *W, filename *prototype, filename *F, module_search *I) {
+void Makefiles::write(web *W, filename *prototype, filename *F, module_search *I,
+    text_stream *platform) {
     linked_list *L = NEW_LINKED_LIST(preprocessor_macro);
     Preprocessor::new_macro(L,
         I"platform-settings", NULL,
@@ -101,6 +102,7 @@ a data structure to store those declarations in:
     struct dictionary *webs_dictionary;     components with type: web
     struct dictionary *modules_dictionary;  components with type: module
     struct module_search *search_path;
+    struct text_stream *which_platform;
     CLASS_DEFINITION
 } makefile_specifics;
 
@@ -114,6 +116,7 @@ a data structure to store those declarations in: specifics->webs_dictionary = Dictionaries::new(16, FALSE); specifics->modules_dictionary = Dictionaries::new(16, FALSE); specifics->search_path = I; + specifics->which_platform = platform;
  • This code is used in §1.

§2. The identity-settings expander.

@@ -143,10 +146,13 @@ for that platform.
 void Makefiles::platform_settings_expander(preprocessor_macro *mm, preprocessor_state *PPS,
     text_stream **parameter_values, preprocessor_loop *loop, text_file_position *tfp) {
-    filename *prototype = Filenames::in(path_to_inweb, I"platform-settings.mk");
-    text_stream *INWEBPLATFORM = Str::new();
-    TextFiles::read(prototype, FALSE, "can't open platform settings file",
-        TRUE, Makefiles::seek_INWEBPLATFORM, NULL, INWEBPLATFORM);
+    makefile_specifics *specifics = RETRIEVE_POINTER_makefile_specifics(PPS->specifics);
+    text_stream *INWEBPLATFORM = Str::duplicate(specifics->which_platform);
+    if (Str::len(INWEBPLATFORM) == 0) {
+        filename *ps = Filenames::in(path_to_inweb, I"platform-settings.mk");
+        TextFiles::read(ps, FALSE, "can't open platform settings file",
+            TRUE, Makefiles::seek_INWEBPLATFORM, NULL, INWEBPLATFORM);
+    }
     if (Str::len(INWEBPLATFORM) == 0) {
         Errors::in_text_file(
             "found platform settings file, but it does not set INWEBPLATFORM", tfp);
diff --git a/docs/inweb/6-rw.html b/docs/inweb/6-rw.html
index 9eee223..43611f8 100644
--- a/docs/inweb/6-rw.html
+++ b/docs/inweb/6-rw.html
@@ -39,7 +39,7 @@ function togglePopup(material_id) {
 

Repository

Related Projects

diff --git a/docs/inweb/M-awwp.html b/docs/inweb/M-awwp.html index 908dbb3..a9c251f 100644 --- a/docs/inweb/M-awwp.html +++ b/docs/inweb/M-awwp.html @@ -32,7 +32,7 @@

Repository

Related Projects

diff --git a/docs/inweb/M-htwaw.html b/docs/inweb/M-htwaw.html index f61f3d6..cf0eaa4 100644 --- a/docs/inweb/M-htwaw.html +++ b/docs/inweb/M-htwaw.html @@ -54,7 +54,7 @@ MathJax = {

Repository

Related Projects

diff --git a/docs/inweb/M-iti.html b/docs/inweb/M-iti.html index c42901e..a363c17 100644 --- a/docs/inweb/M-iti.html +++ b/docs/inweb/M-iti.html @@ -32,7 +32,7 @@

Repository

Related Projects

diff --git a/docs/inweb/M-mwiw.html b/docs/inweb/M-mwiw.html index 37bc9c6..6fe2b8e 100644 --- a/docs/inweb/M-mwiw.html +++ b/docs/inweb/M-mwiw.html @@ -32,7 +32,7 @@

Repository

Related Projects

@@ -163,7 +163,7 @@ for the Inweb repository: web: "eastertide" at "inweb/Examples/eastertide" in "inweb/docs/eastertide" web: "intest" at "intest" in "intest/docs" -web: "inform" at "inform/docs-src/index.inweb" in "inform/docs" +web: "inform" at "inform/docs-src/overview.inweb" in "inform/docs"

As this demonstrates, either webs, or modules, or both, can be declared. Each one gives (a) a short name, (b) a location relative to the current diff --git a/docs/inweb/M-rc.html b/docs/inweb/M-rc.html index c6b41e5..785b92a 100644 --- a/docs/inweb/M-rc.html +++ b/docs/inweb/M-rc.html @@ -31,7 +31,7 @@

Repository

Related Projects

@@ -81,6 +81,7 @@ -functions catalogue the functions in the web -gitignore X write a .gitignore file for this web and store it in X -makefile X write a makefile for this web and store it in X + -platform X use platform X (e.g. 'windows') when making e.g. makefiles -prototype X translate makefile from prototype X -scan scan the web -structures catalogue the structures in the web diff --git a/docs/inweb/M-spl.html b/docs/inweb/M-spl.html index 14267e7..4d7eef6 100644 --- a/docs/inweb/M-spl.html +++ b/docs/inweb/M-spl.html @@ -31,7 +31,7 @@

Repository

Related Projects

diff --git a/docs/inweb/M-tid.html b/docs/inweb/M-tid.html index 881db66..d4186fa 100644 --- a/docs/inweb/M-tid.html +++ b/docs/inweb/M-tid.html @@ -31,7 +31,7 @@

Repository

Related Projects

diff --git a/docs/inweb/M-wtaw.html b/docs/inweb/M-wtaw.html index 69e0cea..aeef7ef 100644 --- a/docs/inweb/M-wtaw.html +++ b/docs/inweb/M-wtaw.html @@ -37,7 +37,7 @@

Repository

Related Projects

diff --git a/docs/inweb/P-htpw.html b/docs/inweb/P-htpw.html index f6b4cd9..43e6bd6 100644 --- a/docs/inweb/P-htpw.html +++ b/docs/inweb/P-htpw.html @@ -36,7 +36,7 @@

Repository

Related Projects

diff --git a/docs/inweb/index.html b/docs/inweb/index.html index 4c32f1a..0296a9f 100644 --- a/docs/inweb/index.html +++ b/docs/inweb/index.html @@ -29,7 +29,7 @@

Repository

Related Projects

diff --git a/docs/twinprimes/twinprimes.html b/docs/twinprimes/twinprimes.html index 3fa99d7..f03317f 100644 --- a/docs/twinprimes/twinprimes.html +++ b/docs/twinprimes/twinprimes.html @@ -53,7 +53,7 @@ function togglePopup(material_id) {

Repository

Related Projects

diff --git a/foundation-module/Chapter 4/Preprocessor.w b/foundation-module/Chapter 4/Preprocessor.w index a493179..c432b52 100644 --- a/foundation-module/Chapter 4/Preprocessor.w +++ b/foundation-module/Chapter 4/Preprocessor.w @@ -115,11 +115,22 @@ is the special comment character: often |#|, but not necessarily. @ = match_results mr = Regexp::create_mr(); + if (Regexp::match(&mr, line, L" *{define: *(%C+) *} *")) @; if (Regexp::match(&mr, line, L" *{define: *(%C+) (%c*)} *")) @; if (Regexp::match(&mr, line, L" *{end-define} *")) @; if (PPS->defining) @; Regexp::dispose_of(&mr); +@ = + if (PPS->defining) + Errors::in_text_file("nested definitions are not allowed", tfp); + text_stream *name = mr.exp[0]; + text_stream *parameter_specification = Str::new(); + PPS->defining = Preprocessor::new_macro(PPS->known_macros, name, + parameter_specification, Preprocessor::default_expander, tfp); + Regexp::dispose_of(&mr); + return; + @ = if (PPS->defining) Errors::in_text_file("nested definitions are not allowed", tfp);