Feoramund
e17fc8272b
Document rationale behind RegEx shorthand classes
2024-08-04 19:12:46 -04:00
Feoramund
dde42f0ebc
Add more documentation for core:text/regex API
2024-08-04 18:56:29 -04:00
Feoramund
ca7e46d56f
Add explicit test case for Capture pos
2024-08-04 18:56:29 -04:00
Feoramund
743480b1a4
Use regex.destroy for test captures
2024-08-04 18:56:29 -04:00
Feoramund
1ccb0b2558
Remove unused code
2024-08-04 18:56:29 -04:00
Feoramund
babdc432e9
Move Flag_To_Letter to core:text/regex/common
2024-08-04 18:56:25 -04:00
Feoramund
d3a51e208d
Hide Regular_Expression values
...
We don't directly support printing these.
To prevent future issues being raised about the pattern being missing if
someone tries to print one, hide everything.
2024-08-04 18:40:27 -04:00
Feoramund
cd8272557f
Test that a RegEx Capture pos corresponds to its groups
2024-08-04 18:33:36 -04:00
Feoramund
6252712363
Add missing features to regex package documentation
2024-08-04 13:21:13 -04:00
Feoramund
90f1f7fbdf
Use unaligned_store in regex too
2024-07-24 16:48:49 -04:00
Feoramund
ff492e615c
Use unaligned_load for regex virtual machine
...
This should hopefully avoid any issues with loading operands greater
than 8 bits on alignment-sensitive platforms.
2024-07-24 16:27:20 -04:00
Feoramund
042f6de478
Remove printing facilities for Regular_Expression
...
The `original_pattern` introduced a tenuous dependency to the expression
value as a whole, and after some consideration, I decided that it would
be better for the developer to manage their own pattern strings.
In the event you need to print the text representation of a pattern,
it's usually better that you manage the memory of it as well.
2024-07-24 16:27:20 -04:00
Feoramund
c52a8a5f86
Allow configuring of MAX_CAPTURE_GROUPS for n > 10
2024-07-24 16:27:08 -04:00
Feoramund
16b644ad79
Use slice.zero instead
2024-07-24 15:23:20 -04:00
Feoramund
e8537a3134
Add test cases for unclosed classes and repetition
...
Simplified error checking while I was at it, too.
2024-07-24 15:21:41 -04:00
Feoramund
e642be8550
Fix handling of unclosed regex classes and repetitions
2024-07-24 15:17:37 -04:00
Feoramund
b8f3d0fb53
Add core:text/regex to examples/all
2024-07-22 15:07:13 -04:00
Feoramund
be38ba6c5e
Add benchmarks for core:text/regex
2024-07-22 15:07:13 -04:00
Feoramund
3e49ceb82a
Add tests for core:text/regex
2024-07-22 15:07:13 -04:00
Feoramund
730e10bd6f
Support printing Regular_Expression in fmt
2024-07-22 14:25:12 -04:00
Feoramund
cb0704d51c
Add core:text/regex
2024-07-22 14:25:12 -04:00
Feoramund
b38237e8f0
Fix compiler crash when switching on no value
2024-07-14 14:59:00 -04:00
Feoramund
77d64a5461
Forbid $T= parameter from crashing compiler
...
Fixes #3883
2024-07-06 15:32:17 -04:00
Feoramund
bb6cbf6559
Fix SDL constants
2024-07-03 15:22:39 -04:00
Feoramund
8cd7fd95a3
Don't factor trailing zeroes into mantissa division
...
This should fix issues where `N00 / (pow+2)` results in a different number
than `N / pow`.
2024-06-30 22:18:25 -04:00
Feoramund
8e64265aed
Replace unneeded transmute
2024-06-30 16:39:22 -04:00
Feoramund
1e7dfd0e34
Add more core:net tests
...
- UDP send & read
- DNS resolution
- Nonblocking socket option
2024-06-30 16:39:22 -04:00
Feoramund
8ed5cb283b
Re-implement the error squiggles with visual width
2024-06-29 18:55:12 -04:00
Feoramund
8b305a4c67
Add UCG library to Odin compiler
2024-06-29 18:42:56 -04:00
Feoramund
b3caae6db4
Keep -vet happy
2024-06-28 23:14:03 -04:00
Feoramund
6496432b80
Add -vet-identical-cast
2024-06-28 23:14:03 -04:00
Feoramund
0ea0fac2f9
Call pthread_cancel on Darwin, with advisory comment
2024-06-28 20:47:37 -04:00
Feoramund
13539d3be1
Catch SIGTRAP in the test runner
...
Fixes `panic` for Darwin.
2024-06-28 19:43:03 -04:00
Feoramund
929cc48703
Merge Darwin signals into other UNIX-likes
...
They're all the same.
2024-06-28 19:03:43 -04:00
Feoramund
574342af6f
Let -vet be used with -define:ODIN_TEST_NAMES
2024-06-28 15:58:22 -04:00
Feoramund
2af121752a
Require base:runtime import in core:math/linalg
2024-06-28 11:34:35 -04:00
Feoramund
ba354e0524
Add documentation for write_decorated_table
2024-06-26 12:53:34 -04:00
Feoramund
f13d30ad23
Add write_decorated_table API
2024-06-26 12:50:43 -04:00
Feoramund
8b05ec1765
Add string caching example documentation
2024-06-24 15:11:43 -04:00
Feoramund
fbd609fa37
Add complete example showcasing Unicode support
2024-06-24 15:04:45 -04:00
Feoramund
f325a08e57
Make core:text/table examples more complete
...
They should be completely copy-and-paste friendly now, without the
assumption of someone using `using table`.
2024-06-24 15:04:45 -04:00
Feoramund
7a43404ea1
Add Width_Proc documentation
2024-06-24 15:04:45 -04:00
Feoramund
7da96c484d
Remove table.dirty
2024-06-24 14:28:05 -04:00
Feoramund
e397bdf11d
Let WIDTH_PROC be specified as proc argument to write_*_table
2024-06-24 13:38:59 -04:00
Feoramund
67b4cb0038
Crunch the ranges
2024-06-24 13:18:54 -04:00
Feoramund
ca58d7771b
Use new API from_nanoseconds in uuid
2024-06-22 18:36:42 -04:00
Feoramund
8a4a3ed66e
Change how Time is constructed in uuid
2024-06-22 18:21:32 -04:00
Feoramund
4481f9c695
Clarify some uuid legacy documentation
2024-06-22 18:21:32 -04:00
Feoramund
5a75cac5b9
Add API for creating custom version 8 UUIDs
2024-06-22 18:21:32 -04:00
Feoramund
e9b882be05
Add vendor-specific version 8 UUID generation (hashing)
2024-06-22 18:21:32 -04:00
Feoramund
859cbf7d72
Test if v1 and v6 UUID node is set correctly
2024-06-22 18:21:32 -04:00
Feoramund
d559feb701
Add uuid test for timestamps
2024-06-22 18:21:32 -04:00
Feoramund
f6344577d3
Add UUID sorting tests
2024-06-22 18:21:32 -04:00
Feoramund
339b2b23f6
Add unsafe_write to uuid package
2024-06-22 18:21:32 -04:00
Feoramund
8b8f8c7f7d
Address minor organizational issues
2024-06-22 18:21:32 -04:00
Feoramund
95a9c9b016
Fix indentation
2024-06-22 18:21:32 -04:00
Feoramund
9b3a104640
Add buffer-based to_string to uuid package
2024-06-22 18:21:32 -04:00
Feoramund
9b265b2309
Improve time-related API in uuid package
...
- Let timestamps be specified by the user.
- Change `time_v*` to `raw_time_v*` and implement an API that returns
timestamps from the `time` package.
2024-06-22 18:21:32 -04:00
Feoramund
ea771d0cb7
Update uuid package documentation
2024-06-22 18:21:31 -04:00
Feoramund
fcdba334ea
Require CSPRNG in UUID generation where applicable
2024-06-22 18:21:31 -04:00
Feoramund
3aa232a894
Move v3 and v5 UUID procs to uuid/legacy
2024-06-22 18:21:31 -04:00
Feoramund
9866b54d59
Add version 6 UUID generation
2024-06-22 18:21:31 -04:00
Feoramund
525bfca4ef
Add version 1 UUID generation
2024-06-22 18:21:31 -04:00
Feoramund
4cfbd83b10
Add version 7 UUID generation
2024-06-22 18:21:31 -04:00
Feoramund
fee81985b4
Make UUID namespaces @(rodata)
2024-06-22 18:21:31 -04:00
Feoramund
6da99b888a
Make UUID Identfier only a distinct byte array
2024-06-22 18:21:31 -04:00
Feoramund
31873ed466
Fix wrong comments
2024-06-22 18:21:31 -04:00
Feoramund
4dacddd85e
Add core:encoding/uuid
2024-06-22 18:21:27 -04:00
Feoramund
f58eded5d2
Fix print segfault by missing argument in or_* shadowed error
2024-06-22 11:45:43 -04:00
Feoramund
bf44a94065
Update core:text/table documentation
2024-06-20 18:22:03 -04:00
Feoramund
82d92dc46c
Use log.error instead of eprintf
2024-06-20 17:53:45 -04:00
Feoramund
b81458073e
Add new API to core:text/table
...
- `header/row_of_values`, same `header/row`, more verbose name
- `aligned_header/row_of_values`, set alignment for an entire row
- `header/row_of_aligned_values`, set alignment per value
2024-06-20 17:53:45 -04:00
Feoramund
585747bbbf
Clarify error message
2024-06-20 17:53:34 -04:00
Feoramund
99c955d124
Remove unneeded loc argument
2024-06-20 15:26:00 -04:00
Feoramund
fd28199178
Optimize printing of markdown tables
...
Check only once if the table has a header row, instead of every row.
2024-06-20 15:01:09 -04:00
Feoramund
dd099d9dd6
Add Unicode support to core:text/table
2024-06-20 15:01:09 -04:00
Feoramund
2241ca8e72
Use tabs to indent HTML tables
2024-06-20 13:06:32 -04:00
Feoramund
b66b960e7e
Don't build HTML tables
...
`build` only recalculates length and width information, and this is not
needed for HTML tables.
2024-06-20 13:06:32 -04:00
Feoramund
4a3684c5e8
Rename write_ascii_table to write_plain_table
2024-06-20 13:06:28 -04:00
Feoramund
1dfc89567e
Optimize default RNG for the common case
2024-06-20 11:27:51 -04:00
Feoramund
e620645a03
Measure East_Asian_Width during grapheme decoding
2024-06-19 22:35:36 -04:00
Feoramund
d4803583ff
Work around Windows test failure
...
I am uncertain why this works, but it does. Previously, `rtti_test` was
failing due to non-zero data appearing in the `l_buggy` `Buggy_Struct`.
The issue was caused by calling `runtime.default_random_generator` with
a pointer to the state, somehow. The pointer could be on the stack or in
the heap; it did not matter.
I found two workarounds.
- One is to move the RNG setup behind the call to `free_all`.
- The other is to construct the random generator manually.
Despite my digging and testing, I could find no reason as to why this
works or what the fundamental issue was to begin with. If anyone comes
upon this in the future with direct access to a Windows machine, I
recommend stepping through the program with a debugger to investigate
more deeply into why this happens.
2024-06-18 23:21:04 -04:00
Feoramund
e3f4772d01
Fix removal of temporary file in core:flags test
2024-06-18 11:06:49 -04:00
Feoramund
6b25d17ef9
Add missing imports to core test suite
2024-06-18 10:38:43 -04:00
Feoramund
0196cc46e3
Allow custom main when -no-entry-point is set
2024-06-18 01:49:55 -04:00
Feoramund
eb5a66c944
Forbid private test cases
2024-06-18 01:28:05 -04:00
Feoramund
9e4899d35c
Add tests for decode_grapheme_clusters
2024-06-17 21:57:32 -04:00
Feoramund
63973f431e
Make core:unicode letter procs @(require_results)
2024-06-17 21:57:32 -04:00
Feoramund
1620a69398
Add decode_grapheme_clusters to core:unicode/utf8
2024-06-17 21:57:32 -04:00
Feoramund
1a93dfd28f
Fix indentation
2024-06-17 13:24:47 -04:00
Feoramund
78a5a27212
Fix bit_set construction crash on constant non-integer field
2024-06-16 12:27:42 -04:00
Feoramund
8b31cddaba
Keep -vet happy
2024-06-15 15:49:05 -04:00
Feoramund
aab5338134
Add tests for core:math/rand
2024-06-15 15:49:05 -04:00
Feoramund
1a52cf1f1c
Use test's random generator
...
This removes the `create` calls when a test was only setting up a
generator, and it replaces them with `reset` when run in a loop.
2024-06-15 15:49:05 -04:00
Feoramund
5dfd303fd1
Setup default context.random_generator for tests
2024-06-15 15:44:56 -04:00
Feoramund
53140dca15
Fix default_random_generator_proc not using state
2024-06-15 12:54:30 -04:00
Feoramund
753516c392
Add ODIN_TEST_SHORT_LOGS define
...
Strips out the procedure, date, and time information, for when you just
need to know the file, line, and message.
2024-06-15 11:18:40 -04:00
Feoramund
f353adc7fb
Prefer log.error over fail_now in this case
2024-06-15 10:53:21 -04:00
Feoramund
bb823d5ba0
Make testing.fail_now divergent
...
This is in line with the old way it worked on Windows.
2024-06-15 10:53:21 -04:00
Feoramund
784408358d
Call cleanups after test signal
2024-06-15 10:46:47 -04:00