Christoffer Lerno
3e4d1de70e
Fix issue requiring prefix on a generic interface declaration.
2025-01-16 22:09:53 +01:00
Taylor W
660654f9e0
math_tests: pow test ( #1842 )
...
* math::nolibc: replaced code with word macros
* math_tests: pow test
Added test for pow and added more test points for the exp and log tests.
2025-01-15 13:35:18 +01:00
Christoffer Lerno
2f7d18bfb8
Quicksort and insertsort incorrectly allowing arrays and vectors by value. #1845 .
2025-01-15 13:31:29 +01:00
Christoffer Lerno
7b2fe92241
Improve error message on incorrect inner struct/union name #1847 .
2025-01-15 10:54:50 +01:00
Christoffer Lerno
70da1f748a
Enum associated declarations accidentally allowed declaration in function style. #1841
2025-01-14 23:06:17 +01:00
Christoffer Lerno
3033295884
Fix bug with enums with jump tables #1840 also affecting ranged enums entries.
2025-01-14 22:47:12 +01:00
Christoffer Lerno
8c12f92aff
Make stringify to recursively enter #hash expressions #1834 .
2025-01-14 12:40:42 +01:00
Christoffer Lerno
5ba9acad5d
Fix bug where &i[0] = null was not detected to be an error. #1833
2025-01-14 01:43:59 +01:00
Taylor W
259112e178
math: macros to set floating-point numbers with uint ( #1826 )
...
* math: Setting the bits of floating-point numbers
Added macros which set all 32 bits of a float, the lower 32 bits of
a double, and the upper 32 bits of a double. Some changes were made to
older code to use these macros.
* Replaced code with bitsetting macros in __tan.c3 and tan.c3
* math: tests for word macros and release notes
Tests were written for the word macros, which include getting and
setting a float with a uint and getting and setting the high or low word
of a double with a uint.
Release notes were updated to include the word setter macros.
2025-01-13 13:37:49 +01:00
konimarti
0e44e63fa8
net/url: implement url encoding (RFC 3986) ( #1795 )
...
* net/url: implement url encoding (RFC 3986)
Implement url percent-encoding and -decoding functions according to RFC
3986. Add unit tests.
Link: https://datatracker.ietf.org/doc/html/rfc3986
* net/url: ensure correct encoding of URL components
Add encoding and decoding methods to the Url struct components according
to RFC 3986.
An Url can be parsed from a String with `new_parse()` or `temp_parse()`.
The parsed fields are decoded. The only field that is not decoded is
`raw_query`. To access the decoded query values, use
`Url.query_values()`.
`Url.to_string()` will re-assemble the fields into a valid Url string
with proper percent-encoded values.
If the Url struct fields are filled in manually, use the actual
(un-encoded) values. To create a raw query string, initialize an
`UrlQueryValues` map, use `UrlQueryValues.add()` to add the query
parameters and, finally, call `UrlQueryValues.to_string()`.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-01-12 22:52:25 +01:00
Christoffer Lerno
4e78e32ced
Fix regression with contract docs and generics #1821
2025-01-12 14:19:19 +01:00
Christoffer Lerno
f65ca07b62
Fix bug when multiple $else clauses followed an $if #1824 .
2025-01-12 13:31:35 +01:00
Christoffer Lerno
a863d7fe9e
Prevent #hash arguments from taking code that modifies ct variables. #1794
2025-01-12 02:20:18 +01:00
Christoffer Lerno
f60bfa8442
Assert concatenating constant slices #1805 . Do not link "ld" on Linux with no libc.
2025-01-11 23:46:08 +01:00
Christoffer Lerno
50fdf9900d
Regression: Broken type of constant initialized with cast from bitstruct #1811
2025-01-11 23:17:38 +01:00
Christoffer Lerno
8785c2c46f
Assert when partially initializing a constant struct containing a slice #1812 .
2025-01-11 22:42:33 +01:00
Christoffer Lerno
c8fa7b0cb3
Fix regression with swizzle references for vectors #1810 .
2025-01-11 21:36:17 +01:00
Christoffer Lerno
f2e69f8fdc
Fix bug with defer assignment in macro #1807 .
2025-01-11 20:48:53 +01:00
Christoffer Lerno
8a9edc02b6
Fix bug preventing compile time slices from being iterated over with $foreach.
2025-01-11 03:23:03 +01:00
Christoffer Lerno
d173ba0377
More tests.
2025-01-11 01:51:34 +01:00
Christoffer Lerno
1f29110271
Handle bytes and strings the same way in terms of zero termination.
2025-01-10 19:58:00 +01:00
Louis Brauer
c8c58f946c
Date/Time formatters ( #1782 )
...
* Add .DS_Store to .gitignore
* Allow <= 999_999 as usec on DateTime (was < 999_999)
* Move [Tz]DateTime .format() to std::time::datetime and import only with libc
* Changed name to DateTimeFormat, prefer function over method. Move names to enum.
* Updated tests to the latest standard.
---------
Co-authored-by: Christoffer Lerno <christoffer@aegik.com >
2025-01-10 13:16:51 +01:00
Christoffer Lerno
b941f93416
Deprecate old void! @benchmark and @test functions.
2025-01-09 20:33:53 +01:00
Christoffer Lerno
c22b7d45c1
Update test failing on LLVM 17
2025-01-09 01:35:16 +01:00
Christoffer Lerno
cdc1656f3a
#foo style arguments were not type checked when given a type. #1790
2025-01-09 01:28:30 +01:00
Christoffer Lerno
8fb3ec73ff
Deprecate $varef.
2025-01-08 23:56:10 +01:00
Christoffer Lerno
214e806a33
Deprecate `fn void! main() type main functions.
2025-01-08 23:17:50 +01:00
Christoffer Lerno
8e0d6d11b9
Deprecated '&' macro arguments.
2025-01-08 22:13:49 +01:00
Christoffer Lerno
dad97fc2d9
Improved #foo resolution inside of the compiler.
...
Deprecation of several `&` macros.
2025-01-08 12:55:20 +01:00
Christoffer Lerno
51e0e5e66d
Change ordering to simplify adding methods to type in conditional modules.
2025-01-06 22:36:29 +01:00
Christoffer Lerno
34c7f4e6b7
Deref subscripts as needed for macro ref method arguments. #1789
2025-01-06 13:54:02 +01:00
Christoffer Lerno
f801372074
Optimize temp variables in LLVM.
2025-01-06 04:25:47 +01:00
Christoffer Lerno
ea2dce0ab4
Make "?:" lower in the frontend.
2025-01-06 03:01:13 +01:00
Christoffer Lerno
314c6f94f0
Remove the last "cast" operations.
2025-01-06 01:51:03 +01:00
Louis Brauer
35812bd7ba
Add String.trim_left() / right() ( #1773 )
...
* Add String.trim_left() / right()
* Fix formatting
2025-01-05 21:53:18 +01:00
Christoffer Lerno
f1ef2e8138
Improve @param parse errors #1777
2025-01-05 18:14:30 +01:00
Christoffer Lerno
ab2d223e71
Macros with trailing bodys aren't allowed as the single statement after a while loop with no body #1772 .
2025-01-05 16:00:39 +01:00
Christoffer Lerno
c6c7baa3b4
Refactor casts, removing SLBOOL and PTRBOOL.
2025-01-05 15:45:39 +01:00
Christoffer Lerno
07c59e6a6c
Fix +a = 1 erronously being accepted. Refactorings.
2025-01-05 02:24:11 +01:00
Christoffer Lerno
9957ab259c
Fix vector float -> bool conversion.
2025-01-04 23:16:34 +01:00
Christoffer Lerno
6f9b466d7c
Optimize recast.
2025-01-04 21:58:04 +01:00
Christoffer Lerno
e31e57c7e7
Improved error message when accessing @private from other modules. Added convenience functions to Maybe.
2025-01-04 14:58:06 +01:00
Christoffer Lerno
469188044d
Assert on certain slice to slice casts. #1768 .
2025-01-04 13:31:47 +01:00
Christoffer Lerno
a1ce5e15ce
Fix tests.
2025-01-04 00:09:24 +01:00
Christoffer Lerno
d84e131b73
Add 'warnings' setting.
2025-01-03 23:37:37 +01:00
Christoffer Lerno
ad1511e69c
Prohibit raw vaargs in regular functions with a function body.
2025-01-03 15:36:42 +01:00
Christoffer Lerno
db4dc114f2
$vasplat was allowed inside of a function when passed as an argument to a function.
2025-01-03 15:01:24 +01:00
Christoffer Lerno
a7f363ea43
Dynamic function lookup fails after changing type without dummy anycast due to poor tracing of typeid. #1761
2025-01-03 14:39:01 +01:00
Christoffer Lerno
a3d15fe16c
Fix issue with zero arg @operator(construct). Assert on add to uninitialized ct variable #1765
2025-01-03 11:45:46 +01:00
Christoffer Lerno
56d25cdeeb
Remove array->vector casts
2025-01-03 01:35:51 +01:00