0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std/unicode.zig

2182 lines
84 KiB

2019-12-28 14:45:52 +11:00
2018-04-25 14:59:03 +10:00
2018-01-31 22:48:40 -05:00
2018-04-25 14:59:03 +10:00
2018-04-25 14:59:03 +10:00
2019-12-28 14:45:52 +11:00
2018-04-25 14:59:03 +10:00
2019-12-28 14:45:52 +11:00
2018-04-25 14:59:03 +10:00
2019-12-28 14:45:52 +11:00
2018-04-25 14:59:03 +10:00
2019-12-28 14:45:52 +11:00
2018-02-23 21:20:15 +13:00
2024-02-14 06:05:01 +01:00
2024-02-14 06:05:01 +01:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-12-01 02:14:17 -05:00
2018-02-23 21:20:15 +13:00
2018-02-23 21:20:15 +13:00
2018-05-30 16:09:11 -04:00
2018-02-23 21:20:15 +13:00
2019-12-28 14:45:52 +11:00
2018-02-23 21:20:15 +13:00
2020-06-17 06:04:08 -05:00
2018-02-23 21:20:15 +13:00
2018-08-21 16:07:28 -04:00
2021-07-01 22:23:10 -06:00
2018-08-21 16:07:28 -04:00
2018-04-25 14:59:03 +10:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2021-05-04 20:47:26 +03:00
2018-04-25 14:59:03 +10:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2018-02-23 21:20:15 +13:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2020-06-17 06:04:08 -05:00
2021-05-04 20:47:26 +03:00
2020-06-17 06:04:08 -05:00
2021-05-04 20:47:26 +03:00
2020-06-17 06:04:08 -05:00
2020-06-17 06:04:08 -05:00
2020-06-17 06:04:08 -05:00
2021-05-04 20:47:26 +03:00
2020-06-17 06:04:08 -05:00
2020-06-17 06:04:08 -05:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2019-12-28 14:45:52 +11:00
2021-05-04 20:47:26 +03:00
2024-02-14 06:05:01 +01:00
Full response file (*.rsp) support I hit the "quotes in an RSP file" issue when trying to compile gRPC using "zig cc". As a fun exercise, I decided to see if I could fix it myself. I'm fully open to this code being flat-out rejected. Or I can take feedback to fix it up. This modifies (and renames) _ArgIteratorWindows_ in process.zig such that it works with arbitrary strings (or the contents of an RSP file). In main.zig, this new _ArgIteratorGeneral_ is used to address the "TODO" listed in _ClangArgIterator_. This change closes #4833. **Pros:** - It has the nice attribute of handling "RSP file" arguments in the same way it handles "cmd_line" arguments. - High Performance, minimal allocations - Fixed bug in previous _ArgIteratorWindows_, where final trailing backslashes in a command line were entirely dropped - Added a test case for the above bug - Harmonized the _ArgIteratorXxxx._initWithAllocator()_ and _next()_ interface across Windows/Posix/Wasi (Moved Windows errors to _initWithAllocator()_ rather than _next()_) - Likely perf benefit on Windows by doing _utf16leToUtf8AllocZ()_ only once for the entire cmd_line **Cons:** - Breaking Change in std library on Windows: Call _ArgIterator.initWithAllocator()_ instead of _ArgIterator.init()_ - PhaseMage is new with contributions to Zig, might need a lot of hand-holding - PhaseMage is a Windows person, non-Windows stuff will need to be double-checked **Testing Done:** - Wrote a few new test cases in process.zig - zig.exe build test -Dskip-release (no new failures seen) - zig cc now builds gRPC without error
2022-01-30 11:27:52 -08:00
2018-08-21 16:07:28 -04:00
2024-02-14 06:05:01 +01:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2024-02-14 06:05:01 +01:00
2019-12-17 02:27:26 +05:00
2019-12-17 02:27:26 +05:00
2019-12-17 02:27:26 +05:00
2018-08-21 16:07:28 -04:00
2024-02-14 06:05:01 +01:00
2018-08-21 16:07:28 -04:00
2018-08-21 16:07:28 -04:00
2019-12-17 02:27:26 +05:00
2019-12-17 02:27:26 +05:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2019-12-17 02:27:26 +05:00
compiler: implement analysis-local comptime-mutable memory This commit changes how we represent comptime-mutable memory (`comptime var`) in the compiler in order to implement the intended behavior that references to such memory can only exist at comptime. It does *not* clean up the representation of mutable values, improve the representation of comptime-known pointers, or fix the many bugs in the comptime pointer access code. These will be future enhancements. Comptime memory lives for the duration of a single Sema, and is not permitted to escape that one analysis, either by becoming runtime-known or by becoming comptime-known to other analyses. These restrictions mean that we can represent comptime allocations not via Decl, but with state local to Sema - specifically, the new `Sema.comptime_allocs` field. All comptime-mutable allocations, as well as any comptime-known const allocs containing references to such memory, live in here. This allows for relatively fast checking of whether a value references any comptime-mtuable memory, since we need only traverse values up to pointers: pointers to Decls can never reference comptime-mutable memory, and pointers into `Sema.comptime_allocs` always do. This change exposed some faulty pointer access logic in `Value.zig`. I've fixed the important cases, but there are some TODOs I've put in which are definitely possible to hit with sufficiently esoteric code. I plan to resolve these by auditing all direct accesses to pointers (most of them ought to use Sema to perform the pointer access!), but for now this is sufficient for all realistic code and to get tests passing. This change eliminates `Zcu.tmp_hack_arena`, instead using the Sema arena for comptime memory mutations, which is possible since comptime memory is now local to the current Sema. This change should allow `Decl` to store only an `InternPool.Index` rather than a full-blown `ty: Type, val: Value`. This commit does not perform this refactor.
2024-03-22 23:39:44 +00:00
2021-07-01 22:23:10 -06:00
2021-07-01 22:23:10 -06:00
2021-07-01 22:23:10 -06:00
2021-07-01 22:23:10 -06:00
2021-07-01 22:23:10 -06:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00
2021-05-04 20:47:26 +03:00