Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nektro/zig-fmt-valueliteral
Print a value to a writer as it would be written in Zig syntax as a (x) literal.
https://github.com/nektro/zig-fmt-valueliteral
zig zig-package
Last synced: 15 days ago
JSON representation
Print a value to a writer as it would be written in Zig syntax as a (x) literal.
- Host: GitHub
- URL: https://github.com/nektro/zig-fmt-valueliteral
- Owner: nektro
- License: mit
- Created: 2021-05-09T21:48:53.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-12-29T03:34:18.000Z (about 1 month ago)
- Last Synced: 2024-12-29T04:21:19.648Z (about 1 month ago)
- Topics: zig, zig-package
- Language: Zig
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zig-fmt-valueliteral
Print a value to a writer as it would be written in Zig syntax as a (x) literal.
## Api
- `pub fn fmtValueLiteral(w: std.io.Writer, value: anytype, comptime print_type_name: bool) !void`
- `w` is an `anytype` for any value that implements `std.io.Writer`. It will then print the respective syntax literal to it.
- `value` is anything you'd like it to print. Should it fail to print a value you feel it should be able to please open an issue.
- `print_type_name` is a bool for whether or not you'd like it to print `@typeName(T)` or `.` when printing structs, enums, and unions.## License
MIT