aboutsummaryrefslogtreecommitdiff
path: root/src/InternPool.zig
diff options
context:
space:
mode:
authorCarl Åstholm <carl@astholm.se>2024-02-13 18:30:22 +0100
committerCarl Åstholm <carl@astholm.se>2024-04-07 14:47:10 +0200
commitd8e7eda5f4a894fe8fec8c53f7bcc3d475dd55c9 (patch)
treecb194249a7cdc1643283219bc6c327ad5b8363ac /src/InternPool.zig
parent129de47a71b954b1118ce188f7032ad726491f53 (diff)
downloadzig-d8e7eda5f4a894fe8fec8c53f7bcc3d475dd55c9.tar.gz
zig-d8e7eda5f4a894fe8fec8c53f7bcc3d475dd55c9.zip
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.
Diffstat (limited to 'src/InternPool.zig')
0 files changed, 0 insertions, 0 deletions