aboutsummaryrefslogtreecommitdiff
path: root/std/fmt/index.zig
AgeCommit message (Collapse)Author
2019-03-02rename std lib files to new conventionAndrew Kelley
2019-02-26breaking changes to the way targets work in zigAndrew Kelley
* CLI: `-target [name]` instead of `--target-*` args. This matches clang's API. * `builtin.Environ` renamed to `builtin.Abi` - likewise `builtin.environ` renamed to `builtin.abi` * stop hiding the concept of sub-arch. closes #1526 * `zig targets` only shows available targets. closes #438 * include all targets in readme, even those that don't print with `zig targets` but note they are Tier 4 * refactor target.cpp and make the naming conventions more consistent * introduce the concept of a "default C ABI" for a given OS/Arch combo. As a rule of thumb, if the system compiler is clang or gcc then the default C ABI is the gnu ABI.
2019-02-16Merge pull request #1958 from ziglang/parse-floatMarc Tiehuis
Add float parsing support to std
2019-02-14Add parseFloat to std.fmtMarc Tiehuis
This is not intended to be the long-term implementation as it doesn't provide various properties that we eventually will want (e.g. round-tripping, denormal support). It also uses f64 internally so the wider f128 will be inaccurate.
2019-02-11add C pointer type to @typeInfoAndrew Kelley
See #1059
2019-02-08std.debug.assert: remove special case for test buildsAndrew Kelley
Previously, std.debug.assert would `@panic` in test builds, if the assertion failed. Now, it's always `unreachable`. This makes release mode test builds more accurately test the actual code that will be run. However this requires tests to call `std.testing.expect` rather than `std.debug.assert` to make sure output is correct. Here is the explanation of when to use either one, copied from the assert doc comments: Inside a test block, it is best to use the `std.testing` module rather than assert, because assert may not detect a test failure in ReleaseFast and ReleaseSafe mode. Outside of a test block, assert is the correct function to use. closes #1304
2019-02-01fixupsAndrew Kelley
2018-12-19Added formatting of function pointers (#1843)Jimmi Holst Christensen
2018-12-19formatType can now format comptime_intJimmi Holst Christensen
2018-11-29make parseUnsigned handle types <8 bits widedbandstra
2018-11-16std/fmt/index.zig: support printing hex bytes on slices;kristopher tate
2018-11-13New Zig formal grammar (#1685)Jimmi Holst Christensen
Reverted #1628 and changed the grammar+parser of the language to not allow certain expr where types are expected
2018-10-15Solve the return type ambiguity (#1628)Jimmi Holst Christensen
Changed container and initializer syntax * <container> { ... } -> <container> . { ... } * <exrp> { ... } -> <expr> . { ...}
2018-10-06Merge pull request #1429 from shawnl/arm64Andrew Kelley
initial arm64 support
2018-10-06arm64: respond to code reviewShawn Landden
2018-09-20fix formatInt to handle upcasting to base int sizeAndrew Kelley
2018-09-13remove `this`. add `@This()`.Andrew Kelley
closes #1283
2018-09-08NaNs do not have signedness.Shawn Landden
From IEEE-754 standard: Conversion of a quiet NaN in a supported format to an external character sequence shall produce a language-defined one of “nan” or a sequence that is equivalent except for case (e.g., “NaN”), with an optional preceding sign. (This standard does not interpret the sign of a NaN.)
2018-09-02fixupsAndrew Kelley
* zig fmt * use canonical parameter order. memcpy has dest first and the base64 code follows the pattern. * pass correct radix to charToDigit
2018-09-03std/fmt/index.zig: add hexToBytes function under std.fmt;kristopher tate
Depends on #1454 being implemented;
2018-09-02std/fmt/index.zig: test for printing double width hex bytes with zeros;kristopher tate
Co-Authored-By: Shawn Landden <shawn@git.icu>
2018-09-02std/fmt/index.zig: set width from 0 to 2;kristopher tate
\x00 was printed as 0 and \x0E was printed as E; \x00 now correctly prints 00 and \x0E correctly prints 0E;
2018-09-01std/fmt/index.zig: #1358: test bytes printed-out as hex;kristopher tate
2018-09-01std/fmt/index.zig: #1358 allow bytes to be printed-out as hex;kristopher tate
Supports {x} for lowercase and {X} for uppercase;
2018-08-27zig fmtAndrew Kelley
2018-08-27Handle unions differently in std.fmt (#1432)tgschultz
* Handle unions differently in std.fmt Print the active tag's value in tagged unions. Untagged unions considered unsafe to print and treated like a pointer or an array.
2018-08-25add test for previous commitAndrew Kelley
2018-08-25Fixed compile error when passing enum to fmttgschultz
Caused by struct printing behavior. Enums are different enough from structs and unions that the field iteration behavior doesn't do what we want even if @memberName didn't error on enums.
2018-08-20std.fmt.format: handle non-pointer struct/union/enumAndrew Kelley
Also adds support for printing structs via reflection. The case when structs have pointers to themselves is not handled yet. closes #1380
2018-08-14fixed handling of [*]u8 when no format specifier is settgschultz
If fmt was called on with a [*]u8 or [*]const u8 argument, but the fmt string did not specify 's' to treat it as a string, it produced a compile error due to accessing index 1 of a 0 length slice.
2018-08-01Add integer binary output format (#1313)Marc Tiehuis
2018-07-31std.fmt.format: add '*' for formatting things as pointersAndrew Kelley
closes #1285
2018-07-18self-hosted: find libc on linuxAndrew Kelley
2018-07-02add event loop Channel abstractionAndrew Kelley
This is akin to channels in Go, except: * implemented in userland * they are lock-free and thread-safe * they integrate with the userland event loop The self hosted compiler is changed to use a channel for events, and made to stay alive, watching files and performing builds when things change, however the main.zig file exits after 1 build. Note that nothing is actually built yet, it just parses the input and then declares that the build succeeded. Next items to do: * add windows and macos support for std.event.Loop * improve the event loop stop() operation * make the event loop multiplex coroutines onto kernel threads * watch source file for updates, and provide AST diffs (at least list the top level declaration changes) * top level declaration analysis
2018-06-30Alignment fix and allow rudimentary f128 float printingMarc Tiehuis
2018-06-17remove integer and float casting syntaxAndrew Kelley
* add `@intCast` * add `@floatCast` * add `@floatToInt` * add `@intToFloat` See #1061
2018-06-16don't automatically take pointer when passing by non-copying valueAndrew Kelley
this commit does not have all tests passing
2018-06-10Added C string support to fmt by using "{s}". The format string requirement ↵tgschultz
is for saftey. (#1092)
2018-06-09breaking syntax change: ??x to x.? (#1095)Andrew Kelley
See #1023 This also renames Nullable/Maybe to Optional
2018-06-09std/fmt: Use lowercase k for kilo in base 1000 (#1090)marleck55
2018-06-06Pointer Reform: update @typeInfoAndrew Kelley
* add assertion for trying to do @typeInfo on global error set * remove TypeInfo.Slice * add TypeInfo.Pointer.Size with possible values - One - Many - Slice See #770
2018-06-04Pointer Reform: proper slicing and indexing (#1053)Andrew Kelley
* enable slicing for single-item ptr to arrays * disable slicing for other single-item pointers * enable indexing for single-item ptr to arrays * disable indexing for other single-item pointers see #770 closes #386
2018-06-04Merge branch 'zig-custom-format' of https://github.com/tgschultz/zig into ↵Andrew Kelley
tgschultz-zig-custom-format I removed the code that checks for type signature and type. A function named `format` is enough for zig to give it a try.
2018-05-31use * for pointer type instead of &Andrew Kelley
See #770 To help automatically translate code, see the zig-fmt-pointer-reform-2 branch. This will convert all & into *. Due to the syntax ambiguity (which is why we are making this change), even address-of & will turn into *, so you'll have to manually fix thes instances. You will be guaranteed to get compile errors for them - expected 'type', found 'foo'
2018-05-30run zig fmt on the codebaseAndrew Kelley
2018-05-30Fixed character handlingtgschultz
2018-05-30Formattingtgschultz
2018-05-30Minor typotgschultz
2018-05-30Added custom formatter support, refactored fmt.formattgschultz
2018-05-29run zig fmt on the codebaseAndrew Kelley
See #1003