eyeprolog 1.5.16 → 1.5.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/book/README.md +9 -9
- package/examples/book/chapter-39/{02-answer.pl → 01-answer.pl} +1 -1
- package/examples/book/chapter-39/{01-program.pl → 07-program.pl} +1 -1
- package/package.json +1 -1
- package/test/run-regression.mjs +38 -20
- package/the-art-of-eyeprolog.md +2685 -2650
- package/tools/generate-predicate-reference.mjs +7 -8
- /package/examples/book/chapter-39/{03-answer-2.pl → 02-answer-2.pl} +0 -0
- /package/examples/book/chapter-39/{04-answer-3.pl → 03-answer-3.pl} +0 -0
- /package/examples/book/chapter-39/{05-cost.pl → 04-cost.pl} +0 -0
- /package/examples/book/chapter-39/{06-message.pl → 05-message.pl} +0 -0
- /package/examples/book/chapter-39/{07-task.pl → 06-task.pl} +0 -0
package/examples/book/README.md
CHANGED
|
@@ -236,15 +236,15 @@ npm run generate
|
|
|
236
236
|
- [01-city.pl](chapter-38/01-city.pl)
|
|
237
237
|
- [02-look_ahead.pl](chapter-38/02-look_ahead.pl) — Part 3-oriented definite clause grammars
|
|
238
238
|
|
|
239
|
-
## Chapter 39:
|
|
240
|
-
|
|
241
|
-
- [01-
|
|
242
|
-
- [02-answer.pl](chapter-39/02-answer.pl)
|
|
243
|
-
- [03-answer-
|
|
244
|
-
- [04-
|
|
245
|
-
- [05-
|
|
246
|
-
- [06-
|
|
247
|
-
- [07-
|
|
239
|
+
## Chapter 39: Predicate reference
|
|
240
|
+
|
|
241
|
+
- [01-answer.pl](chapter-39/01-answer.pl) — Library relations by programming role
|
|
242
|
+
- [02-answer-2.pl](chapter-39/02-answer-2.pl)
|
|
243
|
+
- [03-answer-3.pl](chapter-39/03-answer-3.pl)
|
|
244
|
+
- [04-cost.pl](chapter-39/04-cost.pl)
|
|
245
|
+
- [05-message.pl](chapter-39/05-message.pl)
|
|
246
|
+
- [06-task.pl](chapter-39/06-task.pl)
|
|
247
|
+
- [07-program.pl](chapter-39/07-program.pl) — Specialized library implementation notes
|
|
248
248
|
|
|
249
249
|
## Chapter 40: Running EyeProlog: command line and corpus
|
|
250
250
|
|
package/package.json
CHANGED
package/test/run-regression.mjs
CHANGED
|
@@ -4804,6 +4804,25 @@ function documentationSyncCases() {
|
|
|
4804
4804
|
assertNotIncludes(section, '[Symbols](#predicate-reference-symbols)', 'predicate index does not rely on renderer-generated group anchors');
|
|
4805
4805
|
assertIncludes(section, 'stable numeric IDs instead of relying on Markdown heading-slug rules', 'renderer-independent predicate anchors');
|
|
4806
4806
|
assertIncludes(section, 'wrap naturally on narrow screens without horizontal scrolling', 'responsive predicate reference layout');
|
|
4807
|
+
|
|
4808
|
+
const chapter = between(book, '## 39. Predicate reference', '## 40. Running EyeProlog: command line and corpus');
|
|
4809
|
+
assertEqual(chapter.split('\n').some((line) => line.trimStart().startsWith('|')), false, 'Chapter 39 uses one wrapping stacked layout without Markdown tables');
|
|
4810
|
+
const orderedHeadings = [
|
|
4811
|
+
'### How to read this chapter',
|
|
4812
|
+
'### Core registry',
|
|
4813
|
+
'### Normal-mode extensions',
|
|
4814
|
+
'### Bundled libraries',
|
|
4815
|
+
'### Library relations by programming role',
|
|
4816
|
+
'### Interoperability, autoloading, and portability',
|
|
4817
|
+
'### Specialized library implementation notes',
|
|
4818
|
+
'### Complete predicate indicator reference',
|
|
4819
|
+
];
|
|
4820
|
+
let previous = -1;
|
|
4821
|
+
for (const heading of orderedHeadings) {
|
|
4822
|
+
const position = chapter.indexOf(heading);
|
|
4823
|
+
assertEqual(position > previous, true, `Chapter 39 section order: ${heading}`);
|
|
4824
|
+
previous = position;
|
|
4825
|
+
}
|
|
4807
4826
|
},
|
|
4808
4827
|
},
|
|
4809
4828
|
{
|
|
@@ -7564,7 +7583,7 @@ function bookReferenceDocumentationIssues() {
|
|
|
7564
7583
|
if (book.includes('EyeProlog does not perform it.')) {
|
|
7565
7584
|
issues.push('book contradicts implementation occurs-check behavior');
|
|
7566
7585
|
}
|
|
7567
|
-
for (const heading of ['## 38. Language and ISO profile', '## 39.
|
|
7586
|
+
for (const heading of ['## 38. Language and ISO profile', '## 39. Predicate reference', '## 40. Running EyeProlog: command line and corpus']) {
|
|
7568
7587
|
if (!book.includes(heading)) issues.push(`book is missing ${heading}`);
|
|
7569
7588
|
}
|
|
7570
7589
|
if (!guide.includes('[*The Art of EyeProlog*](../../the-art-of-eyeprolog.md) is the reference')) {
|
|
@@ -7811,26 +7830,31 @@ function registeredBuiltinSummary() {
|
|
|
7811
7830
|
|
|
7812
7831
|
function bookBuiltinNames() {
|
|
7813
7832
|
const book = fs.readFileSync(path.join(packageRoot, 'the-art-of-eyeprolog.md'), 'utf8');
|
|
7814
|
-
return documentedBuiltinNames(
|
|
7833
|
+
return documentedBuiltinNames(
|
|
7834
|
+
between(book, '<!-- eyeprolog-core-catalog:start -->', '<!-- eyeprolog-core-catalog:end -->'),
|
|
7835
|
+
);
|
|
7815
7836
|
}
|
|
7816
7837
|
|
|
7817
7838
|
function bookEyePrologLibraryNames() {
|
|
7818
7839
|
const book = fs.readFileSync(path.join(packageRoot, 'the-art-of-eyeprolog.md'), 'utf8');
|
|
7819
7840
|
const iso = new Set(registeredBuiltinNames());
|
|
7820
|
-
|
|
7821
|
-
|
|
7822
|
-
|
|
7823
|
-
|
|
7841
|
+
const section = between(book, '<!-- eyeprolog-library-catalog:start -->', '<!-- eyeprolog-library-catalog:end -->');
|
|
7842
|
+
const exports = section.split('\n')
|
|
7843
|
+
.filter((line) => line.trimStart().startsWith('**Exports:**'))
|
|
7844
|
+
.join('\n');
|
|
7845
|
+
return documentedBuiltinNames(exports).filter((indicator) => !iso.has(indicator));
|
|
7824
7846
|
}
|
|
7825
7847
|
|
|
7826
7848
|
function bookLibraryModuleIssues() {
|
|
7827
7849
|
const book = fs.readFileSync(path.join(packageRoot, 'the-art-of-eyeprolog.md'), 'utf8');
|
|
7828
7850
|
const section = between(book, '<!-- eyeprolog-library-catalog:start -->', '<!-- eyeprolog-library-catalog:end -->');
|
|
7829
7851
|
const documented = new Map();
|
|
7830
|
-
|
|
7831
|
-
|
|
7852
|
+
const lines = section.split('\n');
|
|
7853
|
+
for (let i = 0; i < lines.length; i++) {
|
|
7854
|
+
const match = lines[i].match(/^- \*\*`library\(([^)`]+)\)`\*\*/);
|
|
7832
7855
|
if (match == null) continue;
|
|
7833
|
-
|
|
7856
|
+
const exports = lines[i + 1] ?? '';
|
|
7857
|
+
documented.set(match[1], documentedBuiltinNames(exports));
|
|
7834
7858
|
}
|
|
7835
7859
|
|
|
7836
7860
|
const issues = [];
|
|
@@ -7864,18 +7888,12 @@ function bookBuiltinSummary() {
|
|
|
7864
7888
|
return { entries: Number(match[1]), names: Number(match[2]) };
|
|
7865
7889
|
}
|
|
7866
7890
|
|
|
7867
|
-
function documentedBuiltinNames(section
|
|
7891
|
+
function documentedBuiltinNames(section) {
|
|
7868
7892
|
const names = [];
|
|
7869
|
-
for (const
|
|
7870
|
-
|
|
7871
|
-
|
|
7872
|
-
|
|
7873
|
-
const arity = match[2].trim() === '' ? 0 : match[2].split(',').length;
|
|
7874
|
-
names.push(`${match[1]}/${arity}`);
|
|
7875
|
-
}
|
|
7876
|
-
for (const match of catalogCell.matchAll(/`([^`\s]+)\/(\d+)`/g)) {
|
|
7877
|
-
names.push(`${match[1]}/${match[2]}`);
|
|
7878
|
-
}
|
|
7893
|
+
for (const match of section.matchAll(/`([^`]+)`/g)) {
|
|
7894
|
+
const indicator = match[1].match(/^(.+)\/(\d+)$/);
|
|
7895
|
+
if (indicator == null) continue;
|
|
7896
|
+
names.push(`${indicator[1]}/${indicator[2]}`);
|
|
7879
7897
|
}
|
|
7880
7898
|
return [...new Set(names)].sort();
|
|
7881
7899
|
}
|