Commit Graph

4640 Commits

Author SHA1 Message Date
Mark Thom
16dc10ee96 assert rational(3) as true in tests/builtins.pl 2026-01-14 20:34:06 -08:00
Mark Thom
4e8f338870 Merge pull request #3222 from Skgland/reduce-instructions_template
move static parts of instructions template directly into instructions module, fix clippy and typos
2026-01-12 23:22:44 -07:00
Skgland
b14e363d5e run rustfmt to fix formatting 2026-01-10 18:31:40 +01:00
Bennet Bleßmann
87f89545bb restore accidentally removed comment 2026-01-10 18:30:09 +01:00
Skgland
5064760b1e fix spelling 2026-01-10 18:13:59 +01:00
Skgland
eca4262be6 fix clippy lints 2026-01-10 17:52:34 +01:00
Skgland
73c26bed2a extaract the static part of the instructions template directly into the instructions module
This way goto source doesn't end up in a generated file for those parts and they can be edited directly.
I have way too often accidentally edited the generated file.
2026-01-10 17:48:07 +01:00
Mark Thom
172b6a6f8f Merge pull request #3207 from Skgland/quote-fix-unquote-segv
"fix" segv from #3198, #3199, and #3205
2025-12-17 14:11:21 -07:00
Skgland
129cca53ed throw error(resource_error(memory), []) when the list length exceeds usize. 2025-12-10 00:04:24 +01:00
Mark Thom
cd1ed106ed Merge pull request #3177 from triska/use_phrase_to_file
use more recently available phrase_[to|from]_file/3 in example
2025-12-08 19:23:52 -07:00
Skgland
00aba96185 remove overengineered RecursionGuard 2025-12-08 22:27:24 +01:00
Skgland
616f071cd9 fix another integer overflow 2025-12-08 19:59:43 +01:00
Skgland
580572aec6 don't calculate panic message eagerly 2025-12-07 23:06:09 +01:00
Skgland
47e908bf76 handle overflown in Heap::with_cell_capacity 2025-12-07 22:59:00 +01:00
Skgland
11901b5fde handle oob heap index calculation 2025-12-07 21:45:13 +01:00
Skgland
d63b0a192c use checked multiplication in heap_index! macro 2025-12-07 21:31:24 +01:00
Skgland
2fc08dde1e prevent multiply with overflow resulting in odd errors/segv 2025-12-07 21:27:24 +01:00
Skgland
193cfabc66 detect recursive throw_resource_error and panic instead of causing a segmentation fault 2025-12-07 21:08:17 +01:00
Skgland
7c3ffd0e87 deny function_casts_as_integer warnings 2025-12-04 23:35:35 +01:00
Skgland
797a8f8611 fix function_casts_as_integer warning
Comparing addresses of function pointers is brittle.

Functions may be duplicated resulting in function pointers to the same function to compare !=.
Functions may be merged/de-duplicated resulting in function pointers to different function to compare ==.

The later shouldn't be relevant here as the function differ in behavior, but mentioning it for completeness.
2025-12-04 23:35:23 +01:00
Mark Thom
f570e566f8 fix backtrack_on_resource_error around choice instructions 2025-12-03 18:13:00 -08:00
Mark Thom
96a9dfcc1b Merge pull request #3185 from mthom/install_verify_attr_opt
Optimize `verify_attr` by removing the need to scan instructions
2025-12-03 19:10:46 -07:00
Mark Thom
6fdcd17f32 Merge pull request #3164 from Skgland/alloc_errors2
handle machine heap/stack allocation error
2025-12-03 19:10:22 -07:00
Mark Thom
652e824e59 Merge pull request #3147 from jjtolton/error-termination-flag
Add -t flag for custom toplevel (replaces --halt-on-error)
2025-12-02 00:24:46 -07:00
Mark Thom
f595eaee2e Merge pull request #3179 from triska/meetups
update meetups
2025-12-01 23:55:46 -07:00
Mark Thom
9ddeeed683 Merge pull request #3180 from triska/foldl_6
ADDED: foldl/6, addressing #2973
2025-12-01 23:55:34 -07:00
Mark Thom
b287f0aedb corrections to arithmetic expression compilation 2025-11-27 21:03:56 -08:00
Mark Thom
3b019fca1d corrections to dispatch loop 2025-11-27 21:03:22 -08:00
Mark Thom
4bd16b8a2e revise InstallVerifyAttrs to remove need for predicate scanning (#3175) 2025-11-25 23:17:51 -08:00
Mark Thom
f2e044e5b8 remove interms field from MachineState 2025-11-24 22:19:36 -08:00
Markus Triska
1cd55d8131 ADDED: foldl/6, addressing #2973 2025-11-23 11:13:57 +01:00
Markus Triska
14265118f1 update meetups 2025-11-23 10:29:31 +01:00
Markus Triska
b66824ffce use more recently available phrase_[to|from]_file/3 in example 2025-11-23 09:42:14 +01:00
Skgland
6ec8c9064f fix pstr_iter_tests test 2025-11-20 23:08:46 +01:00
Skgland
d4f2f7ba2b remove RESOURCE_ERROR_OFFSET_INIT
With it when using multiple Machine in one process only the first would store the pre-allocated error.
Instead Heap.resource_err_loc is now Option<NonZero<usize>> instead of usize using None for uninitialized.
The cell at index 0 should alredy be used by a runtime reserved interstitial cell that is allocated prior. So requiring the offset to be non zero should be fine.
2025-11-20 21:44:29 +01:00
Skgland
a05dc79505 fix unecessary parens in macro 2025-11-20 21:24:47 +01:00
Skgland
e90c813528 return an AllocError instead of panicing in Heap::with_cell_capacity 2025-11-20 21:13:17 +01:00
Skgland
516848e214 wrap resource_error into an error/2 functor and don't wrap it into a syntax_error functor 2025-11-20 01:22:18 +01:00
Skgland
6063783e9d propagate AllocErrro instead of unwrapping 2025-11-20 00:19:24 +01:00
Skgland
e9e97fe82a handle machine heap/stack allocation error 2025-11-19 22:17:24 +01:00
Skgland
5686b69013 stub a clippy config
with things we need to get rid of replace if we want to eliminate panics due to oom
2025-11-19 19:23:42 +01:00
Skgland
248b05c992 use as_bytes().to_vec() instead of bytes().collect()
copying a slice into a vec should be easier to optimize by the complier than collecting a byte iteration into a vec
2025-11-19 19:23:41 +01:00
Skgland
a283c8bdc2 remove some uncessary allocations/copies 2025-11-19 19:23:41 +01:00
Skgland
6b5ec3fab8 ignore incompatible msrv in compat module 2025-11-19 19:23:41 +01:00
Skgland
a0b4162d7a improve count_to_letter_code
- reserve the complete required length at the beginning to reduce reallocations
- use u8 instead of char so that we can re-use the allocation for the string
2025-11-19 19:23:41 +01:00
Skgland
119761ad10 ignore unused_parens warning
parens are generated by external macro
2025-11-18 21:42:00 +01:00
Skgland
bf8651db29 remove two unecessary clones 2025-11-18 21:29:22 +01:00
J.J. Tolton
11d0215963 Fix -t flag help text to reflect it accepts any goal
The -t flag is not limited to arity 0 predicates - it accepts any
goal including goals with arguments (e.g., -t 'halt(1)'). Updated
the help text to remove the incorrect "(arity 0 predicate)" constraint.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 10:55:49 -05:00
J.J. Tolton
16fd7a8d51 Move -t and -g flags before filenames in tests
Per maintainer feedback, switches must come before files to follow
the convention: switches before files are Scryer-specific, switches
after files are application-specific.
2025-11-09 13:04:59 -05:00
J.J. Tolton
5357ecf8e3 Remove redundant unit test file
The custom_toplevel.pl unit tests were trivial and didn't actually test
the functionality. All real testing is done via comprehensive CLI tests
in tests/scryer/cli/src_tests/custom_toplevel.md
2025-11-09 12:56:47 -05:00