mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 23:52:31 +00:00
d8e7eda5f4
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. |
||
---|---|---|
.. | ||
compiler | ||
compiler_rt | ||
docs | ||
include | ||
init | ||
libc | ||
libcxx | ||
libcxxabi | ||
libunwind | ||
std | ||
tsan | ||
c.zig | ||
compiler_rt.zig | ||
zig.h |