Carl Åstholm d8e7eda5f4 std.zig.fmtId: conditionally escape primitives/_
This is a breaking change.

This updates `std.zig.fmtId` to support conditionally escaping
primitives and the reserved `_` identifier via format specifiers:

- `{}`: escape invalid identifiers, identifiers that shadow primitives
  and the reserved `_` identifier.
- `{p}`: same as `{}`, but don't escape identifiers that
  shadow primitives.
- `{_}`: same as `{}`, but don't escape the reserved `_` identifier.
- `{p_}` or `{_p}`: only escape invalid identifiers.

(The idea is that `p`/`_` mean "allow primitives/underscores".)

Any other format specifiers will result in compile errors.

Additionally, `isValidId` now considers `_` a valid identifier. If this
distinction is important, consider combining existing uses of this
function with the new `isUnderscore` function.
2024-04-07 14:47:10 +02:00
..
2024-03-30 20:50:48 -04:00
2024-03-19 11:45:09 -07:00
2024-03-29 22:15:17 -07:00
2024-03-23 18:11:32 +01:00
2024-03-19 11:45:09 -07:00
2024-03-20 21:05:35 -07:00
2024-03-29 09:33:57 +00:00
2024-03-21 14:11:46 -07:00
2024-02-23 02:37:11 -07:00
2024-03-31 23:57:16 +02:00
2024-03-19 11:45:09 -07:00
2024-03-19 11:45:09 -07:00
2024-03-13 02:17:28 -04:00
2024-03-21 14:11:46 -07:00
2024-03-21 14:11:46 -07:00
2024-03-15 02:28:50 -04:00
2024-03-10 18:13:30 -07:00
2024-03-21 14:11:46 -07:00
2024-03-19 11:45:09 -07:00
2024-03-23 18:11:32 +01:00
2024-03-10 18:13:30 -07:00
2024-03-30 20:50:48 -04:00
2024-03-19 11:45:09 -07:00
2024-03-10 18:13:30 -07:00
2024-03-21 14:11:46 -07:00
2024-03-19 16:18:18 -07:00
2024-02-05 11:55:14 +03:30
2024-03-19 11:45:09 -07:00
2024-03-27 01:55:42 -04:00
2023-10-25 04:28:30 -04:00
2024-02-09 14:02:57 -08:00
2024-03-29 09:33:57 +00:00
2024-03-19 11:45:09 -07:00
2024-03-19 16:18:18 -07:00
2024-03-19 11:45:09 -07:00
2024-03-23 18:11:32 +01:00
2024-03-21 14:11:46 -07:00
2024-02-08 15:39:28 +01:00
2024-03-10 18:13:30 -07:00
2024-03-21 14:11:46 -07:00
2024-03-30 20:50:48 -04:00
2024-03-19 11:45:09 -07:00
2024-03-21 14:11:46 -07:00
2024-03-21 14:11:46 -07:00
2024-02-26 20:11:43 -08:00
2023-10-21 21:24:55 +00:00