Added Docs command
This commit is contained in:
parent
dea7ce0f44
commit
9dbf5324cc
15 changed files with 338 additions and 243 deletions
|
@ -468,6 +468,8 @@ its square-bracketed parts.
|
|||
} else if (Regexp::match(&mr, varname, L"Section (%c+)")) {
|
||||
text_stream *detail = mr.exp[0];
|
||||
@<Substitute a Section@>;
|
||||
} else if (Regexp::match(&mr, varname, L"Docs")) {
|
||||
@<Substitute a Docs@>;
|
||||
} else if (Regexp::match(&mr, varname, L"URL \"(%c+)\"")) {
|
||||
text_stream *link_text = mr.exp[0];
|
||||
@<Substitute a URL@>;
|
||||
|
@ -620,6 +622,11 @@ use this.)
|
|||
@ These commands are all used in constructing relative URLs, especially for
|
||||
navigation purposes.
|
||||
|
||||
@<Substitute a Docs@> =
|
||||
Pathnames::relative_URL(substituted,
|
||||
Filenames::get_path_to(Indexer::current_file()),
|
||||
Pathnames::from_text(Colonies::home()));
|
||||
|
||||
@<Substitute a URL@> =
|
||||
Pathnames::relative_URL(substituted,
|
||||
Filenames::get_path_to(Indexer::current_file()),
|
||||
|
|
|
@ -369,6 +369,7 @@ void HTMLFormat::source_code(weave_format *self, text_stream *OUT, weave_target
|
|||
Str::substr(reference, Str::at(matter, i + N), Str::at(matter, j));
|
||||
@<Attempt to resolve the cross-reference@>;
|
||||
DISCARD_TEXT(reference);
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ Orb-Weaving Spiders With Communal Webbing in a Man-Made Structural Habitat
|
|||
=
|
||||
typedef struct colony {
|
||||
struct linked_list *members; /* of |colony_member| */
|
||||
struct text_stream *home; /* path of home repository */
|
||||
MEMORY_MANAGEMENT
|
||||
} colony;
|
||||
|
||||
|
@ -63,6 +64,7 @@ typedef struct colony_reader_state {
|
|||
void Colonies::load(filename *F) {
|
||||
colony *C = CREATE(colony);
|
||||
C->members = NEW_LINKED_LIST(colony_member);
|
||||
C->home = I"docs";
|
||||
colony_reader_state crs;
|
||||
crs.province = C;
|
||||
crs.nav = NULL;
|
||||
|
@ -108,6 +110,8 @@ void Colonies::read_line(text_stream *line, text_file_position *tfp, void *v_crs
|
|||
CM->breadcrumb_tail = crs->crumbs;
|
||||
CM->default_weave_pattern = Str::duplicate(crs->pattern);
|
||||
ADD_TO_LINKED_LIST(CM, colony_member, C->members);
|
||||
} else if (Regexp::match(&mr, line, L"home: *(%c*)")) {
|
||||
C->home = Str::duplicate(mr.exp[0]);
|
||||
} else if (Regexp::match(&mr, line, L"pattern: none")) {
|
||||
crs->pattern = NULL;
|
||||
} else if (Regexp::match(&mr, line, L"pattern: *(%c*)")) {
|
||||
|
@ -252,6 +256,16 @@ module *Colonies::as_module(colony_member *CM, source_line *L, web_md *Wm) {
|
|||
WRITE_TO(err, "unable to load '%S'", CM->name);
|
||||
Main::error_in_web(err, L);
|
||||
|
||||
@ Finally:
|
||||
|
||||
=
|
||||
text_stream *Colonies::home(void) {
|
||||
colony *C;
|
||||
LOOP_OVER(C, colony)
|
||||
return C->home;
|
||||
return I"docs";
|
||||
}
|
||||
|
||||
@h Cross-references.
|
||||
The following must decide what references like the following should refer to:
|
||||
= (text)
|
||||
|
@ -291,7 +305,10 @@ int Colonies::resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
@<Is it the name of a function in the current web?@>;
|
||||
@<Is it the name of a type in the current web?@>;
|
||||
}
|
||||
Main::error_in_web(I"Can't find this cross-reference", L);
|
||||
TEMPORARY_TEXT(err);
|
||||
WRITE_TO(err, "Can't find the cross-reference '%S'", text);
|
||||
Main::error_in_web(err, L);
|
||||
DISCARD_TEXT(err);
|
||||
return FALSE;
|
||||
} else if (N > 1) {
|
||||
Main::error_in_web(I"Multiple cross-references might be meant here", L);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Title: goldbach
|
||||
Author: Graham Nelson
|
||||
Purpose: A simple test web for inweb.
|
||||
Purpose: This example of using inweb is a simple program to test Goldbach's Conjecture, a classic problem in number theory.
|
||||
Language: C
|
||||
Licence: This is a free, open-source program published under the Artistic License 2.0.
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ much longer roster, such as:
|
|||
= (text)
|
||||
Appendix A: The Standard Rules (Independent Inform 7)
|
||||
"This is the body of Inform 7 source text automatically included with every
|
||||
project run through the NI compiler, and which defines most of what end users
|
||||
project run through the Inform compiler, and which defines most of what end users
|
||||
see as the Inform language."
|
||||
SR0 - Preamble
|
||||
SR1 - Physical World Model
|
||||
|
|
319
Tangled/inweb.c
319
Tangled/inweb.c
|
@ -1912,9 +1912,10 @@ typedef struct writeme_asset {
|
|||
#line 21 "inweb/Chapter 6/Colonies.w"
|
||||
typedef struct colony {
|
||||
struct linked_list *members; /* of |colony_member| */
|
||||
struct text_stream *home; /* path of home repository */
|
||||
MEMORY_MANAGEMENT
|
||||
} colony;
|
||||
#line 36 "inweb/Chapter 6/Colonies.w"
|
||||
#line 37 "inweb/Chapter 6/Colonies.w"
|
||||
typedef struct colony_member {
|
||||
int web_rather_than_module; /* |TRUE| for a web, |FALSE| for a module */
|
||||
struct text_stream *name; /* the |N| in |N at P in W| */
|
||||
|
@ -1928,14 +1929,14 @@ typedef struct colony_member {
|
|||
struct linked_list *breadcrumb_tail; /* of |breadcrumb_request| */
|
||||
MEMORY_MANAGEMENT
|
||||
} colony_member;
|
||||
#line 56 "inweb/Chapter 6/Colonies.w"
|
||||
#line 57 "inweb/Chapter 6/Colonies.w"
|
||||
typedef struct colony_reader_state {
|
||||
struct colony *province;
|
||||
struct filename *nav;
|
||||
struct linked_list *crumbs; /* of |breadcrumb_request| */
|
||||
struct text_stream *pattern;
|
||||
} colony_reader_state;
|
||||
#line 151 "inweb/Chapter 6/Colonies.w"
|
||||
#line 155 "inweb/Chapter 6/Colonies.w"
|
||||
typedef struct breadcrumb_request {
|
||||
struct text_stream *breadcrumb_text;
|
||||
struct text_stream *breadcrumb_link;
|
||||
|
@ -3269,15 +3270,15 @@ linked_list_item * Indexer__heading_topmost_on_stack(index_engine_state *ies, in
|
|||
void Indexer__start_CI_loop(index_engine_state *ies, int level, linked_list_item *from, linked_list_item *to, int pos) ;
|
||||
#line 430 "inweb/Chapter 3/The Indexer.w"
|
||||
void Indexer__end_CI_loop(index_engine_state *ies) ;
|
||||
#line 672 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 679 "inweb/Chapter 3/The Indexer.w"
|
||||
void Indexer__list_module(OUTPUT_STREAM, module *M, int list_this) ;
|
||||
#line 689 "inweb/Chapter 3/The Indexer.w"
|
||||
void Indexer__transcribe_CSS(OUTPUT_STREAM, filename *CSS_file) ;
|
||||
#line 696 "inweb/Chapter 3/The Indexer.w"
|
||||
void Indexer__transcribe_CSS(OUTPUT_STREAM, filename *CSS_file) ;
|
||||
#line 703 "inweb/Chapter 3/The Indexer.w"
|
||||
void Indexer__copy_CSS(text_stream *line, text_file_position *tfp, void *X) ;
|
||||
#line 705 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 712 "inweb/Chapter 3/The Indexer.w"
|
||||
filename * Indexer__current_file(void) ;
|
||||
#line 708 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 715 "inweb/Chapter 3/The Indexer.w"
|
||||
void Indexer__set_current_file(filename *F) ;
|
||||
#line 16 "inweb/Chapter 3/The Weaver.w"
|
||||
int Weaver__weave_source(web *W, weave_target *wv) ;
|
||||
|
@ -3731,47 +3732,47 @@ void HTMLFormat__toc(weave_format *self, text_stream *OUT, weave_target *wv, i
|
|||
void HTMLFormat__paragraph_heading(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *TeX_macro, section *S, paragraph *P, text_stream *heading_text, text_stream *chaptermark, text_stream *sectionmark, int weight) ;
|
||||
#line 289 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__source_code(weave_format *self, text_stream *OUT, weave_target *wv, int tab_stops_of_indentation, text_stream *prefatory, text_stream *matter, text_stream *colouring, text_stream *concluding_comment, int starts, int finishes, int code_mode, int linked) ;
|
||||
#line 440 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 441 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__inline_code(weave_format *self, text_stream *OUT, weave_target *wv, int enter) ;
|
||||
#line 451 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 452 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__url(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *url, text_stream *content, int external) ;
|
||||
#line 459 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 460 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__footnote_cue(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *cue) ;
|
||||
#line 470 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 471 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__begin_footnote_text(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *cue) ;
|
||||
#line 480 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 481 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__end_footnote_text(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *cue) ;
|
||||
#line 490 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 491 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__display_line(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *from) ;
|
||||
#line 501 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 502 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__item(weave_format *self, text_stream *OUT, weave_target *wv, int depth, text_stream *label) ;
|
||||
#line 510 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 511 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__bar(weave_format *self, text_stream *OUT, weave_target *wv) ;
|
||||
#line 516 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 517 "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 531 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 532 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__embed(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *service, text_stream *ID) ;
|
||||
#line 570 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 571 "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 585 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 586 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__pagebreak(weave_format *self, text_stream *OUT, weave_target *wv) ;
|
||||
#line 590 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 591 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__blank_line(weave_format *self, text_stream *OUT, weave_target *wv, int in_comment) ;
|
||||
#line 603 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 604 "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 672 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 673 "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 693 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 694 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__endnote(weave_format *self, text_stream *OUT, weave_target *wv, int end) ;
|
||||
#line 703 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 704 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__commentary_text(weave_format *self, text_stream *OUT, weave_target *wv, text_stream *id) ;
|
||||
#line 724 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 725 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__locale(weave_format *self, text_stream *OUT, weave_target *wv, paragraph *par1, paragraph *par2) ;
|
||||
#line 738 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 739 "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 785 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 786 "inweb/Chapter 5/HTML Formats.w"
|
||||
int HTMLFormat__begin_weaving_EPUB(weave_format *wf, web *W, weave_pattern *pattern) ;
|
||||
#line 800 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 801 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__end_weaving_EPUB(weave_format *wf, web *W, weave_pattern *pattern) ;
|
||||
#line 19 "inweb/Chapter 5/Weave Plugins.w"
|
||||
weave_plugin * WeavePlugins__new(text_stream *name) ;
|
||||
|
@ -3825,31 +3826,33 @@ void Readme__header_harvester(text_stream *text, text_file_position *tfp, void
|
|||
void Readme__template_harvester(text_stream *text, text_file_position *tfp, void *state) ;
|
||||
#line 366 "inweb/Chapter 6/Readme Writeme.w"
|
||||
void Readme__readme_harvester(text_stream *text, text_file_position *tfp, void *state) ;
|
||||
#line 63 "inweb/Chapter 6/Colonies.w"
|
||||
#line 64 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__load(filename *F) ;
|
||||
#line 78 "inweb/Chapter 6/Colonies.w"
|
||||
#line 80 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__read_line(text_stream *line, text_file_position *tfp, void *v_crs) ;
|
||||
#line 139 "inweb/Chapter 6/Colonies.w"
|
||||
#line 143 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__add_crumb(linked_list *L, text_stream *spec, text_file_position *tfp) ;
|
||||
#line 157 "inweb/Chapter 6/Colonies.w"
|
||||
#line 161 "inweb/Chapter 6/Colonies.w"
|
||||
breadcrumb_request * Colonies__request_breadcrumb(text_stream *arg) ;
|
||||
#line 172 "inweb/Chapter 6/Colonies.w"
|
||||
#line 176 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__drop_initial_breadcrumbs(OUTPUT_STREAM, filename *F, linked_list *crumbs) ;
|
||||
#line 182 "inweb/Chapter 6/Colonies.w"
|
||||
#line 186 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__write_breadcrumb(OUTPUT_STREAM, text_stream *text, text_stream *link) ;
|
||||
#line 203 "inweb/Chapter 6/Colonies.w"
|
||||
#line 207 "inweb/Chapter 6/Colonies.w"
|
||||
colony_member * Colonies__find(text_stream *T) ;
|
||||
#line 221 "inweb/Chapter 6/Colonies.w"
|
||||
#line 225 "inweb/Chapter 6/Colonies.w"
|
||||
module * Colonies__as_module(colony_member *CM, source_line *L, web_md *Wm) ;
|
||||
#line 274 "inweb/Chapter 6/Colonies.w"
|
||||
#line 262 "inweb/Chapter 6/Colonies.w"
|
||||
text_stream * Colonies__home(void) ;
|
||||
#line 288 "inweb/Chapter 6/Colonies.w"
|
||||
int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title, filename *for_HTML_file, text_stream *text, web_md *Wm, source_line *L) ;
|
||||
#line 386 "inweb/Chapter 6/Colonies.w"
|
||||
#line 403 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__link_URL(OUTPUT_STREAM, text_stream *link_text, filename *F) ;
|
||||
#line 395 "inweb/Chapter 6/Colonies.w"
|
||||
#line 412 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__reference_URL(OUTPUT_STREAM, text_stream *link_text, filename *F) ;
|
||||
#line 406 "inweb/Chapter 6/Colonies.w"
|
||||
#line 423 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__section_URL(OUTPUT_STREAM, section_md *Sm) ;
|
||||
#line 416 "inweb/Chapter 6/Colonies.w"
|
||||
#line 433 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__paragraph_URL(OUTPUT_STREAM, paragraph *P, section *from, int a_link) ;
|
||||
void register_tangled_nonterminals(void);
|
||||
text_stream *TL_IS_0 = NULL;
|
||||
|
@ -4383,6 +4386,7 @@ text_stream *TL_IS_527 = NULL;
|
|||
text_stream *TL_IS_528 = NULL;
|
||||
text_stream *TL_IS_529 = NULL;
|
||||
text_stream *TL_IS_530 = NULL;
|
||||
text_stream *TL_IS_531 = NULL;
|
||||
void register_tangled_text_literals(void);
|
||||
#line 57 "inweb/foundation-module/Chapter 2/Streams.w"
|
||||
#define WRITE(args...) Writers__printf(OUT, args)
|
||||
|
@ -7228,11 +7232,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+1A19";
|
||||
char *svn = "7-alpha.1+1A20";
|
||||
if (svn[0]) PRINT(" version %s", svn);
|
||||
char *vname = "Escape to Danger";
|
||||
if (vname[0]) PRINT(" '%s'", vname);
|
||||
char *d = "13 April 2020";
|
||||
char *d = "14 April 2020";
|
||||
if (d[0]) PRINT(" (%s)", d);
|
||||
PRINT("\n");
|
||||
innocuous = TRUE; break;
|
||||
|
@ -17265,7 +17269,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
if (Bibliographic__data_exists(ies->for_web->md, varname)) {
|
||||
|
||||
{
|
||||
#line 505 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 507 "inweb/Chapter 3/The Indexer.w"
|
||||
Str__copy(substituted, Bibliographic__get_datum(ies->for_web->md, varname));
|
||||
|
||||
}
|
||||
|
@ -17274,7 +17278,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
} else if (Regexp__match(&mr, varname, L"Navigation")) {
|
||||
|
||||
{
|
||||
#line 511 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 513 "inweb/Chapter 3/The Indexer.w"
|
||||
if (ies->nav_file) {
|
||||
if (TextFiles__exists(ies->nav_file))
|
||||
Indexer__incorporate_template(substituted, ies->for_web, ies->restrict_to_range,
|
||||
|
@ -17291,7 +17295,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
} else if (Regexp__match(&mr, varname, L"Breadcrumbs")) {
|
||||
|
||||
{
|
||||
#line 524 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 526 "inweb/Chapter 3/The Indexer.w"
|
||||
Colonies__drop_initial_breadcrumbs(substituted, Indexer__current_file(),
|
||||
ies->crumbs);
|
||||
|
||||
|
@ -17301,7 +17305,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
} else if (Str__eq_wide_string(varname, L"Plugins")) {
|
||||
|
||||
{
|
||||
#line 534 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 536 "inweb/Chapter 3/The Indexer.w"
|
||||
weave_plugin *wp;
|
||||
LOOP_OVER_LINKED_LIST(wp, weave_plugin, ies->nav_pattern->plugins)
|
||||
WeavePlugins__include(OUT, ies->for_web, wp, ies->nav_pattern);
|
||||
|
@ -17312,7 +17316,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
} else if (Regexp__match(&mr, varname, L"Modules")) {
|
||||
|
||||
{
|
||||
#line 541 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 543 "inweb/Chapter 3/The Indexer.w"
|
||||
module *M = ies->for_web->md->as_module;
|
||||
int L = LinkedLists__len(M->dependencies);
|
||||
if (L > 0) {
|
||||
|
@ -17331,7 +17335,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
text_stream *detail = mr.exp[0];
|
||||
|
||||
{
|
||||
#line 555 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 557 "inweb/Chapter 3/The Indexer.w"
|
||||
if (swarm_leader)
|
||||
if (Formats__substitute_post_processing_data(substituted,
|
||||
swarm_leader, detail, ies->nav_pattern) == FALSE)
|
||||
|
@ -17344,7 +17348,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
text_stream *detail = mr.exp[0];
|
||||
|
||||
{
|
||||
#line 563 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 565 "inweb/Chapter 3/The Indexer.w"
|
||||
chapter *C = CONTENT_IN_ITEM(
|
||||
Indexer__heading_topmost_on_stack(ies, CHAPTER_LEVEL), chapter);
|
||||
if (C == NULL)
|
||||
|
@ -17352,7 +17356,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
ies->errors_at, lpos);
|
||||
else
|
||||
{
|
||||
#line 571 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 573 "inweb/Chapter 3/The Indexer.w"
|
||||
if (Str__eq_wide_string(detail, L"Title")) {
|
||||
Str__copy(substituted, C->md->ch_title);
|
||||
} else if (Str__eq_wide_string(detail, L"Code")) {
|
||||
|
@ -17367,7 +17371,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
}
|
||||
|
||||
}
|
||||
#line 568 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 570 "inweb/Chapter 3/The Indexer.w"
|
||||
;
|
||||
|
||||
}
|
||||
|
@ -17377,7 +17381,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
text_stream *detail = mr.exp[0];
|
||||
|
||||
{
|
||||
#line 587 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 589 "inweb/Chapter 3/The Indexer.w"
|
||||
section *S = CONTENT_IN_ITEM(
|
||||
Indexer__heading_topmost_on_stack(ies, SECTION_LEVEL), section);
|
||||
if (S == NULL)
|
||||
|
@ -17385,7 +17389,7 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
ies->errors_at, lpos);
|
||||
else
|
||||
{
|
||||
#line 595 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 597 "inweb/Chapter 3/The Indexer.w"
|
||||
if (Str__eq_wide_string(detail, L"Title")) {
|
||||
Str__copy(substituted, S->md->sect_title);
|
||||
} else if (Str__eq_wide_string(detail, L"Purpose")) {
|
||||
|
@ -17412,59 +17416,70 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
}
|
||||
|
||||
}
|
||||
#line 592 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 594 "inweb/Chapter 3/The Indexer.w"
|
||||
;
|
||||
|
||||
}
|
||||
#line 470 "inweb/Chapter 3/The Indexer.w"
|
||||
;
|
||||
} else if (Regexp__match(&mr, varname, L"Docs")) {
|
||||
|
||||
{
|
||||
#line 626 "inweb/Chapter 3/The Indexer.w"
|
||||
Pathnames__relative_URL(substituted,
|
||||
Filenames__get_path_to(Indexer__current_file()),
|
||||
Pathnames__from_text(Colonies__home()));
|
||||
|
||||
}
|
||||
#line 472 "inweb/Chapter 3/The Indexer.w"
|
||||
;
|
||||
} else if (Regexp__match(&mr, varname, L"URL \"(%c+)\"")) {
|
||||
text_stream *link_text = mr.exp[0];
|
||||
|
||||
{
|
||||
#line 624 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 631 "inweb/Chapter 3/The Indexer.w"
|
||||
Pathnames__relative_URL(substituted,
|
||||
Filenames__get_path_to(Indexer__current_file()),
|
||||
Pathnames__from_text(link_text));
|
||||
|
||||
}
|
||||
#line 473 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 475 "inweb/Chapter 3/The Indexer.w"
|
||||
;
|
||||
} else if (Regexp__match(&mr, varname, L"Link \"(%c+)\"")) {
|
||||
text_stream *link_text = mr.exp[0];
|
||||
|
||||
{
|
||||
#line 629 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 636 "inweb/Chapter 3/The Indexer.w"
|
||||
WRITE_TO(substituted, "<a href=\"");
|
||||
Colonies__reference_URL(substituted, link_text, Indexer__current_file());
|
||||
WRITE_TO(substituted, "\">");
|
||||
|
||||
}
|
||||
#line 476 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 478 "inweb/Chapter 3/The Indexer.w"
|
||||
;
|
||||
} else if (Regexp__match(&mr, varname, L"Menu \"(%c+)\"")) {
|
||||
text_stream *menu_name = mr.exp[0];
|
||||
|
||||
{
|
||||
#line 634 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 641 "inweb/Chapter 3/The Indexer.w"
|
||||
if (ies->inside_navigation_submenu) WRITE_TO(substituted, "</ul>");
|
||||
WRITE_TO(substituted, "<h2>%S</h2><ul>", menu_name);
|
||||
ies->inside_navigation_submenu = TRUE;
|
||||
|
||||
}
|
||||
#line 479 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 481 "inweb/Chapter 3/The Indexer.w"
|
||||
;
|
||||
} else if (Regexp__match(&mr, varname, L"Item \"(%c+)\"")) {
|
||||
text_stream *item_name = mr.exp[0];
|
||||
text_stream *link_text = item_name;
|
||||
|
||||
{
|
||||
#line 639 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 646 "inweb/Chapter 3/The Indexer.w"
|
||||
TEMPORARY_TEXT(url);
|
||||
Colonies__reference_URL(url, link_text, Indexer__current_file());
|
||||
|
||||
{
|
||||
#line 651 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 658 "inweb/Chapter 3/The Indexer.w"
|
||||
if (ies->inside_navigation_submenu == FALSE) WRITE_TO(substituted, "<ul>");
|
||||
ies->inside_navigation_submenu = TRUE;
|
||||
WRITE_TO(substituted, "<li>");
|
||||
|
@ -17486,24 +17501,24 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
WRITE_TO(substituted, "</li>");
|
||||
|
||||
}
|
||||
#line 641 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 648 "inweb/Chapter 3/The Indexer.w"
|
||||
;
|
||||
DISCARD_TEXT(url);
|
||||
|
||||
}
|
||||
#line 483 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 485 "inweb/Chapter 3/The Indexer.w"
|
||||
;
|
||||
} else if (Regexp__match(&mr, varname, L"Item \"(%c+)\" -> (%c+)")) {
|
||||
text_stream *item_name = mr.exp[0];
|
||||
text_stream *link_text = mr.exp[1];
|
||||
|
||||
{
|
||||
#line 645 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 652 "inweb/Chapter 3/The Indexer.w"
|
||||
TEMPORARY_TEXT(url);
|
||||
Colonies__link_URL(url, link_text, Indexer__current_file());
|
||||
|
||||
{
|
||||
#line 651 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 658 "inweb/Chapter 3/The Indexer.w"
|
||||
if (ies->inside_navigation_submenu == FALSE) WRITE_TO(substituted, "<ul>");
|
||||
ies->inside_navigation_submenu = TRUE;
|
||||
WRITE_TO(substituted, "<li>");
|
||||
|
@ -17525,12 +17540,12 @@ void Indexer__run_engine(text_stream *OUT, index_engine_state *ies) {
|
|||
WRITE_TO(substituted, "</li>");
|
||||
|
||||
}
|
||||
#line 647 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 654 "inweb/Chapter 3/The Indexer.w"
|
||||
;
|
||||
DISCARD_TEXT(url);
|
||||
|
||||
}
|
||||
#line 487 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 489 "inweb/Chapter 3/The Indexer.w"
|
||||
;
|
||||
} else {
|
||||
WRITE_TO(substituted, "%S", varname);
|
||||
|
@ -17586,7 +17601,7 @@ void Indexer__end_CI_loop(index_engine_state *ies) {
|
|||
ies->stack_pointer--;
|
||||
}
|
||||
|
||||
#line 672 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 679 "inweb/Chapter 3/The Indexer.w"
|
||||
void Indexer__list_module(OUTPUT_STREAM, module *M, int list_this) {
|
||||
if (list_this) {
|
||||
WRITE("<li><p>%S - ", M->module_name);
|
||||
|
@ -17601,7 +17616,7 @@ void Indexer__list_module(OUTPUT_STREAM, module *M, int list_this) {
|
|||
Indexer__list_module(OUT, N, TRUE);
|
||||
}
|
||||
|
||||
#line 689 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 696 "inweb/Chapter 3/The Indexer.w"
|
||||
void Indexer__transcribe_CSS(OUTPUT_STREAM, filename *CSS_file) {
|
||||
WRITE("<style type=\"text/css\">\n");
|
||||
TextFiles__read(CSS_file, FALSE, "can't open CSS file",
|
||||
|
@ -17614,7 +17629,7 @@ void Indexer__copy_CSS(text_stream *line, text_file_position *tfp, void *X) {
|
|||
WRITE("%S\n", line);
|
||||
}
|
||||
|
||||
#line 704 "inweb/Chapter 3/The Indexer.w"
|
||||
#line 711 "inweb/Chapter 3/The Indexer.w"
|
||||
filename *file_being_woven = NULL;
|
||||
filename *Indexer__current_file(void) {
|
||||
return file_being_woven;
|
||||
|
@ -23751,7 +23766,7 @@ void HTMLFormat__source_code(weave_format *self, text_stream *OUT, weave_target
|
|||
for (int i=0; i < Str__len(matter); i++) {
|
||||
colour_wanted = Str__get_at(colouring, i);
|
||||
{
|
||||
#line 389 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 390 "inweb/Chapter 5/HTML Formats.w"
|
||||
if (colour_wanted != current_colour) {
|
||||
if (current_colour >= 0) HTML_CLOSE("span");
|
||||
Formats__change_colour(OUT, wv, colour_wanted, TRUE);
|
||||
|
@ -23842,7 +23857,7 @@ void HTMLFormat__source_code(weave_format *self, text_stream *OUT, weave_target
|
|||
Str__substr(reference, Str__at(matter, i + N), Str__at(matter, j));
|
||||
|
||||
{
|
||||
#line 378 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 379 "inweb/Chapter 5/HTML Formats.w"
|
||||
TEMPORARY_TEXT(url);
|
||||
TEMPORARY_TEXT(title);
|
||||
if (Colonies__resolve_reference_in_weave(url, title, wv->weave_to, reference,
|
||||
|
@ -23857,6 +23872,7 @@ void HTMLFormat__source_code(weave_format *self, text_stream *OUT, weave_target
|
|||
#line 370 "inweb/Chapter 5/HTML Formats.w"
|
||||
;
|
||||
DISCARD_TEXT(reference);
|
||||
break;
|
||||
}
|
||||
j++;
|
||||
}
|
||||
|
@ -23884,7 +23900,7 @@ void HTMLFormat__source_code(weave_format *self, text_stream *OUT, weave_target
|
|||
}
|
||||
}
|
||||
|
||||
#line 440 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 441 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__inline_code(weave_format *self, text_stream *OUT, weave_target *wv,
|
||||
int enter) {
|
||||
if (enter) {
|
||||
|
@ -23895,7 +23911,7 @@ void HTMLFormat__inline_code(weave_format *self, text_stream *OUT, weave_target
|
|||
}
|
||||
}
|
||||
|
||||
#line 451 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 452 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__url(weave_format *self, text_stream *OUT, weave_target *wv,
|
||||
text_stream *url, text_stream *content, int external) {
|
||||
HTML__begin_link_with_class(OUT, (external)?TL_IS_480:TL_IS_481, url);
|
||||
|
@ -23903,7 +23919,7 @@ void HTMLFormat__url(weave_format *self, text_stream *OUT, weave_target *wv,
|
|||
HTML__end_link(OUT);
|
||||
}
|
||||
|
||||
#line 459 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 460 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__footnote_cue(weave_format *self, text_stream *OUT, weave_target *wv,
|
||||
text_stream *cue) {
|
||||
text_stream *fn_plugin_name =
|
||||
|
@ -23914,7 +23930,7 @@ void HTMLFormat__footnote_cue(weave_format *self, text_stream *OUT, weave_target
|
|||
cue, cue, cue);
|
||||
}
|
||||
|
||||
#line 470 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 471 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__begin_footnote_text(weave_format *self, text_stream *OUT, weave_target *wv,
|
||||
text_stream *cue) {
|
||||
text_stream *fn_plugin_name =
|
||||
|
@ -23924,7 +23940,7 @@ void HTMLFormat__begin_footnote_text(weave_format *self, text_stream *OUT, weave
|
|||
WRITE("<li class=\"footnote\" id=\"fn:%S\"><p>", cue);
|
||||
}
|
||||
|
||||
#line 480 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 481 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__end_footnote_text(weave_format *self, text_stream *OUT, weave_target *wv,
|
||||
text_stream *cue) {
|
||||
text_stream *fn_plugin_name =
|
||||
|
@ -23934,7 +23950,7 @@ void HTMLFormat__end_footnote_text(weave_format *self, text_stream *OUT, weave_t
|
|||
WRITE("<a href=\"#fnref:%S\" title=\"return to text\"> ↩</a></p></li>", cue);
|
||||
}
|
||||
|
||||
#line 490 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 491 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__display_line(weave_format *self, text_stream *OUT, weave_target *wv,
|
||||
text_stream *from) {
|
||||
HTMLFormat__exit_current_paragraph(OUT);
|
||||
|
@ -23945,7 +23961,7 @@ void HTMLFormat__display_line(weave_format *self, text_stream *OUT, weave_target
|
|||
OUTDENT; HTML_CLOSE("blockquote"); WRITE("\n");
|
||||
}
|
||||
|
||||
#line 501 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 502 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__item(weave_format *self, text_stream *OUT, weave_target *wv, int depth,
|
||||
text_stream *label) {
|
||||
HTMLFormat__go_to_depth(OUT, depth);
|
||||
|
@ -23954,13 +23970,13 @@ void HTMLFormat__item(weave_format *self, text_stream *OUT, weave_target *wv, in
|
|||
|
||||
}
|
||||
|
||||
#line 510 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 511 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__bar(weave_format *self, text_stream *OUT, weave_target *wv) {
|
||||
HTMLFormat__exit_current_paragraph(OUT);
|
||||
HTML__hr(OUT, NULL);
|
||||
}
|
||||
|
||||
#line 516 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 517 "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);
|
||||
|
@ -23975,7 +23991,7 @@ void HTMLFormat__figure(weave_format *self, text_stream *OUT, weave_target *wv,
|
|||
WRITE("\n");
|
||||
}
|
||||
|
||||
#line 531 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 532 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__embed(weave_format *self, text_stream *OUT, weave_target *wv,
|
||||
text_stream *service, text_stream *ID) {
|
||||
text_stream *CH = TL_IS_489;
|
||||
|
@ -24014,7 +24030,7 @@ void HTMLFormat__embed(weave_format *self, text_stream *OUT, weave_target *wv,
|
|||
Regexp__dispose_of(&mr);
|
||||
}
|
||||
|
||||
#line 570 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 571 "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;
|
||||
|
@ -24029,12 +24045,12 @@ void HTMLFormat__para_macro(weave_format *self, text_stream *OUT, weave_target *
|
|||
WRITE(">%s", (defn)?" =":"");
|
||||
}
|
||||
|
||||
#line 585 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 586 "inweb/Chapter 5/HTML Formats.w"
|
||||
void HTMLFormat__pagebreak(weave_format *self, text_stream *OUT, weave_target *wv) {
|
||||
HTMLFormat__exit_current_paragraph(OUT);
|
||||
}
|
||||
|
||||
#line 590 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 591 "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) {
|
||||
|
@ -24047,7 +24063,7 @@ void HTMLFormat__blank_line(weave_format *self, text_stream *OUT, weave_target *
|
|||
}
|
||||
}
|
||||
|
||||
#line 603 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 604 "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) {
|
||||
if (old_material != new_material) {
|
||||
|
@ -24116,7 +24132,7 @@ void HTMLFormat__change_material(weave_format *self, text_stream *OUT, weave_tar
|
|||
}
|
||||
}
|
||||
|
||||
#line 672 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 673 "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";
|
||||
|
@ -24137,7 +24153,7 @@ void HTMLFormat__change_colour(weave_format *self, text_stream *OUT, weave_targe
|
|||
HTML_OPEN_WITH("span", "class=\"%s\"", cl);
|
||||
}
|
||||
|
||||
#line 693 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 694 "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);
|
||||
|
@ -24147,7 +24163,7 @@ void HTMLFormat__endnote(weave_format *self, text_stream *OUT, weave_target *wv,
|
|||
}
|
||||
}
|
||||
|
||||
#line 703 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 704 "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++) {
|
||||
|
@ -24168,7 +24184,7 @@ void HTMLFormat__commentary_text(weave_format *self, text_stream *OUT, weave_tar
|
|||
}
|
||||
}
|
||||
|
||||
#line 724 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 725 "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)
|
||||
|
@ -24182,7 +24198,7 @@ void HTMLFormat__locale(weave_format *self, text_stream *OUT, weave_target *wv,
|
|||
HTML__end_link(OUT);
|
||||
}
|
||||
|
||||
#line 738 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 739 "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);
|
||||
|
@ -24227,7 +24243,7 @@ void HTMLFormat__tail(weave_format *self, text_stream *OUT, weave_target *wv,
|
|||
Indexer__cover_sheet_maker(OUT, wv->weave_web, TL_IS_498, wv, WEAVE_SECOND_HALF);
|
||||
}
|
||||
|
||||
#line 785 "inweb/Chapter 5/HTML Formats.w"
|
||||
#line 786 "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_499));
|
||||
|
@ -25381,15 +25397,16 @@ void Readme__readme_harvester(text_stream *text, text_file_position *tfp, void *
|
|||
Regexp__dispose_of(&mr);
|
||||
}
|
||||
|
||||
#line 25 "inweb/Chapter 6/Colonies.w"
|
||||
#line 26 "inweb/Chapter 6/Colonies.w"
|
||||
|
||||
#line 49 "inweb/Chapter 6/Colonies.w"
|
||||
#line 50 "inweb/Chapter 6/Colonies.w"
|
||||
|
||||
#line 62 "inweb/Chapter 6/Colonies.w"
|
||||
#line 63 "inweb/Chapter 6/Colonies.w"
|
||||
|
||||
void Colonies__load(filename *F) {
|
||||
colony *C = CREATE(colony);
|
||||
C->members = NEW_LINKED_LIST(colony_member);
|
||||
C->home = TL_IS_525;
|
||||
colony_reader_state crs;
|
||||
crs.province = C;
|
||||
crs.nav = NULL;
|
||||
|
@ -25399,7 +25416,7 @@ void Colonies__load(filename *F) {
|
|||
TRUE, Colonies__read_line, NULL, (void *) &crs);
|
||||
}
|
||||
|
||||
#line 78 "inweb/Chapter 6/Colonies.w"
|
||||
#line 80 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__read_line(text_stream *line, text_file_position *tfp, void *v_crs) {
|
||||
colony_reader_state *crs = (colony_reader_state *) v_crs;
|
||||
colony *C = crs->province;
|
||||
|
@ -25411,8 +25428,8 @@ void Colonies__read_line(text_stream *line, text_file_position *tfp, void *v_crs
|
|||
match_results mr = Regexp__create_mr();
|
||||
if (Regexp__match(&mr, line, L"(%c*?): \"*(%C+)\" at \"(%c*)\" in \"(%c*)\"")) {
|
||||
colony_member *CM = CREATE(colony_member);
|
||||
if (Str__eq(mr.exp[0], TL_IS_525)) CM->web_rather_than_module = TRUE;
|
||||
else if (Str__eq(mr.exp[0], TL_IS_526)) CM->web_rather_than_module = FALSE;
|
||||
if (Str__eq(mr.exp[0], TL_IS_526)) CM->web_rather_than_module = TRUE;
|
||||
else if (Str__eq(mr.exp[0], TL_IS_527)) CM->web_rather_than_module = FALSE;
|
||||
else {
|
||||
CM->web_rather_than_module = FALSE;
|
||||
Errors__in_text_file("text before ':' must be 'web' or 'module'", tfp);
|
||||
|
@ -25420,7 +25437,7 @@ void Colonies__read_line(text_stream *line, text_file_position *tfp, void *v_crs
|
|||
CM->name = Str__duplicate(mr.exp[1]);
|
||||
CM->path = Str__duplicate(mr.exp[2]);
|
||||
CM->home_leaf = Str__new();
|
||||
if (Str__suffix_eq(CM->path, TL_IS_527, 6)) {
|
||||
if (Str__suffix_eq(CM->path, TL_IS_528, 6)) {
|
||||
filename *F = Filenames__from_text(CM->path);
|
||||
Filenames__write_unextended_leafname(CM->home_leaf, F);
|
||||
WRITE_TO(CM->home_leaf, ".html");
|
||||
|
@ -25433,6 +25450,8 @@ void Colonies__read_line(text_stream *line, text_file_position *tfp, void *v_crs
|
|||
CM->breadcrumb_tail = crs->crumbs;
|
||||
CM->default_weave_pattern = Str__duplicate(crs->pattern);
|
||||
ADD_TO_LINKED_LIST(CM, colony_member, C->members);
|
||||
} else if (Regexp__match(&mr, line, L"home: *(%c*)")) {
|
||||
C->home = Str__duplicate(mr.exp[0]);
|
||||
} else if (Regexp__match(&mr, line, L"pattern: none")) {
|
||||
crs->pattern = NULL;
|
||||
} else if (Regexp__match(&mr, line, L"pattern: *(%c*)")) {
|
||||
|
@ -25457,7 +25476,7 @@ void Colonies__read_line(text_stream *line, text_file_position *tfp, void *v_crs
|
|||
Regexp__dispose_of(&mr);
|
||||
}
|
||||
|
||||
#line 139 "inweb/Chapter 6/Colonies.w"
|
||||
#line 143 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__add_crumb(linked_list *L, text_stream *spec, text_file_position *tfp) {
|
||||
match_results mr = Regexp__create_mr();
|
||||
if (Regexp__match(&mr, spec, L"\"(%c*?)\"") == FALSE) {
|
||||
|
@ -25470,7 +25489,7 @@ void Colonies__add_crumb(linked_list *L, text_stream *spec, text_file_position *
|
|||
Regexp__dispose_of(&mr);
|
||||
}
|
||||
|
||||
#line 156 "inweb/Chapter 6/Colonies.w"
|
||||
#line 160 "inweb/Chapter 6/Colonies.w"
|
||||
|
||||
breadcrumb_request *Colonies__request_breadcrumb(text_stream *arg) {
|
||||
breadcrumb_request *BR = CREATE(breadcrumb_request);
|
||||
|
@ -25513,7 +25532,7 @@ void Colonies__write_breadcrumb(OUTPUT_STREAM, text_stream *text, text_stream *l
|
|||
}
|
||||
}
|
||||
|
||||
#line 203 "inweb/Chapter 6/Colonies.w"
|
||||
#line 207 "inweb/Chapter 6/Colonies.w"
|
||||
colony_member *Colonies__find(text_stream *T) {
|
||||
colony *C;
|
||||
LOOP_OVER(C, colony) {
|
||||
|
@ -25525,20 +25544,20 @@ colony_member *Colonies__find(text_stream *T) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#line 221 "inweb/Chapter 6/Colonies.w"
|
||||
#line 225 "inweb/Chapter 6/Colonies.w"
|
||||
module *Colonies__as_module(colony_member *CM, source_line *L, web_md *Wm) {
|
||||
if (CM->loaded == NULL)
|
||||
{
|
||||
#line 230 "inweb/Chapter 6/Colonies.w"
|
||||
#line 234 "inweb/Chapter 6/Colonies.w"
|
||||
if ((Wm) && (Str__eq_insensitive(Wm->as_module->module_name, CM->name)))
|
||||
CM->loaded = Wm;
|
||||
|
||||
}
|
||||
#line 222 "inweb/Chapter 6/Colonies.w"
|
||||
#line 226 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
if (CM->loaded == NULL)
|
||||
{
|
||||
#line 234 "inweb/Chapter 6/Colonies.w"
|
||||
#line 238 "inweb/Chapter 6/Colonies.w"
|
||||
if (Wm) {
|
||||
module *M;
|
||||
LOOP_OVER_LINKED_LIST(M, module, Wm->as_module->dependencies)
|
||||
|
@ -25547,36 +25566,44 @@ module *Colonies__as_module(colony_member *CM, source_line *L, web_md *Wm) {
|
|||
}
|
||||
|
||||
}
|
||||
#line 223 "inweb/Chapter 6/Colonies.w"
|
||||
#line 227 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
if (CM->loaded == NULL)
|
||||
{
|
||||
#line 242 "inweb/Chapter 6/Colonies.w"
|
||||
#line 246 "inweb/Chapter 6/Colonies.w"
|
||||
filename *F = NULL;
|
||||
pathname *P = NULL;
|
||||
if (Str__suffix_eq(CM->path, TL_IS_528, 6))
|
||||
if (Str__suffix_eq(CM->path, TL_IS_529, 6))
|
||||
F = Filenames__from_text(CM->path);
|
||||
else
|
||||
P = Pathnames__from_text(CM->path);
|
||||
CM->loaded = WebMetadata__get_without_modules(P, F);
|
||||
|
||||
}
|
||||
#line 224 "inweb/Chapter 6/Colonies.w"
|
||||
#line 228 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
if (CM->loaded == NULL)
|
||||
{
|
||||
#line 251 "inweb/Chapter 6/Colonies.w"
|
||||
#line 255 "inweb/Chapter 6/Colonies.w"
|
||||
TEMPORARY_TEXT(err);
|
||||
WRITE_TO(err, "unable to load '%S'", CM->name);
|
||||
Main__error_in_web(err, L);
|
||||
|
||||
}
|
||||
#line 225 "inweb/Chapter 6/Colonies.w"
|
||||
#line 229 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
return CM->loaded->as_module;
|
||||
}
|
||||
|
||||
#line 274 "inweb/Chapter 6/Colonies.w"
|
||||
#line 262 "inweb/Chapter 6/Colonies.w"
|
||||
text_stream *Colonies__home(void) {
|
||||
colony *C;
|
||||
LOOP_OVER(C, colony)
|
||||
return C->home;
|
||||
return TL_IS_530;
|
||||
}
|
||||
|
||||
#line 288 "inweb/Chapter 6/Colonies.w"
|
||||
int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
||||
filename *for_HTML_file, text_stream *text, web_md *Wm, source_line *L) {
|
||||
module *from_M = (Wm)?(Wm->as_module):NULL;
|
||||
|
@ -25586,7 +25613,7 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
|
||||
|
||||
{
|
||||
#line 308 "inweb/Chapter 6/Colonies.w"
|
||||
#line 325 "inweb/Chapter 6/Colonies.w"
|
||||
search_CM = Colonies__find(text);
|
||||
if (search_CM) {
|
||||
module *found_M = Colonies__as_module(search_CM, L, Wm);
|
||||
|
@ -25595,11 +25622,11 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
WRITE_TO(title, "%S", search_CM->name);
|
||||
|
||||
{
|
||||
#line 355 "inweb/Chapter 6/Colonies.w"
|
||||
#line 372 "inweb/Chapter 6/Colonies.w"
|
||||
if (found_M == NULL) internal_error("could not locate M");
|
||||
if (search_CM)
|
||||
{
|
||||
#line 361 "inweb/Chapter 6/Colonies.w"
|
||||
#line 378 "inweb/Chapter 6/Colonies.w"
|
||||
pathname *from = Filenames__get_path_to(for_HTML_file);
|
||||
pathname *to = search_CM->weave_path;
|
||||
Pathnames__relative_URL(url, from, to);
|
||||
|
@ -25609,11 +25636,11 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
WRITE_TO(title, " (in %S)", search_CM->name);
|
||||
|
||||
}
|
||||
#line 356 "inweb/Chapter 6/Colonies.w"
|
||||
#line 373 "inweb/Chapter 6/Colonies.w"
|
||||
|
||||
else
|
||||
{
|
||||
#line 374 "inweb/Chapter 6/Colonies.w"
|
||||
#line 391 "inweb/Chapter 6/Colonies.w"
|
||||
if (found_M == from_M) {
|
||||
Colonies__section_URL(url, found_Sm);
|
||||
} else {
|
||||
|
@ -25624,21 +25651,21 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
}
|
||||
|
||||
}
|
||||
#line 357 "inweb/Chapter 6/Colonies.w"
|
||||
#line 374 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
#line 314 "inweb/Chapter 6/Colonies.w"
|
||||
#line 331 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
}
|
||||
|
||||
}
|
||||
#line 281 "inweb/Chapter 6/Colonies.w"
|
||||
#line 295 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
|
||||
{
|
||||
#line 318 "inweb/Chapter 6/Colonies.w"
|
||||
#line 335 "inweb/Chapter 6/Colonies.w"
|
||||
match_results mr = Regexp__create_mr();
|
||||
if (Regexp__match(&mr, text, L"(%c*?): (%c*)")) {
|
||||
search_CM = Colonies__find(mr.exp[0]);
|
||||
|
@ -25654,7 +25681,7 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
Regexp__dispose_of(&mr);
|
||||
|
||||
}
|
||||
#line 282 "inweb/Chapter 6/Colonies.w"
|
||||
#line 296 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
|
||||
module *found_M = NULL;
|
||||
|
@ -25666,7 +25693,7 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
if ((L) && (external == FALSE)) {
|
||||
|
||||
{
|
||||
#line 333 "inweb/Chapter 6/Colonies.w"
|
||||
#line 350 "inweb/Chapter 6/Colonies.w"
|
||||
language_function *fn;
|
||||
LOOP_OVER(fn, language_function) {
|
||||
if (Str__eq_insensitive(fn->function_name, text)) {
|
||||
|
@ -25678,11 +25705,11 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
}
|
||||
|
||||
}
|
||||
#line 291 "inweb/Chapter 6/Colonies.w"
|
||||
#line 305 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
|
||||
{
|
||||
#line 344 "inweb/Chapter 6/Colonies.w"
|
||||
#line 361 "inweb/Chapter 6/Colonies.w"
|
||||
language_type *str;
|
||||
LOOP_OVER(str, language_type) {
|
||||
if (Str__eq_insensitive(str->structure_name, text)) {
|
||||
|
@ -25694,24 +25721,27 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
}
|
||||
|
||||
}
|
||||
#line 292 "inweb/Chapter 6/Colonies.w"
|
||||
#line 306 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
}
|
||||
Main__error_in_web(TL_IS_529, L);
|
||||
TEMPORARY_TEXT(err);
|
||||
WRITE_TO(err, "Can't find the cross-reference '%S'", text);
|
||||
Main__error_in_web(err, L);
|
||||
DISCARD_TEXT(err);
|
||||
return FALSE;
|
||||
} else if (N > 1) {
|
||||
Main__error_in_web(TL_IS_530, L);
|
||||
Main__error_in_web(TL_IS_531, L);
|
||||
WebModules__named_reference(&found_M, &found_Sm, &bare_module_name,
|
||||
title, search_M, text, TRUE);
|
||||
return FALSE;
|
||||
} else {
|
||||
|
||||
{
|
||||
#line 355 "inweb/Chapter 6/Colonies.w"
|
||||
#line 372 "inweb/Chapter 6/Colonies.w"
|
||||
if (found_M == NULL) internal_error("could not locate M");
|
||||
if (search_CM)
|
||||
{
|
||||
#line 361 "inweb/Chapter 6/Colonies.w"
|
||||
#line 378 "inweb/Chapter 6/Colonies.w"
|
||||
pathname *from = Filenames__get_path_to(for_HTML_file);
|
||||
pathname *to = search_CM->weave_path;
|
||||
Pathnames__relative_URL(url, from, to);
|
||||
|
@ -25721,11 +25751,11 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
WRITE_TO(title, " (in %S)", search_CM->name);
|
||||
|
||||
}
|
||||
#line 356 "inweb/Chapter 6/Colonies.w"
|
||||
#line 373 "inweb/Chapter 6/Colonies.w"
|
||||
|
||||
else
|
||||
{
|
||||
#line 374 "inweb/Chapter 6/Colonies.w"
|
||||
#line 391 "inweb/Chapter 6/Colonies.w"
|
||||
if (found_M == from_M) {
|
||||
Colonies__section_URL(url, found_Sm);
|
||||
} else {
|
||||
|
@ -25736,18 +25766,18 @@ int Colonies__resolve_reference_in_weave(text_stream *url, text_stream *title,
|
|||
}
|
||||
|
||||
}
|
||||
#line 357 "inweb/Chapter 6/Colonies.w"
|
||||
#line 374 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
return TRUE;
|
||||
|
||||
}
|
||||
#line 302 "inweb/Chapter 6/Colonies.w"
|
||||
#line 319 "inweb/Chapter 6/Colonies.w"
|
||||
;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
#line 386 "inweb/Chapter 6/Colonies.w"
|
||||
#line 403 "inweb/Chapter 6/Colonies.w"
|
||||
void Colonies__link_URL(OUTPUT_STREAM, text_stream *link_text, filename *F) {
|
||||
match_results mr = Regexp__create_mr();
|
||||
if (Regexp__match(&mr, link_text, L" *//(%c+)// *"))
|
||||
|
@ -26328,10 +26358,11 @@ void register_tangled_text_literals(void) {
|
|||
TL_IS_522 = Str__literal(L"(manifest).txt");
|
||||
TL_IS_523 = Str__literal(L"README.txt");
|
||||
TL_IS_524 = Str__literal(L"README.md");
|
||||
TL_IS_525 = Str__literal(L"web");
|
||||
TL_IS_526 = Str__literal(L"module");
|
||||
TL_IS_527 = Str__literal(L".inweb");
|
||||
TL_IS_525 = Str__literal(L"docs");
|
||||
TL_IS_526 = Str__literal(L"web");
|
||||
TL_IS_527 = Str__literal(L"module");
|
||||
TL_IS_528 = Str__literal(L".inweb");
|
||||
TL_IS_529 = Str__literal(L"Can't find this cross-reference");
|
||||
TL_IS_530 = Str__literal(L"Multiple cross-references might be meant here");
|
||||
TL_IS_529 = Str__literal(L".inweb");
|
||||
TL_IS_530 = Str__literal(L"docs");
|
||||
TL_IS_531 = Str__literal(L"Multiple cross-references might be meant here");
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ trace-sentences mode, that is, between asterisk sentences.
|
|||
|
||||
<p class="inwebparagraph"><a id="SP5"></a><b>§5. </b>The debugging log provides an opportunity to see what has been happening
|
||||
behind the scenes; but such a log file is often buffered by the filing system,
|
||||
so that a sudden crash of NI may result in the loss of recent data written to
|
||||
so that a sudden crash of Inform may result in the loss of recent data written to
|
||||
the log. Which is a pity, since this is exactly the most useful evidence as to
|
||||
the cause of the crash in the first place. Accordingly, we fairly often
|
||||
<code class="display"><span class="extract">fflush</span></code> the debug log file, forcing any buffered output to be written.
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</nav>
|
||||
<main role="main">
|
||||
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><b>goldbach</b></li></ul>
|
||||
<p class="purpose">A simple test web for inweb. This is version 1.</p>
|
||||
<p class="purpose">This example of using inweb is a simple program to test Goldbach's Conjecture, a classic problem in number theory. This is version 1.</p>
|
||||
<hr>
|
||||
<ul class="sectionlist">
|
||||
<li>
|
||||
|
|
|
@ -469,7 +469,7 @@ source:
|
|||
</p>
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Main::error_in_web<button class="popup" onclick="togglePopup('usagePopup1')">...<span class="popuptext" id="usagePopup1">Usage of <b>Main::error_in_web</b>:<br>Configuration - <a href="1-cnf.html#SP4">§4</a><br>The Parser - <a href="2-tp.html#SP1_1_6_3">§1.1.6.3</a>, <a href="2-tp.html#SP1_1_6_4">§1.1.6.4</a>, <a href="2-tp.html#SP1_1_6_7">§1.1.6.7</a>, <a href="2-tp.html#SP1_1_6_7_1">§1.1.6.7.1</a>, <a href="2-tp.html#SP1_1_6_5_1">§1.1.6.5.1</a>, <a href="2-tp.html#SP1_1_6_5_1_1">§1.1.6.5.1.1</a>, <a href="2-tp.html#SP1_1_6_5_1_2">§1.1.6.5.1.2</a>, <a href="2-tp.html#SP1_1_6_5_1_3">§1.1.6.5.1.3</a>, <a href="2-tp.html#SP1_1_6_5_1_4">§1.1.6.5.1.4</a>, <a href="2-tp.html#SP1_1_6_5_1_7">§1.1.6.5.1.7</a>, <a href="2-tp.html#SP3">§3</a><br>Enumerated Constants - <a href="2-ec.html#SP3_1">§3.1</a>, <a href="2-ec.html#SP3_2">§3.2</a>, <a href="2-ec.html#SP3_3">§3.3</a><br>The Analyser - <a href="3-ta.html#SP4_1">§4.1</a><br>The Weaver - <a href="3-tw.html#SP1_3_4_1_8_5">§1.3.4.1.8.5</a><br>The Tangler - <a href="3-tt.html#SP1_1_1_1">§1.1.1.1</a>, <a href="3-tt.html#SP3_1">§3.1</a><br>Types and Functions - <a href="4-taf.html#SP7_3">§7.3</a><br>Language Methods - <a href="4-lm.html#SP10">§10</a><br>C-Like Languages - <a href="4-cl.html#SP3">§3</a>, <a href="4-cl.html#SP3_1">§3.1</a>, <a href="4-cl.html#SP3_2_2_1">§3.2.2.1</a>, <a href="4-cl.html#SP9">§9</a><br>HTML Formats - <a href="5-hf.html#SP19">§19</a><br>Weave Plugins - <a href="5-wp.html#SP3">§3</a><br>Colonies - <a href="6-cln.html#SP8_4">§8.4</a>, <a href="6-cln.html#SP9">§9</a></span></button></span><span class="plain">(</span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">message</span><span class="plain">, </span><span class="reserved">source_line</span><span class="plain"> *</span><span class="identifier">sl</span><span class="plain">) {</span>
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Main::error_in_web<button class="popup" onclick="togglePopup('usagePopup1')">...<span class="popuptext" id="usagePopup1">Usage of <b>Main::error_in_web</b>:<br>Configuration - <a href="1-cnf.html#SP4">§4</a><br>The Parser - <a href="2-tp.html#SP1_1_6_3">§1.1.6.3</a>, <a href="2-tp.html#SP1_1_6_4">§1.1.6.4</a>, <a href="2-tp.html#SP1_1_6_7">§1.1.6.7</a>, <a href="2-tp.html#SP1_1_6_7_1">§1.1.6.7.1</a>, <a href="2-tp.html#SP1_1_6_5_1">§1.1.6.5.1</a>, <a href="2-tp.html#SP1_1_6_5_1_1">§1.1.6.5.1.1</a>, <a href="2-tp.html#SP1_1_6_5_1_2">§1.1.6.5.1.2</a>, <a href="2-tp.html#SP1_1_6_5_1_3">§1.1.6.5.1.3</a>, <a href="2-tp.html#SP1_1_6_5_1_4">§1.1.6.5.1.4</a>, <a href="2-tp.html#SP1_1_6_5_1_7">§1.1.6.5.1.7</a>, <a href="2-tp.html#SP3">§3</a><br>Enumerated Constants - <a href="2-ec.html#SP3_1">§3.1</a>, <a href="2-ec.html#SP3_2">§3.2</a>, <a href="2-ec.html#SP3_3">§3.3</a><br>The Analyser - <a href="3-ta.html#SP4_1">§4.1</a><br>The Weaver - <a href="3-tw.html#SP1_3_4_1_8_5">§1.3.4.1.8.5</a><br>The Tangler - <a href="3-tt.html#SP1_1_1_1">§1.1.1.1</a>, <a href="3-tt.html#SP3_1">§3.1</a><br>Types and Functions - <a href="4-taf.html#SP7_3">§7.3</a><br>Language Methods - <a href="4-lm.html#SP10">§10</a><br>C-Like Languages - <a href="4-cl.html#SP3">§3</a>, <a href="4-cl.html#SP3_1">§3.1</a>, <a href="4-cl.html#SP3_2_2_1">§3.2.2.1</a>, <a href="4-cl.html#SP9">§9</a><br>HTML Formats - <a href="5-hf.html#SP19">§19</a><br>Weave Plugins - <a href="5-wp.html#SP3">§3</a><br>Colonies - <a href="6-cln.html#SP8_4">§8.4</a>, <a href="6-cln.html#SP10">§10</a></span></button></span><span class="plain">(</span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">message</span><span class="plain">, </span><span class="reserved">source_line</span><span class="plain"> *</span><span class="identifier">sl</span><span class="plain">) {</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">sl</span><span class="plain">) {</span>
|
||||
<span class="functiontext"><a href="3-em.html#SP5">Errors::in_text_file_S</a></span><span class="plain">(</span><span class="identifier">message</span><span class="plain">, &(</span><span class="identifier">sl</span><span class="plain">-></span><span class="element">source</span><span class="plain">));</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="constant">STDERR</span><span class="plain">, </span><span class="string">"%07d %S\n"</span><span class="plain">, </span><span class="identifier">sl</span><span class="plain">-></span><span class="element">source</span><span class="plain">.</span><span class="element">line_count</span><span class="plain">, </span><span class="identifier">sl</span><span class="plain">-></span><span class="element">text</span><span class="plain">);</span>
|
||||
|
|
|
@ -691,23 +691,25 @@ its square-bracketed parts.
|
|||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">varname</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Section (%c+)"</span><span class="plain">)) {</span>
|
||||
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">detail</span><span class="plain"> = </span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[0];</span>
|
||||
<<span class="cwebmacro">Substitute a Section</span> <span class="cwebmacronumber">6.1.8.8</span>><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">varname</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Docs"</span><span class="plain">)) {</span>
|
||||
<<span class="cwebmacro">Substitute a Docs</span> <span class="cwebmacronumber">6.1.8.9</span>><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">varname</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"URL \"(%c+)\""</span><span class="plain">)) {</span>
|
||||
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">link_text</span><span class="plain"> = </span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[0];</span>
|
||||
<<span class="cwebmacro">Substitute a URL</span> <span class="cwebmacronumber">6.1.8.9</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">Substitute a URL</span> <span class="cwebmacronumber">6.1.8.10</span>><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">varname</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Link \"(%c+)\""</span><span class="plain">)) {</span>
|
||||
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">link_text</span><span class="plain"> = </span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[0];</span>
|
||||
<<span class="cwebmacro">Substitute a Link</span> <span class="cwebmacronumber">6.1.8.10</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">Substitute a Link</span> <span class="cwebmacronumber">6.1.8.11</span>><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">varname</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Menu \"(%c+)\""</span><span class="plain">)) {</span>
|
||||
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">menu_name</span><span class="plain"> = </span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[0];</span>
|
||||
<<span class="cwebmacro">Substitute a Menu</span> <span class="cwebmacronumber">6.1.8.11</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">Substitute a Menu</span> <span class="cwebmacronumber">6.1.8.12</span>><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">varname</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Item \"(%c+)\""</span><span class="plain">)) {</span>
|
||||
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">item_name</span><span class="plain"> = </span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[0];</span>
|
||||
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">link_text</span><span class="plain"> = </span><span class="identifier">item_name</span><span class="plain">;</span>
|
||||
<<span class="cwebmacro">Substitute a member Item</span> <span class="cwebmacronumber">6.1.8.12</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">Substitute a member Item</span> <span class="cwebmacronumber">6.1.8.13</span>><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">varname</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Item \"(%c+)\" -> (%c+)"</span><span class="plain">)) {</span>
|
||||
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">item_name</span><span class="plain"> = </span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[0];</span>
|
||||
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">link_text</span><span class="plain"> = </span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[1];</span>
|
||||
<<span class="cwebmacro">Substitute a general Item</span> <span class="cwebmacronumber">6.1.8.13</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">Substitute a general Item</span> <span class="cwebmacronumber">6.1.8.14</span>><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">substituted</span><span class="plain">, </span><span class="string">"%S"</span><span class="plain">, </span><span class="identifier">varname</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">varname</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"%i+%c*"</span><span class="plain">))</span>
|
||||
|
@ -942,7 +944,7 @@ use this.)
|
|||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-sm.html#SP21">Str::eq_wide_string</a></span><span class="plain">(</span><span class="identifier">detail</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Source"</span><span class="plain">)) {</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">substituted</span><span class="plain">, </span><span class="string">"%f"</span><span class="plain">, </span><span class="identifier">S</span><span class="plain">-></span><span class="element">md</span><span class="plain">-></span><span class="element">source_file_for_section</span><span class="plain">);</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-sm.html#SP21">Str::eq_wide_string</a></span><span class="plain">(</span><span class="identifier">detail</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Page"</span><span class="plain">)) {</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP10">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">substituted</span><span class="plain">, </span><span class="identifier">S</span><span class="plain">-></span><span class="element">md</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP11">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">substituted</span><span class="plain">, </span><span class="identifier">S</span><span class="plain">-></span><span class="element">md</span><span class="plain">);</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-sm.html#SP21">Str::eq_wide_string</a></span><span class="plain">(</span><span class="identifier">detail</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Paragraphs"</span><span class="plain">)) {</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">substituted</span><span class="plain">, </span><span class="string">"%d"</span><span class="plain">, </span><span class="identifier">S</span><span class="plain">-></span><span class="element">sect_paragraphs</span><span class="plain">);</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-sm.html#SP21">Str::eq_wide_string</a></span><span class="plain">(</span><span class="identifier">detail</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"Mean"</span><span class="plain">)) {</span>
|
||||
|
@ -967,7 +969,22 @@ navigation purposes.
|
|||
|
||||
|
||||
<p class="macrodefinition"><code class="display">
|
||||
<<span class="cwebmacrodefn">Substitute a URL</span> <span class="cwebmacronumber">6.1.8.9</span>> =
|
||||
<<span class="cwebmacrodefn">Substitute a Docs</span> <span class="cwebmacronumber">6.1.8.9</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
<pre class="displaydefn">
|
||||
<span class="functiontext"><a href="3-pth.html#SP8">Pathnames::relative_URL</a></span><span class="plain">(</span><span class="identifier">substituted</span><span class="plain">,</span>
|
||||
<span class="functiontext"><a href="3-fln.html#SP6">Filenames::get_path_to</a></span><span class="plain">(</span><span class="functiontext"><a href="#SP9">Indexer::current_file</a></span><span class="plain">()),</span>
|
||||
<span class="functiontext"><a href="3-pth.html#SP5">Pathnames::from_text</a></span><span class="plain">(</span><span class="functiontext"><a href="6-cln.html#SP9">Colonies::home</a></span><span class="plain">()));</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">This code is used in <a href="#SP6_1_8">§6.1.8</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP6_1_8_10"></a><b>§6.1.8.10. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Substitute a URL</span> <span class="cwebmacronumber">6.1.8.10</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
|
@ -981,14 +998,14 @@ navigation purposes.
|
|||
|
||||
<p class="endnote">This code is used in <a href="#SP6_1_8">§6.1.8</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP6_1_8_10"></a><b>§6.1.8.10. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Substitute a Link</span> <span class="cwebmacronumber">6.1.8.10</span>> =
|
||||
<p class="inwebparagraph"><a id="SP6_1_8_11"></a><b>§6.1.8.11. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Substitute a Link</span> <span class="cwebmacronumber">6.1.8.11</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
<pre class="displaydefn">
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">substituted</span><span class="plain">, </span><span class="string">"<a href=\""</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP10">Colonies::reference_URL</a></span><span class="plain">(</span><span class="identifier">substituted</span><span class="plain">, </span><span class="identifier">link_text</span><span class="plain">, </span><span class="functiontext"><a href="#SP9">Indexer::current_file</a></span><span class="plain">());</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP11">Colonies::reference_URL</a></span><span class="plain">(</span><span class="identifier">substituted</span><span class="plain">, </span><span class="identifier">link_text</span><span class="plain">, </span><span class="functiontext"><a href="#SP9">Indexer::current_file</a></span><span class="plain">());</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">substituted</span><span class="plain">, </span><span class="string">"\">"</span><span class="plain">);</span>
|
||||
</pre>
|
||||
|
||||
|
@ -996,8 +1013,8 @@ navigation purposes.
|
|||
|
||||
<p class="endnote">This code is used in <a href="#SP6_1_8">§6.1.8</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP6_1_8_11"></a><b>§6.1.8.11. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Substitute a Menu</span> <span class="cwebmacronumber">6.1.8.11</span>> =
|
||||
<p class="inwebparagraph"><a id="SP6_1_8_12"></a><b>§6.1.8.12. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Substitute a Menu</span> <span class="cwebmacronumber">6.1.8.12</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
|
@ -1011,31 +1028,15 @@ navigation purposes.
|
|||
|
||||
<p class="endnote">This code is used in <a href="#SP6_1_8">§6.1.8</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP6_1_8_12"></a><b>§6.1.8.12. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Substitute a member Item</span> <span class="cwebmacronumber">6.1.8.12</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
<pre class="displaydefn">
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP10">Colonies::reference_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">link_text</span><span class="plain">, </span><span class="functiontext"><a href="#SP9">Indexer::current_file</a></span><span class="plain">());</span>
|
||||
<<span class="cwebmacro">Substitute an item at this URL</span> <span class="cwebmacronumber">6.1.8.12.1</span>><span class="plain">;</span>
|
||||
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">This code is used in <a href="#SP6_1_8">§6.1.8</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP6_1_8_13"></a><b>§6.1.8.13. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Substitute a general Item</span> <span class="cwebmacronumber">6.1.8.13</span>> =
|
||||
<<span class="cwebmacrodefn">Substitute a member Item</span> <span class="cwebmacronumber">6.1.8.13</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
<pre class="displaydefn">
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP10">Colonies::link_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">link_text</span><span class="plain">, </span><span class="functiontext"><a href="#SP9">Indexer::current_file</a></span><span class="plain">());</span>
|
||||
<<span class="cwebmacro">Substitute an item at this URL</span> <span class="cwebmacronumber">6.1.8.12.1</span>><span class="plain">;</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP11">Colonies::reference_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">link_text</span><span class="plain">, </span><span class="functiontext"><a href="#SP9">Indexer::current_file</a></span><span class="plain">());</span>
|
||||
<<span class="cwebmacro">Substitute an item at this URL</span> <span class="cwebmacronumber">6.1.8.13.1</span>><span class="plain">;</span>
|
||||
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
</pre>
|
||||
|
||||
|
@ -1043,8 +1044,24 @@ navigation purposes.
|
|||
|
||||
<p class="endnote">This code is used in <a href="#SP6_1_8">§6.1.8</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP6_1_8_12_1"></a><b>§6.1.8.12.1. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Substitute an item at this URL</span> <span class="cwebmacronumber">6.1.8.12.1</span>> =
|
||||
<p class="inwebparagraph"><a id="SP6_1_8_14"></a><b>§6.1.8.14. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Substitute a general Item</span> <span class="cwebmacronumber">6.1.8.14</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
<pre class="displaydefn">
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP11">Colonies::link_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">link_text</span><span class="plain">, </span><span class="functiontext"><a href="#SP9">Indexer::current_file</a></span><span class="plain">());</span>
|
||||
<<span class="cwebmacro">Substitute an item at this URL</span> <span class="cwebmacronumber">6.1.8.13.1</span>><span class="plain">;</span>
|
||||
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">This code is used in <a href="#SP6_1_8">§6.1.8</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP6_1_8_13_1"></a><b>§6.1.8.13.1. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Substitute an item at this URL</span> <span class="cwebmacronumber">6.1.8.13.1</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
|
@ -1072,7 +1089,7 @@ navigation purposes.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">This code is used in <a href="#SP6_1_8_12">§6.1.8.12</a>, <a href="#SP6_1_8_13">§6.1.8.13</a>.</p>
|
||||
<p class="endnote">This code is used in <a href="#SP6_1_8_13">§6.1.8.13</a>, <a href="#SP6_1_8_14">§6.1.8.14</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP7"></a><b>§7. </b></p>
|
||||
|
||||
|
@ -1116,7 +1133,7 @@ navigation purposes.
|
|||
|
||||
<pre class="display">
|
||||
<span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">file_being_woven</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">filename</span><span class="plain"> *</span><span class="functiontext">Indexer::current_file<button class="popup" onclick="togglePopup('usagePopup85')">...<span class="popuptext" id="usagePopup85">Usage of <b>Indexer::current_file</b>:<br><a href="#SP6">§6</a>, <a href="#SP6_1_8_3">§6.1.8.3</a>, <a href="#SP6_1_8_9">§6.1.8.9</a>, <a href="#SP6_1_8_10">§6.1.8.10</a>, <a href="#SP6_1_8_12">§6.1.8.12</a>, <a href="#SP6_1_8_13">§6.1.8.13</a>, <a href="#SP6_1_8_12_1">§6.1.8.12.1</a></span></button></span><span class="plain">(</span><span class="reserved">void</span><span class="plain">) {</span>
|
||||
<span class="reserved">filename</span><span class="plain"> *</span><span class="functiontext">Indexer::current_file<button class="popup" onclick="togglePopup('usagePopup85')">...<span class="popuptext" id="usagePopup85">Usage of <b>Indexer::current_file</b>:<br><a href="#SP6">§6</a>, <a href="#SP6_1_8_3">§6.1.8.3</a>, <a href="#SP6_1_8_9">§6.1.8.9</a>, <a href="#SP6_1_8_10">§6.1.8.10</a>, <a href="#SP6_1_8_11">§6.1.8.11</a>, <a href="#SP6_1_8_13">§6.1.8.13</a>, <a href="#SP6_1_8_14">§6.1.8.14</a>, <a href="#SP6_1_8_13_1">§6.1.8.13.1</a></span></button></span><span class="plain">(</span><span class="reserved">void</span><span class="plain">) {</span>
|
||||
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">file_being_woven</span><span class="plain">;</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Indexer::set_current_file<button class="popup" onclick="togglePopup('usagePopup86')">...<span class="popuptext" id="usagePopup86">Usage of <b>Indexer::set_current_file</b>:<br><a href="#SP6">§6</a>, The Swarm - <a href="3-ts.html#SP4">§4</a><br>The Weaver - <a href="3-tw.html#SP1">§1</a></span></button></span><span class="plain">(</span><span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">F</span><span class="plain">) {</span>
|
||||
|
|
|
@ -828,7 +828,7 @@ as appropriate.
|
|||
<pre class="displaydefn">
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="6-cln.html#SP9">Colonies::resolve_reference_in_weave</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-></span><span class="element">weave_to</span><span class="plain">, </span><span class="identifier">reference</span><span class="plain">,</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="6-cln.html#SP10">Colonies::resolve_reference_in_weave</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-></span><span class="element">weave_to</span><span class="plain">, </span><span class="identifier">reference</span><span class="plain">,</span>
|
||||
<span class="identifier">wv</span><span class="plain">-></span><span class="element">weave_web</span><span class="plain">-></span><span class="element">md</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-></span><span class="element">current_weave_line</span><span class="plain">)) {</span>
|
||||
<span class="functiontext"><a href="#SP27">Formats::text_r</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">before</span><span class="plain">, </span><span class="identifier">within</span><span class="plain">, </span><span class="identifier">comments</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="#SP12">Formats::url</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="constant">FALSE</span><span class="plain">);</span>
|
||||
|
|
|
@ -294,7 +294,7 @@ which is itself inside a list entry"; and so on.
|
|||
<span class="reserved">break</span><span class="plain">;</span>
|
||||
<span class="reserved">case</span><span class="plain"> </span><span class="constant">3</span><span class="plain">: {</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">)</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP10">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">P</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="constant">TRUE</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP11">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">P</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="constant">TRUE</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="5-htm.html#SP15">HTML::begin_link</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">TEMP</span><span class="plain">);</span>
|
||||
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">)</span>
|
||||
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"%s%S"</span><span class="plain">, (</span><span class="functiontext"><a href="4-sm.html#SP13">Str::get_first_char</a></span><span class="plain">(</span><span class="identifier">P</span><span class="plain">-></span><span class="element">ornament</span><span class="plain">) == </span><span class="character">'S'</span><span class="plain">)?</span><span class="string">"&#167;"</span><span class="plain">:</span><span class="string">"&para;"</span><span class="plain">,</span>
|
||||
|
@ -330,7 +330,7 @@ which is itself inside a list entry"; and so on.
|
|||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">P</span><span class="plain">) {</span>
|
||||
<span class="functiontext"><a href="#SP2">HTMLFormat::p</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="string">"inwebparagraph"</span><span class="plain">);</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">)</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP10">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">P</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="constant">FALSE</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP11">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">P</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="constant">FALSE</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="5-htm.html#SP15">HTML::anchor</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">TEMP</span><span class="plain">);</span>
|
||||
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">)</span>
|
||||
<span class="identifier">HTML_OPEN</span><span class="plain">(</span><span class="string">"b"</span><span class="plain">);</span>
|
||||
|
@ -486,6 +486,7 @@ which is itself inside a list entry"; and so on.
|
|||
<span class="functiontext"><a href="4-sm.html#SP25">Str::substr</a></span><span class="plain">(</span><span class="identifier">reference</span><span class="plain">, </span><span class="functiontext"><a href="4-sm.html#SP10">Str::at</a></span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">i</span><span class="plain"> + </span><span class="identifier">N</span><span class="plain">), </span><span class="functiontext"><a href="4-sm.html#SP10">Str::at</a></span><span class="plain">(</span><span class="identifier">matter</span><span class="plain">, </span><span class="identifier">j</span><span class="plain">));</span>
|
||||
<<span class="cwebmacro">Attempt to resolve the cross-reference</span> <span class="cwebmacronumber">9.2.1</span>><span class="plain">;</span>
|
||||
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">reference</span><span class="plain">);</span>
|
||||
<span class="reserved">break</span><span class="plain">;</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="identifier">j</span><span class="plain">++;</span>
|
||||
<span class="plain">}</span>
|
||||
|
@ -504,7 +505,7 @@ which is itself inside a list entry"; and so on.
|
|||
<pre class="displaydefn">
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="6-cln.html#SP9">Colonies::resolve_reference_in_weave</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-></span><span class="element">weave_to</span><span class="plain">, </span><span class="identifier">reference</span><span class="plain">,</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="6-cln.html#SP10">Colonies::resolve_reference_in_weave</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-></span><span class="element">weave_to</span><span class="plain">, </span><span class="identifier">reference</span><span class="plain">,</span>
|
||||
<span class="identifier">wv</span><span class="plain">-></span><span class="element">weave_web</span><span class="plain">-></span><span class="element">md</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">-></span><span class="element">current_weave_line</span><span class="plain">)) {</span>
|
||||
<span class="functiontext"><a href="5-fm.html#SP12">Formats::url</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">wv</span><span class="plain">, </span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="constant">FALSE</span><span class="plain">);</span>
|
||||
<span class="identifier">i</span><span class="plain"> = </span><span class="identifier">j</span><span class="plain"> + </span><span class="identifier">N</span><span class="plain">;</span>
|
||||
|
@ -558,7 +559,7 @@ which is itself inside a list entry"; and so on.
|
|||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
|
||||
<span class="reserved">if</span><span class="plain"> ((</span><span class="identifier">defn_line</span><span class="plain">) && (</span><span class="identifier">defn_line</span><span class="plain">-></span><span class="element">owning_paragraph</span><span class="plain">)) {</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">)</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP10">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">defn_line</span><span class="plain">-></span><span class="element">owning_paragraph</span><span class="plain">,</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP11">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">defn_line</span><span class="plain">-></span><span class="element">owning_paragraph</span><span class="plain">,</span>
|
||||
<span class="identifier">wv</span><span class="plain">-></span><span class="element">current_weave_line</span><span class="plain">-></span><span class="element">owning_section</span><span class="plain">, </span><span class="constant">TRUE</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="5-htm.html#SP15">HTML::begin_link</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">TEMP</span><span class="plain">);</span>
|
||||
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">)</span>
|
||||
|
@ -953,7 +954,7 @@ which is itself inside a list entry"; and so on.
|
|||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">HTMLFormat::locale<button class="popup" onclick="togglePopup('usagePopup330')">...<span class="popuptext" id="usagePopup330">Usage of <b>HTMLFormat::locale</b>:<br><a href="#SP1_1_1">§1.1.1</a></span></button></span><span class="plain">(</span><span class="reserved">weave_format</span><span class="plain"> *</span><span class="identifier">self</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">OUT</span><span class="plain">, </span><span class="reserved">weave_target</span><span class="plain"> *</span><span class="identifier">wv</span><span class="plain">,</span>
|
||||
<span class="reserved">paragraph</span><span class="plain"> *</span><span class="identifier">par1</span><span class="plain">, </span><span class="reserved">paragraph</span><span class="plain"> *</span><span class="identifier">par2</span><span class="plain">) {</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">)</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP10">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">par1</span><span class="plain">, </span><span class="identifier">page_section</span><span class="plain">, </span><span class="constant">TRUE</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP11">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">par1</span><span class="plain">, </span><span class="identifier">page_section</span><span class="plain">, </span><span class="constant">TRUE</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="5-htm.html#SP15">HTML::begin_link</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">TEMP</span><span class="plain">);</span>
|
||||
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">)</span>
|
||||
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"%s%S"</span><span class="plain">,</span>
|
||||
|
@ -986,7 +987,7 @@ which is itself inside a list entry"; and so on.
|
|||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">prev_S</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"<i>(This section begins %S.)</i>"</span><span class="plain">, </span><span class="identifier">C</span><span class="plain">-></span><span class="element">md</span><span class="plain">-></span><span class="element">ch_title</span><span class="plain">);</span>
|
||||
<span class="reserved">else</span><span class="plain"> {</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP10">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">prev_S</span><span class="plain">-></span><span class="element">md</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP11">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">prev_S</span><span class="plain">-></span><span class="element">md</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="5-htm.html#SP15">HTML::begin_link</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">TEMP</span><span class="plain">);</span>
|
||||
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"Back to '%S'"</span><span class="plain">, </span><span class="identifier">prev_S</span><span class="plain">-></span><span class="element">md</span><span class="plain">-></span><span class="element">sect_title</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="5-htm.html#SP15">HTML::end_link</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">);</span>
|
||||
|
@ -997,7 +998,7 @@ which is itself inside a list entry"; and so on.
|
|||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">next_S</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"<i>(This section ends %S.)</i>"</span><span class="plain">, </span><span class="identifier">C</span><span class="plain">-></span><span class="element">md</span><span class="plain">-></span><span class="element">ch_title</span><span class="plain">);</span>
|
||||
<span class="reserved">else</span><span class="plain"> {</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP10">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">next_S</span><span class="plain">-></span><span class="element">md</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="6-cln.html#SP11">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">TEMP</span><span class="plain">, </span><span class="identifier">next_S</span><span class="plain">-></span><span class="element">md</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="5-htm.html#SP15">HTML::begin_link</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">TEMP</span><span class="plain">);</span>
|
||||
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"Continue with '%S'"</span><span class="plain">, </span><span class="identifier">next_S</span><span class="plain">-></span><span class="element">md</span><span class="plain">-></span><span class="element">sect_title</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="5-htm.html#SP15">HTML::end_link</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">);</span>
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<!--Weave of 'Colonies' generated by 7-->
|
||||
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="index.html">inweb</a></li><li><a href="index.html#6">Chapter 6: Extras</a></li><li><b>Colonies</b></li></ul><p class="purpose">Cross-referencing multiple webs gathered together.</p>
|
||||
|
||||
<ul class="toc"><li><a href="#SP1">§1. Colonies of webs</a></li><li><a href="#SP7">§7. Searching</a></li><li><a href="#SP9">§9. Cross-references</a></li><li><a href="#SP10">§10. URL management</a></li></ul><hr class="tocbar">
|
||||
<ul class="toc"><li><a href="#SP1">§1. Colonies of webs</a></li><li><a href="#SP7">§7. Searching</a></li><li><a href="#SP10">§10. Cross-references</a></li><li><a href="#SP11">§11. URL management</a></li></ul><hr class="tocbar">
|
||||
|
||||
<p class="inwebparagraph"><a id="SP1"></a><b>§1. Colonies of webs. </b>Social spiders are said to form "colonies" when their webs are shared,<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> and
|
||||
in that spirit, a colony to Inweb is a collection of coexisting webs — which
|
||||
|
@ -53,6 +53,7 @@ Orb-Weaving Spiders With Communal Webbing in a Man-Made Structural Habitat
|
|||
<pre class="display">
|
||||
<span class="reserved">typedef</span><span class="plain"> </span><span class="reserved">struct</span><span class="plain"> </span><span class="reserved">colony</span><span class="plain"> {</span>
|
||||
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">linked_list</span><span class="plain"> *</span><span class="identifier">members</span><span class="plain">; </span><span class="comment"> of <code class="display"><span class="extract">colony_member</span></code></span>
|
||||
<span class="reserved">struct</span><span class="plain"> </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">home</span><span class="plain">; </span><span class="comment"> path of home repository</span>
|
||||
<span class="constant">MEMORY_MANAGEMENT</span>
|
||||
<span class="plain">} </span><span class="reserved">colony</span><span class="plain">;</span>
|
||||
</pre>
|
||||
|
@ -125,6 +126,7 @@ at GitHub:
|
|||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Colonies::load<button class="popup" onclick="togglePopup('usagePopup360')">...<span class="popuptext" id="usagePopup360">Usage of <b>Colonies::load</b>:<br>Configuration - <a href="1-cnf.html#SP2_5">§2.5</a></span></button></span><span class="plain">(</span><span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">F</span><span class="plain">) {</span>
|
||||
<span class="reserved">colony</span><span class="plain"> *</span><span class="identifier">C</span><span class="plain"> = </span><span class="identifier">CREATE</span><span class="plain">(</span><span class="reserved">colony</span><span class="plain">);</span>
|
||||
<span class="identifier">C</span><span class="plain">-></span><span class="element">members</span><span class="plain"> = </span><span class="identifier">NEW_LINKED_LIST</span><span class="plain">(</span><span class="reserved">colony_member</span><span class="plain">);</span>
|
||||
<span class="identifier">C</span><span class="plain">-></span><span class="element">home</span><span class="plain"> = </span><span class="identifier">I</span><span class="string">"docs"</span><span class="plain">;</span>
|
||||
<span class="reserved">colony_reader_state</span><span class="plain"> </span><span class="identifier">crs</span><span class="plain">;</span>
|
||||
<span class="identifier">crs</span><span class="plain">.</span><span class="element">province</span><span class="plain"> = </span><span class="identifier">C</span><span class="plain">;</span>
|
||||
<span class="identifier">crs</span><span class="plain">.</span><span class="element">nav</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
|
@ -176,6 +178,8 @@ at GitHub:
|
|||
<span class="identifier">CM</span><span class="plain">-></span><span class="element">breadcrumb_tail</span><span class="plain"> = </span><span class="identifier">crs</span><span class="plain">-></span><span class="element">crumbs</span><span class="plain">;</span>
|
||||
<span class="identifier">CM</span><span class="plain">-></span><span class="element">default_weave_pattern</span><span class="plain"> = </span><span class="functiontext"><a href="4-sm.html#SP3">Str::duplicate</a></span><span class="plain">(</span><span class="identifier">crs</span><span class="plain">-></span><span class="element">pattern</span><span class="plain">);</span>
|
||||
<span class="identifier">ADD_TO_LINKED_LIST</span><span class="plain">(</span><span class="identifier">CM</span><span class="plain">, </span><span class="reserved">colony_member</span><span class="plain">, </span><span class="identifier">C</span><span class="plain">-></span><span class="element">members</span><span class="plain">);</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">line</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"home: *(%c*)"</span><span class="plain">)) {</span>
|
||||
<span class="identifier">C</span><span class="plain">-></span><span class="element">home</span><span class="plain"> = </span><span class="functiontext"><a href="4-sm.html#SP3">Str::duplicate</a></span><span class="plain">(</span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[0]);</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">line</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"pattern: none"</span><span class="plain">)) {</span>
|
||||
<span class="identifier">crs</span><span class="plain">-></span><span class="element">pattern</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">line</span><span class="plain">, </span><span class="identifier">L</span><span class="string">"pattern: *(%c*)"</span><span class="plain">)) {</span>
|
||||
|
@ -245,7 +249,7 @@ the page, and this requests one.
|
|||
<span class="reserved">breadcrumb_request</span><span class="plain"> *</span><span class="identifier">BR</span><span class="plain">;</span>
|
||||
<span class="identifier">LOOP_OVER_LINKED_LIST</span><span class="plain">(</span><span class="identifier">BR</span><span class="plain">, </span><span class="reserved">breadcrumb_request</span><span class="plain">, </span><span class="identifier">crumbs</span><span class="plain">) {</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="#SP10">Colonies::link_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">BR</span><span class="plain">-></span><span class="element">breadcrumb_link</span><span class="plain">, </span><span class="identifier">F</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="#SP11">Colonies::link_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">BR</span><span class="plain">-></span><span class="element">breadcrumb_link</span><span class="plain">, </span><span class="identifier">F</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="#SP6">Colonies::write_breadcrumb</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">BR</span><span class="plain">-></span><span class="element">breadcrumb_text</span><span class="plain">, </span><span class="identifier">url</span><span class="plain">);</span>
|
||||
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
<span class="plain">}</span>
|
||||
|
@ -277,7 +281,7 @@ first we find.
|
|||
</p>
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">colony_member</span><span class="plain"> *</span><span class="functiontext">Colonies::find<button class="popup" onclick="togglePopup('usagePopup366')">...<span class="popuptext" id="usagePopup366">Usage of <b>Colonies::find</b>:<br><a href="#SP9_1">§9.1</a>, <a href="#SP9_2">§9.2</a>, Configuration - <a href="1-cnf.html#SP2_5">§2.5</a></span></button></span><span class="plain">(</span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">T</span><span class="plain">) {</span>
|
||||
<span class="reserved">colony_member</span><span class="plain"> *</span><span class="functiontext">Colonies::find<button class="popup" onclick="togglePopup('usagePopup366')">...<span class="popuptext" id="usagePopup366">Usage of <b>Colonies::find</b>:<br><a href="#SP10_1">§10.1</a>, <a href="#SP10_2">§10.2</a>, Configuration - <a href="1-cnf.html#SP2_5">§2.5</a></span></button></span><span class="plain">(</span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">T</span><span class="plain">) {</span>
|
||||
<span class="reserved">colony</span><span class="plain"> *</span><span class="identifier">C</span><span class="plain">;</span>
|
||||
<span class="identifier">LOOP_OVER</span><span class="plain">(</span><span class="identifier">C</span><span class="plain">, </span><span class="reserved">colony</span><span class="plain">) {</span>
|
||||
<span class="reserved">colony_member</span><span class="plain"> *</span><span class="identifier">CM</span><span class="plain">;</span>
|
||||
|
@ -299,7 +303,7 @@ the data we already have; but if not, we read it in.
|
|||
</p>
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">module</span><span class="plain"> *</span><span class="functiontext">Colonies::as_module<button class="popup" onclick="togglePopup('usagePopup367')">...<span class="popuptext" id="usagePopup367">Usage of <b>Colonies::as_module</b>:<br><a href="#SP9_1">§9.1</a>, <a href="#SP9_2">§9.2</a></span></button></span><span class="plain">(</span><span class="reserved">colony_member</span><span class="plain"> *</span><span class="identifier">CM</span><span class="plain">, </span><span class="reserved">source_line</span><span class="plain"> *</span><span class="identifier">L</span><span class="plain">, </span><span class="reserved">web_md</span><span class="plain"> *</span><span class="identifier">Wm</span><span class="plain">) {</span>
|
||||
<span class="reserved">module</span><span class="plain"> *</span><span class="functiontext">Colonies::as_module<button class="popup" onclick="togglePopup('usagePopup367')">...<span class="popuptext" id="usagePopup367">Usage of <b>Colonies::as_module</b>:<br><a href="#SP10_1">§10.1</a>, <a href="#SP10_2">§10.2</a></span></button></span><span class="plain">(</span><span class="reserved">colony_member</span><span class="plain"> *</span><span class="identifier">CM</span><span class="plain">, </span><span class="reserved">source_line</span><span class="plain"> *</span><span class="identifier">L</span><span class="plain">, </span><span class="reserved">web_md</span><span class="plain"> *</span><span class="identifier">Wm</span><span class="plain">) {</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">CM</span><span class="plain">-></span><span class="element">loaded</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><<span class="cwebmacro">Perhaps the web being woven</span> <span class="cwebmacronumber">8.1</span>><span class="plain">;</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">CM</span><span class="plain">-></span><span class="element">loaded</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><<span class="cwebmacro">Perhaps a module imported by the web being woven</span> <span class="cwebmacronumber">8.2</span>><span class="plain">;</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">CM</span><span class="plain">-></span><span class="element">loaded</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><<span class="cwebmacro">Perhaps a module not yet seen</span> <span class="cwebmacronumber">8.3</span>><span class="plain">;</span>
|
||||
|
@ -376,7 +380,21 @@ the data we already have; but if not, we read it in.
|
|||
|
||||
<p class="endnote">This code is used in <a href="#SP8">§8</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP9"></a><b>§9. Cross-references. </b>The following must decide what references like the following should refer to:
|
||||
<p class="inwebparagraph"><a id="SP9"></a><b>§9. </b>Finally:
|
||||
</p>
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">text_stream</span><span class="plain"> *</span><span class="functiontext">Colonies::home<button class="popup" onclick="togglePopup('usagePopup368')">...<span class="popuptext" id="usagePopup368">Usage of <b>Colonies::home</b>:<br>The Indexer - <a href="3-ti.html#SP6_1_8_9">§6.1.8.9</a></span></button></span><span class="plain">(</span><span class="reserved">void</span><span class="plain">) {</span>
|
||||
<span class="reserved">colony</span><span class="plain"> *</span><span class="identifier">C</span><span class="plain">;</span>
|
||||
<span class="identifier">LOOP_OVER</span><span class="plain">(</span><span class="identifier">C</span><span class="plain">, </span><span class="reserved">colony</span><span class="plain">)</span>
|
||||
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">C</span><span class="plain">-></span><span class="identifier">home</span><span class="plain">;</span>
|
||||
<span class="reserved">return</span><span class="plain"> </span><span class="identifier">I</span><span class="string">"docs"</span><span class="plain">;</span>
|
||||
<span class="plain">}</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP10"></a><b>§10. Cross-references. </b>The following must decide what references like the following should refer to:
|
||||
</p>
|
||||
|
||||
<pre class="display">
|
||||
|
@ -399,15 +417,15 @@ is where the reference is made from.
|
|||
</p>
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">int</span><span class="plain"> </span><span class="functiontext">Colonies::resolve_reference_in_weave<button class="popup" onclick="togglePopup('usagePopup368')">...<span class="popuptext" id="usagePopup368">Usage of <b>Colonies::resolve_reference_in_weave</b>:<br><a href="#SP10">§10</a>, Format Methods - <a href="5-fm.html#SP27_4_1">§27.4.1</a><br>HTML Formats - <a href="5-hf.html#SP9_2_1">§9.2.1</a></span></button></span><span class="plain">(</span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">url</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">title</span><span class="plain">,</span>
|
||||
<span class="reserved">int</span><span class="plain"> </span><span class="functiontext">Colonies::resolve_reference_in_weave<button class="popup" onclick="togglePopup('usagePopup369')">...<span class="popuptext" id="usagePopup369">Usage of <b>Colonies::resolve_reference_in_weave</b>:<br><a href="#SP11">§11</a>, Format Methods - <a href="5-fm.html#SP27_4_1">§27.4.1</a><br>HTML Formats - <a href="5-hf.html#SP9_2_1">§9.2.1</a></span></button></span><span class="plain">(</span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">url</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">title</span><span class="plain">,</span>
|
||||
<span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">for_HTML_file</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">text</span><span class="plain">, </span><span class="reserved">web_md</span><span class="plain"> *</span><span class="identifier">Wm</span><span class="plain">, </span><span class="reserved">source_line</span><span class="plain"> *</span><span class="identifier">L</span><span class="plain">) {</span>
|
||||
<span class="reserved">module</span><span class="plain"> *</span><span class="identifier">from_M</span><span class="plain"> = (</span><span class="identifier">Wm</span><span class="plain">)?(</span><span class="identifier">Wm</span><span class="plain">-></span><span class="element">as_module</span><span class="plain">):</span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">module</span><span class="plain"> *</span><span class="identifier">search_M</span><span class="plain"> = </span><span class="identifier">from_M</span><span class="plain">;</span>
|
||||
<span class="reserved">colony_member</span><span class="plain"> *</span><span class="identifier">search_CM</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">external</span><span class="plain"> = </span><span class="constant">FALSE</span><span class="plain">;</span>
|
||||
|
||||
<<span class="cwebmacro">Is it the name of a member of our colony?</span> <span class="cwebmacronumber">9.1</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">If it contains a colon, does this indicate a section in a colony member?</span> <span class="cwebmacronumber">9.2</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">Is it the name of a member of our colony?</span> <span class="cwebmacronumber">10.1</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">If it contains a colon, does this indicate a section in a colony member?</span> <span class="cwebmacronumber">10.2</span>><span class="plain">;</span>
|
||||
|
||||
<span class="reserved">module</span><span class="plain"> *</span><span class="identifier">found_M</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
<span class="reserved">section_md</span><span class="plain"> *</span><span class="identifier">found_Sm</span><span class="plain"> = </span><span class="identifier">NULL</span><span class="plain">;</span>
|
||||
|
@ -416,10 +434,13 @@ is where the reference is made from.
|
|||
<span class="identifier">title</span><span class="plain">, </span><span class="identifier">search_M</span><span class="plain">, </span><span class="identifier">text</span><span class="plain">, </span><span class="constant">FALSE</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">N</span><span class="plain"> == </span><span class="constant">0</span><span class="plain">) {</span>
|
||||
<span class="reserved">if</span><span class="plain"> ((</span><span class="identifier">L</span><span class="plain">) && (</span><span class="identifier">external</span><span class="plain"> == </span><span class="constant">FALSE</span><span class="plain">)) {</span>
|
||||
<<span class="cwebmacro">Is it the name of a function in the current web?</span> <span class="cwebmacronumber">9.3</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">Is it the name of a type in the current web?</span> <span class="cwebmacronumber">9.4</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">Is it the name of a function in the current web?</span> <span class="cwebmacronumber">10.3</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">Is it the name of a type in the current web?</span> <span class="cwebmacronumber">10.4</span>><span class="plain">;</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="functiontext"><a href="1-pc.html#SP8">Main::error_in_web</a></span><span class="plain">(</span><span class="identifier">I</span><span class="string">"Can't find this cross-reference"</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">);</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">err</span><span class="plain">);</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">err</span><span class="plain">, </span><span class="string">"Can't find the cross-reference '%S'"</span><span class="plain">, </span><span class="identifier">text</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="1-pc.html#SP8">Main::error_in_web</a></span><span class="plain">(</span><span class="identifier">err</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">);</span>
|
||||
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">err</span><span class="plain">);</span>
|
||||
<span class="reserved">return</span><span class="plain"> </span><span class="constant">FALSE</span><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="identifier">N</span><span class="plain"> > </span><span class="constant">1</span><span class="plain">) {</span>
|
||||
<span class="functiontext"><a href="1-pc.html#SP8">Main::error_in_web</a></span><span class="plain">(</span><span class="identifier">I</span><span class="string">"Multiple cross-references might be meant here"</span><span class="plain">, </span><span class="identifier">L</span><span class="plain">);</span>
|
||||
|
@ -427,7 +448,7 @@ is where the reference is made from.
|
|||
<span class="identifier">title</span><span class="plain">, </span><span class="identifier">search_M</span><span class="plain">, </span><span class="identifier">text</span><span class="plain">, </span><span class="constant">TRUE</span><span class="plain">);</span>
|
||||
<span class="reserved">return</span><span class="plain"> </span><span class="constant">FALSE</span><span class="plain">;</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
|
||||
<<span class="cwebmacro">It refers unambiguously to a single section</span> <span class="cwebmacronumber">9.5</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">It refers unambiguously to a single section</span> <span class="cwebmacronumber">10.5</span>><span class="plain">;</span>
|
||||
<span class="reserved">return</span><span class="plain"> </span><span class="constant">TRUE</span><span class="plain">;</span>
|
||||
<span class="plain">}</span>
|
||||
<span class="plain">}</span>
|
||||
|
@ -435,8 +456,8 @@ is where the reference is made from.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP9_1"></a><b>§9.1. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Is it the name of a member of our colony?</span> <span class="cwebmacronumber">9.1</span>> =
|
||||
<p class="inwebparagraph"><a id="SP10_1"></a><b>§10.1. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Is it the name of a member of our colony?</span> <span class="cwebmacronumber">10.1</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
|
@ -447,16 +468,16 @@ is where the reference is made from.
|
|||
<span class="reserved">section_md</span><span class="plain"> *</span><span class="identifier">found_Sm</span><span class="plain"> = </span><span class="identifier">FIRST_IN_LINKED_LIST</span><span class="plain">(</span><span class="reserved">section_md</span><span class="plain">, </span><span class="identifier">found_M</span><span class="plain">-></span><span class="element">sections_md</span><span class="plain">);</span>
|
||||
<span class="reserved">int</span><span class="plain"> </span><span class="identifier">bare_module_name</span><span class="plain"> = </span><span class="constant">TRUE</span><span class="plain">;</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">, </span><span class="string">"%S"</span><span class="plain">, </span><span class="identifier">search_CM</span><span class="plain">-></span><span class="identifier">name</span><span class="plain">);</span>
|
||||
<<span class="cwebmacro">It refers unambiguously to a single section</span> <span class="cwebmacronumber">9.5</span>><span class="plain">;</span>
|
||||
<<span class="cwebmacro">It refers unambiguously to a single section</span> <span class="cwebmacronumber">10.5</span>><span class="plain">;</span>
|
||||
<span class="plain">}</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">This code is used in <a href="#SP9">§9</a>.</p>
|
||||
<p class="endnote">This code is used in <a href="#SP10">§10</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP9_2"></a><b>§9.2. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">If it contains a colon, does this indicate a section in a colony member?</span> <span class="cwebmacronumber">9.2</span>> =
|
||||
<p class="inwebparagraph"><a id="SP10_2"></a><b>§10.2. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">If it contains a colon, does this indicate a section in a colony member?</span> <span class="cwebmacronumber">10.2</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
|
@ -478,10 +499,10 @@ is where the reference is made from.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">This code is used in <a href="#SP9">§9</a>.</p>
|
||||
<p class="endnote">This code is used in <a href="#SP10">§10</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP9_3"></a><b>§9.3. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Is it the name of a function in the current web?</span> <span class="cwebmacronumber">9.3</span>> =
|
||||
<p class="inwebparagraph"><a id="SP10_3"></a><b>§10.3. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Is it the name of a function in the current web?</span> <span class="cwebmacronumber">10.3</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
|
@ -489,7 +510,7 @@ is where the reference is made from.
|
|||
<span class="reserved">language_function</span><span class="plain"> *</span><span class="identifier">fn</span><span class="plain">;</span>
|
||||
<span class="identifier">LOOP_OVER</span><span class="plain">(</span><span class="identifier">fn</span><span class="plain">, </span><span class="reserved">language_function</span><span class="plain">) {</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-sm.html#SP18">Str::eq_insensitive</a></span><span class="plain">(</span><span class="identifier">fn</span><span class="plain">-></span><span class="element">function_name</span><span class="plain">, </span><span class="identifier">text</span><span class="plain">)) {</span>
|
||||
<span class="functiontext"><a href="#SP10">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">fn</span><span class="plain">-></span><span class="identifier">function_header_at</span><span class="plain">-></span><span class="element">owning_paragraph</span><span class="plain">,</span>
|
||||
<span class="functiontext"><a href="#SP11">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">fn</span><span class="plain">-></span><span class="identifier">function_header_at</span><span class="plain">-></span><span class="element">owning_paragraph</span><span class="plain">,</span>
|
||||
<span class="identifier">L</span><span class="plain">-></span><span class="element">owning_section</span><span class="plain">, </span><span class="constant">TRUE</span><span class="plain">);</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">, </span><span class="string">"%S"</span><span class="plain">, </span><span class="identifier">fn</span><span class="plain">-></span><span class="element">function_name</span><span class="plain">);</span>
|
||||
<span class="reserved">return</span><span class="plain"> </span><span class="constant">TRUE</span><span class="plain">;</span>
|
||||
|
@ -499,10 +520,10 @@ is where the reference is made from.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">This code is used in <a href="#SP9">§9</a>.</p>
|
||||
<p class="endnote">This code is used in <a href="#SP10">§10</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP9_4"></a><b>§9.4. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Is it the name of a type in the current web?</span> <span class="cwebmacronumber">9.4</span>> =
|
||||
<p class="inwebparagraph"><a id="SP10_4"></a><b>§10.4. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">Is it the name of a type in the current web?</span> <span class="cwebmacronumber">10.4</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
|
@ -510,7 +531,7 @@ is where the reference is made from.
|
|||
<span class="reserved">language_type</span><span class="plain"> *</span><span class="identifier">str</span><span class="plain">;</span>
|
||||
<span class="identifier">LOOP_OVER</span><span class="plain">(</span><span class="identifier">str</span><span class="plain">, </span><span class="reserved">language_type</span><span class="plain">) {</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-sm.html#SP18">Str::eq_insensitive</a></span><span class="plain">(</span><span class="identifier">str</span><span class="plain">-></span><span class="element">structure_name</span><span class="plain">, </span><span class="identifier">text</span><span class="plain">)) {</span>
|
||||
<span class="functiontext"><a href="#SP10">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">str</span><span class="plain">-></span><span class="element">structure_header_at</span><span class="plain">-></span><span class="element">owning_paragraph</span><span class="plain">,</span>
|
||||
<span class="functiontext"><a href="#SP11">Colonies::paragraph_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">str</span><span class="plain">-></span><span class="element">structure_header_at</span><span class="plain">-></span><span class="element">owning_paragraph</span><span class="plain">,</span>
|
||||
<span class="identifier">L</span><span class="plain">-></span><span class="element">owning_section</span><span class="plain">, </span><span class="constant">TRUE</span><span class="plain">);</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">, </span><span class="string">"%S"</span><span class="plain">, </span><span class="identifier">str</span><span class="plain">-></span><span class="element">structure_name</span><span class="plain">);</span>
|
||||
<span class="reserved">return</span><span class="plain"> </span><span class="constant">TRUE</span><span class="plain">;</span>
|
||||
|
@ -520,26 +541,26 @@ is where the reference is made from.
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">This code is used in <a href="#SP9">§9</a>.</p>
|
||||
<p class="endnote">This code is used in <a href="#SP10">§10</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP9_5"></a><b>§9.5. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">It refers unambiguously to a single section</span> <span class="cwebmacronumber">9.5</span>> =
|
||||
<p class="inwebparagraph"><a id="SP10_5"></a><b>§10.5. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">It refers unambiguously to a single section</span> <span class="cwebmacronumber">10.5</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
<pre class="displaydefn">
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">found_M</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"could not locate M"</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">search_CM</span><span class="plain">) </span><<span class="cwebmacro">The section is a known colony member</span> <span class="cwebmacronumber">9.5.1</span>>
|
||||
<span class="reserved">else</span><span class="plain"> </span><<span class="cwebmacro">The section is not in a known colony member</span> <span class="cwebmacronumber">9.5.2</span>><span class="plain">;</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">search_CM</span><span class="plain">) </span><<span class="cwebmacro">The section is a known colony member</span> <span class="cwebmacronumber">10.5.1</span>>
|
||||
<span class="reserved">else</span><span class="plain"> </span><<span class="cwebmacro">The section is not in a known colony member</span> <span class="cwebmacronumber">10.5.2</span>><span class="plain">;</span>
|
||||
<span class="reserved">return</span><span class="plain"> </span><span class="constant">TRUE</span><span class="plain">;</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">This code is used in <a href="#SP9">§9</a>, <a href="#SP9_1">§9.1</a>.</p>
|
||||
<p class="endnote">This code is used in <a href="#SP10">§10</a>, <a href="#SP10_1">§10.1</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP9_5_1"></a><b>§9.5.1. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">The section is a known colony member</span> <span class="cwebmacronumber">9.5.1</span>> =
|
||||
<p class="inwebparagraph"><a id="SP10_5_1"></a><b>§10.5.1. </b><code class="display">
|
||||
<<span class="cwebmacrodefn">The section is a known colony member</span> <span class="cwebmacronumber">10.5.1</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
|
@ -548,32 +569,32 @@ is where the reference is made from.
|
|||
<span class="reserved">pathname</span><span class="plain"> *</span><span class="identifier">to</span><span class="plain"> = </span><span class="identifier">search_CM</span><span class="plain">-></span><span class="element">weave_path</span><span class="plain">;</span>
|
||||
<span class="functiontext"><a href="3-pth.html#SP8">Pathnames::relative_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">from</span><span class="plain">, </span><span class="identifier">to</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">bare_module_name</span><span class="plain">) </span><span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="string">"%S"</span><span class="plain">, </span><span class="identifier">search_CM</span><span class="plain">-></span><span class="element">home_leaf</span><span class="plain">);</span>
|
||||
<span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="identifier">found_Sm</span><span class="plain">) </span><span class="functiontext"><a href="#SP10">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">found_Sm</span><span class="plain">);</span>
|
||||
<span class="reserved">else</span><span class="plain"> </span><span class="reserved">if</span><span class="plain"> (</span><span class="identifier">found_Sm</span><span class="plain">) </span><span class="functiontext"><a href="#SP11">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">found_Sm</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">bare_module_name</span><span class="plain"> == </span><span class="constant">FALSE</span><span class="plain">)</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">, </span><span class="string">" (in %S)"</span><span class="plain">, </span><span class="identifier">search_CM</span><span class="plain">-></span><span class="element">name</span><span class="plain">);</span>
|
||||
</pre>
|
||||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">This code is used in <a href="#SP9_5">§9.5</a>.</p>
|
||||
<p class="endnote">This code is used in <a href="#SP10_5">§10.5</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP9_5_2"></a><b>§9.5.2. </b>In the absence of a colony file, Inweb can really only guess, and the
|
||||
<p class="inwebparagraph"><a id="SP10_5_2"></a><b>§10.5.2. </b>In the absence of a colony file, Inweb can really only guess, and the
|
||||
guess it makes is that modules of the current web will be woven alongside
|
||||
the main one, and suffixed by <code class="display"><span class="extract">-module</span></code>.
|
||||
</p>
|
||||
|
||||
|
||||
<p class="macrodefinition"><code class="display">
|
||||
<<span class="cwebmacrodefn">The section is not in a known colony member</span> <span class="cwebmacronumber">9.5.2</span>> =
|
||||
<<span class="cwebmacrodefn">The section is not in a known colony member</span> <span class="cwebmacronumber">10.5.2</span>> =
|
||||
</code></p>
|
||||
|
||||
|
||||
<pre class="displaydefn">
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">found_M</span><span class="plain"> == </span><span class="identifier">from_M</span><span class="plain">) {</span>
|
||||
<span class="functiontext"><a href="#SP10">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">found_Sm</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="#SP11">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">found_Sm</span><span class="plain">);</span>
|
||||
<span class="plain">} </span><span class="reserved">else</span><span class="plain"> {</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="string">"../%S-module/"</span><span class="plain">, </span><span class="identifier">found_M</span><span class="plain">-></span><span class="element">module_name</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="#SP10">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">found_Sm</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="#SP11">Colonies::section_URL</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">found_Sm</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">bare_module_name</span><span class="plain"> == </span><span class="constant">FALSE</span><span class="plain">)</span>
|
||||
<span class="identifier">WRITE_TO</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">, </span><span class="string">" (in %S)"</span><span class="plain">, </span><span class="identifier">found_M</span><span class="plain">-></span><span class="element">module_name</span><span class="plain">);</span>
|
||||
<span class="plain">}</span>
|
||||
|
@ -581,24 +602,24 @@ the main one, and suffixed by <code class="display"><span class="extract">-modul
|
|||
|
||||
<p class="inwebparagraph"></p>
|
||||
|
||||
<p class="endnote">This code is used in <a href="#SP9_5">§9.5</a>.</p>
|
||||
<p class="endnote">This code is used in <a href="#SP10_5">§10.5</a>.</p>
|
||||
|
||||
<p class="inwebparagraph"><a id="SP10"></a><b>§10. URL management. </b></p>
|
||||
<p class="inwebparagraph"><a id="SP11"></a><b>§11. URL management. </b></p>
|
||||
|
||||
<pre class="display">
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Colonies::link_URL<button class="popup" onclick="togglePopup('usagePopup369')">...<span class="popuptext" id="usagePopup369">Usage of <b>Colonies::link_URL</b>:<br><a href="#SP6">§6</a>, The Indexer - <a href="3-ti.html#SP6_1_8_13">§6.1.8.13</a></span></button></span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">link_text</span><span class="plain">, </span><span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">F</span><span class="plain">) {</span>
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Colonies::link_URL<button class="popup" onclick="togglePopup('usagePopup370')">...<span class="popuptext" id="usagePopup370">Usage of <b>Colonies::link_URL</b>:<br><a href="#SP6">§6</a>, The Indexer - <a href="3-ti.html#SP6_1_8_14">§6.1.8.14</a></span></button></span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">link_text</span><span class="plain">, </span><span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">F</span><span class="plain">) {</span>
|
||||
<span class="reserved">match_results</span><span class="plain"> </span><span class="identifier">mr</span><span class="plain"> = </span><span class="functiontext"><a href="4-pm.html#SP9">Regexp::create_mr</a></span><span class="plain">();</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="4-pm.html#SP10">Regexp::match</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">, </span><span class="identifier">link_text</span><span class="plain">, </span><span class="identifier">L</span><span class="string">" *//(%c+)// *"</span><span class="plain">))</span>
|
||||
<span class="functiontext"><a href="#SP10">Colonies::reference_URL</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[0], </span><span class="identifier">F</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="#SP11">Colonies::reference_URL</a></span><span class="plain">(</span><span class="identifier">OUT</span><span class="plain">, </span><span class="identifier">mr</span><span class="plain">.</span><span class="element">exp</span><span class="plain">[0], </span><span class="identifier">F</span><span class="plain">);</span>
|
||||
<span class="reserved">else</span>
|
||||
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"%S"</span><span class="plain">, </span><span class="identifier">link_text</span><span class="plain">);</span>
|
||||
<span class="functiontext"><a href="4-pm.html#SP9">Regexp::dispose_of</a></span><span class="plain">(&</span><span class="identifier">mr</span><span class="plain">);</span>
|
||||
<span class="plain">}</span>
|
||||
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Colonies::reference_URL<button class="popup" onclick="togglePopup('usagePopup370')">...<span class="popuptext" id="usagePopup370">Usage of <b>Colonies::reference_URL</b>:<br>The Indexer - <a href="3-ti.html#SP6_1_8_10">§6.1.8.10</a>, <a href="3-ti.html#SP6_1_8_12">§6.1.8.12</a></span></button></span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">link_text</span><span class="plain">, </span><span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">F</span><span class="plain">) {</span>
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Colonies::reference_URL<button class="popup" onclick="togglePopup('usagePopup371')">...<span class="popuptext" id="usagePopup371">Usage of <b>Colonies::reference_URL</b>:<br>The Indexer - <a href="3-ti.html#SP6_1_8_11">§6.1.8.11</a>, <a href="3-ti.html#SP6_1_8_13">§6.1.8.13</a></span></button></span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">text_stream</span><span class="plain"> *</span><span class="identifier">link_text</span><span class="plain">, </span><span class="reserved">filename</span><span class="plain"> *</span><span class="identifier">F</span><span class="plain">) {</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">title</span><span class="plain">);</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="#SP9">Colonies::resolve_reference_in_weave</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="identifier">F</span><span class="plain">, </span><span class="identifier">link_text</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">))</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="functiontext"><a href="#SP10">Colonies::resolve_reference_in_weave</a></span><span class="plain">(</span><span class="identifier">url</span><span class="plain">, </span><span class="identifier">title</span><span class="plain">, </span><span class="identifier">F</span><span class="plain">, </span><span class="identifier">link_text</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">, </span><span class="identifier">NULL</span><span class="plain">))</span>
|
||||
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">"%S"</span><span class="plain">, </span><span class="identifier">url</span><span class="plain">);</span>
|
||||
<span class="reserved">else</span>
|
||||
<span class="identifier">PRINT</span><span class="plain">(</span><span class="string">"Warning: unable to resolve reference '%S' in navigation\n"</span><span class="plain">, </span><span class="identifier">link_text</span><span class="plain">);</span>
|
||||
|
@ -606,7 +627,7 @@ the main one, and suffixed by <code class="display"><span class="extract">-modul
|
|||
<span class="identifier">DISCARD_TEXT</span><span class="plain">(</span><span class="identifier">url</span><span class="plain">);</span>
|
||||
<span class="plain">}</span>
|
||||
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Colonies::section_URL<button class="popup" onclick="togglePopup('usagePopup371')">...<span class="popuptext" id="usagePopup371">Usage of <b>Colonies::section_URL</b>:<br><a href="#SP9_5_1">§9.5.1</a>, <a href="#SP9_5_2">§9.5.2</a>, The Indexer - <a href="3-ti.html#SP6_1_8_8_1">§6.1.8.8.1</a><br>HTML Formats - <a href="5-hf.html#SP28">§28</a></span></button></span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">section_md</span><span class="plain"> *</span><span class="identifier">Sm</span><span class="plain">) {</span>
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Colonies::section_URL<button class="popup" onclick="togglePopup('usagePopup372')">...<span class="popuptext" id="usagePopup372">Usage of <b>Colonies::section_URL</b>:<br><a href="#SP10_5_1">§10.5.1</a>, <a href="#SP10_5_2">§10.5.2</a>, The Indexer - <a href="3-ti.html#SP6_1_8_8_1">§6.1.8.8.1</a><br>HTML Formats - <a href="5-hf.html#SP28">§28</a></span></button></span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">section_md</span><span class="plain"> *</span><span class="identifier">Sm</span><span class="plain">) {</span>
|
||||
<span class="reserved">if</span><span class="plain"> (</span><span class="identifier">Sm</span><span class="plain"> == </span><span class="identifier">NULL</span><span class="plain">) </span><span class="identifier">internal_error</span><span class="plain">(</span><span class="string">"unwoven section"</span><span class="plain">);</span>
|
||||
<span class="identifier">LOOP_THROUGH_TEXT</span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">, </span><span class="identifier">Sm</span><span class="plain">-></span><span class="element">sect_range</span><span class="plain">)</span>
|
||||
<span class="reserved">if</span><span class="plain"> ((</span><span class="functiontext"><a href="4-sm.html#SP13">Str::get</a></span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">) == </span><span class="character">'/'</span><span class="plain">) || (</span><span class="functiontext"><a href="4-sm.html#SP13">Str::get</a></span><span class="plain">(</span><span class="identifier">pos</span><span class="plain">) == </span><span class="character">' '</span><span class="plain">))</span>
|
||||
|
@ -616,7 +637,7 @@ the main one, and suffixed by <code class="display"><span class="extract">-modul
|
|||
<span class="identifier">WRITE</span><span class="plain">(</span><span class="string">".html"</span><span class="plain">);</span>
|
||||
<span class="plain">}</span>
|
||||
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Colonies::paragraph_URL<button class="popup" onclick="togglePopup('usagePopup372')">...<span class="popuptext" id="usagePopup372">Usage of <b>Colonies::paragraph_URL</b>:<br><a href="#SP9_3">§9.3</a>, <a href="#SP9_4">§9.4</a>, HTML Formats - <a href="5-hf.html#SP7">§7</a>, <a href="5-hf.html#SP8">§8</a>, <a href="5-hf.html#SP9_3">§9.3</a>, <a href="5-hf.html#SP27">§27</a></span></button></span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">paragraph</span><span class="plain"> *</span><span class="identifier">P</span><span class="plain">, </span><span class="reserved">section</span><span class="plain"> *</span><span class="identifier">from</span><span class="plain">, </span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">a_link</span><span class="plain">) {</span>
|
||||
<span class="reserved">void</span><span class="plain"> </span><span class="functiontext">Colonies::paragraph_URL<button class="popup" onclick="togglePopup('usagePopup373')">...<span class="popuptext" id="usagePopup373">Usage of <b>Colonies::paragraph_URL</b>:<br><a href="#SP10_3">§10.3</a>, <a href="#SP10_4">§10.4</a>, HTML Formats - <a href="5-hf.html#SP7">§7</a>, <a href="5-hf.html#SP8">§8</a>, <a href="5-hf.html#SP9_3">§9.3</a>, <a href="5-hf.html#SP27">§27</a></span></button></span><span class="plain">(</span><span class="constant">OUTPUT_STREAM</span><span class="plain">, </span><span class="reserved">paragraph</span><span class="plain"> *</span><span class="identifier">P</span><span class="plain">, </span><span class="reserved">section</span><span class="plain"> *</span><span class="identifier">from</span><span class="plain">, </span><span class="reserved">int</span><span class="plain"> </span><span class="identifier">a_link</span><span class="plain">) {</span>
|
||||
<span class="identifier">TEMPORARY_TEXT</span><span class="plain">(</span><span class="identifier">linkto</span><span class="plain">);</span>
|
||||
<span class="reserved">if</span><span class="plain"> ((</span><span class="identifier">from</span><span class="plain">) && (</span><span class="identifier">P</span><span class="plain">-></span><span class="element">under_section</span><span class="plain"> != </span><span class="identifier">from</span><span class="plain">)) {</span>
|
||||
<span class="functiontext"><a href="4-sm.html#SP16">Str::copy</a></span><span class="plain">(</span><span class="identifier">linkto</span><span class="plain">, </span><span class="identifier">P</span><span class="plain">-></span><span class="element">under_section</span><span class="plain">-></span><span class="element">md</span><span class="plain">-></span><span class="element">sect_range</span><span class="plain">);</span>
|
||||
|
|
|
@ -307,7 +307,7 @@ much longer roster, such as:
|
|||
<pre class="display">
|
||||
<span class="plain">Appendix A: The Standard Rules (Independent Inform 7)</span>
|
||||
<span class="plain">"This is the body of Inform 7 source text automatically included with every</span>
|
||||
<span class="plain">project run through the NI compiler, and which defines most of what end users</span>
|
||||
<span class="plain">project run through the Inform compiler, and which defines most of what end users</span>
|
||||
<span class="plain">see as the Inform language."</span>
|
||||
<span class="plain">SR0 - Preamble</span>
|
||||
<span class="plain">SR1 - Physical World Model</span>
|
||||
|
|
|
@ -96,7 +96,7 @@ void Log::declare_aspect(int a, wchar_t *name, int def, int alt) {
|
|||
|
||||
@ The debugging log provides an opportunity to see what has been happening
|
||||
behind the scenes; but such a log file is often buffered by the filing system,
|
||||
so that a sudden crash of NI may result in the loss of recent data written to
|
||||
so that a sudden crash of Inform may result in the loss of recent data written to
|
||||
the log. Which is a pity, since this is exactly the most useful evidence as to
|
||||
the cause of the crash in the first place. Accordingly, we fairly often
|
||||
|fflush| the debug log file, forcing any buffered output to be written.
|
||||
|
|
Loading…
Reference in a new issue