mirror of
https://github.com/ganelson/inform.git
synced 2024-06-26 04:00:43 +03:00
Completed guide to supervisor module
This commit is contained in:
parent
51be4aa9d7
commit
2f1490fc58
|
@ -59,17 +59,17 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../arch-module/index.html"><spon class="sectiontitle">shared/arch</span></a>
|
||||
- <span class="sectionpurpose">Definitions of Inter and final VM architectures.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -59,27 +59,27 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../building-module/index.html"><spon class="sectiontitle">../building</span></a>
|
||||
- <span class="sectionpurpose">An intermediate layer for building code in Inter.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../bytecode-module/index.html"><spon class="sectiontitle">../bytecode</span></a>
|
||||
- <span class="sectionpurpose">Dealing with intermediate-level Inform as bytecode in memory.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
352
docs/docs-assets/Bigfoot.css
Normal file
352
docs/docs-assets/Bigfoot.css
Normal file
|
@ -0,0 +1,352 @@
|
|||
.bigfoot-footnote__button {
|
||||
position: relative;
|
||||
z-index: 5;
|
||||
top: -0.1em;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
display: inline-block;
|
||||
padding: 0.35em;
|
||||
margin: 0 0.1em 0 0.2em;
|
||||
border: none;
|
||||
border-radius: 0.3em;
|
||||
cursor: pointer;
|
||||
background-color: rgba(110, 110, 110, 0.2);
|
||||
-webkit-backface-visibility: hidden;
|
||||
-ms-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
font-size: 1rem;
|
||||
line-height: 0;
|
||||
vertical-align: middle;
|
||||
text-decoration: none;
|
||||
font-smoothing: antialiased;
|
||||
-webkit-transition-property: background-color;
|
||||
transition-property: background-color;
|
||||
-webkit-transition-duration: 0.25s;
|
||||
transition-duration: 0.25s;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__button:hover,
|
||||
.bigfoot-footnote__button:focus {
|
||||
outline: none;
|
||||
background-color: rgba(110, 110, 110, 0.5);
|
||||
}
|
||||
|
||||
.bigfoot-footnote__button:active {
|
||||
background-color: rgba(110, 110, 110, 0.5);
|
||||
}
|
||||
|
||||
.bigfoot-footnote__button.is-active {
|
||||
background-color: #6e6e6e;
|
||||
-webkit-transition-delay: 0.1s;
|
||||
transition-delay: 0.1s;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__button:after {
|
||||
content: '';
|
||||
display: table;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__button__circle {
|
||||
display: inline-block;
|
||||
width: 0.25em;
|
||||
height: 0.25em;
|
||||
margin-right: 0.25em;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__button__circle:last-child {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__container {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
text-indent: 0;
|
||||
}
|
||||
|
||||
@media not print {
|
||||
.footnote-print-only {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media print {
|
||||
.bigfoot-footnote,
|
||||
.bigfoot-footnote__button {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.bigfoot-footnote {
|
||||
position: absolute;
|
||||
z-index: 10;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: inline-block;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
max-width: 90%;
|
||||
margin: 1.96924em 0;
|
||||
background: #fafafa;
|
||||
opacity: 0;
|
||||
border-radius: 0.5em;
|
||||
border: 1px solid #c3c3c3;
|
||||
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
|
||||
line-height: 0;
|
||||
-webkit-transition-property: opacity, -webkit-transform;
|
||||
transition-property: opacity, transform;
|
||||
-webkit-transition-duration: 0.25s;
|
||||
transition-duration: 0.25s;
|
||||
-webkit-transition-timing-function: ease;
|
||||
transition-timing-function: ease;
|
||||
-webkit-transform: scale(0.1) translateZ(0);
|
||||
-ms-transform: scale(0.1) translateZ(0);
|
||||
transform: scale(0.1) translateZ(0);
|
||||
-webkit-transform-origin: 50% 0;
|
||||
-ms-transform-origin: 50% 0;
|
||||
transform-origin: 50% 0;
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-positioned-top {
|
||||
top: auto;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-active {
|
||||
-webkit-transform: scale(1) translateZ(0);
|
||||
-ms-transform: scale(1) translateZ(0);
|
||||
transform: scale(1) translateZ(0);
|
||||
opacity: 0.97;
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-bottom-fixed {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
top: auto;
|
||||
left: 0;
|
||||
right: auto;
|
||||
-webkit-transform: translateY(100%);
|
||||
-ms-transform: translateY(100%);
|
||||
transform: translateY(100%);
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
border-radius: 0;
|
||||
opacity: 1;
|
||||
border-width: 1px 0 0;
|
||||
-webkit-transition: -webkit-transform 0.3s ease;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-bottom-fixed.is-active {
|
||||
-webkit-transform: translateY(0);
|
||||
-ms-transform: translateY(0);
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__wrapper {
|
||||
margin: 0 0 0 50%;
|
||||
-webkit-transform: translateX(-50%);
|
||||
-ms-transform: translateX(-50%);
|
||||
transform: translateX(-50%);
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__wrapper,
|
||||
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__content {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-bottom-fixed .bigfoot-footnote__tooltip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-scrollable:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: 0.3375em;
|
||||
left: 0.3375em;
|
||||
z-index: 14;
|
||||
display: block;
|
||||
height: 0.78125em;
|
||||
width: 0.625em;
|
||||
background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTJweCIgaGVpZ2h0PSIxNXB4IiB2aWV3Qm94PSIwIDAgMTIgMTUiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pbllNaW4iPgogICAgPGcgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9IkFycm93IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxLjAwMDAwMCwgMS4wMDAwMDApIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJzcXVhcmUiPgogICAgICAgICAgICA8cGF0aCBkPSJNNSwwIEw1LDExLjUiIGlkPSJMaW5lIj48L3BhdGg+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLjUsNy41IEw1LjAyNzY5Mjc5LDEyLjAyNzY5MjgiIGlkPSJMaW5lIj48L3BhdGg+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik00LjUsNy41IEw5LjAyNzY5Mjc5LDEyLjAyNzY5MjgiIGlkPSJMaW5lLTIiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDcuMDAwMDAwLCAxMC4wMDAwMDApIHNjYWxlKC0xLCAxKSB0cmFuc2xhdGUoLTcuMDAwMDAwLCAtMTAuMDAwMDAwKSAiPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPgo=");
|
||||
-webkit-background-size: cover;
|
||||
background-size: cover;
|
||||
opacity: 0.1;
|
||||
transition-properties: opacity;
|
||||
-webkit-transition-duration: 0.25s;
|
||||
transition-duration: 0.25s;
|
||||
-webkit-transition-timing-function: ease;
|
||||
transition-timing-function: ease;
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:before,
|
||||
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
z-index: 12;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:before {
|
||||
top: -1px;
|
||||
height: 1.1em;
|
||||
border-radius: 0.5em 0.5em 0 0;
|
||||
background-image: -webkit-gradient(linear, left top, left bottom, from(#fafafa), to(rgba(250, 250, 250, 0)));
|
||||
background-image: -webkit-linear-gradient(top, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
|
||||
background-image: linear-gradient(to bottom, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-scrollable .bigfoot-footnote__wrapper:after {
|
||||
bottom: -1px;
|
||||
height: 1.2em;
|
||||
border-radius: 0 0 0.5em 0.5em;
|
||||
background-image: -webkit-gradient(linear, left bottom, left top, from(#fafafa), to(rgba(250, 250, 250, 0)));
|
||||
background-image: -webkit-linear-gradient(bottom, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
|
||||
background-image: linear-gradient(to top, #fafafa 50%, rgba(250, 250, 250, 0) 100%);
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-scrollable ::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.bigfoot-footnote.is-fully-scrolled:after,
|
||||
.bigfoot-footnote.is-fully-scrolled:before {
|
||||
opacity: 0;
|
||||
-webkit-transition-delay: 0;
|
||||
transition-delay: 0;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__wrapper {
|
||||
position: relative;
|
||||
z-index: 14;
|
||||
width: 38em;
|
||||
display: inline-block;
|
||||
-webkit-box-sizing: inherit;
|
||||
-moz-box-sizing: inherit;
|
||||
box-sizing: inherit;
|
||||
overflow: hidden;
|
||||
margin: 0;
|
||||
background-color: #fafafa;
|
||||
border-radius: 0.5em;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__content {
|
||||
position: relative;
|
||||
z-index: 8;
|
||||
display: inline-block;
|
||||
max-height: 15em;
|
||||
padding: 1.1em 1.3em 1.2em;
|
||||
-webkit-box-sizing: inherit;
|
||||
-moz-box-sizing: inherit;
|
||||
box-sizing: inherit;
|
||||
overflow: auto;
|
||||
-webkit-overflow-scrolling: touch;
|
||||
background: #fafafa;
|
||||
border-radius: 0.5em;
|
||||
font-smoothing: subpixel-antialiased;
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__content img {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__content *:last-child {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__content *:first-child {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__tooltip {
|
||||
position: absolute;
|
||||
z-index: 12;
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
margin-left: -0.65em;
|
||||
width: 1.3em;
|
||||
height: 1.3em;
|
||||
-webkit-transform: rotate(45deg);
|
||||
-ms-transform: rotate(45deg);
|
||||
transform: rotate(45deg);
|
||||
background: #fafafa;
|
||||
border: 1px solid #c3c3c3;
|
||||
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
|
||||
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.3);
|
||||
border-top-left-radius: 0;
|
||||
}
|
||||
|
||||
.is-positioned-bottom .bigfoot-footnote__tooltip {
|
||||
top: -0.65em;
|
||||
}
|
||||
|
||||
.is-positioned-top .bigfoot-footnote__tooltip {
|
||||
bottom: -0.65em;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__button {
|
||||
position: relative;
|
||||
height: 0.95em;
|
||||
width: 1.5em;
|
||||
border-radius: 0.475em;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__button:after {
|
||||
content: attr(data-footnote-number);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
-ms-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
display: block;
|
||||
font-size: 0.57em;
|
||||
font-weight: bold;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
-webkit-transition: color 0.25s ease;
|
||||
transition: color 0.25s ease;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__button:hover:after,
|
||||
.bigfoot-footnote__button.is-active:after {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.bigfoot-footnote__button__circle {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Dark Mode */
|
||||
|
||||
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
|
||||
|
||||
|
||||
|
||||
.bigfoot-footnote__content {
|
||||
color: black;
|
||||
}
|
||||
|
||||
|
||||
.bigfoot-footnote__button {
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
640
docs/docs-assets/Bigfoot.js
Normal file
640
docs/docs-assets/Bigfoot.js
Normal file
|
@ -0,0 +1,640 @@
|
|||
(function() {
|
||||
(function($) {
|
||||
return $.bigfoot = function(options) {
|
||||
var addBreakpoint, baseFontSize, bigfoot, buttonHover, calculatePixelDimension, cleanFootnoteLinks, clickButton, createPopover, defaults, deleteEmptyOrHR, escapeKeypress, footnoteInit, getSetting, makeDefaultCallbacks, popoverStates, positionTooltip, removeBackLinks, removeBreakpoint, removePopovers, replaceWithReferenceAttributes, repositionFeet, roomCalc, settings, touchClick, unhoverFeet, updateSetting, viewportDetails;
|
||||
bigfoot = void 0;
|
||||
defaults = {
|
||||
actionOriginalFN: "hide",
|
||||
activateCallback: function() {},
|
||||
activateOnHover: false,
|
||||
allowMultipleFN: false,
|
||||
anchorPattern: /(fn|footnote|note)[:\-_\d]/gi,
|
||||
anchorParentTagname: 'sup',
|
||||
breakpoints: {},
|
||||
deleteOnUnhover: false,
|
||||
footnoteParentClass: 'footnote',
|
||||
footnoteTagname: 'li',
|
||||
hoverDelay: 250,
|
||||
numberResetSelector: void 0,
|
||||
popoverDeleteDelay: 300,
|
||||
popoverCreateDelay: 100,
|
||||
positionContent: true,
|
||||
preventPageScroll: true,
|
||||
scope: false,
|
||||
useFootnoteOnlyOnce: true,
|
||||
contentMarkup: "<aside class=\"bigfoot-footnote is-positioned-bottom\" data-footnote-number=\"{{FOOTNOTENUM}}\" data-footnote-identifier=\"{{FOOTNOTEID}}\" alt=\"Footnote {{FOOTNOTENUM}}\"> <div class=\"bigfoot-footnote__wrapper\"> <div class=\"bigfoot-footnote__content\"> {{FOOTNOTECONTENT}} </div></div> <div class=\"bigfoot-footnote__tooltip\"></div> </aside>",
|
||||
buttonMarkup: "<div class='bigfoot-footnote__container'> <button class=\"bigfoot-footnote__button\" id=\"{{SUP:data-footnote-backlink-ref}}\" data-footnote-number=\"{{FOOTNOTENUM}}\" data-footnote-identifier=\"{{FOOTNOTEID}}\" alt=\"See Footnote {{FOOTNOTENUM}}\" rel=\"footnote\" data-bigfoot-footnote=\"{{FOOTNOTECONTENT}}\"> <svg class=\"bigfoot-footnote__button__circle\" viewbox=\"0 0 6 6\" preserveAspectRatio=\"xMinYMin\"><circle r=\"3\" cx=\"3\" cy=\"3\" fill=\"white\"></circle></svg> <svg class=\"bigfoot-footnote__button__circle\" viewbox=\"0 0 6 6\" preserveAspectRatio=\"xMinYMin\"><circle r=\"3\" cx=\"3\" cy=\"3\" fill=\"white\"></circle></svg> <svg class=\"bigfoot-footnote__button__circle\" viewbox=\"0 0 6 6\" preserveAspectRatio=\"xMinYMin\"><circle r=\"3\" cx=\"3\" cy=\"3\" fill=\"white\"></circle></svg> </button></div>"
|
||||
};
|
||||
settings = $.extend(defaults, options);
|
||||
popoverStates = {};
|
||||
footnoteInit = function() {
|
||||
var $curResetElement, $currentLastFootnoteLink, $footnoteAnchors, $footnoteButton, $lastResetElement, $parent, $relevantFNLink, $relevantFootnote, finalFNLinks, footnoteButton, footnoteButtonSearchQuery, footnoteContent, footnoteIDNum, footnoteLinks, footnoteNum, footnotes, i, _i, _ref, _results;
|
||||
footnoteButtonSearchQuery = settings.scope ? "" + settings.scope + " a[href*=\"#\"]" : "a[href*=\"#\"]";
|
||||
$footnoteAnchors = $(footnoteButtonSearchQuery).filter(function() {
|
||||
var $this, relAttr;
|
||||
$this = $(this);
|
||||
relAttr = $this.attr("rel");
|
||||
if (relAttr === "null" || (relAttr == null)) {
|
||||
relAttr = "";
|
||||
}
|
||||
return ("" + ($this.attr("href")) + relAttr).match(settings.anchorPattern) && $this.closest("[class*=" + settings.footnoteParentClass + "]:not(a):not(" + settings.anchorParentTagname + ")").length < 1;
|
||||
});
|
||||
footnotes = [];
|
||||
footnoteLinks = [];
|
||||
finalFNLinks = [];
|
||||
cleanFootnoteLinks($footnoteAnchors, footnoteLinks);
|
||||
$(footnoteLinks).each(function() {
|
||||
var $closestFootnoteEl, relatedFN;
|
||||
relatedFN = $(this).data("footnote-ref").replace(/[:.+~*\]\[]/g, "\\$&");
|
||||
if (settings.useFootnoteOnlyOnce) {
|
||||
relatedFN = "" + relatedFN + ":not(.footnote-processed)";
|
||||
}
|
||||
$closestFootnoteEl = $(relatedFN).closest(settings.footnoteTagname);
|
||||
if ($closestFootnoteEl.length > 0) {
|
||||
footnotes.push($closestFootnoteEl.first().addClass("footnote-processed"));
|
||||
return finalFNLinks.push(this);
|
||||
}
|
||||
});
|
||||
$currentLastFootnoteLink = $("[data-footnote-identifier]:last");
|
||||
footnoteIDNum = $currentLastFootnoteLink.length < 1 ? 0 : +$currentLastFootnoteLink.data("footnote-identifier");
|
||||
_results = [];
|
||||
for (i = _i = 0, _ref = footnotes.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
|
||||
footnoteContent = removeBackLinks($(footnotes[i]).html().trim(), $(finalFNLinks[i]).data("footnote-backlink-ref"));
|
||||
footnoteContent = footnoteContent.replace(/"/g, """).replace(/</g, "<sym;").replace(/>/g, ">sym;");
|
||||
footnoteIDNum += 1;
|
||||
footnoteButton = "";
|
||||
$relevantFNLink = $(finalFNLinks[i]);
|
||||
$relevantFootnote = $(footnotes[i]);
|
||||
if (settings.numberResetSelector != null) {
|
||||
$curResetElement = $relevantFNLink.closest(settings.numberResetSelector);
|
||||
if ($curResetElement.is($lastResetElement)) {
|
||||
footnoteNum += 1;
|
||||
} else {
|
||||
footnoteNum = 1;
|
||||
}
|
||||
$lastResetElement = $curResetElement;
|
||||
} else {
|
||||
footnoteNum = footnoteIDNum;
|
||||
}
|
||||
if (footnoteContent.indexOf("<") !== 0) {
|
||||
footnoteContent = "<p>" + footnoteContent + "</p>";
|
||||
}
|
||||
footnoteButton = settings.buttonMarkup.replace(/\{\{FOOTNOTENUM\}\}/g, footnoteNum).replace(/\{\{FOOTNOTEID\}\}/g, footnoteIDNum).replace(/\{\{FOOTNOTECONTENT\}\}/g, footnoteContent);
|
||||
footnoteButton = replaceWithReferenceAttributes(footnoteButton, "SUP", $relevantFNLink);
|
||||
footnoteButton = replaceWithReferenceAttributes(footnoteButton, "FN", $relevantFootnote);
|
||||
$footnoteButton = $(footnoteButton).insertBefore($relevantFNLink);
|
||||
$parent = $relevantFootnote.parent();
|
||||
switch (settings.actionOriginalFN.toLowerCase()) {
|
||||
case "hide":
|
||||
$relevantFNLink.addClass("footnote-print-only");
|
||||
$relevantFootnote.addClass("footnote-print-only");
|
||||
_results.push(deleteEmptyOrHR($parent));
|
||||
break;
|
||||
case "delete":
|
||||
$relevantFNLink.remove();
|
||||
$relevantFootnote.remove();
|
||||
_results.push(deleteEmptyOrHR($parent));
|
||||
break;
|
||||
default:
|
||||
_results.push($relevantFNLink.addClass("footnote-print-only"));
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
cleanFootnoteLinks = function($footnoteAnchors, footnoteLinks) {
|
||||
var $parent, $supChild, linkHREF, linkID;
|
||||
if (footnoteLinks == null) {
|
||||
footnoteLinks = [];
|
||||
}
|
||||
$parent = void 0;
|
||||
$supChild = void 0;
|
||||
linkHREF = void 0;
|
||||
linkID = void 0;
|
||||
$footnoteAnchors.each(function() {
|
||||
var $child, $this;
|
||||
$this = $(this);
|
||||
linkHREF = "#" + ($this.attr("href")).split("#")[1];
|
||||
$parent = $this.closest(settings.anchorParentTagname);
|
||||
$child = $this.find(settings.anchorParentTagname);
|
||||
if ($parent.length > 0) {
|
||||
linkID = ($parent.attr("id") || "") + ($this.attr("id") || "");
|
||||
return footnoteLinks.push($parent.attr({
|
||||
"data-footnote-backlink-ref": linkID,
|
||||
"data-footnote-ref": linkHREF
|
||||
}));
|
||||
} else if ($child.length > 0) {
|
||||
linkID = ($child.attr("id") || "") + ($this.attr("id") || "");
|
||||
return footnoteLinks.push($this.attr({
|
||||
"data-footnote-backlink-ref": linkID,
|
||||
"data-footnote-ref": linkHREF
|
||||
}));
|
||||
} else {
|
||||
linkID = $this.attr("id") || "";
|
||||
return footnoteLinks.push($this.attr({
|
||||
"data-footnote-backlink-ref": linkID,
|
||||
"data-footnote-ref": linkHREF
|
||||
}));
|
||||
}
|
||||
});
|
||||
};
|
||||
deleteEmptyOrHR = function($el) {
|
||||
var $parent;
|
||||
$parent = void 0;
|
||||
if ($el.is(":empty") || $el.children(":not(.footnote-print-only)").length === 0) {
|
||||
$parent = $el.parent();
|
||||
if (settings.actionOriginalFN.toLowerCase() === "delete") {
|
||||
$el.remove();
|
||||
} else {
|
||||
$el.addClass("footnote-print-only");
|
||||
}
|
||||
return deleteEmptyOrHR($parent);
|
||||
} else if ($el.children(":not(.footnote-print-only)").length === $el.children("hr:not(.footnote-print-only)").length) {
|
||||
$parent = $el.parent();
|
||||
if (settings.actionOriginalFN.toLowerCase() === "delete") {
|
||||
$el.remove();
|
||||
} else {
|
||||
$el.children("hr").addClass("footnote-print-only");
|
||||
$el.addClass("footnote-print-only");
|
||||
}
|
||||
return deleteEmptyOrHR($parent);
|
||||
}
|
||||
};
|
||||
removeBackLinks = function(footnoteHTML, backlinkID) {
|
||||
var regex;
|
||||
if (backlinkID.indexOf(' ') >= 0) {
|
||||
backlinkID = backlinkID.trim().replace(/\s+/g, "|").replace(/(.*)/g, "($1)");
|
||||
}
|
||||
regex = new RegExp("(\\s| )*<\\s*a[^#<]*#" + backlinkID + "[^>]*>(.*?)<\\s*/\\s*a>", "g");
|
||||
return footnoteHTML.replace(regex, "").replace("[]", "");
|
||||
};
|
||||
replaceWithReferenceAttributes = function(string, referenceKeyword, $referenceElement) {
|
||||
var refMatches, refRegex, refReplaceRegex, refReplaceText;
|
||||
refRegex = new RegExp("\\{\\{" + referenceKeyword + ":([^\\}]*)\\}\\}", "g");
|
||||
refMatches = void 0;
|
||||
refReplaceText = void 0;
|
||||
refReplaceRegex = void 0;
|
||||
refMatches = refRegex.exec(string);
|
||||
while (refMatches) {
|
||||
if (refMatches[1]) {
|
||||
refReplaceText = $referenceElement.attr(refMatches[1]) || "";
|
||||
string = string.replace("{{" + referenceKeyword + ":" + refMatches[1] + "}}", refReplaceText);
|
||||
}
|
||||
refMatches = refRegex.exec(string);
|
||||
}
|
||||
return string;
|
||||
};
|
||||
buttonHover = function(event) {
|
||||
var $buttonHovered, dataIdentifier, otherPopoverSelector;
|
||||
if (settings.activateOnHover) {
|
||||
$buttonHovered = $(event.target).closest(".bigfoot-footnote__button");
|
||||
dataIdentifier = "[data-footnote-identifier=\"" + ($buttonHovered.attr("data-footnote-identifier")) + "\"]";
|
||||
if ($buttonHovered.hasClass("is-active")) {
|
||||
return;
|
||||
}
|
||||
$buttonHovered.addClass("is-hover-instantiated");
|
||||
if (!settings.allowMultipleFN) {
|
||||
otherPopoverSelector = ".bigfoot-footnote:not(" + dataIdentifier + ")";
|
||||
removePopovers(otherPopoverSelector);
|
||||
}
|
||||
createPopover(".bigfoot-footnote__button" + dataIdentifier).addClass("is-hover-instantiated");
|
||||
}
|
||||
};
|
||||
touchClick = function(event) {
|
||||
var $nearButton, $nearFootnote, $target;
|
||||
$target = $(event.target);
|
||||
$nearButton = $target.closest(".bigfoot-footnote__button");
|
||||
$nearFootnote = $target.closest(".bigfoot-footnote");
|
||||
if ($nearButton.length > 0) {
|
||||
event.preventDefault();
|
||||
clickButton($nearButton);
|
||||
} else if ($nearFootnote.length < 1) {
|
||||
if ($(".bigfoot-footnote").length > 0) {
|
||||
removePopovers();
|
||||
}
|
||||
}
|
||||
};
|
||||
clickButton = function($button) {
|
||||
var dataIdentifier;
|
||||
$button.blur();
|
||||
dataIdentifier = "data-footnote-identifier=\"" + ($button.attr("data-footnote-identifier")) + "\"";
|
||||
if ($button.hasClass("changing")) {
|
||||
return;
|
||||
} else if (!$button.hasClass("is-active")) {
|
||||
$button.addClass("changing");
|
||||
setTimeout((function() {
|
||||
return $button.removeClass("changing");
|
||||
}), settings.popoverCreateDelay);
|
||||
createPopover(".bigfoot-footnote__button[" + dataIdentifier + "]");
|
||||
$button.addClass("is-click-instantiated");
|
||||
if (!settings.allowMultipleFN) {
|
||||
removePopovers(".bigfoot-footnote:not([" + dataIdentifier + "])");
|
||||
}
|
||||
} else {
|
||||
if (!settings.allowMultipleFN) {
|
||||
removePopovers();
|
||||
} else {
|
||||
removePopovers(".bigfoot-footnote[" + dataIdentifier + "]");
|
||||
}
|
||||
}
|
||||
};
|
||||
createPopover = function(selector) {
|
||||
var $buttons, $popoversCreated;
|
||||
$buttons = void 0;
|
||||
if (typeof selector !== "string" && settings.allowMultipleFN) {
|
||||
$buttons = selector;
|
||||
} else if (typeof selector !== "string") {
|
||||
$buttons = selector.first();
|
||||
} else if (settings.allowMultipleFN) {
|
||||
$buttons = $(selector).closest(".bigfoot-footnote__button");
|
||||
} else {
|
||||
$buttons = $(selector + ":first").closest(".bigfoot-footnote__button");
|
||||
}
|
||||
$popoversCreated = $();
|
||||
$buttons.each(function() {
|
||||
var $content, $contentContainer, $this, content;
|
||||
$this = $(this);
|
||||
content = void 0;
|
||||
try {
|
||||
content = settings.contentMarkup.replace(/\{\{FOOTNOTENUM\}\}/g, $this.attr("data-footnote-number")).replace(/\{\{FOOTNOTEID\}\}/g, $this.attr("data-footnote-identifier")).replace(/\{\{FOOTNOTECONTENT\}\}/g, $this.attr("data-bigfoot-footnote")).replace(/\>sym\;/g, ">").replace(/\<sym\;/g, "<");
|
||||
return content = replaceWithReferenceAttributes(content, "BUTTON", $this);
|
||||
} finally {
|
||||
$content = $(content);
|
||||
try {
|
||||
settings.activateCallback($content, $this);
|
||||
} catch (_error) {}
|
||||
$content.insertAfter($buttons);
|
||||
popoverStates[$this.attr("data-footnote-identifier")] = "init";
|
||||
$content.attr("bigfoot-max-width", calculatePixelDimension($content.css("max-width"), $content));
|
||||
$content.css("max-width", 10000);
|
||||
$contentContainer = $content.find(".bigfoot-footnote__content");
|
||||
$content.attr("data-bigfoot-max-height", calculatePixelDimension($contentContainer.css("max-height"), $contentContainer));
|
||||
repositionFeet();
|
||||
$this.addClass("is-active");
|
||||
$content.find(".bigfoot-footnote__content").bindScrollHandler();
|
||||
$popoversCreated = $popoversCreated.add($content);
|
||||
}
|
||||
});
|
||||
setTimeout((function() {
|
||||
return $popoversCreated.addClass("is-active");
|
||||
}), settings.popoverCreateDelay);
|
||||
return $popoversCreated;
|
||||
};
|
||||
baseFontSize = function() {
|
||||
var el, size;
|
||||
el = document.createElement("div");
|
||||
el.style.cssText = "display:inline-block;padding:0;line-height:1;position:absolute;visibility:hidden;font-size:1em;";
|
||||
el.appendChild(document.createElement("M"));
|
||||
document.body.appendChild(el);
|
||||
size = el.offsetHeight;
|
||||
document.body.removeChild(el);
|
||||
return size;
|
||||
};
|
||||
calculatePixelDimension = function(dim, $el) {
|
||||
if (dim === "none") {
|
||||
dim = 10000;
|
||||
} else if (dim.indexOf("rem") >= 0) {
|
||||
dim = parseFloat(dim) * baseFontSize();
|
||||
} else if (dim.indexOf("em") >= 0) {
|
||||
dim = parseFloat(dim) * parseFloat($el.css("font-size"));
|
||||
} else if (dim.indexOf("px") >= 0) {
|
||||
dim = parseFloat(dim);
|
||||
if (dim <= 60) {
|
||||
dim = dim / parseFloat($el.parent().css("width"));
|
||||
}
|
||||
} else if (dim.indexOf("%") >= 0) {
|
||||
dim = parseFloat(dim) / 100;
|
||||
}
|
||||
return dim;
|
||||
};
|
||||
$.fn.bindScrollHandler = function() {
|
||||
if (!settings.preventPageScroll) {
|
||||
return $(this);
|
||||
}
|
||||
$(this).on("DOMMouseScroll mousewheel", function(event) {
|
||||
var $popover, $this, delta, height, prevent, scrollHeight, scrollTop, up;
|
||||
$this = $(this);
|
||||
scrollTop = $this.scrollTop();
|
||||
scrollHeight = $this[0].scrollHeight;
|
||||
height = parseInt($this.css("height"));
|
||||
$popover = $this.closest(".bigfoot-footnote");
|
||||
if ($this.scrollTop() > 0 && $this.scrollTop() < 10) {
|
||||
$popover.addClass("is-scrollable");
|
||||
}
|
||||
if (!$popover.hasClass("is-scrollable")) {
|
||||
return;
|
||||
}
|
||||
delta = event.type === "DOMMouseScroll" ? event.originalEvent.detail * -40 : event.originalEvent.wheelDelta;
|
||||
up = delta > 0;
|
||||
prevent = function() {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
event.returnValue = false;
|
||||
return false;
|
||||
};
|
||||
if (!up && -delta > scrollHeight - height - scrollTop) {
|
||||
$this.scrollTop(scrollHeight);
|
||||
$popover.addClass("is-fully-scrolled");
|
||||
return prevent();
|
||||
} else if (up && delta > scrollTop) {
|
||||
$this.scrollTop(0);
|
||||
$popover.removeClass("is-fully-scrolled");
|
||||
return prevent();
|
||||
} else {
|
||||
return $popover.removeClass("is-fully-scrolled");
|
||||
}
|
||||
});
|
||||
return $(this);
|
||||
};
|
||||
unhoverFeet = function(e) {
|
||||
if (settings.deleteOnUnhover && settings.activateOnHover) {
|
||||
return setTimeout((function() {
|
||||
var $target;
|
||||
$target = $(e.target).closest(".bigfoot-footnote, .bigfoot-footnote__button");
|
||||
if ($(".bigfoot-footnote__button:hover, .bigfoot-footnote:hover").length < 1) {
|
||||
return removePopovers();
|
||||
}
|
||||
}), settings.hoverDelay);
|
||||
}
|
||||
};
|
||||
escapeKeypress = function(event) {
|
||||
if (event.keyCode === 27) {
|
||||
return removePopovers();
|
||||
}
|
||||
};
|
||||
removePopovers = function(footnotes, timeout) {
|
||||
var $buttonsClosed, $linkedButton, $this, footnoteID;
|
||||
if (footnotes == null) {
|
||||
footnotes = ".bigfoot-footnote";
|
||||
}
|
||||
if (timeout == null) {
|
||||
timeout = settings.popoverDeleteDelay;
|
||||
}
|
||||
$buttonsClosed = $();
|
||||
footnoteID = void 0;
|
||||
$linkedButton = void 0;
|
||||
$this = void 0;
|
||||
$(footnotes).each(function() {
|
||||
$this = $(this);
|
||||
footnoteID = $this.attr("data-footnote-identifier");
|
||||
$linkedButton = $(".bigfoot-footnote__button[data-footnote-identifier=\"" + footnoteID + "\"]");
|
||||
if (!$linkedButton.hasClass("changing")) {
|
||||
$buttonsClosed = $buttonsClosed.add($linkedButton);
|
||||
$linkedButton.removeClass("is-active is-hover-instantiated is-click-instantiated").addClass("changing");
|
||||
$this.removeClass("is-active").addClass("disapearing");
|
||||
return setTimeout((function() {
|
||||
$this.remove();
|
||||
delete popoverStates[footnoteID];
|
||||
return $linkedButton.removeClass("changing");
|
||||
}), timeout);
|
||||
}
|
||||
});
|
||||
return $buttonsClosed;
|
||||
};
|
||||
repositionFeet = function(e) {
|
||||
var type;
|
||||
if (settings.positionContent) {
|
||||
type = e ? e.type : "resize";
|
||||
$(".bigfoot-footnote").each(function() {
|
||||
var $button, $contentWrapper, $mainWrap, $this, dataIdentifier, identifier, lastState, marginSize, maxHeightInCSS, maxHeightOnScreen, maxWidth, maxWidthInCSS, positionOnTop, relativeToWidth, roomLeft, totalHeight;
|
||||
$this = $(this);
|
||||
identifier = $this.attr("data-footnote-identifier");
|
||||
dataIdentifier = "data-footnote-identifier=\"" + identifier + "\"";
|
||||
$contentWrapper = $this.find(".bigfoot-footnote__content");
|
||||
$button = $this.siblings(".bigfoot-footnote__button");
|
||||
roomLeft = roomCalc($button);
|
||||
marginSize = parseFloat($this.css("margin-top"));
|
||||
maxHeightInCSS = +($this.attr("data-bigfoot-max-height"));
|
||||
totalHeight = 2 * marginSize + $this.outerHeight();
|
||||
maxHeightOnScreen = 10000;
|
||||
positionOnTop = roomLeft.bottomRoom < totalHeight && roomLeft.topRoom > roomLeft.bottomRoom;
|
||||
lastState = popoverStates[identifier];
|
||||
if (positionOnTop) {
|
||||
if (lastState !== "top") {
|
||||
popoverStates[identifier] = "top";
|
||||
$this.addClass("is-positioned-top").removeClass("is-positioned-bottom");
|
||||
$this.css("transform-origin", (roomLeft.leftRelative * 100) + "% 100%");
|
||||
}
|
||||
maxHeightOnScreen = roomLeft.topRoom - marginSize - 15;
|
||||
} else {
|
||||
if (lastState !== "bottom" || lastState === "init") {
|
||||
popoverStates[identifier] = "bottom";
|
||||
$this.removeClass("is-positioned-top").addClass("is-positioned-bottom");
|
||||
$this.css("transform-origin", (roomLeft.leftRelative * 100) + "% 0%");
|
||||
}
|
||||
maxHeightOnScreen = roomLeft.bottomRoom - marginSize - 15;
|
||||
}
|
||||
$this.find(".bigfoot-footnote__content").css({
|
||||
"max-height": Math.min(maxHeightOnScreen, maxHeightInCSS) + "px"
|
||||
});
|
||||
if (type === "resize") {
|
||||
maxWidthInCSS = parseFloat($this.attr("bigfoot-max-width"));
|
||||
$mainWrap = $this.find(".bigfoot-footnote__wrapper");
|
||||
maxWidth = maxWidthInCSS;
|
||||
if (maxWidthInCSS <= 1) {
|
||||
relativeToWidth = (function() {
|
||||
var jq, userSpecifiedRelativeElWidth;
|
||||
userSpecifiedRelativeElWidth = 10000;
|
||||
if (settings.maxWidthRelativeTo) {
|
||||
jq = $(settings.maxWidthRelativeTo);
|
||||
if (jq.length > 0) {
|
||||
userSpecifiedRelativeElWidth = jq.outerWidth();
|
||||
}
|
||||
}
|
||||
return Math.min(window.innerWidth, userSpecifiedRelativeElWidth);
|
||||
})();
|
||||
maxWidth = relativeToWidth * maxWidthInCSS;
|
||||
}
|
||||
maxWidth = Math.min(maxWidth, $this.find(".bigfoot-footnote__content").outerWidth() + 1);
|
||||
$mainWrap.css("max-width", maxWidth + "px");
|
||||
$this.css({
|
||||
left: (-roomLeft.leftRelative * maxWidth + parseFloat($button.css("margin-left")) + $button.outerWidth() / 2) + "px"
|
||||
});
|
||||
positionTooltip($this, roomLeft.leftRelative);
|
||||
}
|
||||
if (parseInt($this.outerHeight()) < $this.find(".bigfoot-footnote__content")[0].scrollHeight) {
|
||||
return $this.addClass("is-scrollable");
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
positionTooltip = function($popover, leftRelative) {
|
||||
var $tooltip;
|
||||
if (leftRelative == null) {
|
||||
leftRelative = 0.5;
|
||||
}
|
||||
$tooltip = $popover.find(".bigfoot-footnote__tooltip");
|
||||
if ($tooltip.length > 0) {
|
||||
$tooltip.css("left", "" + (leftRelative * 100) + "%");
|
||||
}
|
||||
};
|
||||
roomCalc = function($el) {
|
||||
var elHeight, elLeftMargin, elWidth, leftRoom, topRoom, w;
|
||||
elLeftMargin = parseFloat($el.css("margin-left"));
|
||||
elWidth = parseFloat($el.outerWidth()) - elLeftMargin;
|
||||
elHeight = parseFloat($el.outerHeight());
|
||||
w = viewportDetails();
|
||||
topRoom = $el.offset().top - w.scrollY + elHeight / 2;
|
||||
leftRoom = $el.offset().left - w.scrollX + elWidth / 2;
|
||||
return {
|
||||
topRoom: topRoom,
|
||||
bottomRoom: w.height - topRoom,
|
||||
leftRoom: leftRoom,
|
||||
rightRoom: w.width - leftRoom,
|
||||
leftRelative: leftRoom / w.width,
|
||||
topRelative: topRoom / w.height
|
||||
};
|
||||
};
|
||||
viewportDetails = function() {
|
||||
var $window;
|
||||
$window = $(window);
|
||||
return {
|
||||
width: window.innerWidth,
|
||||
height: window.innerHeight,
|
||||
scrollX: $window.scrollLeft(),
|
||||
scrollY: $window.scrollTop()
|
||||
};
|
||||
};
|
||||
addBreakpoint = function(size, trueCallback, falseCallback, deleteDelay, removeOpen) {
|
||||
var falseDefaultPositionSetting, minMax, mqListener, mql, query, s, trueDefaultPositionSetting;
|
||||
if (deleteDelay == null) {
|
||||
deleteDelay = settings.popoverDeleteDelay;
|
||||
}
|
||||
if (removeOpen == null) {
|
||||
removeOpen = true;
|
||||
}
|
||||
mql = void 0;
|
||||
minMax = void 0;
|
||||
s = void 0;
|
||||
if (typeof size === "string") {
|
||||
s = size.toLowerCase() === "iphone" ? "<320px" : size.toLowerCase() === "ipad" ? "<768px" : size;
|
||||
minMax = s.charAt(0) === ">" ? "min" : s.charAt(0) === "<" ? "max" : null;
|
||||
query = minMax ? "(" + minMax + "-width: " + (s.substring(1)) + ")" : s;
|
||||
mql = window.matchMedia(query);
|
||||
} else {
|
||||
mql = size;
|
||||
}
|
||||
if (mql.media && mql.media === "invalid") {
|
||||
return {
|
||||
added: false,
|
||||
mq: mql,
|
||||
listener: null
|
||||
};
|
||||
}
|
||||
trueDefaultPositionSetting = minMax === "min";
|
||||
falseDefaultPositionSetting = minMax === "max";
|
||||
trueCallback = trueCallback || makeDefaultCallbacks(removeOpen, deleteDelay, trueDefaultPositionSetting, function($popover) {
|
||||
return $popover.addClass("is-bottom-fixed");
|
||||
});
|
||||
falseCallback = falseCallback || makeDefaultCallbacks(removeOpen, deleteDelay, falseDefaultPositionSetting, function() {});
|
||||
mqListener = function(mq) {
|
||||
if (mq.matches) {
|
||||
trueCallback(removeOpen, bigfoot);
|
||||
} else {
|
||||
falseCallback(removeOpen, bigfoot);
|
||||
}
|
||||
};
|
||||
mql.addListener(mqListener);
|
||||
mqListener(mql);
|
||||
settings.breakpoints[size] = {
|
||||
added: true,
|
||||
mq: mql,
|
||||
listener: mqListener
|
||||
};
|
||||
return settings.breakpoints[size];
|
||||
};
|
||||
makeDefaultCallbacks = function(removeOpen, deleteDelay, position, callback) {
|
||||
return function(removeOpen, bigfoot) {
|
||||
var $closedPopovers;
|
||||
$closedPopovers = void 0;
|
||||
if (removeOpen) {
|
||||
$closedPopovers = bigfoot.close();
|
||||
bigfoot.updateSetting("activateCallback", callback);
|
||||
}
|
||||
return setTimeout((function() {
|
||||
bigfoot.updateSetting("positionContent", position);
|
||||
if (removeOpen) {
|
||||
return bigfoot.activate($closedPopovers);
|
||||
}
|
||||
}), deleteDelay);
|
||||
};
|
||||
};
|
||||
removeBreakpoint = function(target, callback) {
|
||||
var b, breakpoint, mq, mqFound;
|
||||
mq = null;
|
||||
b = void 0;
|
||||
mqFound = false;
|
||||
if (typeof target === "string") {
|
||||
mqFound = settings.breakpoints[target] !== undefined;
|
||||
} else {
|
||||
for (b in settings.breakpoints) {
|
||||
if (settings.breakpoints.hasOwnProperty(b) && settings.breakpoints[b].mq === target) {
|
||||
mqFound = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (mqFound) {
|
||||
breakpoint = settings.breakpoints[b || target];
|
||||
if (callback) {
|
||||
callback({
|
||||
matches: false
|
||||
});
|
||||
} else {
|
||||
breakpoint.listener({
|
||||
matches: false
|
||||
});
|
||||
}
|
||||
breakpoint.mq.removeListener(breakpoint.listener);
|
||||
delete settings.breakpoints[b || target];
|
||||
}
|
||||
return mqFound;
|
||||
};
|
||||
updateSetting = function(newSettings, value) {
|
||||
var oldValue, prop;
|
||||
oldValue = void 0;
|
||||
if (typeof newSettings === "string") {
|
||||
oldValue = settings[newSettings];
|
||||
settings[newSettings] = value;
|
||||
} else {
|
||||
oldValue = {};
|
||||
for (prop in newSettings) {
|
||||
if (newSettings.hasOwnProperty(prop)) {
|
||||
oldValue[prop] = settings[prop];
|
||||
settings[prop] = newSettings[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
return oldValue;
|
||||
};
|
||||
getSetting = function(setting) {
|
||||
return settings[setting];
|
||||
};
|
||||
$(document).ready(function() {
|
||||
footnoteInit();
|
||||
$(document).on("mouseenter", ".bigfoot-footnote__button", buttonHover);
|
||||
$(document).on("touchend click", touchClick);
|
||||
$(document).on("mouseout", ".is-hover-instantiated", unhoverFeet);
|
||||
$(document).on("keyup", escapeKeypress);
|
||||
$(window).on("scroll resize", repositionFeet);
|
||||
return $(document).on("gestureend", function() {
|
||||
return repositionFeet();
|
||||
});
|
||||
});
|
||||
bigfoot = {
|
||||
removePopovers: removePopovers,
|
||||
close: removePopovers,
|
||||
createPopover: createPopover,
|
||||
activate: createPopover,
|
||||
repositionFeet: repositionFeet,
|
||||
reposition: repositionFeet,
|
||||
addBreakpoint: addBreakpoint,
|
||||
removeBreakpoint: removeBreakpoint,
|
||||
getSetting: getSetting,
|
||||
updateSetting: updateSetting
|
||||
};
|
||||
return bigfoot;
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
}).call(this);
|
||||
|
||||
$.bigfoot();
|
|
@ -16,6 +16,10 @@ div.contentspage .chapterlist .sectionlist li {
|
|||
div.contentspage p.chapterentry {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
div.contentspage p.moduleentry {
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
div.contentspage span.chaptertitle {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
|
@ -142,12 +142,12 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -85,37 +85,37 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../supervisor-module/index.html"><spon class="sectiontitle">supervisor</span></a>
|
||||
- <span class="sectionpurpose">The central part of the build manager.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../syntax-module/index.html"><spon class="sectiontitle">shared/syntax</span></a>
|
||||
- <span class="sectionpurpose">A library of code to build a parse tree and break text into sentences.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../html-module/index.html"><spon class="sectiontitle">shared/html</span></a>
|
||||
- <span class="sectionpurpose">HTML and Javascript generation tools.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../arch-module/index.html"><spon class="sectiontitle">shared/arch</span></a>
|
||||
- <span class="sectionpurpose">Definitions of Inter and final VM architectures.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../html-module/index.html"><spon class="sectiontitle">shared/html</span></a>
|
||||
- <span class="sectionpurpose">HTML and Javascript generation tools.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../syntax-module/index.html"><spon class="sectiontitle">shared/syntax</span></a>
|
||||
- <span class="sectionpurpose">A library of code to build a parse tree and break text into sentences.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -200,12 +200,12 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -59,22 +59,22 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../inflections-module/index.html"><spon class="sectiontitle">inform7/inflections</span></a>
|
||||
- <span class="sectionpurpose">A library for adapting words or short phrases for linguistic purposes.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -85,92 +85,92 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../inflections-module/index.html"><spon class="sectiontitle">inflections</span></a>
|
||||
- <span class="sectionpurpose">A library for adapting words or short phrases for linguistic purposes.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../problems-module/index.html"><spon class="sectiontitle">problems</span></a>
|
||||
- <span class="sectionpurpose">The issuing mechanism for problem messages used by Inform.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../linguistics-module/index.html"><spon class="sectiontitle">linguistics</span></a>
|
||||
- <span class="sectionpurpose">A library of code to store grammatical categories of vocabulary.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../kinds-module/index.html"><spon class="sectiontitle">kinds</span></a>
|
||||
- <span class="sectionpurpose">The type system used by Inform.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../core-module/index.html"><spon class="sectiontitle">core</span></a>
|
||||
- <span class="sectionpurpose">The core of the Inform compiler, as a module.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../if-module/index.html"><spon class="sectiontitle">if</span></a>
|
||||
- <span class="sectionpurpose">The interactive-fiction specific layer of Inform, as a module.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../multimedia-module/index.html"><spon class="sectiontitle">multimedia</span></a>
|
||||
- <span class="sectionpurpose">A multimedia extension module for Inform.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../index-module/index.html"><spon class="sectiontitle">index</span></a>
|
||||
- <span class="sectionpurpose">Indexing tools needed by Inform, as a module.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
<p class="moduleentry">
|
||||
<a href="../inflections-module/index.html"><spon class="sectiontitle">inflections</span></a>
|
||||
- <span class="sectionpurpose">A library for adapting words or short phrases for linguistic purposes.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../syntax-module/index.html"><spon class="sectiontitle">shared/syntax</span></a>
|
||||
- <span class="sectionpurpose">A library of code to build a parse tree and break text into sentences.</span></p>
|
||||
<p class="moduleentry">
|
||||
<a href="../kinds-module/index.html"><spon class="sectiontitle">kinds</span></a>
|
||||
- <span class="sectionpurpose">The type system used by Inform.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../html-module/index.html"><spon class="sectiontitle">shared/html</span></a>
|
||||
- <span class="sectionpurpose">HTML and Javascript generation tools.</span></p>
|
||||
<p class="moduleentry">
|
||||
<a href="../linguistics-module/index.html"><spon class="sectiontitle">linguistics</span></a>
|
||||
- <span class="sectionpurpose">A library of code to store grammatical categories of vocabulary.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../arch-module/index.html"><spon class="sectiontitle">shared/arch</span></a>
|
||||
- <span class="sectionpurpose">Definitions of Inter and final VM architectures.</span></p>
|
||||
<p class="moduleentry">
|
||||
<a href="../multimedia-module/index.html"><spon class="sectiontitle">multimedia</span></a>
|
||||
- <span class="sectionpurpose">A multimedia extension module for Inform.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../bytecode-module/index.html"><spon class="sectiontitle">inter/bytecode</span></a>
|
||||
- <span class="sectionpurpose">Dealing with intermediate-level Inform as bytecode in memory.</span></p>
|
||||
<p class="moduleentry">
|
||||
<a href="../problems-module/index.html"><spon class="sectiontitle">problems</span></a>
|
||||
- <span class="sectionpurpose">The issuing mechanism for problem messages used by Inform.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../supervisor-module/index.html"><spon class="sectiontitle">inbuild/supervisor</span></a>
|
||||
- <span class="sectionpurpose">The central part of the build manager.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../building-module/index.html"><spon class="sectiontitle">inter/building</span></a>
|
||||
- <span class="sectionpurpose">An intermediate layer for building code in Inter.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../bytecode-module/index.html"><spon class="sectiontitle">inter/bytecode</span></a>
|
||||
- <span class="sectionpurpose">Dealing with intermediate-level Inform as bytecode in memory.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../codegen-module/index.html"><spon class="sectiontitle">inter/codegen</span></a>
|
||||
- <span class="sectionpurpose">The code generation pipeline.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../arch-module/index.html"><spon class="sectiontitle">shared/arch</span></a>
|
||||
- <span class="sectionpurpose">Definitions of Inter and final VM architectures.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../html-module/index.html"><spon class="sectiontitle">shared/html</span></a>
|
||||
- <span class="sectionpurpose">HTML and Javascript generation tools.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../syntax-module/index.html"><spon class="sectiontitle">shared/syntax</span></a>
|
||||
- <span class="sectionpurpose">A library of code to build a parse tree and break text into sentences.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -83,12 +83,12 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -72,12 +72,12 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -121,37 +121,37 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../bytecode-module/index.html"><spon class="sectiontitle">bytecode</span></a>
|
||||
- <span class="sectionpurpose">Dealing with intermediate-level Inform as bytecode in memory.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../building-module/index.html"><spon class="sectiontitle">building</span></a>
|
||||
- <span class="sectionpurpose">An intermediate layer for building code in Inter.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../bytecode-module/index.html"><spon class="sectiontitle">bytecode</span></a>
|
||||
- <span class="sectionpurpose">Dealing with intermediate-level Inform as bytecode in memory.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../codegen-module/index.html"><spon class="sectiontitle">codegen</span></a>
|
||||
- <span class="sectionpurpose">The code generation pipeline.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../arch-module/index.html"><spon class="sectiontitle">shared/arch</span></a>
|
||||
- <span class="sectionpurpose">Definitions of Inter and final VM architectures.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -59,32 +59,32 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../inflections-module/index.html"><spon class="sectiontitle">inform7/inflections</span></a>
|
||||
- <span class="sectionpurpose">A library for adapting words or short phrases for linguistic purposes.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../syntax-module/index.html"><spon class="sectiontitle">shared/syntax</span></a>
|
||||
- <span class="sectionpurpose">A library of code to build a parse tree and break text into sentences.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../linguistics-module/index.html"><spon class="sectiontitle">inform7/linguistics</span></a>
|
||||
- <span class="sectionpurpose">A library of code to store grammatical categories of vocabulary.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../syntax-module/index.html"><spon class="sectiontitle">shared/syntax</span></a>
|
||||
- <span class="sectionpurpose">A library of code to build a parse tree and break text into sentences.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -59,27 +59,27 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../syntax-module/index.html"><spon class="sectiontitle">shared/syntax</span></a>
|
||||
- <span class="sectionpurpose">A library of code to build a parse tree and break text into sentences.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../problems-module/index.html"><spon class="sectiontitle">inform7/problems</span></a>
|
||||
- <span class="sectionpurpose">The issuing mechanism for problem messages used by Inform.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../syntax-module/index.html"><spon class="sectiontitle">shared/syntax</span></a>
|
||||
- <span class="sectionpurpose">A library of code to build a parse tree and break text into sentences.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -591,7 +591,7 @@ are given precedence over those in the external folder, and so on.
|
|||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="function-syntax">Supervisor::nest_list</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">Supervisor::nest_list</span></span>:<br/><a href="1-ic.html#SP9_2">§9.2</a><br/>Inter Skill - <a href="3-is.html#SP3">§3</a>, <a href="3-is.html#SP4">§4</a><br/>Kits - <a href="5-ks.html#SP12">§12</a>, <a href="5-ks.html#SP13_1">§13.1</a><br/>Project Services - <a href="5-ps2.html#SP1">§1</a>, <a href="5-ps2.html#SP4">§4</a><br/>Inclusions - <a href="6-inc.html#SP6_1">§6.1</a>, <a href="6-inc.html#SP6_1_2">§6.1.2</a><br/>Extension Documentation - <a href="7-ed2.html#SP4">§4</a><br/>Extension Census - <a href="7-ec.html#SP1">§1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
|
||||
<span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="function-syntax">Supervisor::nest_list</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">Supervisor::nest_list</span></span>:<br/><a href="1-ic.html#SP9_2">§9.2</a><br/>Inter Skill - <a href="3-is.html#SP3">§3</a>, <a href="3-is.html#SP4">§4</a><br/>Kit Services - <a href="5-ks.html#SP12">§12</a>, <a href="5-ks.html#SP13_1">§13.1</a><br/>Project Services - <a href="5-ps2.html#SP1">§1</a>, <a href="5-ps2.html#SP4">§4</a><br/>Inclusions - <a href="6-inc.html#SP6_1">§6.1</a>, <a href="6-inc.html#SP6_1_2">§6.1.2</a><br/>Extension Documentation - <a href="7-ed2.html#SP4">§4</a><br/>Extension Census - <a href="7-ec.html#SP1">§1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">RUN_ONLY_FROM_PHASE</span><span class="plain-syntax">(</span><span class="constant-syntax">NESTED_INBUILD_PHASE</span><span class="plain-syntax">)</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">shared_nest_list</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"nest list never sorted"</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">shared_nest_list</span><span class="plain-syntax">;</span>
|
||||
|
|
|
@ -128,7 +128,7 @@ fields are blank.
|
|||
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">CE</span><span class="plain-syntax">;</span>
|
||||
<span class="plain-syntax">}</span>
|
||||
|
||||
<span class="reserved-syntax">copy_error</span><span class="plain-syntax"> *</span><span class="function-syntax">CopyErrors::new_T</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">CopyErrors::new_T</span></span>:<br/>Extension Services - <a href="5-es.html#SP2_2">§2.2</a>, <a href="5-es.html#SP2_2_3">§2.2.3</a>, <a href="5-es.html#SP2_2_3_2">§2.2.3.2</a>, <a href="5-es.html#SP2_3">§2.3</a><br/>Kits - <a href="5-ks.html#SP5">§5</a>, <a href="5-ks.html#SP5_1">§5.1</a>, <a href="5-ks.html#SP5_3">§5.3</a><br/>Headings - <a href="6-hdn.html#SP23_2">§23.2</a><br/>Inclusions - <a href="6-inc.html#SP6_1_1">§6.1.1</a>, <a href="6-inc.html#SP6_1_2">§6.1.2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">cat</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">subcat</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">NB</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">copy_error</span><span class="plain-syntax"> *</span><span class="function-syntax">CopyErrors::new_T</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">CopyErrors::new_T</span></span>:<br/>Extension Services - <a href="5-es.html#SP2_2">§2.2</a>, <a href="5-es.html#SP2_2_3">§2.2.3</a>, <a href="5-es.html#SP2_2_3_2">§2.2.3.2</a>, <a href="5-es.html#SP2_3">§2.3</a><br/>Kit Services - <a href="5-ks.html#SP5">§5</a>, <a href="5-ks.html#SP5_1">§5.1</a>, <a href="5-ks.html#SP5_3">§5.3</a><br/>Headings - <a href="6-hdn.html#SP23_2">§23.2</a><br/>Inclusions - <a href="6-inc.html#SP6_1_1">§6.1.1</a>, <a href="6-inc.html#SP6_1_2">§6.1.2</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">cat</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">subcat</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">NB</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">copy_error</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CE</span><span class="plain-syntax"> = </span><a href="2-ce.html#SP2" class="function-link"><span class="function-syntax">CopyErrors::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">cat</span><span class="plain-syntax">, </span><span class="identifier-syntax">subcat</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">CE</span><span class="plain-syntax">-></span><span class="element-syntax">details</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">NB</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">CE</span><span class="plain-syntax">;</span>
|
||||
|
|
|
@ -135,7 +135,7 @@ additional data specific to your genre:
|
|||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Copies::set_content</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">Copies::set_content</span></span>:<br/>Language Manager - <a href="4-lm.html#SP3">§3</a><br/>Pipeline Manager - <a href="4-pm.html#SP3">§3</a><br/>Project Bundle Manager - <a href="4-pbm.html#SP2">§2</a><br/>Project File Manager - <a href="4-pfm.html#SP2">§2</a><br/>Template Manager - <a href="4-tm.html#SP3">§3</a><br/>Extension Services - <a href="5-es.html#SP2">§2</a><br/>Kits - <a href="5-ks.html#SP4">§4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_copy</span><span class="plain-syntax"> *</span><span class="identifier-syntax">C</span><span class="plain-syntax">, </span><span class="identifier-syntax">general_pointer</span><span class="plain-syntax"> </span><span class="identifier-syntax">ref</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Copies::set_content</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">Copies::set_content</span></span>:<br/>Language Manager - <a href="4-lm.html#SP3">§3</a><br/>Pipeline Manager - <a href="4-pm.html#SP3">§3</a><br/>Project Bundle Manager - <a href="4-pbm.html#SP2">§2</a><br/>Project File Manager - <a href="4-pfm.html#SP2">§2</a><br/>Template Manager - <a href="4-tm.html#SP3">§3</a><br/>Extension Services - <a href="5-es.html#SP2">§2</a><br/>Kit Services - <a href="5-ks.html#SP4">§4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_copy</span><span class="plain-syntax"> *</span><span class="identifier-syntax">C</span><span class="plain-syntax">, </span><span class="identifier-syntax">general_pointer</span><span class="plain-syntax"> </span><span class="identifier-syntax">ref</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">C</span><span class="plain-syntax">-></span><span class="element-syntax">content</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ref</span><span class="plain-syntax">;</span>
|
||||
<span class="plain-syntax">}</span>
|
||||
</pre>
|
||||
|
@ -144,7 +144,7 @@ for later reporting. These are stored in a list.
|
|||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Copies::attach_error</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">Copies::attach_error</span></span>:<br/>Extension Services - <a href="5-es.html#SP2_2">§2.2</a>, <a href="5-es.html#SP2_2_3">§2.2.3</a>, <a href="5-es.html#SP2_2_3_2">§2.2.3.2</a>, <a href="5-es.html#SP2_3">§2.3</a><br/>Kits - <a href="5-ks.html#SP5">§5</a>, <a href="5-ks.html#SP5_1">§5.1</a>, <a href="5-ks.html#SP5_3">§5.3</a><br/>Project Services - <a href="5-ps2.html#SP7">§7</a><br/>Source Text - <a href="6-st.html#SP1">§1</a>, <a href="6-st.html#SP2">§2</a>, <a href="6-st.html#SP4">§4</a>, <a href="6-st.html#SP12">§12</a><br/>Headings - <a href="6-hdn.html#SP13_1">§13.1</a>, <a href="6-hdn.html#SP13_2">§13.2</a>, <a href="6-hdn.html#SP23_1">§23.1</a>, <a href="6-hdn.html#SP24_1">§24.1</a>, <a href="6-hdn.html#SP23_2">§23.2</a>, <a href="6-hdn.html#SP23_3">§23.3</a><br/>Inclusions - <a href="6-inc.html#SP3_1">§3.1</a>, <a href="6-inc.html#SP6_1_1">§6.1.1</a>, <a href="6-inc.html#SP6_1_2">§6.1.2</a>, <a href="6-inc.html#SP7_1">§7.1</a>, <a href="6-inc.html#SP9_1">§9.1</a>, <a href="6-inc.html#SP11">§11</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_copy</span><span class="plain-syntax"> *</span><span class="identifier-syntax">C</span><span class="plain-syntax">, </span><span class="reserved-syntax">copy_error</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CE</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Copies::attach_error</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">Copies::attach_error</span></span>:<br/>Extension Services - <a href="5-es.html#SP2_2">§2.2</a>, <a href="5-es.html#SP2_2_3">§2.2.3</a>, <a href="5-es.html#SP2_2_3_2">§2.2.3.2</a>, <a href="5-es.html#SP2_3">§2.3</a><br/>Kit Services - <a href="5-ks.html#SP5">§5</a>, <a href="5-ks.html#SP5_1">§5.1</a>, <a href="5-ks.html#SP5_3">§5.3</a><br/>Project Services - <a href="5-ps2.html#SP7">§7</a><br/>Source Text - <a href="6-st.html#SP1">§1</a>, <a href="6-st.html#SP2">§2</a>, <a href="6-st.html#SP4">§4</a>, <a href="6-st.html#SP12">§12</a><br/>Headings - <a href="6-hdn.html#SP13_1">§13.1</a>, <a href="6-hdn.html#SP13_2">§13.2</a>, <a href="6-hdn.html#SP23_1">§23.1</a>, <a href="6-hdn.html#SP24_1">§24.1</a>, <a href="6-hdn.html#SP23_2">§23.2</a>, <a href="6-hdn.html#SP23_3">§23.3</a><br/>Inclusions - <a href="6-inc.html#SP3_1">§3.1</a>, <a href="6-inc.html#SP6_1_1">§6.1.1</a>, <a href="6-inc.html#SP6_1_2">§6.1.2</a>, <a href="6-inc.html#SP7_1">§7.1</a>, <a href="6-inc.html#SP9_1">§9.1</a>, <a href="6-inc.html#SP11">§11</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_copy</span><span class="plain-syntax"> *</span><span class="identifier-syntax">C</span><span class="plain-syntax">, </span><span class="reserved-syntax">copy_error</span><span class="plain-syntax"> *</span><span class="identifier-syntax">CE</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">C</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no copy to attach to"</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><a href="2-ce.html#SP4" class="function-link"><span class="function-syntax">CopyErrors::supply_attached_copy</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">CE</span><span class="plain-syntax">, </span><span class="identifier-syntax">C</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">ADD_TO_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">CE</span><span class="plain-syntax">, </span><span class="reserved-syntax">copy_error</span><span class="plain-syntax">, </span><span class="identifier-syntax">C</span><span class="plain-syntax">-></span><span class="element-syntax">errors_reading_source_text</span><span class="plain-syntax">);</span>
|
||||
|
|
|
@ -193,7 +193,7 @@ others:
|
|||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="reserved-syntax">inbuild_search_result</span><span class="plain-syntax"> *</span><span class="function-syntax">Nests::search_for_best</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">Nests::search_for_best</span></span>:<br/>Inter Skill - <a href="3-is.html#SP3">§3</a>, <a href="3-is.html#SP4">§4</a><br/>Kits - <a href="5-ks.html#SP8">§8</a><br/>Language Services - <a href="5-ls.html#SP7">§7</a><br/>Inclusions - <a href="6-inc.html#SP6_1">§6.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">,</span>
|
||||
<span class="reserved-syntax">inbuild_search_result</span><span class="plain-syntax"> *</span><span class="function-syntax">Nests::search_for_best</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">Nests::search_for_best</span></span>:<br/>Inter Skill - <a href="3-is.html#SP3">§3</a>, <a href="3-is.html#SP4">§4</a><br/>Kit Services - <a href="5-ks.html#SP8">§8</a><br/>Language Services - <a href="5-ls.html#SP7">§7</a><br/>Inclusions - <a href="6-inc.html#SP6_1">§6.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">,</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">search_list</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">L</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NEW_LINKED_LIST</span><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_search_result</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><a href="2-nst.html#SP7" class="function-link"><span class="function-syntax">Nests::search_for</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">req</span><span class="plain-syntax">, </span><span class="identifier-syntax">search_list</span><span class="plain-syntax">, </span><span class="identifier-syntax">L</span><span class="plain-syntax">);</span>
|
||||
|
|
|
@ -86,14 +86,14 @@ we can give a semantic version number range:
|
|||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax"> *</span><span class="function-syntax">Requirements::new</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Requirements::new</span></span>:<br/>Kits - <a href="5-ks.html#SP5_3">§5.3</a><br/>Inclusions - <a href="6-inc.html#SP5_1">§5.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_work</span><span class="plain-syntax"> *</span><span class="identifier-syntax">work</span><span class="plain-syntax">, </span><span class="identifier-syntax">semver_range</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax"> *</span><span class="function-syntax">Requirements::new</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Requirements::new</span></span>:<br/>Kit Services - <a href="5-ks.html#SP5_3">§5.3</a><br/>Inclusions - <a href="6-inc.html#SP5_1">§5.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_work</span><span class="plain-syntax"> *</span><span class="identifier-syntax">work</span><span class="plain-syntax">, </span><span class="identifier-syntax">semver_range</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">req</span><span class="plain-syntax">-></span><span class="element-syntax">work</span><span class="plain-syntax"> = </span><span class="identifier-syntax">work</span><span class="plain-syntax">;</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">req</span><span class="plain-syntax">-></span><span class="element-syntax">version_range</span><span class="plain-syntax"> = </span><span class="identifier-syntax">R</span><span class="plain-syntax">;</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">req</span><span class="plain-syntax">;</span>
|
||||
<span class="plain-syntax">}</span>
|
||||
|
||||
<span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax"> *</span><span class="function-syntax">Requirements::any_version_of</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Requirements::any_version_of</span></span>:<br/>Inter Skill - <a href="3-is.html#SP3">§3</a>, <a href="3-is.html#SP4">§4</a><br/>Kits - <a href="5-ks.html#SP5_4">§5.4</a>, <a href="5-ks.html#SP8">§8</a><br/>Language Services - <a href="5-ls.html#SP7">§7</a><br/>Inclusions - <a href="6-inc.html#SP6_1_2">§6.1.2</a><br/>Extension Documentation - <a href="7-ed2.html#SP4">§4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_work</span><span class="plain-syntax"> *</span><span class="identifier-syntax">work</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax"> *</span><span class="function-syntax">Requirements::any_version_of</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Requirements::any_version_of</span></span>:<br/>Inter Skill - <a href="3-is.html#SP3">§3</a>, <a href="3-is.html#SP4">§4</a><br/>Kit Services - <a href="5-ks.html#SP5_4">§5.4</a>, <a href="5-ks.html#SP8">§8</a><br/>Language Services - <a href="5-ls.html#SP7">§7</a><br/>Inclusions - <a href="6-inc.html#SP6_1_2">§6.1.2</a><br/>Extension Documentation - <a href="7-ed2.html#SP4">§4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_work</span><span class="plain-syntax"> *</span><span class="identifier-syntax">work</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="2-rqr.html#SP2" class="function-link"><span class="function-syntax">Requirements::new</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">work</span><span class="plain-syntax">, </span><span class="identifier-syntax">VersionNumberRanges::any_range</span><span class="plain-syntax">());</span>
|
||||
<span class="plain-syntax">}</span>
|
||||
|
||||
|
@ -250,7 +250,7 @@ a requirement, then so will all other copies of it.
|
|||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Requirements::meets</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">Requirements::meets</span></span>:<br/>Extension Manager - <a href="4-em.html#SP6">§6</a><br/>Kit Manager - <a href="4-km.html#SP5">§5</a><br/>Language Manager - <a href="4-lm.html#SP5">§5</a><br/>Pipeline Manager - <a href="4-pm.html#SP5">§5</a><br/>Template Manager - <a href="4-tm.html#SP5">§5</a><br/>Extension Services - <a href="5-es.html#SP7">§7</a><br/>Kits - <a href="5-ks.html#SP13_4">§13.4</a><br/>Inclusions - <a href="6-inc.html#SP6">§6</a><br/>Extension Documentation - <a href="7-ed2.html#SP4">§4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_edition</span><span class="plain-syntax"> *</span><span class="identifier-syntax">edition</span><span class="plain-syntax">, </span><span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Requirements::meets</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">Requirements::meets</span></span>:<br/>Extension Manager - <a href="4-em.html#SP6">§6</a><br/>Kit Manager - <a href="4-km.html#SP5">§5</a><br/>Language Manager - <a href="4-lm.html#SP5">§5</a><br/>Pipeline Manager - <a href="4-pm.html#SP5">§5</a><br/>Template Manager - <a href="4-tm.html#SP5">§5</a><br/>Extension Services - <a href="5-es.html#SP7">§7</a><br/>Kit Services - <a href="5-ks.html#SP13_4">§13.4</a><br/>Inclusions - <a href="6-inc.html#SP6">§6</a><br/>Extension Documentation - <a href="7-ed2.html#SP4">§4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_edition</span><span class="plain-syntax"> *</span><span class="identifier-syntax">edition</span><span class="plain-syntax">, </span><span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax"> *</span><span class="identifier-syntax">req</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-></span><span class="element-syntax">work</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">req</span><span class="plain-syntax">-></span><span class="element-syntax">work</span><span class="plain-syntax">-></span><span class="element-syntax">genre</span><span class="plain-syntax">)</span>
|
||||
|
|
|
@ -101,7 +101,7 @@ not subsequently altered.
|
|||
<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">WORK_HASH_CODING_BASE</span><span class="plain-syntax"> </span><span class="constant-syntax">499</span>
|
||||
</pre>
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="reserved-syntax">inbuild_work</span><span class="plain-syntax"> *</span><span class="function-syntax">Works::new</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Works::new</span></span>:<br/><a href="2-wrk.html#SP10">§10</a><br/>Requirements - <a href="2-rqr.html#SP2">§2</a><br/>Inter Skill - <a href="3-is.html#SP3">§3</a>, <a href="3-is.html#SP4">§4</a><br/>Extension Manager - <a href="4-em.html#SP4">§4</a><br/>Language Manager - <a href="4-lm.html#SP3">§3</a><br/>Project Bundle Manager - <a href="4-pbm.html#SP2">§2</a><br/>Project File Manager - <a href="4-pfm.html#SP2">§2</a><br/>Template Manager - <a href="4-tm.html#SP3">§3</a><br/>Extension Services - <a href="5-es.html#SP2_3">§2.3</a><br/>Kits - <a href="5-ks.html#SP5_3">§5.3</a>, <a href="5-ks.html#SP5_4">§5.4</a>, <a href="5-ks.html#SP8">§8</a><br/>Language Services - <a href="5-ls.html#SP7">§7</a><br/>Headings - <a href="6-hdn.html#SP13_3">§13.3</a><br/>Inclusions - <a href="6-inc.html#SP5_1">§5.1</a><br/>Extension Dictionary - <a href="7-ed.html#SP10">§10</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_genre</span><span class="plain-syntax"> *</span><span class="identifier-syntax">genre</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ti</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">an</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">inbuild_work</span><span class="plain-syntax"> *</span><span class="function-syntax">Works::new</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Works::new</span></span>:<br/><a href="2-wrk.html#SP10">§10</a><br/>Requirements - <a href="2-rqr.html#SP2">§2</a><br/>Inter Skill - <a href="3-is.html#SP3">§3</a>, <a href="3-is.html#SP4">§4</a><br/>Extension Manager - <a href="4-em.html#SP4">§4</a><br/>Language Manager - <a href="4-lm.html#SP3">§3</a><br/>Project Bundle Manager - <a href="4-pbm.html#SP2">§2</a><br/>Project File Manager - <a href="4-pfm.html#SP2">§2</a><br/>Template Manager - <a href="4-tm.html#SP3">§3</a><br/>Extension Services - <a href="5-es.html#SP2_3">§2.3</a><br/>Kit Services - <a href="5-ks.html#SP5_3">§5.3</a>, <a href="5-ks.html#SP5_4">§5.4</a>, <a href="5-ks.html#SP8">§8</a><br/>Language Services - <a href="5-ls.html#SP7">§7</a><br/>Headings - <a href="6-hdn.html#SP13_3">§13.3</a><br/>Inclusions - <a href="6-inc.html#SP5_1">§5.1</a><br/>Extension Dictionary - <a href="7-ed.html#SP10">§10</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_genre</span><span class="plain-syntax"> *</span><span class="identifier-syntax">genre</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ti</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">an</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="2-wrk.html#SP3" class="function-link"><span class="function-syntax">Works::new_inner</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">genre</span><span class="plain-syntax">, </span><span class="identifier-syntax">ti</span><span class="plain-syntax">, </span><span class="identifier-syntax">an</span><span class="plain-syntax">, </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax">}</span>
|
||||
<span class="reserved-syntax">inbuild_work</span><span class="plain-syntax"> *</span><span class="function-syntax">Works::new_raw</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Works::new_raw</span></span>:<br/>Kit Manager - <a href="4-km.html#SP3">§3</a><br/>Pipeline Manager - <a href="4-pm.html#SP4">§4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_genre</span><span class="plain-syntax"> *</span><span class="identifier-syntax">genre</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ti</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">an</span><span class="plain-syntax">) {</span>
|
||||
|
|
|
@ -121,7 +121,7 @@ compiled, is a file vertex.
|
|||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="function-syntax">Graphs::file_vertex</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Graphs::file_vertex</span></span>:<br/><a href="3-bg.html#SP3">§3</a><br/>Kits - <a href="5-ks.html#SP13">§13</a>, <a href="5-ks.html#SP13_1">§13.1</a>, <a href="5-ks.html#SP13_3">§13.3</a><br/>Project Services - <a href="5-ps2.html#SP1">§1</a>, <a href="5-ps2.html#SP4">§4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">F</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="function-syntax">Graphs::file_vertex</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">Graphs::file_vertex</span></span>:<br/><a href="3-bg.html#SP3">§3</a><br/>Kit Services - <a href="5-ks.html#SP13">§13</a>, <a href="5-ks.html#SP13_1">§13.1</a>, <a href="5-ks.html#SP13_3">§13.3</a><br/>Project Services - <a href="5-ps2.html#SP1">§1</a>, <a href="5-ps2.html#SP4">§4</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">filename</span><span class="plain-syntax"> *</span><span class="identifier-syntax">F</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">V</span><span class="plain-syntax">-></span><span class="element-syntax">type</span><span class="plain-syntax"> = </span><span class="constant-syntax">FILE_VERTEX</span><span class="plain-syntax">;</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">V</span><span class="plain-syntax">-></span><span class="element-syntax">build_edges</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NEW_LINKED_LIST</span><span class="plain-syntax">(</span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax">);</span>
|
||||
|
@ -143,7 +143,7 @@ compiled, is a file vertex.
|
|||
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">V</span><span class="plain-syntax">;</span>
|
||||
<span class="plain-syntax">}</span>
|
||||
|
||||
<span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="function-syntax">Graphs::req_vertex</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Graphs::req_vertex</span></span>:<br/>Kits - <a href="5-ks.html#SP13_4">§13.4</a><br/>Inclusions - <a href="6-inc.html#SP6_1">§6.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="function-syntax">Graphs::req_vertex</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">Graphs::req_vertex</span></span>:<br/>Kit Services - <a href="5-ks.html#SP13_4">§13.4</a><br/>Inclusions - <a href="6-inc.html#SP6_1">§6.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_requirement</span><span class="plain-syntax"> *</span><span class="identifier-syntax">R</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">R</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no requirement"</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">V</span><span class="plain-syntax"> = </span><a href="3-bg.html#SP2" class="function-link"><span class="function-syntax">Graphs::file_vertex</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">V</span><span class="plain-syntax">-></span><span class="element-syntax">type</span><span class="plain-syntax"> = </span><span class="constant-syntax">REQUIREMENT_VERTEX</span><span class="plain-syntax">;</span>
|
||||
|
@ -170,7 +170,7 @@ at most one edge of each colour.
|
|||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Graphs::need_this_to_build</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">Graphs::need_this_to_build</span></span>:<br/>Kits - <a href="5-ks.html#SP13_1">§13.1</a>, <a href="5-ks.html#SP13_2">§13.2</a>, <a href="5-ks.html#SP13_3">§13.3</a><br/>Project Services - <a href="5-ps2.html#SP4">§4</a><br/>Inclusions - <a href="6-inc.html#SP1_1">§1.1</a>, <a href="6-inc.html#SP6_1">§6.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Graphs::need_this_to_build</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">Graphs::need_this_to_build</span></span>:<br/>Kit Services - <a href="5-ks.html#SP13_1">§13.1</a>, <a href="5-ks.html#SP13_2">§13.2</a>, <a href="5-ks.html#SP13_3">§13.3</a><br/>Project Services - <a href="5-ps2.html#SP4">§4</a><br/>Inclusions - <a href="6-inc.html#SP1_1">§1.1</a>, <a href="6-inc.html#SP6_1">§6.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">from</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no from"</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">to</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no to"</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">from</span><span class="plain-syntax"> == </span><span class="identifier-syntax">to</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"graph node depends on itself"</span><span class="plain-syntax">);</span>
|
||||
|
@ -180,7 +180,7 @@ at most one edge of each colour.
|
|||
<span class="plain-syntax"> </span><span class="identifier-syntax">ADD_TO_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">to</span><span class="plain-syntax">, </span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax">, </span><span class="identifier-syntax">from</span><span class="plain-syntax">-></span><span class="element-syntax">build_edges</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax">}</span>
|
||||
|
||||
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Graphs::need_this_to_use</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">Graphs::need_this_to_use</span></span>:<br/>Kits - <a href="5-ks.html#SP13_4">§13.4</a><br/>Project Services - <a href="5-ps2.html#SP4">§4</a><br/>Inclusions - <a href="6-inc.html#SP1_1">§1.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Graphs::need_this_to_use</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">Graphs::need_this_to_use</span></span>:<br/>Kit Services - <a href="5-ks.html#SP13_4">§13.4</a><br/>Project Services - <a href="5-ps2.html#SP4">§4</a><br/>Inclusions - <a href="6-inc.html#SP1_1">§1.1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">from</span><span class="plain-syntax">, </span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">from</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no from"</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">to</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no to"</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">from</span><span class="plain-syntax"> == </span><span class="identifier-syntax">to</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"graph node depends on itself"</span><span class="plain-syntax">);</span>
|
||||
|
|
|
@ -128,7 +128,7 @@ to access any of <span class="extract"><span class="extract-syntax">inbuild</spa
|
|||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="reserved-syntax">build_step</span><span class="plain-syntax"> *</span><span class="function-syntax">BuildSteps::attach</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">BuildSteps::attach</span></span>:<br/>Kits - <a href="5-ks.html#SP13_1">§13.1</a><br/>Project Services - <a href="5-ps2.html#SP4">§4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vertex</span><span class="plain-syntax">, </span><span class="reserved-syntax">build_skill</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to_do</span><span class="plain-syntax">, </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">search</span><span class="plain-syntax">,</span>
|
||||
<span class="reserved-syntax">build_step</span><span class="plain-syntax"> *</span><span class="function-syntax">BuildSteps::attach</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">BuildSteps::attach</span></span>:<br/>Kit Services - <a href="5-ks.html#SP13_1">§13.1</a><br/>Project Services - <a href="5-ps2.html#SP4">§4</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">build_vertex</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vertex</span><span class="plain-syntax">, </span><span class="reserved-syntax">build_skill</span><span class="plain-syntax"> *</span><span class="identifier-syntax">to_do</span><span class="plain-syntax">, </span><span class="identifier-syntax">linked_list</span><span class="plain-syntax"> *</span><span class="identifier-syntax">search</span><span class="plain-syntax">,</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">rel</span><span class="plain-syntax">, </span><span class="identifier-syntax">target_vm</span><span class="plain-syntax"> *</span><span class="identifier-syntax">VM</span><span class="plain-syntax">, </span><span class="identifier-syntax">inter_architecture</span><span class="plain-syntax"> *</span><span class="identifier-syntax">arch</span><span class="plain-syntax">, </span><span class="reserved-syntax">inbuild_copy</span><span class="plain-syntax"> *</span><span class="identifier-syntax">assoc</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">build_step</span><span class="plain-syntax"> *</span><span class="identifier-syntax">S</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">build_step</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">S</span><span class="plain-syntax">-></span><span class="element-syntax">what_to_do</span><span class="plain-syntax"> = </span><span class="identifier-syntax">to_do</span><span class="plain-syntax">;</span>
|
||||
|
|
|
@ -97,7 +97,7 @@ the metadata file.
|
|||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="identifier-syntax">pathname</span><span class="plain-syntax"> *</span><span class="function-syntax">KitManager::path_within_nest</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">KitManager::path_within_nest</span></span>:<br/><a href="4-km.html#SP5">§5</a>, <a href="4-km.html#SP6">§6</a><br/>Kits - <a href="5-ks.html#SP12">§12</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_nest</span><span class="plain-syntax"> *</span><span class="identifier-syntax">N</span><span class="plain-syntax">) {</span>
|
||||
<span class="identifier-syntax">pathname</span><span class="plain-syntax"> *</span><span class="function-syntax">KitManager::path_within_nest</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">KitManager::path_within_nest</span></span>:<br/><a href="4-km.html#SP5">§5</a>, <a href="4-km.html#SP6">§6</a><br/>Kit Services - <a href="5-ks.html#SP12">§12</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_nest</span><span class="plain-syntax"> *</span><span class="identifier-syntax">N</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">N</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"no nest"</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">Pathnames::down</span><span class="plain-syntax">(</span><span class="identifier-syntax">N</span><span class="plain-syntax">-></span><span class="element-syntax">location</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"Inter"</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax">}</span>
|
||||
|
@ -107,7 +107,7 @@ which stores data about extensions used by the Inform compiler.
|
|||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="reserved-syntax">inform_kit</span><span class="plain-syntax"> *</span><span class="function-syntax">KitManager::from_copy</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">KitManager::from_copy</span></span>:<br/><a href="4-km.html#SP7">§7</a><br/>Kits - <a href="5-ks.html#SP5">§5</a>, <a href="5-ks.html#SP8">§8</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_copy</span><span class="plain-syntax"> *</span><span class="identifier-syntax">C</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">inform_kit</span><span class="plain-syntax"> *</span><span class="function-syntax">KitManager::from_copy</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">KitManager::from_copy</span></span>:<br/><a href="4-km.html#SP7">§7</a><br/>Kit Services - <a href="5-ks.html#SP5">§5</a>, <a href="5-ks.html#SP8">§8</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inbuild_copy</span><span class="plain-syntax"> *</span><span class="identifier-syntax">C</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">C</span><span class="plain-syntax">) && (</span><span class="identifier-syntax">C</span><span class="plain-syntax">-></span><span class="element-syntax">edition</span><span class="plain-syntax">-></span><span class="element-syntax">work</span><span class="plain-syntax">-></span><span class="element-syntax">genre</span><span class="plain-syntax"> == </span><span class="identifier-syntax">kit_genre</span><span class="plain-syntax">)) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">RETRIEVE_POINTER_inform_kit</span><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">-></span><span class="element-syntax">content</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> }</span>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Kits</title>
|
||||
<title>Kit Services</title>
|
||||
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
||||
<meta name="viewport" content="width=device-width initial-scale=1">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
|
@ -75,9 +75,9 @@ MathJax = {
|
|||
</ul>
|
||||
</nav>
|
||||
<main role="main">
|
||||
<!--Weave of 'Kits' generated by Inweb-->
|
||||
<!--Weave of 'Kit Services' generated by Inweb-->
|
||||
<div class="breadcrumbs">
|
||||
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../compiler.html">Inbuild Modules</a></li><li><a href="index.html">supervisor</a></li><li><a href="index.html#5">Chapter 5: Genre Services</a></li><li><b>Kits</b></li></ul></div>
|
||||
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../compiler.html">Inbuild Modules</a></li><li><a href="index.html">supervisor</a></li><li><a href="index.html#5">Chapter 5: Genre Services</a></li><li><b>Kit Services</b></li></ul></div>
|
||||
<p class="purpose">Behaviour specific to copies of the kit genre.</p>
|
||||
|
||||
<ul class="toc"><li><a href="5-ks.html#SP1">§1. Scanning metadata</a></li><li><a href="5-ks.html#SP8">§8. The kits included by a project</a></li><li><a href="5-ks.html#SP10">§10. Kind definitions</a></li><li><a href="5-ks.html#SP11">§11. Language element activation</a></li><li><a href="5-ks.html#SP12">§12. Early source</a></li><li><a href="5-ks.html#SP13">§13. Build graph</a></li></ul><hr class="tocbar">
|
||||
|
|
|
@ -196,7 +196,7 @@ function togglePopup(material_id) {
|
|||
<span class="plain-syntax"> </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">project</span><span class="plain-syntax">-></span><span class="element-syntax">source_vertices</span><span class="plain-syntax">;</span>
|
||||
<span class="plain-syntax">}</span>
|
||||
|
||||
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Projects::add_kit_dependency</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">Projects::add_kit_dependency</span></span>:<br/>Inbuild Control - <a href="1-ic.html#SP22">§22</a><br/>Kits - <a href="5-ks.html#SP9">§9</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inform_project</span><span class="plain-syntax"> *</span><span class="identifier-syntax">project</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kit_name</span><span class="plain-syntax">,</span>
|
||||
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">Projects::add_kit_dependency</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">Projects::add_kit_dependency</span></span>:<br/>Inbuild Control - <a href="1-ic.html#SP22">§22</a><br/>Kit Services - <a href="5-ks.html#SP9">§9</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inform_project</span><span class="plain-syntax"> *</span><span class="identifier-syntax">project</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kit_name</span><span class="plain-syntax">,</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">inform_language</span><span class="plain-syntax"> *</span><span class="identifier-syntax">because_of_language</span><span class="plain-syntax">, </span><span class="reserved-syntax">inform_kit</span><span class="plain-syntax"> *</span><span class="identifier-syntax">because_of_kit</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">RUN_ONLY_BEFORE_PHASE</span><span class="plain-syntax">(</span><span class="constant-syntax">OPERATIONAL_INBUILD_PHASE</span><span class="plain-syntax">)</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="5-ps2.html#SP1" class="function-link"><span class="function-syntax">Projects::uses_kit</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">project</span><span class="plain-syntax">, </span><span class="identifier-syntax">kit_name</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax">;</span>
|
||||
|
@ -207,7 +207,7 @@ function togglePopup(material_id) {
|
|||
<span class="plain-syntax"> </span><span class="identifier-syntax">ADD_TO_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">kd</span><span class="plain-syntax">, </span><span class="reserved-syntax">kit_dependency</span><span class="plain-syntax">, </span><span class="identifier-syntax">project</span><span class="plain-syntax">-></span><span class="element-syntax">kits_to_include</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax">}</span>
|
||||
|
||||
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Projects::uses_kit</span><button class="popup" onclick="togglePopup('usagePopup11')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup11">Usage of <span class="code-font"><span class="function-syntax">Projects::uses_kit</span></span>:<br/>Kits - <a href="5-ks.html#SP9">§9</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inform_project</span><span class="plain-syntax"> *</span><span class="identifier-syntax">project</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">name</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Projects::uses_kit</span><button class="popup" onclick="togglePopup('usagePopup11')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup11">Usage of <span class="code-font"><span class="function-syntax">Projects::uses_kit</span></span>:<br/>Kit Services - <a href="5-ks.html#SP9">§9</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inform_project</span><span class="plain-syntax"> *</span><span class="identifier-syntax">project</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">name</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">kit_dependency</span><span class="plain-syntax"> *</span><span class="identifier-syntax">kd</span><span class="plain-syntax">;</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">LOOP_OVER_LINKED_LIST</span><span class="plain-syntax">(</span><span class="identifier-syntax">kd</span><span class="plain-syntax">, </span><span class="reserved-syntax">kit_dependency</span><span class="plain-syntax">, </span><span class="identifier-syntax">project</span><span class="plain-syntax">-></span><span class="element-syntax">kits_to_include</span><span class="plain-syntax">)</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::eq</span><span class="plain-syntax">(</span><span class="identifier-syntax">kd</span><span class="plain-syntax">-></span><span class="element-syntax">kit</span><span class="plain-syntax">-></span><span class="element-syntax">as_copy</span><span class="plain-syntax">-></span><span class="element-syntax">edition</span><span class="plain-syntax">-></span><span class="element-syntax">work</span><span class="plain-syntax">-></span><span class="element-syntax">title</span><span class="plain-syntax">, </span><span class="identifier-syntax">name</span><span class="plain-syntax">))</span>
|
||||
|
|
|
@ -298,10 +298,10 @@ and cannot contain information about releasing or about virtual machines.
|
|||
</pre>
|
||||
<p class="commentary firstcommentary"><a id="SP11"></a><b>§11. </b></p>
|
||||
|
||||
<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">NEW_HEADING_HANDLER</span><span class="plain-syntax"> </span><a href="6-hdn.html#SP11" class="function-link"><span class="function-syntax">Headings::new_heading</span></a>
|
||||
<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">NEW_HEADING_HANDLER</span><span class="plain-syntax"> </span><a href="6-hdn.html#SP11" class="function-link"><span class="function-syntax">Headings::new</span></a>
|
||||
</pre>
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Headings::new_heading</span><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">T</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">new</span><span class="plain-syntax">) {</span>
|
||||
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">Headings::new</span><span class="plain-syntax">(</span><span class="identifier-syntax">parse_node_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">T</span><span class="plain-syntax">, </span><span class="identifier-syntax">parse_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">new</span><span class="plain-syntax">) {</span>
|
||||
<span class="plain-syntax"> </span><span class="reserved-syntax">heading</span><span class="plain-syntax"> *</span><span class="identifier-syntax">h</span><span class="plain-syntax"> = </span><a href="6-hdn.html#SP11" class="function-link"><span class="function-syntax">Headings::declare</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">T</span><span class="plain-syntax">, </span><span class="identifier-syntax">new</span><span class="plain-syntax">);</span>
|
||||
<span class="plain-syntax"> #</span><span class="identifier-syntax">ifdef</span><span class="plain-syntax"> </span><span class="identifier-syntax">CORE_MODULE</span>
|
||||
<span class="plain-syntax"> </span><span class="identifier-syntax">ParseTree::set_embodying_heading</span><span class="plain-syntax">(</span><span class="identifier-syntax">new</span><span class="plain-syntax">, </span><span class="identifier-syntax">h</span><span class="plain-syntax">);</span>
|
||||
|
|
|
@ -12,7 +12,13 @@
|
|||
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
||||
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
||||
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
||||
<script src="http://code.jquery.com/jquery-1.12.4.min.js"
|
||||
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
|
||||
|
||||
<script src="../docs-assets/Bigfoot.js"></script>
|
||||
<link href="../docs-assets/Bigfoot.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
||||
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
||||
<link href="../docs-assets/ConsoleText-Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
|
||||
|
||||
</head>
|
||||
<body class="commentary-font">
|
||||
|
@ -58,7 +64,7 @@
|
|||
<ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../compiler.html">Inbuild Modules</a></li><li><a href="index.html">supervisor</a></li><li><a href="index.html#P">Preliminaries</a></li><li><b>What This Module Does</b></li></ul></div>
|
||||
<p class="purpose">An overview of the supervisor module's role and abilities.</p>
|
||||
|
||||
<ul class="toc"><li><a href="P-wtmd.html#SP1">§1. Prerequisites</a></li><li><a href="P-wtmd.html#SP2">§2. The Supervisor and its Parent</a></li></ul><hr class="tocbar">
|
||||
<ul class="toc"><li><a href="P-wtmd.html#SP1">§1. Prerequisites</a></li><li><a href="P-wtmd.html#SP2">§2. The Supervisor and its Parent</a></li><li><a href="P-wtmd.html#SP4">§4. Genre, work, edition, copy</a></li><li><a href="P-wtmd.html#SP5">§5. Searches and requirements</a></li><li><a href="P-wtmd.html#SP7">§7. Discovery</a></li><li><a href="P-wtmd.html#SP8">§8. Limitation</a></li><li><a href="P-wtmd.html#SP9">§9. Build graph</a></li><li><a href="P-wtmd.html#SP11">§11. Reading source text</a></li><li><a href="P-wtmd.html#SP18">§18. Incremental builds</a></li><li><a href="P-wtmd.html#SP19">§19. Extension census</a></li></ul><hr class="tocbar">
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP1"></a><b>§1. Prerequisites. </b>The supervisor module is a part of the Inform compiler toolset. It is
|
||||
presented as a literate program or "web". Before diving in:
|
||||
|
@ -76,19 +82,18 @@ For more, see <a href="../../../inweb/docs/foundation-module/P-abgtf.html" class
|
|||
</li></ul>
|
||||
<p class="commentary firstcommentary"><a id="SP2"></a><b>§2. The Supervisor and its Parent. </b>The <a href="index.html" class="internal">supervisor</a> module is part of both <a href="../inform7/index.html" class="internal">inform7</a> and <a href="../inbuild/index.html" class="internal">inbuild</a>, and acts
|
||||
as a build manager. To compile an Inform project is not so atomic a task as
|
||||
it sounds, because the project may need resources which themselves need to be
|
||||
built first, and so on. <a href="index.html" class="internal">supervisor</a> takes charge of this, issuing
|
||||
instructions as needed. It does so either "externally", by issuing shell
|
||||
commands, or "internally", by calling functions in other modules resident in
|
||||
the current compiler tool.
|
||||
it sounds, because the project involves not only the original source text but
|
||||
also some extensions, and they may need kits of Inter code, which may need to
|
||||
be assimilated using pipelines, ... and so on. <a href="index.html" class="internal">supervisor</a> manages this:
|
||||
it finds such dependent resources, and sees that they are ready as needed.
|
||||
</p>
|
||||
|
||||
<p class="commentary">When included in <a href="../inform7/index.html" class="internal">inform7</a>, the Supervisor is given a single task which
|
||||
is always the same: build the current Inform 7 project. (See <a href="../core-module/1-mr.html" class="internal">Main Routine (in core)</a>.)
|
||||
But when included in <a href="../inbuild/index.html" class="internal">inbuild</a>, a much wider range of tasks can be asked for,
|
||||
as specified at the command line. (See <a href="../inbuild/1-mn.html" class="internal">Main (in inbuild)</a>.) In this discussion,
|
||||
"the parent" means the tool which is using <a href="index.html" class="internal">supervisor</a>, and might be either
|
||||
<a href="../inform7/index.html" class="internal">inform7</a> or <a href="../inbuild/index.html" class="internal">inbuild</a>.
|
||||
But when included in <a href="../inbuild/index.html" class="internal">inbuild</a>, it might be asked to perform quite a variety
|
||||
of tasks, sometimes several at once, as specified by the user at the command line.
|
||||
(See <a href="../inbuild/1-mn.html" class="internal">Main (in inbuild)</a>.) In this discussion, "the parent" means the tool which
|
||||
is using <a href="index.html" class="internal">supervisor</a>, and might be either <a href="../inform7/index.html" class="internal">inform7</a> or <a href="../inbuild/index.html" class="internal">inbuild</a>.
|
||||
</p>
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP3"></a><b>§3. </b><a href="index.html" class="internal">supervisor</a> has a relationship with its parent tool which involves to and
|
||||
|
@ -103,11 +108,9 @@ subsystems with further calls. But all modules do something like this.
|
|||
</li><li>(2) More unusually, when the parent is creating its command-line options, it
|
||||
should call <a href="1-ic.html#SP4" class="internal">Supervisor::declare_options</a> to add more. This allows all tools
|
||||
containing the Supervisor to offer a unified set of command-line options to
|
||||
configure it. (Compare <a href="../inform7/M-rc.html" class="internal">Reference Card (in inform7)</a> and <a href="../inbuild/M-rc.html" class="internal">Reference Card (in inbuild)</a>
|
||||
to see the effect.) When the parent is given a command-line switch that
|
||||
it doesn't recognise, it should call <a href="1-ic.html#SP8" class="internal">Supervisor::option</a> to handle that; and
|
||||
when the command line has been fully processed, it should call
|
||||
<a href="1-ic.html#SP9" class="internal">Supervisor::optioneering_complete</a>.
|
||||
configure it.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> When the parent is given a switch that it doesn't recognise,
|
||||
it should call <a href="1-ic.html#SP8" class="internal">Supervisor::option</a>; and when it has fully processed the
|
||||
command line, it should call <a href="1-ic.html#SP9" class="internal">Supervisor::optioneering_complete</a>.
|
||||
</li><li>(3) The parent can now, if it chooses, make calls into <a href="index.html" class="internal">supervisor</a> to set
|
||||
up additional dependencies. But eventually it will call <a href="1-ic.html#SP11" class="internal">Supervisor::go_operational</a>.
|
||||
The Supervisor is now ready for use!
|
||||
|
@ -120,6 +123,453 @@ on the copy representing the current Inform 7 project. But when <a href="../inbu
|
|||
is the parent, a variety of other functions may be made.
|
||||
</p>
|
||||
|
||||
<ul class="footnotetexts"><li class="footnote" id="fn:1"><p class="inwebfootnote"><sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> Compare <a href="../inform7/M-rc.html" class="internal">Reference Card (in inform7)</a> and <a href="../inbuild/M-rc.html" class="internal">Reference Card (in inbuild)</a>
|
||||
to see the effect.
|
||||
<a href="#fnref:1" title="return to text"> ↩</a></p></li></ul>
|
||||
<p class="commentary firstcommentary"><a id="SP4"></a><b>§4. Genre, work, edition, copy. </b>A "genre" is a category of software or artistic work for us to manage. For
|
||||
example, "Inform 7 extension" and "website template" are both genres. Each
|
||||
different genre is represented by an <a href="2-gnr.html#SP1" class="internal">inbuild_genre</a> object, whose method
|
||||
calls provide the behaviour distinctive to that genre. The currently seven
|
||||
genre objects are created during <a href="1-ic.html#SP3" class="internal">Supervisor::start</a>, which calls out to
|
||||
<a href="4-em.html#SP2" class="internal">ExtensionManager::start</a>, <a href="4-km.html#SP1" class="internal">KitManager::start</a>, and so on: the seven
|
||||
sections of <a href="4-em.html" class="internal">Chapter 4: Genre Management</a> are exactly the method calls for the seven genre
|
||||
objects.
|
||||
</p>
|
||||
|
||||
<p class="commentary">A "work" is a single artistic or programming creation; for example, the IF
|
||||
story Bronze by Emily Short might be a work. Each different one we deal with
|
||||
is represented by an <a href="2-wrk.html#SP1" class="internal">inbuild_work</a> object. Works are identified by genre,
|
||||
title and author name, but see <a href="2-wrk.html#SP4" class="internal">Works::normalise_casing</a> for exactly how.
|
||||
</p>
|
||||
|
||||
<p class="commentary">An "edition" is a versioned work; for example, release 7 of Bronze by Emily
|
||||
Short is an edition. These are represented by <a href="2-edt.html#SP1" class="internal">inbuild_edition</a> objects.
|
||||
Such objects carry with them a note of which virtual machine architectures
|
||||
they work with: see <a href="../arch-module/2-cmp.html" class="internal">Compatibility (in arch)</a> for more on this.
|
||||
</p>
|
||||
|
||||
<p class="commentary">A "copy" is an instance of an edition actually present somewhere in the file
|
||||
system — note that we might have several copies of the same edition in
|
||||
different places. Each copy known to the Supervisor is an <a href="2-cps.html#SP1" class="internal">inbuild_copy</a> object.
|
||||
</p>
|
||||
|
||||
<p class="commentary">When copies are claimed, they are typically scanned — exactly how depends
|
||||
on the genre — and this can reveal damage: if so, a <a href="2-ce.html#SP1" class="internal">copy_error</a> object is
|
||||
attached to the copy for each different defect turned up. These errors are not
|
||||
necessarily reported at once, or at all: if they are reported, the function
|
||||
<a href="2-ce.html#SP5" class="internal">CopyErrors::write</a> is used to write a suitable command-line error, but it's
|
||||
also possible for the parent to issue its own errors instead. <span class="extract"><span class="extract-syntax">inform7</span></span>
|
||||
does this to convert copy errors into Inform problem messages: see
|
||||
<a href="../core-module/2-pwst.html" class="internal">Problems With Source Text (in core)</a>.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup>
|
||||
</p>
|
||||
|
||||
<ul class="footnotetexts"><li class="footnote" id="fn:2"><p class="inwebfootnote"><sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> Note that because it is <a href="index.html" class="internal">supervisor</a> which causes source text to be read
|
||||
in, and not <a href="../core-module/index.html" class="internal">core</a>, lexical problems such as improperly paired comment
|
||||
brackets or overly long quoted strings will come to light as copy errors,
|
||||
as will blunders in identifying extensions. In general, though, a copy which
|
||||
has no copy errors is not necessarily a correct program: only one which is
|
||||
in good enough condition for the compiler to look at.
|
||||
<a href="#fnref:2" title="return to text"> ↩</a></p></li></ul>
|
||||
<p class="commentary firstcommentary"><a id="SP5"></a><b>§5. Searches and requirements. </b>Copies may be strewn all over the user's file system, and it's not for us to
|
||||
go poking around without being asked.<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup> Instead, the user will give the
|
||||
parent tool some locations at the command line: and those command-line
|
||||
instructions will be processed by <a href="index.html" class="internal">supervisor</a>. For example, if the user
|
||||
typed:
|
||||
</p>
|
||||
|
||||
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
|
||||
<span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-element-syntax">$</span><span class="ConsoleText-plain-syntax"> </span><span class="ConsoleText-function-syntax">inform7</span><span class="ConsoleText-identifier-syntax"> -internal</span><span class="ConsoleText-plain-syntax"> inform7/Internal</span><span class="ConsoleText-identifier-syntax"> -external</span><span class="ConsoleText-plain-syntax"> ~/mystuff</span><span class="ConsoleText-identifier-syntax"> -project</span><span class="ConsoleText-plain-syntax"> Tadpoles.inform</span>
|
||||
</pre>
|
||||
<p class="commentary">then all three command-line switches here would actually be parsed by
|
||||
<a href="1-ic.html#SP8" class="internal">Supervisor::option</a>, rather than by anything in the <a href="../core-module/index.html" class="internal">core</a> module.
|
||||
They would set the "internal" and "external" nest (see <a href="../inbuild/M-ui.html" class="internal">Manual (in inbuild)</a>),
|
||||
creating an <a href="2-nst.html#SP1" class="internal">inbuild_nest</a> object for each. The Inform 7 project for the
|
||||
run would also be set.<sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup> This would become whose genre is <span class="extract"><span class="ConsoleText-extract-syntax">project_bundle_genre</span></span>.
|
||||
</p>
|
||||
|
||||
<p class="commentary">Other copies would swiftly be needed — the definition of the English language
|
||||
(found inside the Internal nest), the Standard Rules extension, and several more.
|
||||
These are not explicitly named on the command line: instead, they are found by
|
||||
searching through the nests. <a href="index.html" class="internal">supervisor</a> does this by creating an
|
||||
<a href="2-rqr.html#SP1" class="internal">inbuild_requirement</a> object to specify what it wants, and then calling its
|
||||
search engine <a href="2-nst.html#SP7" class="internal">Nests::search_for</a>. This builds a list of <a href="2-nst.html#SP5" class="internal">inbuild_search_result</a>
|
||||
objects, each pointing to a new copy which matches the requirement given.
|
||||
</p>
|
||||
|
||||
<p class="commentary">Requirements can be quite flexible, and are converitble to and from text: see
|
||||
<a href="2-rqr.html#SP3" class="internal">Requirements::from_text</a> and <a href="2-rqr.html#SP6" class="internal">Requirements::write</a>.<sup id="fnref:5"><a href="#fn:5" rel="footnote">5</a></sup> The crucial routine
|
||||
here is <a href="2-rqr.html#SP7" class="internal">Requirements::meets</a>, which tests whether an edition meets the
|
||||
requirement.
|
||||
</p>
|
||||
|
||||
<ul class="footnotetexts"><li class="footnote" id="fn:3"><p class="inwebfootnote"><sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup> Indeed, such a scan would violate sandboxing restrictions, for example
|
||||
when <a href="index.html" class="internal">supervisor</a> is running as part of <a href="../inform7/index.html" class="internal">inform7</a> inside the MacOS Inform app.
|
||||
<a href="#fnref:3" title="return to text"> ↩</a></p></li><li class="footnote" id="fn:4"><p class="inwebfootnote"><sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup> The project, singular: see the Limitation note below.
|
||||
<a href="#fnref:4" title="return to text"> ↩</a></p></li><li class="footnote" id="fn:5"><p class="inwebfootnote"><sup id="fnref:5"><a href="#fn:5" rel="footnote">5</a></sup> A typical requirement might read, say, "genre=extension, author=Emily Short",
|
||||
which matches any extension by Emily Short.
|
||||
<a href="#fnref:5" title="return to text"> ↩</a></p></li></ul>
|
||||
<p class="commentary firstcommentary"><a id="SP6"></a><b>§6. </b>Although such searches can be used with vague requirements to scan for,
|
||||
say, everything with a given genre, they can also be used to seek specific
|
||||
pieces of software which we will need. <a href="2-nst.html#SP8" class="internal">Nests::search_for_best</a> is a version
|
||||
of the search engine which returns a single result (or none): the best one.
|
||||
Best is defined by <a href="2-nst.html#SP9" class="internal">Nests::better_result</a> and makes careful use of both
|
||||
semantic versioning and the user's intentions to ensure a happy outcome.
|
||||
For example, if an Inform project says
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Include Upturned Faces by Raphael.</p>
|
||||
</blockquote>
|
||||
|
||||
<p class="commentary">then <a href="2-nst.html#SP8" class="internal">Nests::search_for_best</a> will be used to seek which copy of this
|
||||
extension to use.
|
||||
</p>
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP7"></a><b>§7. Discovery. </b>A copy is "claimed" when it is found in the file system: either by being
|
||||
right where the user said it would be, or by a search.
|
||||
</p>
|
||||
|
||||
<p class="commentary">When the search engine wants to look for, say, kits in a given nest, it will
|
||||
ask the kit genre how to do this, by a method call: and this will be handled
|
||||
by <a href="4-km.html#SP5" class="internal">KitManager::search_nest_for</a>. That enables kits to be looked for in
|
||||
a different part of a nest than extensions, for example. Similarly, each
|
||||
genre scans and generally vets a copy differently, attaching copy errors
|
||||
for different reasons. But in general, a function like <a href="4-km.html#SP3" class="internal">KitManager::new_copy</a>
|
||||
will "claim" the copy.
|
||||
</p>
|
||||
|
||||
<p class="commentary">For most genres, we want each copy to be claimed only once. We might run
|
||||
into the copy of version 1.2 of <span class="extract"><span class="ConsoleText-extract-syntax">WorldModelKit</span></span> at <span class="extract"><span class="ConsoleText-extract-syntax">inform7/Internal/Inter</span></span>
|
||||
for multiple reasons, as a result of several different searches: we want to
|
||||
return the same <a href="2-cps.html#SP1" class="internal">inbuild_copy</a> object each time we do, rather than create
|
||||
duplicates. This is done with a dictionary of pathnames: i.e., the Kit
|
||||
Manager keeps a dictionary of which pathnames lead to copies it has already
|
||||
claimed. Most other managers do the same.
|
||||
</p>
|
||||
|
||||
<p class="commentary">But if a new <a href="2-cps.html#SP1" class="internal">inbuild_copy</a> is made, then we also give it a rich set of
|
||||
genre-specific metadata by attaching "content". In this case, that will be
|
||||
an <a href="5-ks.html#SP1" class="internal">inform_kit</a> object, and code in <a href="5-ks.html" class="internal">Kit Services</a> will provide
|
||||
special functionality by working on this <a href="5-ks.html#SP1" class="internal">inform_kit</a>. If <span class="extract"><span class="ConsoleText-extract-syntax">C</span></span> is a copy
|
||||
which is a kit, then <span class="extract"><span class="ConsoleText-extract-syntax">KitManager::from_copy(C)</span></span> produces its <a href="5-ks.html#SP1" class="internal">inform_kit</a>
|
||||
object <span class="extract"><span class="ConsoleText-extract-syntax">K</span></span>; conversely, <span class="extract"><span class="ConsoleText-extract-syntax">K->as_copy</span></span> produces <span class="extract"><span class="ConsoleText-extract-syntax">C</span></span> again. They correspond in
|
||||
a one-to-one fashion.
|
||||
</p>
|
||||
|
||||
<p class="commentary">This table summarises the genres, where they managed, what type of metadata
|
||||
object is attached to each copy of that genre, and where such metadata is
|
||||
handled. Note that the two Inform project genres — one for single files,
|
||||
one for whole bundles — share a metadata format: a project is a project,
|
||||
however it is managed on disc.
|
||||
</p>
|
||||
|
||||
<pre class="displayed-code all-displayed-code code-font">
|
||||
<span class="plain-syntax"> GENRE INSTANCE WHOSE METHODS ARE AT COPIES GET AN WHICH IS HANDLED BY</span>
|
||||
<span class="plain-syntax"> extension_genre </span><a href="4-em.html" class="internal">Extension Manager</a><span class="plain-syntax"> inform_extension </span><a href="5-es.html" class="internal">Extension Services</a>
|
||||
<span class="plain-syntax"> kit_genre </span><a href="4-km.html" class="internal">Kit Manager</a><span class="plain-syntax"> inform_kit </span><a href="5-ks.html" class="internal">Kit Services</a>
|
||||
<span class="plain-syntax"> language_genre </span><a href="4-lm.html" class="internal">Language Manager</a><span class="plain-syntax"> inform_language </span><a href="5-ls.html" class="internal">Language Services</a>
|
||||
<span class="plain-syntax"> pipeline_genre </span><a href="4-pm.html" class="internal">Pipeline Manager</a><span class="plain-syntax"> inform_pipeline </span><a href="5-ps.html" class="internal">Pipeline Services</a>
|
||||
<span class="plain-syntax"> project_bundle_genre </span><a href="4-pbm.html" class="internal">Project Bundle Manager</a><span class="plain-syntax"> inform_project </span><a href="5-ps2.html" class="internal">Project Services</a>
|
||||
<span class="plain-syntax"> project_file_genre </span><a href="4-pfm.html" class="internal">Project File Manager</a><span class="plain-syntax"> inform_project </span><a href="5-ps2.html" class="internal">Project Services</a>
|
||||
<span class="plain-syntax"> template_genre </span><a href="4-tm.html" class="internal">Template Manager</a><span class="plain-syntax"> inform_template </span><a href="5-ts.html" class="internal">Template Services</a>
|
||||
</pre>
|
||||
<p class="commentary firstcommentary"><a id="SP8"></a><b>§8. Limitation. </b>A pragmatic design choice in the Supervisor is that, although it can manage
|
||||
large numbers of copies and dependencies simultaneously — and often does,
|
||||
when managing extensions or kits, for example — it imposes one big limitation
|
||||
for simplicity's sake.
|
||||
</p>
|
||||
|
||||
<ul class="items"><li>(a) It can claim only one full-scale Inform 7 project in a single run.
|
||||
To find this, call <a href="1-ic.html#SP20" class="internal">Supervisor::project</a>, which returns the associated
|
||||
<a href="5-ps2.html#SP1" class="internal">inform_project</a> object. Of course, there doesn't have to be even one,
|
||||
in which case this returns <span class="extract"><span class="extract-syntax">NULL</span></span>.
|
||||
</li><li>(b) This can be built for just one virtual machine architecture in a single
|
||||
run. To find it, call <a href="1-ic.html#SP10" class="internal">Supervisor::current_vm</a>.
|
||||
</li><li>(c) There is consequently a single <span class="extract"><span class="extract-syntax">.Materials</span></span> directory to worry about —
|
||||
the one for the current project. Its pathname can be found by calling
|
||||
<a href="1-ic.html#SP15" class="internal">Supervisor::materials</a>.
|
||||
</li><li>(d) And because the search list of nests has to include the <span class="extract"><span class="extract-syntax">.Materials</span></span>
|
||||
directory as one of those nests, there is just one search list at a time.
|
||||
This can be found with <a href="1-ic.html#SP15" class="internal">Supervisor::nest_list</a>, while the nest designated
|
||||
as "internal" and "external" are <a href="1-ic.html#SP15" class="internal">Supervisor::internal</a> and <a href="1-ic.html#SP15" class="internal">Supervisor::external</a>.
|
||||
</li></ul>
|
||||
<p class="commentary">It would be more elegant not to impose these restrictions, but the result would
|
||||
seldom be more useful. It's easy enough to batch-run Inbuild with shell
|
||||
scripting to handle multiple projects; <span class="extract"><span class="extract-syntax">inform7</span></span> can only handle one project
|
||||
on each run anyway; and constantly having to specify which project we mean in
|
||||
function calls would involve much more passing of parameters around.
|
||||
</p>
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP9"></a><b>§9. Build graph. </b>See <a href="3-bg.html" class="internal">Build Graphs</a> for the infrastructure of how a dependency graph is stored.
|
||||
Basically these consist of <a href="3-bg.html#SP1" class="internal">build_vertex</a> objects joined together by edges,
|
||||
represented by lists of other vertices — each vertex has two lists, one of
|
||||
"use edges", the other of "build edges". See the manual at <a href="../inbuild/M-ui.html" class="internal">Using Inbuild (in inbuild)</a>
|
||||
for an explanation and examples.
|
||||
</p>
|
||||
|
||||
<p class="commentary">There are three "colours" of vertex: copy, file and requirement. Each copy
|
||||
vertex corresponds to a single <a href="2-cps.html#SP1" class="internal">inbuild_copy</a> and vice versa: thus, the
|
||||
dependencies for a copy are represented by the component of the graph which
|
||||
runs out from its vertex. File vertices correspond to single files needed
|
||||
during a build process, and requirement vertices to unfilled requirements,
|
||||
such as extensions which could not be found.
|
||||
</p>
|
||||
|
||||
<p class="commentary">The three colours of vertex are created by <a href="3-bg.html#SP3" class="internal">Graphs::copy_vertex</a>,
|
||||
<a href="3-bg.html#SP2" class="internal">Graphs::file_vertex</a> and <a href="3-bg.html#SP2" class="internal">Graphs::req_vertex</a> respectively, and the
|
||||
two colours of edge by <a href="3-bg.html#SP4" class="internal">Graphs::need_this_to_build</a> and <a href="3-bg.html#SP4" class="internal">Graphs::need_this_to_use</a>.
|
||||
</p>
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP10"></a><b>§10. </b>When are graphs actually built? It would be appealing to do this the moment a
|
||||
copy is claimed (i.e., as soon as the <a href="2-cps.html#SP1" class="internal">inbuild_copy</a> object is created),
|
||||
but this is impractical: it happens before we know enough about dependencies.
|
||||
So when a copy is claimed it gets an isolated copy vertex with no edges, as a
|
||||
placeholder.
|
||||
</p>
|
||||
|
||||
<p class="commentary">The answer in fact depends on genre. For pipelines, languages and website
|
||||
templates, there are no dependencies, so there's nothing to build. For kits
|
||||
and projects, the task is performed by <a href="4-km.html#SP7" class="internal">KitManager::construct_graph</a>,
|
||||
<a href="4-pbm.html#SP6" class="internal">ProjectBundleManager::construct_graph</a>, and <a href="4-pfm.html#SP6" class="internal">ProjectFileManager::construct_graph</a>
|
||||
respectively — though in fact those three functions simply pass the buck to
|
||||
<a href="5-ks.html#SP13" class="internal">Kits::construct_graph</a> and <a href="5-ps2.html#SP4" class="internal">Projects::construct_graph</a>.
|
||||
</p>
|
||||
|
||||
<p class="commentary">All of that happens when the Supervisor "goes operational", because
|
||||
<a href="1-ic.html#SP11" class="internal">Supervisor::go_operational</a> calls <a href="2-cps.html#SP8" class="internal">Copies::construct_graph</a> for
|
||||
every extant copy. The idea is that all the graphs need to be made before we
|
||||
can be ready to do any building.
|
||||
</p>
|
||||
|
||||
<p class="commentary">And yet... they are not, because extensions dependencies are missing from
|
||||
this account. Extensions have rich dependency graphs, but they are built
|
||||
on demand as the need arises, not at the going operational stage. This is
|
||||
becauses <a href="index.html" class="internal">supervisor</a> may have to deal with very large numbers of
|
||||
extension copies (for example, when performing a census inside the Inform
|
||||
app, or to install or copy extensions), and it takes significant computation
|
||||
to read and parse the full text of extensions.<sup id="fnref:6"><a href="#fn:6" rel="footnote">6</a></sup>
|
||||
</p>
|
||||
|
||||
<ul class="footnotetexts"><li class="footnote" id="fn:6"><p class="inwebfootnote"><sup id="fnref:6"><a href="#fn:6" rel="footnote">6</a></sup> Arguably the speed hit would be worth it for the gain in simplicity,
|
||||
except that there's also another obstacle: an extension's dependencies
|
||||
depend on the virtual machine they are to be used for. Some extensions
|
||||
claimed during searches will not be compatible with the current VM at all,
|
||||
and that's fine, since they won't be used: but we can't read their text in
|
||||
without throwing copy errors. We solve this by reading in only those
|
||||
extensions we will actually use, and that means building the graph only
|
||||
for those.
|
||||
<a href="#fnref:6" title="return to text"> ↩</a></p></li></ul>
|
||||
<p class="commentary firstcommentary"><a id="SP11"></a><b>§11. Reading source text. </b>For any copy, <a href="2-cps.html#SP7" class="internal">Copies::get_source_text</a> will instruct the Supervisor to
|
||||
read in the Inform source text associated with it — if any: this does nothing
|
||||
for languages, pipelines, website templates or kits. Text for a copy is read
|
||||
at most once, and is cached so that a second read produces the same result
|
||||
as the first.
|
||||
</p>
|
||||
|
||||
<p class="commentary">Reading is performed by <a href="5-ps2.html#SP5" class="internal">Projects::read_source_text_for</a> and
|
||||
<a href="5-es.html#SP3" class="internal">Extensions::read_source_text_for</a>. For extensions this involves reading
|
||||
only a single file, but for projects it can involve multiple files. Each
|
||||
such is read by a call to <a href="6-st.html#SP1" class="internal">SourceText::read_file</a>, which then sends out
|
||||
to the <a href="../words-module/index.html" class="internal">words</a> module to break the text file into a stream of words:
|
||||
see <a href="../words-module/3-tff.html" class="internal">Text From Files (in words)</a>. But it is <a href="6-st.html#SP1" class="internal">SourceText::read_file</a> which
|
||||
prints console messages like these:
|
||||
</p>
|
||||
|
||||
<pre class="ConsoleText-displayed-code all-displayed-code code-font">
|
||||
<span class="ConsoleText-plain-syntax"> I've now read your source text, which is 70 words long.</span>
|
||||
<span class="ConsoleText-plain-syntax"> I've also read Basic Inform by Graham Nelson, which is 7645 words long.</span>
|
||||
<span class="ConsoleText-plain-syntax"> I've also read English Language by Graham Nelson, which is 2328 words long.</span>
|
||||
<span class="ConsoleText-plain-syntax"> I've also read Standard Rules by Graham Nelson, which is 32123 words long.</span>
|
||||
</pre>
|
||||
<p class="commentary">Any lexical errors arising in <a href="../words-module/index.html" class="internal">words</a> are converted by us into copy errors
|
||||
and attached to the <a href="2-cps.html#SP1" class="internal">inbuild_copy</a> object for the extension or project.
|
||||
</p>
|
||||
|
||||
<p class="commentary">The text is not left as a simple stream of words, but is also "sentence-broken"
|
||||
into a syntax tree: that service is also one we subcontract out, to the
|
||||
<a href="../syntax-module/index.html" class="internal">syntax</a> module. (See <a href="../syntax-module/2-snt.html" class="internal">Sentences (in syntax)</a> for details of how.) Once
|
||||
again, syntax errors can arise, and once again, these are converted into
|
||||
copy errors.
|
||||
</p>
|
||||
|
||||
<p class="commentary">It might seem beyond the scope of a build manager to have to construct a
|
||||
syntax tree for the Inform source text it encounters. But (a) we have to do
|
||||
this to identify the Include ... sentences in them, and thus detect extension
|
||||
dependencies, and (b) the syntax tree is only a rudimentary one at this stage,
|
||||
parsing only a few "structural sentences".
|
||||
</p>
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP12"></a><b>§12. </b>The definition of "structural sentence" is given in the form of Preform grammar
|
||||
in <a href="6-st.html" class="internal">Source Text</a>. (Preform is the natural-language parsing engine provided
|
||||
by the <a href="../words-module/index.html" class="internal">words</a> module, and which the InC dialect of C provides a simple way
|
||||
to type into code.)
|
||||
</p>
|
||||
|
||||
<p class="commentary">For reasons which will become clear shortly, the sentences we care most about
|
||||
are extension inclusions and headings. Headings are sentences such as:
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Chapter the First - The Voyage</p>
|
||||
</blockquote>
|
||||
|
||||
<p class="commentary">These are detected for us by the sentence-breaker in <a href="../syntax-module/index.html" class="internal">syntax</a>, which
|
||||
calls out to our function <a href="6-hdn.html#SP11" class="internal">Headings::new</a> when it finds one. Each is
|
||||
given a <a href="6-hdn.html#SP2" class="internal">heading</a> object. We will do three things with headings:
|
||||
</p>
|
||||
|
||||
<ul class="items"><li>(1) Form them into a tree structure, to be able to determine quickly
|
||||
which is a subheading of which;
|
||||
</li><li>(2) Parse their bracketed caveats, such as "for use with ... only",
|
||||
which we will soon need — this is done by another Preform grammar; and
|
||||
</li><li>(3) Move content around to satisfy annotations such as "in place of...",
|
||||
though this stage is performed only later — see below.
|
||||
</li></ul>
|
||||
<p class="commentary firstcommentary"><a id="SP13"></a><b>§13. </b>What happens next involves is carefully timed. What we want is to look
|
||||
through for sentences like this one:
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Include Holy Bat Artefacts by Bruce Wayne.</p>
|
||||
</blockquote>
|
||||
|
||||
<p class="commentary">...so that we can see what extensions the project/extension we are reading
|
||||
will further need. And this is performed by the <a href="6-inc.html#SP1" class="internal">Inclusions::traverse</a>
|
||||
function, which crawls over the syntax tree looking for such. However, if
|
||||
an extension inclusion occurs under a heading in the source text like this one:
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Chapter 9 - External Files (not for Z-machine)</p>
|
||||
</blockquote>
|
||||
|
||||
<p class="commentary">and the current virtual machine doesn't meet stipulation, then we must ignore
|
||||
the inclusion and there's no dependency; and similarly:
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Section 1 - Figures (for figures language element only)</p>
|
||||
</blockquote>
|
||||
|
||||
<p class="commentary">Because of this, we make sure to call <a href="5-ps2.html#SP3" class="internal">Projects::activate_elements</a> before
|
||||
looking for inclusion sentences, in order to know whether or not, e.g., the
|
||||
figures language element is present.
|
||||
</p>
|
||||
|
||||
<p class="commentary">Worst of all is the case of an extension inclusion coming underneath a
|
||||
heading like this:
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Section 15 - Bolts (for use with Locksmith by Emily Short)</p>
|
||||
</blockquote>
|
||||
|
||||
<p class="commentary">We can only base the decision on whether we have so far included Locksmith.
|
||||
Otherwise, it would be easy to set up flip-flop like paradoxes where if X
|
||||
is not present, Y is present, and vice versa, leaving it a matter of chance
|
||||
which of those states actually happens.
|
||||
</p>
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP14"></a><b>§14. </b>At any rate, when <a href="6-inc.html#SP1" class="internal">Inclusions::traverse</a> finds an Include sentence which
|
||||
it decides is valid, it calls <a href="6-inc.html#SP5" class="internal">Inclusions::fulfill_request_to_include_extension</a>.
|
||||
This performs a search for the best compatible copy of the extension named —
|
||||
see above — and, once such a copy is found, calls <a href="6-inc.html#SP6" class="internal">Inclusions::load</a> to
|
||||
merge its text into the current syntax tree. (Note: it doesn't form an
|
||||
isolated syntax tree of its own.) This is why Inform reads the text of an
|
||||
extension as if it appeared at the same position as the Include sentence.
|
||||
</p>
|
||||
|
||||
<p class="commentary">When a valid Include is found, <a href="6-inc.html#SP5" class="internal">Inclusions::fulfill_request_to_include_extension</a>
|
||||
also puts a dependency edge in between the vertex for our copy and the vertex
|
||||
for the new extension's copy. That will be a use edge if our copy is also an
|
||||
extension — i.e., you can't use Existing Extension unless you also have
|
||||
New Extension — but a build edge if our copy is a project — i.e., you can't
|
||||
build Existing Project unless you also have New Extension.
|
||||
</p>
|
||||
|
||||
<p class="commentary">By the end of the process, therefore, all dependencies on or between extensions
|
||||
will have been added to the build graph.
|
||||
</p>
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP15"></a><b>§15. </b>Finally comes the complicated business of rearranging the syntax tree due
|
||||
to headings like:
|
||||
</p>
|
||||
|
||||
<blockquote>
|
||||
<p>Chapter 7a (in place of Chapter 7 in Applied Pathology by Attila Hun)</p>
|
||||
</blockquote>
|
||||
|
||||
<p class="commentary">This is performed by <a href="6-hdn.html#SP23" class="internal">Headings::satisfy_individual_heading_dependency</a>,
|
||||
and it has to be done after all the extension inclusions have been made. It's
|
||||
a step only performed for the syntax tree of a whole project: if we've just
|
||||
made an isolated tree for a single extension, we don't bother, because we
|
||||
couldn't compile that in isolation anyway.
|
||||
</p>
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP16"></a><b>§16. </b>This is all quite a long road, and the way is strewn with potential errors.
|
||||
What if a requested extension can't be found? Or is damaged? Or not compatible
|
||||
with our VM? Or if a heading is "in place of" one which isn't where it claimed?
|
||||
And so on. Such issues are converted into still more copy errors.
|
||||
</p>
|
||||
|
||||
<p class="commentary">If <a href="index.html" class="internal">supervisor</a> is running in the parent <a href="../inbuild/index.html" class="internal">inbuild</a>, then all errors are
|
||||
all issued to the console when text reading is complete. But if it is running
|
||||
in the parent <a href="../inform7/index.html" class="internal">inform7</a>, they are suppressed for now, and will be picked
|
||||
up later and issued as problem messages by <a href="../core-module/2-pwst.html" class="internal">Problems With Source Text (in core)</a>.
|
||||
</p>
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP17"></a><b>§17. </b>Now that we have read in the text of a project/extension, we know all of its
|
||||
dependencies on other extensions. If we were reading an extension, we now have
|
||||
its complete graph made, because it can only be dependent on other extensions.
|
||||
But a project also depends on kits of Inter codes, on a language definition,
|
||||
and so forth: and also on the files it draws its source text from. See
|
||||
<a href="5-ps2.html#SP4" class="internal">Projects::construct_graph</a> for the details.
|
||||
</p>
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP18"></a><b>§18. Incremental builds. </b>So, then, at this point we can determine the complete build graph for any copy.
|
||||
The parent can do several things:
|
||||
</p>
|
||||
|
||||
<ul class="items"><li>(a) Call <a href="2-cps.html#SP11" class="internal">Copies::show_graph</a>, or <a href="2-cps.html#SP11" class="internal">Copies::show_needs</a>, or <a href="2-cps.html#SP11" class="internal">Copies::show_missing</a>,
|
||||
to print out the graph, show what a project needs in order to be built, or
|
||||
show what it needs but doesn't currently have;
|
||||
</li><li>(b) Call <a href="2-cps.html#SP12" class="internal">Copies::archive</a> to make archived copies of all dependent resources;
|
||||
</li><li>(c) Or, the big one, call <a href="2-cps.html#SP10" class="internal">Copies::build</a> or <a href="2-cps.html#SP10" class="internal">Copies::rebuild</a> to perform
|
||||
a build.
|
||||
</li></ul>
|
||||
<p class="commentary">A "build" is incremental, and uses time-stamps of files to avoid unnecessary
|
||||
duplication of previous compilation work; a "rebuild" is not. They are otherwise
|
||||
the same, both calling <a href="3-ib.html#SP5" class="internal">IncrementalBuild::build</a>. This works rather like the
|
||||
traditional Unix tool <span class="extract"><span class="ConsoleText-extract-syntax">make</span></span>: if it wants to build the resource which a vertex
|
||||
represents, it first has to build the resources which that vertex depends on,
|
||||
i.e., has edges out to.
|
||||
</p>
|
||||
|
||||
<p class="commentary">How does one "build a vertex", though? The answer is that if a vertex has been
|
||||
given a <a href="3-bs.html#SP1" class="internal">build_script</a>, one follows this script. The script is only a list
|
||||
of <a href="3-bs2.html#SP3" class="internal">build_step</a> objects, and each step is an application of a <a href="3-bs2.html#SP1" class="internal">build_skill</a>.
|
||||
There are only a few skills known to the Supervisor, created by <a href="1-ic.html#SP3" class="internal">Supervisor::start</a>.
|
||||
For example, assimilating a kit is a skill; but the need to apply this skill to
|
||||
a particular copy of <span class="extract"><span class="ConsoleText-extract-syntax">WorldModelKit</span></span> is a build step.
|
||||
</p>
|
||||
|
||||
<p class="commentary">Some build steps can be carried out in two different ways: externally, by
|
||||
issuing a command to the shell; or internally, by calling a function in some
|
||||
module also present in the parent tool. The Supervisor chooses which way
|
||||
according to the <a href="3-bm.html#SP1" class="internal">build_methodology</a> object passed to <a href="3-ib.html#SP5" class="internal">IncrementalBuild::build</a>
|
||||
to configure how it should go about its business.
|
||||
</p>
|
||||
|
||||
<p class="commentary firstcommentary"><a id="SP19"></a><b>§19. Extension census. </b>That's basically everything except for a few special features to provide
|
||||
the Inform GUI apps with nice-looking documentation pages on installed
|
||||
extensions. These are constructed by a "census", when the parent calls
|
||||
<a href="7-ec.html#SP1" class="internal">Extensions::Census::new</a>. Copies for extensions are annotated with
|
||||
metadata on, for example, when they were last used, and such metadata is stored
|
||||
between runs in the <a href="7-ed.html" class="internal">Extension Dictionary</a>, and used as part of the
|
||||
<a href="7-ed2.html" class="internal">Extension Documentation</a> generated for the benefit of the Inform user
|
||||
interface apps.
|
||||
</p>
|
||||
|
||||
<nav role="progress"><div class="progresscontainer">
|
||||
<ul class="progressbar"><li class="progressprevoff">❮</li><li class="progresscurrentchapter">P</li><li class="progresscurrent">wtmd</li><li class="progresschapter"><a href="1-sm.html">1</a></li><li class="progresschapter"><a href="2-gnr.html">2</a></li><li class="progresschapter"><a href="3-bg.html">3</a></li><li class="progresschapter"><a href="4-em.html">4</a></li><li class="progresschapter"><a href="5-es.html">5</a></li><li class="progresschapter"><a href="6-st.html">6</a></li><li class="progresschapter"><a href="7-ed.html">7</a></li><li class="progressnext"><a href="1-sm.html">❯</a></li></ul></div>
|
||||
</nav><!--End of weave-->
|
||||
|
|
|
@ -227,7 +227,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<p class="sectionentry"><a href="5-ks.html">
|
||||
<spon class="sectiontitle">Kits</span></a> -
|
||||
<spon class="sectiontitle">Kit Services</span></a> -
|
||||
<span class="sectionpurpose">Behaviour specific to copies of the kit genre.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
|
|
|
@ -59,22 +59,22 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../syntax-module/index.html"><spon class="sectiontitle">shared/syntax</span></a>
|
||||
- <span class="sectionpurpose">A library of code to build a parse tree and break text into sentences.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -59,17 +59,17 @@
|
|||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<p class="purpose">Importing:</p>
|
||||
<p class="purpose">This program also incorporates the following web(s) as module(s):</p>
|
||||
<ul class="chapterlist">
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../words-module/index.html"><spon class="sectiontitle">shared/words</span></a>
|
||||
- <span class="sectionpurpose">A library of code for reading natural language into a stream of words.</span></p>
|
||||
</li>
|
||||
<li>
|
||||
<p class="chapterentry">
|
||||
<p class="moduleentry">
|
||||
<a href="../../../inweb/docs/foundation-module/index.html"><spon class="sectiontitle">inweb/foundation</span></a>
|
||||
- <span class="sectionpurpose">A library of common code used by all of the Inform tools.</span></p>
|
||||
- <span class="sectionpurpose">A library of utility functions for command-line tools.</span></p>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[Kits::] Kits.
|
||||
[Kits::] Kit Services.
|
||||
|
||||
Behaviour specific to copies of the kit genre.
|
||||
|
||||
|
|
|
@ -191,10 +191,10 @@ heading *Headings::from_node(parse_node *PN) {
|
|||
|
||||
@
|
||||
|
||||
@d NEW_HEADING_HANDLER Headings::new_heading
|
||||
@d NEW_HEADING_HANDLER Headings::new
|
||||
|
||||
=
|
||||
int Headings::new_heading(parse_node_tree *T, parse_node *new) {
|
||||
int Headings::new(parse_node_tree *T, parse_node *new) {
|
||||
heading *h = Headings::declare(T, new);
|
||||
#ifdef CORE_MODULE
|
||||
ParseTree::set_embodying_heading(new, h);
|
||||
|
|
|
@ -18,18 +18,17 @@ For more, see //foundation: A Brief Guide to Foundation//.
|
|||
@h The Supervisor and its Parent.
|
||||
The //supervisor// module is part of both //inform7// and //inbuild//, and acts
|
||||
as a build manager. To compile an Inform project is not so atomic a task as
|
||||
it sounds, because the project may need resources which themselves need to be
|
||||
built first, and so on. //supervisor// takes charge of this, issuing
|
||||
instructions as needed. It does so either "externally", by issuing shell
|
||||
commands, or "internally", by calling functions in other modules resident in
|
||||
the current compiler tool.
|
||||
it sounds, because the project involves not only the original source text but
|
||||
also some extensions, and they may need kits of Inter code, which may need to
|
||||
be assimilated using pipelines, ... and so on. //supervisor// manages this:
|
||||
it finds such dependent resources, and sees that they are ready as needed.
|
||||
|
||||
When included in //inform7//, the Supervisor is given a single task which
|
||||
is always the same: build the current Inform 7 project. (See //core: Main Routine//.)
|
||||
But when included in //inbuild//, a much wider range of tasks can be asked for,
|
||||
as specified at the command line. (See //inbuild: Main//.) In this discussion,
|
||||
"the parent" means the tool which is using //supervisor//, and might be either
|
||||
//inform7// or //inbuild//.
|
||||
But when included in //inbuild//, it might be asked to perform quite a variety
|
||||
of tasks, sometimes several at once, as specified by the user at the command line.
|
||||
(See //inbuild: Main//.) In this discussion, "the parent" means the tool which
|
||||
is using //supervisor//, and might be either //inform7// or //inbuild//.
|
||||
|
||||
@ //supervisor// has a relationship with its parent tool which involves to and
|
||||
fro: it's not as simple as single one-time call from the parent to //supervisor//
|
||||
|
@ -42,11 +41,9 @@ subsystems with further calls. But all modules do something like this.
|
|||
(2) More unusually, when the parent is creating its command-line options, it
|
||||
should call //Supervisor::declare_options// to add more. This allows all tools
|
||||
containing the Supervisor to offer a unified set of command-line options to
|
||||
configure it. (Compare //inform7: Reference Card// and //inbuild: Reference Card//
|
||||
to see the effect.) When the parent is given a command-line switch that
|
||||
it doesn't recognise, it should call //Supervisor::option// to handle that; and
|
||||
when the command line has been fully processed, it should call
|
||||
//Supervisor::optioneering_complete//.
|
||||
configure it.[1] When the parent is given a switch that it doesn't recognise,
|
||||
it should call //Supervisor::option//; and when it has fully processed the
|
||||
command line, it should call //Supervisor::optioneering_complete//.
|
||||
(3) The parent can now, if it chooses, make calls into //supervisor// to set
|
||||
up additional dependencies. But eventually it will call //Supervisor::go_operational//.
|
||||
The Supervisor is now ready for use!
|
||||
|
@ -57,3 +54,391 @@ at a given filing system location. When //inform7// is the parent, it follows
|
|||
the call to //Supervisor::go_operational// with a single call to //Copies::build//
|
||||
on the copy representing the current Inform 7 project. But when //inbuild//
|
||||
is the parent, a variety of other functions may be made.
|
||||
|
||||
[1] Compare //inform7: Reference Card// and //inbuild: Reference Card//
|
||||
to see the effect.
|
||||
|
||||
@h Genre, work, edition, copy.
|
||||
A "genre" is a category of software or artistic work for us to manage. For
|
||||
example, "Inform 7 extension" and "website template" are both genres. Each
|
||||
different genre is represented by an //inbuild_genre// object, whose method
|
||||
calls provide the behaviour distinctive to that genre. The currently seven
|
||||
genre objects are created during //Supervisor::start//, which calls out to
|
||||
//ExtensionManager::start//, //KitManager::start//, and so on: the seven
|
||||
sections of //Chapter 4// are exactly the method calls for the seven genre
|
||||
objects.
|
||||
|
||||
A "work" is a single artistic or programming creation; for example, the IF
|
||||
story Bronze by Emily Short might be a work. Each different one we deal with
|
||||
is represented by an //inbuild_work// object. Works are identified by genre,
|
||||
title and author name, but see //Works::normalise_casing// for exactly how.
|
||||
|
||||
An "edition" is a versioned work; for example, release 7 of Bronze by Emily
|
||||
Short is an edition. These are represented by //inbuild_edition// objects.
|
||||
Such objects carry with them a note of which virtual machine architectures
|
||||
they work with: see //arch: Compatibility// for more on this.
|
||||
|
||||
A "copy" is an instance of an edition actually present somewhere in the file
|
||||
system -- note that we might have several copies of the same edition in
|
||||
different places. Each copy known to the Supervisor is an //inbuild_copy// object.
|
||||
|
||||
When copies are claimed, they are typically scanned -- exactly how depends
|
||||
on the genre -- and this can reveal damage: if so, a //copy_error// object is
|
||||
attached to the copy for each different defect turned up. These errors are not
|
||||
necessarily reported at once, or at all: if they are reported, the function
|
||||
//CopyErrors::write// is used to write a suitable command-line error, but it's
|
||||
also possible for the parent to issue its own errors instead. |inform7|
|
||||
does this to convert copy errors into Inform problem messages: see
|
||||
//core: Problems With Source Text//.[1]
|
||||
|
||||
[1] Note that because it is //supervisor// which causes source text to be read
|
||||
in, and not //core//, lexical problems such as improperly paired comment
|
||||
brackets or overly long quoted strings will come to light as copy errors,
|
||||
as will blunders in identifying extensions. In general, though, a copy which
|
||||
has no copy errors is not necessarily a correct program: only one which is
|
||||
in good enough condition for the compiler to look at.
|
||||
|
||||
@h Searches and requirements.
|
||||
Copies may be strewn all over the user's file system, and it's not for us to
|
||||
go poking around without being asked.[1] Instead, the user will give the
|
||||
parent tool some locations at the command line: and those command-line
|
||||
instructions will be processed by //supervisor//. For example, if the user
|
||||
typed:
|
||||
= (text as ConsoleText)
|
||||
$ inform7 -internal inform7/Internal -external ~/mystuff -project Tadpoles.inform
|
||||
=
|
||||
then all three command-line switches here would actually be parsed by
|
||||
//Supervisor::option//, rather than by anything in the //core// module.
|
||||
They would set the "internal" and "external" nest (see //inbuild: Manual//),
|
||||
creating an //inbuild_nest// object for each. The Inform 7 project for the
|
||||
run would also be set.[2] This would become whose genre is |project_bundle_genre|.
|
||||
|
||||
Other copies would swiftly be needed -- the definition of the English language
|
||||
(found inside the Internal nest), the Standard Rules extension, and several more.
|
||||
These are not explicitly named on the command line: instead, they are found by
|
||||
searching through the nests. //supervisor// does this by creating an
|
||||
//inbuild_requirement// object to specify what it wants, and then calling its
|
||||
search engine //Nests::search_for//. This builds a list of //inbuild_search_result//
|
||||
objects, each pointing to a new copy which matches the requirement given.
|
||||
|
||||
Requirements can be quite flexible, and are converitble to and from text: see
|
||||
//Requirements::from_text// and //Requirements::write//.[3] The crucial routine
|
||||
here is //Requirements::meets//, which tests whether an edition meets the
|
||||
requirement.
|
||||
|
||||
[1] Indeed, such a scan would violate sandboxing restrictions, for example
|
||||
when //supervisor// is running as part of //inform7// inside the MacOS Inform app.
|
||||
|
||||
[2] The project, singular: see the Limitation note below.
|
||||
|
||||
[3] A typical requirement might read, say, "genre=extension, author=Emily Short",
|
||||
which matches any extension by Emily Short.
|
||||
|
||||
@ Although such searches can be used with vague requirements to scan for,
|
||||
say, everything with a given genre, they can also be used to seek specific
|
||||
pieces of software which we will need. //Nests::search_for_best// is a version
|
||||
of the search engine which returns a single result (or none): the best one.
|
||||
Best is defined by //Nests::better_result// and makes careful use of both
|
||||
semantic versioning and the user's intentions to ensure a happy outcome.
|
||||
For example, if an Inform project says
|
||||
|
||||
>> Include Upturned Faces by Raphael.
|
||||
|
||||
then //Nests::search_for_best// will be used to seek which copy of this
|
||||
extension to use.
|
||||
|
||||
@h Discovery.
|
||||
A copy is "claimed" when it is found in the file system: either by being
|
||||
right where the user said it would be, or by a search.
|
||||
|
||||
When the search engine wants to look for, say, kits in a given nest, it will
|
||||
ask the kit genre how to do this, by a method call: and this will be handled
|
||||
by //KitManager::search_nest_for//. That enables kits to be looked for in
|
||||
a different part of a nest than extensions, for example. Similarly, each
|
||||
genre scans and generally vets a copy differently, attaching copy errors
|
||||
for different reasons. But in general, a function like //KitManager::new_copy//
|
||||
will "claim" the copy.
|
||||
|
||||
For most genres, we want each copy to be claimed only once. We might run
|
||||
into the copy of version 1.2 of |WorldModelKit| at |inform7/Internal/Inter|
|
||||
for multiple reasons, as a result of several different searches: we want to
|
||||
return the same //inbuild_copy// object each time we do, rather than create
|
||||
duplicates. This is done with a dictionary of pathnames: i.e., the Kit
|
||||
Manager keeps a dictionary of which pathnames lead to copies it has already
|
||||
claimed. Most other managers do the same.
|
||||
|
||||
But if a new //inbuild_copy// is made, then we also give it a rich set of
|
||||
genre-specific metadata by attaching "content". In this case, that will be
|
||||
an //inform_kit// object, and code in //Kit Services// will provide
|
||||
special functionality by working on this //inform_kit//. If |C| is a copy
|
||||
which is a kit, then |KitManager::from_copy(C)| produces its //inform_kit//
|
||||
object |K|; conversely, |K->as_copy| produces |C| again. They correspond in
|
||||
a one-to-one fashion.
|
||||
|
||||
This table summarises the genres, where they managed, what type of metadata
|
||||
object is attached to each copy of that genre, and where such metadata is
|
||||
handled. Note that the two Inform project genres -- one for single files,
|
||||
one for whole bundles -- share a metadata format: a project is a project,
|
||||
however it is managed on disc.
|
||||
= (hyperlinked text)
|
||||
GENRE INSTANCE WHOSE METHODS ARE AT COPIES GET AN WHICH IS HANDLED BY
|
||||
extension_genre //Extension Manager// inform_extension //Extension Services//
|
||||
kit_genre //Kit Manager// inform_kit //Kit Services//
|
||||
language_genre //Language Manager// inform_language //Language Services//
|
||||
pipeline_genre //Pipeline Manager// inform_pipeline //Pipeline Services//
|
||||
project_bundle_genre //Project Bundle Manager// inform_project //Project Services//
|
||||
project_file_genre //Project File Manager// inform_project //Project Services//
|
||||
template_genre //Template Manager// inform_template //Template Services//
|
||||
=
|
||||
|
||||
@h Limitation.
|
||||
A pragmatic design choice in the Supervisor is that, although it can manage
|
||||
large numbers of copies and dependencies simultaneously -- and often does,
|
||||
when managing extensions or kits, for example -- it imposes one big limitation
|
||||
for simplicity's sake.
|
||||
|
||||
(a) It can claim only one full-scale Inform 7 project in a single run.
|
||||
To find this, call //Supervisor::project//, which returns the associated
|
||||
//inform_project// object. Of course, there doesn't have to be even one,
|
||||
in which case this returns |NULL|.
|
||||
(b) This can be built for just one virtual machine architecture in a single
|
||||
run. To find it, call //Supervisor::current_vm//.
|
||||
(c) There is consequently a single |.Materials| directory to worry about --
|
||||
the one for the current project. Its pathname can be found by calling
|
||||
//Supervisor::materials//.
|
||||
(d) And because the search list of nests has to include the |.Materials|
|
||||
directory as one of those nests, there is just one search list at a time.
|
||||
This can be found with //Supervisor::nest_list//, while the nest designated
|
||||
as "internal" and "external" are //Supervisor::internal// and //Supervisor::external//.
|
||||
|
||||
It would be more elegant not to impose these restrictions, but the result would
|
||||
seldom be more useful. It's easy enough to batch-run Inbuild with shell
|
||||
scripting to handle multiple projects; |inform7| can only handle one project
|
||||
on each run anyway; and constantly having to specify which project we mean in
|
||||
function calls would involve much more passing of parameters around.
|
||||
|
||||
@h Build graph.
|
||||
See //Build Graphs// for the infrastructure of how a dependency graph is stored.
|
||||
Basically these consist of //build_vertex// objects joined together by edges,
|
||||
represented by lists of other vertices -- each vertex has two lists, one of
|
||||
"use edges", the other of "build edges". See the manual at //inbuild: Using Inbuild//
|
||||
for an explanation and examples.
|
||||
|
||||
There are three "colours" of vertex: copy, file and requirement. Each copy
|
||||
vertex corresponds to a single //inbuild_copy// and vice versa: thus, the
|
||||
dependencies for a copy are represented by the component of the graph which
|
||||
runs out from its vertex. File vertices correspond to single files needed
|
||||
during a build process, and requirement vertices to unfilled requirements,
|
||||
such as extensions which could not be found.
|
||||
|
||||
The three colours of vertex are created by //Graphs::copy_vertex//,
|
||||
//Graphs::file_vertex// and //Graphs::req_vertex// respectively, and the
|
||||
two colours of edge by //Graphs::need_this_to_build// and //Graphs::need_this_to_use//.
|
||||
|
||||
@ When are graphs actually built? It would be appealing to do this the moment a
|
||||
copy is claimed (i.e., as soon as the //inbuild_copy// object is created),
|
||||
but this is impractical: it happens before we know enough about dependencies.
|
||||
So when a copy is claimed it gets an isolated copy vertex with no edges, as a
|
||||
placeholder.
|
||||
|
||||
The answer in fact depends on genre. For pipelines, languages and website
|
||||
templates, there are no dependencies, so there's nothing to build. For kits
|
||||
and projects, the task is performed by //KitManager::construct_graph//,
|
||||
//ProjectBundleManager::construct_graph//, and //ProjectFileManager::construct_graph//
|
||||
respectively -- though in fact those three functions simply pass the buck to
|
||||
//Kits::construct_graph// and //Projects::construct_graph//.
|
||||
|
||||
All of that happens when the Supervisor "goes operational", because
|
||||
//Supervisor::go_operational// calls //Copies::construct_graph// for
|
||||
every extant copy. The idea is that all the graphs need to be made before we
|
||||
can be ready to do any building.
|
||||
|
||||
And yet... they are not, because extensions dependencies are missing from
|
||||
this account. Extensions have rich dependency graphs, but they are built
|
||||
on demand as the need arises, not at the going operational stage. This is
|
||||
becauses //supervisor// may have to deal with very large numbers of
|
||||
extension copies (for example, when performing a census inside the Inform
|
||||
app, or to install or copy extensions), and it takes significant computation
|
||||
to read and parse the full text of extensions.[1]
|
||||
|
||||
[1] Arguably the speed hit would be worth it for the gain in simplicity,
|
||||
except that there's also another obstacle: an extension's dependencies
|
||||
depend on the virtual machine they are to be used for. Some extensions
|
||||
claimed during searches will not be compatible with the current VM at all,
|
||||
and that's fine, since they won't be used: but we can't read their text in
|
||||
without throwing copy errors. We solve this by reading in only those
|
||||
extensions we will actually use, and that means building the graph only
|
||||
for those.
|
||||
|
||||
@h Reading source text.
|
||||
For any copy, //Copies::get_source_text// will instruct the Supervisor to
|
||||
read in the Inform source text associated with it -- if any: this does nothing
|
||||
for languages, pipelines, website templates or kits. Text for a copy is read
|
||||
at most once, and is cached so that a second read produces the same result
|
||||
as the first.
|
||||
|
||||
Reading is performed by //Projects::read_source_text_for// and
|
||||
//Extensions::read_source_text_for//. For extensions this involves reading
|
||||
only a single file, but for projects it can involve multiple files. Each
|
||||
such is read by a call to //SourceText::read_file//, which then sends out
|
||||
to the //words// module to break the text file into a stream of words:
|
||||
see //words: Text From Files//. But it is //SourceText::read_file// which
|
||||
prints console messages like these:
|
||||
= (text as ConsoleText)
|
||||
I've now read your source text, which is 70 words long.
|
||||
I've also read Basic Inform by Graham Nelson, which is 7645 words long.
|
||||
I've also read English Language by Graham Nelson, which is 2328 words long.
|
||||
I've also read Standard Rules by Graham Nelson, which is 32123 words long.
|
||||
=
|
||||
Any lexical errors arising in //words// are converted by us into copy errors
|
||||
and attached to the //inbuild_copy// object for the extension or project.
|
||||
|
||||
The text is not left as a simple stream of words, but is also "sentence-broken"
|
||||
into a syntax tree: that service is also one we subcontract out, to the
|
||||
//syntax// module. (See //syntax: Sentences// for details of how.) Once
|
||||
again, syntax errors can arise, and once again, these are converted into
|
||||
copy errors.
|
||||
|
||||
It might seem beyond the scope of a build manager to have to construct a
|
||||
syntax tree for the Inform source text it encounters. But (a) we have to do
|
||||
this to identify the Include ... sentences in them, and thus detect extension
|
||||
dependencies, and (b) the syntax tree is only a rudimentary one at this stage,
|
||||
parsing only a few "structural sentences".
|
||||
|
||||
@ The definition of "structural sentence" is given in the form of Preform grammar
|
||||
in //Source Text//. (Preform is the natural-language parsing engine provided
|
||||
by the //words// module, and which the InC dialect of C provides a simple way
|
||||
to type into code.)
|
||||
|
||||
For reasons which will become clear shortly, the sentences we care most about
|
||||
are extension inclusions and headings. Headings are sentences such as:
|
||||
|
||||
>> Chapter the First - The Voyage
|
||||
|
||||
These are detected for us by the sentence-breaker in //syntax//, which
|
||||
calls out to our function //Headings::new// when it finds one. Each is
|
||||
given a //heading// object. We will do three things with headings:
|
||||
(1) Form them into a tree structure, to be able to determine quickly
|
||||
which is a subheading of which;
|
||||
(2) Parse their bracketed caveats, such as "for use with ... only",
|
||||
which we will soon need -- this is done by another Preform grammar; and
|
||||
(3) Move content around to satisfy annotations such as "in place of...",
|
||||
though this stage is performed only later -- see below.
|
||||
|
||||
@ What happens next involves is carefully timed. What we want is to look
|
||||
through for sentences like this one:
|
||||
|
||||
>> Include Holy Bat Artefacts by Bruce Wayne.
|
||||
|
||||
...so that we can see what extensions the project/extension we are reading
|
||||
will further need. And this is performed by the //Inclusions::traverse//
|
||||
function, which crawls over the syntax tree looking for such. However, if
|
||||
an extension inclusion occurs under a heading in the source text like this one:
|
||||
|
||||
>> Chapter 9 - External Files (not for Z-machine)
|
||||
|
||||
and the current virtual machine doesn't meet stipulation, then we must ignore
|
||||
the inclusion and there's no dependency; and similarly:
|
||||
|
||||
>> Section 1 - Figures (for figures language element only)
|
||||
|
||||
Because of this, we make sure to call //Projects::activate_elements// before
|
||||
looking for inclusion sentences, in order to know whether or not, e.g., the
|
||||
figures language element is present.
|
||||
|
||||
Worst of all is the case of an extension inclusion coming underneath a
|
||||
heading like this:
|
||||
|
||||
>> Section 15 - Bolts (for use with Locksmith by Emily Short)
|
||||
|
||||
We can only base the decision on whether we have so far included Locksmith.
|
||||
Otherwise, it would be easy to set up flip-flop like paradoxes where if X
|
||||
is not present, Y is present, and vice versa, leaving it a matter of chance
|
||||
which of those states actually happens.
|
||||
|
||||
@ At any rate, when //Inclusions::traverse// finds an Include sentence which
|
||||
it decides is valid, it calls //Inclusions::fulfill_request_to_include_extension//.
|
||||
This performs a search for the best compatible copy of the extension named --
|
||||
see above -- and, once such a copy is found, calls //Inclusions::load// to
|
||||
merge its text into the current syntax tree. (Note: it doesn't form an
|
||||
isolated syntax tree of its own.) This is why Inform reads the text of an
|
||||
extension as if it appeared at the same position as the Include sentence.
|
||||
|
||||
When a valid Include is found, //Inclusions::fulfill_request_to_include_extension//
|
||||
also puts a dependency edge in between the vertex for our copy and the vertex
|
||||
for the new extension's copy. That will be a use edge if our copy is also an
|
||||
extension -- i.e., you can't use Existing Extension unless you also have
|
||||
New Extension -- but a build edge if our copy is a project -- i.e., you can't
|
||||
build Existing Project unless you also have New Extension.
|
||||
|
||||
By the end of the process, therefore, all dependencies on or between extensions
|
||||
will have been added to the build graph.
|
||||
|
||||
@ Finally comes the complicated business of rearranging the syntax tree due
|
||||
to headings like:
|
||||
|
||||
>> Chapter 7a (in place of Chapter 7 in Applied Pathology by Attila Hun)
|
||||
|
||||
This is performed by //Headings::satisfy_individual_heading_dependency//,
|
||||
and it has to be done after all the extension inclusions have been made. It's
|
||||
a step only performed for the syntax tree of a whole project: if we've just
|
||||
made an isolated tree for a single extension, we don't bother, because we
|
||||
couldn't compile that in isolation anyway.
|
||||
|
||||
@ This is all quite a long road, and the way is strewn with potential errors.
|
||||
What if a requested extension can't be found? Or is damaged? Or not compatible
|
||||
with our VM? Or if a heading is "in place of" one which isn't where it claimed?
|
||||
And so on. Such issues are converted into still more copy errors.
|
||||
|
||||
If //supervisor// is running in the parent //inbuild//, then all errors are
|
||||
all issued to the console when text reading is complete. But if it is running
|
||||
in the parent //inform7//, they are suppressed for now, and will be picked
|
||||
up later and issued as problem messages by //core: Problems With Source Text//.
|
||||
|
||||
@ Now that we have read in the text of a project/extension, we know all of its
|
||||
dependencies on other extensions. If we were reading an extension, we now have
|
||||
its complete graph made, because it can only be dependent on other extensions.
|
||||
But a project also depends on kits of Inter codes, on a language definition,
|
||||
and so forth: and also on the files it draws its source text from. See
|
||||
//Projects::construct_graph// for the details.
|
||||
|
||||
@h Incremental builds.
|
||||
So, then, at this point we can determine the complete build graph for any copy.
|
||||
The parent can do several things:
|
||||
|
||||
(a) Call //Copies::show_graph//, or //Copies::show_needs//, or //Copies::show_missing//,
|
||||
to print out the graph, show what a project needs in order to be built, or
|
||||
show what it needs but doesn't currently have;
|
||||
(b) Call //Copies::archive// to make archived copies of all dependent resources;
|
||||
(c) Or, the big one, call //Copies::build// or //Copies::rebuild// to perform
|
||||
a build.
|
||||
|
||||
A "build" is incremental, and uses time-stamps of files to avoid unnecessary
|
||||
duplication of previous compilation work; a "rebuild" is not. They are otherwise
|
||||
the same, both calling //IncrementalBuild::build//. This works rather like the
|
||||
traditional Unix tool |make|: if it wants to build the resource which a vertex
|
||||
represents, it first has to build the resources which that vertex depends on,
|
||||
i.e., has edges out to.
|
||||
|
||||
How does one "build a vertex", though? The answer is that if a vertex has been
|
||||
given a //build_script//, one follows this script. The script is only a list
|
||||
of //build_step// objects, and each step is an application of a //build_skill//.
|
||||
There are only a few skills known to the Supervisor, created by //Supervisor::start//.
|
||||
For example, assimilating a kit is a skill; but the need to apply this skill to
|
||||
a particular copy of |WorldModelKit| is a build step.
|
||||
|
||||
Some build steps can be carried out in two different ways: externally, by
|
||||
issuing a command to the shell; or internally, by calling a function in some
|
||||
module also present in the parent tool. The Supervisor chooses which way
|
||||
according to the //build_methodology// object passed to //IncrementalBuild::build//
|
||||
to configure how it should go about its business.
|
||||
|
||||
@h Extension census.
|
||||
That's basically everything except for a few special features to provide
|
||||
the Inform GUI apps with nice-looking documentation pages on installed
|
||||
extensions. These are constructed by a "census", when the parent calls
|
||||
//Extensions::Census::new//. Copies for extensions are annotated with
|
||||
metadata on, for example, when they were last used, and such metadata is stored
|
||||
between runs in the //Extension Dictionary//, and used as part of the
|
||||
//Extension Documentation// generated for the benefit of the Inform user
|
||||
interface apps.
|
||||
|
|
Loading…
Reference in a new issue