eyeprolog 1.3.86 → 1.3.87
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/package.json
CHANGED
package/src/iso.js
CHANGED
|
@@ -1756,15 +1756,6 @@ function writeOptionBoolean(value, env, option) {
|
|
|
1756
1756
|
return value.name === 'true';
|
|
1757
1757
|
}
|
|
1758
1758
|
|
|
1759
|
-
function writeOptionSpacing(value, env, option) {
|
|
1760
|
-
value = deref(value, env);
|
|
1761
|
-
if (value.type === VAR) throw new PrologError('instantiation_error');
|
|
1762
|
-
if (value.type !== ATOM || !['minimal', 'standard'].includes(value.name)) {
|
|
1763
|
-
throw new PrologError('domain_error(write_option)', copyResolved(option, env));
|
|
1764
|
-
}
|
|
1765
|
-
return value.name;
|
|
1766
|
-
}
|
|
1767
|
-
|
|
1768
1759
|
function writeVariableNames(value, env, option) {
|
|
1769
1760
|
value = deref(value, env);
|
|
1770
1761
|
if (value.type === VAR) throw new PrologError('instantiation_error');
|
|
@@ -1806,7 +1797,7 @@ function termWriteOptionsFromItems(options, env, mode = 'write_term', solver = n
|
|
|
1806
1797
|
else if (option.name === 'double_quotes' && !solver?.isoStrict) {
|
|
1807
1798
|
result.doubleQuotes = writeOptionBoolean(option.args[0], env, option);
|
|
1808
1799
|
} else if (option.name === 'spacing' && !solver?.isoStrict) {
|
|
1809
|
-
result.minimalOperatorSpacing =
|
|
1800
|
+
result.minimalOperatorSpacing = !writeOptionBoolean(option.args[0], env, option);
|
|
1810
1801
|
} else {
|
|
1811
1802
|
throw new PrologError('domain_error(write_option)', copyResolved(option, env));
|
|
1812
1803
|
}
|
|
@@ -124,7 +124,7 @@ families; `--iso-strict` is intended to remove their Part 1 interpretation.
|
|
|
124
124
|
| 5.5.9 Built-in predicates | EyeProlog libraries, CLP(Z), statistics, Part 3 `phrase/2-3`, and interop autoloaded predicates | Strict registry contains only the Part 1 + Corrigenda core registry. |
|
|
125
125
|
| 5.5.10 Evaluable functors | Normal mode additionally accepts the EyeProlog evaluable atom `e`; the remaining arithmetic functors accepted by strict mode are the Part 1 + Corrigenda set. | Strict mode rejects `e/0` as non-evaluable and retains the Corrigendum arithmetic additions. **covered** — strict extension-boundary regression plus `src/iso-arithmetic.js`. |
|
|
126
126
|
| 5.5.11 Reserved atoms | None | None. |
|
|
127
|
-
| Cor.3 5.5.12 Options | Extra library/host options may exist outside core option lists | Normal mode additionally accepts the EyeProlog `write_term/2-3` options `double_quotes(true|false)` and `spacing(
|
|
127
|
+
| Cor.3 5.5.12 Options | Extra library/host options may exist outside core option lists | Normal mode additionally accepts the EyeProlog `write_term/2-3` options `double_quotes(true|false)` and `spacing(true|false)`. `spacing(false)` emits only lexically required separators; `spacing(true)` adds conventional layout around operators. Strict core excludes these implementation-specific extensions and accepts only the Part 1 plus Corrigendum 3 write-option surface; unknown extension options raise `domain_error(write_option,...)`. |
|
|
128
128
|
|
|
129
129
|
Normal mode provides documented module and DCG compatibility profiles whose
|
|
130
130
|
features overlap standardized Part 2 and Part 3 facilities. They are extensions
|
package/test/run-iso-strict.mjs
CHANGED
|
@@ -285,13 +285,13 @@ export function runIsoStrict(reporter = new TestReporter()) {
|
|
|
285
285
|
|
|
286
286
|
const strictSpacingError = capture(() => run('', {
|
|
287
287
|
isoStrict: true,
|
|
288
|
-
goal: 'write_term(1+1,[spacing(
|
|
288
|
+
goal: 'write_term(1+1,[spacing(false)])',
|
|
289
289
|
}));
|
|
290
290
|
equal(strictSpacingError.formal, 'domain_error(write_option)', 'strict spacing extension rejection');
|
|
291
291
|
|
|
292
292
|
const normal = run('', { goal: 'write_term("ab",[double_quotes(true)])' });
|
|
293
293
|
includes(normal.stdout, '"ab"', 'normal-profile extension remains available');
|
|
294
|
-
includes(run('', { goal: 'write_term(1+1,[spacing(
|
|
294
|
+
includes(run('', { goal: 'write_term(1+1,[spacing(true)])' }).stdout,
|
|
295
295
|
'1 + 1', 'normal-profile spacing extension remains available');
|
|
296
296
|
});
|
|
297
297
|
|
package/test/run-regression.mjs
CHANGED
|
@@ -4078,8 +4078,8 @@ child.stdin.write(\`consult(${consultedAtom}).\\n\`);
|
|
|
4078
4078
|
run: () => {
|
|
4079
4079
|
const source = [
|
|
4080
4080
|
'emit :-',
|
|
4081
|
-
' write_term(1+1, [spacing(
|
|
4082
|
-
' write_term(1+1, [spacing(
|
|
4081
|
+
' write_term(1+1, [spacing(false)]), put_char(\'|\'),',
|
|
4082
|
+
' write_term(1+1, [spacing(true)]).',
|
|
4083
4083
|
'',
|
|
4084
4084
|
].join('\n');
|
|
4085
4085
|
assertEqual(run(source, { goal: 'emit' }).stdout, '1+1|1 + 1emit.\n',
|
|
@@ -4104,7 +4104,7 @@ child.stdin.write(\`consult(${consultedAtom}).\\n\`);
|
|
|
4104
4104
|
}
|
|
4105
4105
|
assertEqual(variableError?.formal, 'instantiation_error', 'variable spacing value');
|
|
4106
4106
|
|
|
4107
|
-
for (const value of ['
|
|
4107
|
+
for (const value of ['minimal', 'standard', '1', '0']) {
|
|
4108
4108
|
let domainError = null;
|
|
4109
4109
|
try {
|
|
4110
4110
|
run('', { goal: `write_term(1+1,[spacing(${value})])` });
|
package/the-art-of-eyeprolog.md
CHANGED
|
@@ -5439,11 +5439,11 @@ still retained where adjacent graphic tokens would otherwise merge, as in
|
|
|
5439
5439
|
`double_quotes(true|false)`: `true` lets eligible character/code lists use the
|
|
5440
5440
|
current `double_quotes` representation, while strict ISO mode rejects this
|
|
5441
5441
|
implementation-specific write option. Normal mode also accepts the
|
|
5442
|
-
implementation-specific `spacing(
|
|
5443
|
-
only separators required to avoid lexical ambiguity, while `
|
|
5442
|
+
implementation-specific boolean `spacing(true|false)` option: `false` emits
|
|
5443
|
+
only separators required to avoid lexical ambiguity, while `true` adds
|
|
5444
5444
|
conventional layout around operators. For example,
|
|
5445
|
-
`write_term(1+1,[spacing(
|
|
5446
|
-
`write_term(1+1,[spacing(
|
|
5445
|
+
`write_term(1+1,[spacing(false)])` emits `1+1` and
|
|
5446
|
+
`write_term(1+1,[spacing(true)])` emits `1 + 1`. The REPL always follows
|
|
5447
5447
|
the minimal-separator rule, so `X=1*1` is displayed as `X = 1*1`, while a
|
|
5448
5448
|
separator is retained in `X = a+ -b` because the adjacent graphic tokens would
|
|
5449
5449
|
otherwise merge. Strict ISO mode rejects both extension options.
|
|
@@ -6139,7 +6139,7 @@ the beginning. A peek does not mark the stream as past-end.
|
|
|
6139
6139
|
| `write(+Term)`, `write(+Stream,+Term)` | Writes readable operator notation without quoting atoms merely because quoting would be required for reparsing. Number variables are enabled. |
|
|
6140
6140
|
| `writeq(+Term)`, `writeq(+Stream,+Term)` | Like `write`, but quotes atoms when required for unambiguous input syntax. |
|
|
6141
6141
|
| `write_canonical(+Term)`, `write_canonical(+Stream,+Term)` | Writes quoted canonical functor notation while ignoring operators and without interpreting *$VAR/1*. |
|
|
6142
|
-
| `write_term(+Term,+Options)`, `write_term(+Stream,+Term,+Options)` | Writes with *quoted(true or false)*, *ignore_ops(true or false)*, *numbervars(true or false)*, and *variable_names([Name=Variable,...])*. Normal mode also supports *double_quotes(true or false)* and *spacing(
|
|
6142
|
+
| `write_term(+Term,+Options)`, `write_term(+Stream,+Term,+Options)` | Writes with *quoted(true or false)*, *ignore_ops(true or false)*, *numbervars(true or false)*, and *variable_names([Name=Variable,...])*. Normal mode also supports *double_quotes(true or false)* and *spacing(true or false)*. |
|
|
6143
6143
|
|
|
6144
6144
|
Term input uses the program's current operator table and the same ISO quoted-character
|
|
6145
6145
|
syntax as source text, including backslash-terminated octal and hexadecimal
|
|
@@ -7796,7 +7796,7 @@ Notable implementation boundaries are:
|
|
|
7796
7796
|
- `write_term/2-3` implements the Part 1 plus Corrigendum 3 `quoted/1`,
|
|
7797
7797
|
`ignore_ops/1`, `numbervars/1`, and `variable_names/1` option surface,
|
|
7798
7798
|
including option validation and traversal rules; normal mode also offers
|
|
7799
|
-
`double_quotes(true|false)` and `spacing(
|
|
7799
|
+
`double_quotes(true|false)` and `spacing(true|false)` as explicitly
|
|
7800
7800
|
implementation-specific extensions, which strict mode rejects;
|
|
7801
7801
|
- unification consistently performs an occurs check, rejecting rational-tree
|
|
7802
7802
|
bindings accepted as extensions by some systems.
|