Commit Graph

1017 Commits

Author SHA1 Message Date
Mark Thom
02c927bb83 Merge pull request #3241 from Skgland/parse-error-improvements
change `ParserError` type
2026-03-09 22:07:03 -07:00
Mark Thom
4a8388a6e9 Merge pull request #3189 from Skgland/fix-function_casts_as_integer
fix `function_casts_as_integer` warning
2026-03-09 22:06:33 -07:00
Thierry Marianne
4bd0ff0fcb cargo fmt fixes
Signed-off-by: Thierry Marianne <thierry@marianne.io>
2026-03-04 14:04:47 +01:00
Thierry Marianne
ed59aa05b0 apply suggestion
Signed-off-by: Thierry Marianne <thierry@marianne.io>
2026-03-04 14:01:17 +01:00
Thierry M.
fa21ff4813 use CStr .to_str() method
Co-authored-by: Bennet Bleßmann <3877590+Skgland@users.noreply.github.com>
2026-03-04 14:00:44 +01:00
Thierry Marianne
fae9ca1bb9 fix utf-8 panic
Signed-off-by: Thierry Marianne <thierry@marianne.io>
2026-03-04 12:45:58 +01:00
Skgland
18b476af28 make ParserError a struct with an enum kind field 2026-01-24 04:08:40 +01:00
Skgland
3343188756 replace pairs of usize with location struct 2026-01-24 04:08:40 +01:00
Mark Thom
1a8c4f9b03 cargo fmt fixes 2026-01-14 20:39:48 -08:00
Mark Thom
c2e1ded852 remove variant_hashing.rs and related instructions 2026-01-14 20:39:48 -08:00
Mark Thom
69a367d1c9 do not retain attributes in solutions of findall (#3020) 2026-01-14 20:39:48 -08:00
Mark Thom
e2bdf59c81 fix cargo fmt 2026-01-14 20:39:48 -08:00
Mark Thom
6284aa3a3f add variant_hash and is_non_variant to fix setof/3, bagof/3 2026-01-14 20:39:48 -08:00
Mark Thom
29cd80510b replace compare_term_test with parallel iterator, add is_not_variant 2026-01-14 20:39:45 -08:00
Mark Thom
9089f9ddb4 use branch numbers to detect branch subsumption 2026-01-14 20:34:06 -08: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
129cca53ed throw error(resource_error(memory), []) when the list length exceeds usize. 2025-12-10 00:04:24 +01: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
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
193cfabc66 detect recursive throw_resource_error and panic instead of causing a segmentation fault 2025-12-07 21:08:17 +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
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
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
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
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
Skgland
9376bc6369 fix mthom/scryer-prolog#3073 2025-09-27 22:48:05 +02:00
Thierry Marianne
042631cb4c run rustfmt
Signed-off-by: Thierry Marianne <thierry@marianne.io>
2025-09-21 22:52:12 +02:00
Thierry Marianne
32b6458deb dereferencing registers to access stack variables
deref register to access stack variable for `directory_exists/1`
deref register to access stack variable for `directory_files/2`
deref register to access stack variable for `delete_directory/1`
deref register to access stack variable for `delete_file/1`
deref registers to access stack variable for `file_copy/2`
deref register to access stack variable for `file_exists/1`
deref register to access stack variable for `file_size/2`
deref register to access stack variable from `file_time` function
deref register to access stack variable for `make_directory/1`
deref register to access stack variable for `make_directory_path/1`
deref register to access stack variable for `path_canonical/2`
deref registers to access stack variables for `rename_file/2`

Signed-off-by: Thierry Marianne <thierry@marianne.io>
2025-09-21 22:52:12 +02:00
Mark Thom
e9ff1348b1 Merge pull request #3084 from thierrymarianne/set_stream
Prevent top-level from panicking when calling  `set_input/1` with `Stream` variants.
2025-09-17 22:20:10 -07:00
Mark Thom
fc6e007ad1 add missing P increment to GetPartialString (#3089) 2025-09-17 20:31:03 -07:00
Mark Thom
ba7b54e8f8 fix attempted bind to bound StackVar (#3089) 2025-09-17 19:43:37 -07:00
Mark Thom
012e3de3a1 do not use self.fail in compare_term_test 2025-09-16 21:23:23 -07:00
Mark Thom
72cdba82f5 implement unify_ginteger to address FIXME in skip_max_list_cycle 2025-09-15 21:58:38 -07:00
Mark Thom
24f431e2ca fix off-by-one lam loop (#3081) 2025-09-15 21:52:43 -07:00