aboutsummaryrefslogtreecommitdiff
path: root/core/fmt
Commit message (Collapse)AuthorAgeFilesLines
* Specify %m and %M as verbs for integer formattingAmedeoAlf2025-09-011-2/+2
|
* Begin supporting `string16` across the core librarygingerBill2025-08-021-8/+8
|
* Add `string16` and `cstring16` (UTF-16 based strings)gingerBill2025-08-021-0/+76
|
* Clarify `strconv.append_*` to `strconv.write_*`Feoramund2025-06-051-4/+4
|
* Correctly capitalize 'E' for the %E format specifier (#5065)mtarik34b2025-04-221-1/+4
|
* Fixed `fmt` handling of `bit_set[Enum]` when `min(Enum) != 0`.Barinzaya2025-04-071-7/+3
| | | | | | The lower bound of the `bit_set` was only being applied *after* searching for a matching enum value, so values wouldn't line up if the minimum value of the enum wasn't 0.
* Update `fmt` docs for procedures with a default allocator parameterAdam Zadrożny2025-03-091-7/+14
|
* Fix `rune` printing with `%b`gingerBill2025-02-251-1/+1
|
* Support use of `*` in format strings without an index.Barinzaya2025-02-141-0/+8
| | | | | | This allows `*` to be used in C fashion, without specifying an argument index to use. Like C, this results in the argument *preceding* the value for the format specifier itself.
* Fix the '+' sign placement in the presence of '0'-paddingflysand72025-01-241-2/+2
|
* add ensure and ensuref to fmt and log, fix some inconsistenciesLaytan Laats2025-01-131-2/+24
|
* Remove `#relative` types from the compilergingerBill2024-11-141-12/+0
|
* fix thread_unix for Darwin after pthread corrections in posix packageLaytan Laats2024-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | afed3ce removed the sys/unix package and moved over to sys/posix, it has new bindings for the pthread APIs but should have been equivalent (not). 8fb7182 used `CANCEL_ENABLE :: 0`, `CANCEL_DISABLE :: 1`, `CANCEL_DEFERRED :: 0`, `CANCEL_ASYNCHRONOUS :: 1` for Darwin, while the correct values are `1`, `0`, `2` and `0` respectively (same mistake was made for FreeBSD in that commit). What this meant is that the `pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS)` was not actually successful, but because the error wasn't checked it was assumed it was. It also meant `pthread_setcancelstate(PTHREAD_CANCEL_ENABLE)` would actually be setting `PTHREAD_CANCEL_DISABLE`. The code in this PR restores the behaviour by now actually deliberately setting `PTHREAD_CANCEL_DISABLE` and not setting `PTHREAD_CANCEL_ASYNCHRONOUS` which was the previous behaviour that does actually seem to work for some reason. (I also fixed an issue in fmt where `x` would use uppercase if it was a pointer.)
* Moved all packages in core, base, vendor, tests and examples to use new #+ ↵Karl Zylinski2024-09-143-5/+5
| | | | file tag syntax.
* [fmt] Add bit fields to the pointer printing logicTetralux2024-08-121-1/+2
| | | | | | | core:fmt prints pointers to structs as `&StructName{ ... }` but `bit_field`s are currently printed the same as rawptrs (`0xAABBCCDDEEFF` only). This commit changes that so they behave the same as structs and unions.
* Add `allocator` parameters to `fmt.caprint*`gingerBill2024-07-241-17/+28
|
* fmt: fix optional_len or use_nul_termination being used by both array and elemsLaytan Laats2024-07-151-0/+8
| | | | | | | | | | | | | | | | | | | | | ```odin My_Struct :: struct { names: [^]string `fmt:"v,name_count"`, name_count: int, } main :: proc() { name := "hello?" foo := My_Struct { names = &name, name_count = 1, } fmt.println(foo) } ``` Before: `My_Struct{names = ["h"], name_count = 1}` After: `My_Struct{names = ["hello?"], name_count = 1}`
* Reduce the size of `runtime.Type_Info`gingerBill2024-07-141-8/+8
|
* Imply `#no_capture` to all variadic parametersgingerBill2024-07-143-53/+53
|
* Add `#no_capture args: ..T` to reuse the backing array stack memorygingerBill2024-07-143-53/+53
|
* Fix fmt for code compilation bug with `any`gingerBill2024-07-081-3/+3
|
* Fix loads of indentation issues with mixing spaces and tabsgingerBill2024-06-291-8/+8
|
* Even more style fixesgingerBill2024-06-291-9/+6
|
* Added fmt.ctprintKarl Zylinski2024-06-251-0/+19
|
* Handle empty structs in fmt with hashMatias Fernandez2024-06-141-4/+10
|
* Add example of a custom formatter.Jeroen van Rijn2024-06-131-0/+57
|
* Fix and document `%w` verb for `core:fmt`Feoramund2024-06-122-6/+17
|
* Fix `%p` pointers not printing leading `0x`Feoramund2024-06-071-1/+1
|
* improve orca targetLaytan Laats2024-06-051-0/+1
|
* Fix duplicate sign printing of complex and quaternion typesFeoramund2024-06-031-4/+20
| | | | | Negative zero wasn't being detected (so it would appear as `+-0`), and `+Inf` was appearing as `++Inf` when imaginary.
* Improve `fmt` parsing of struct field tagsgingerBill2024-05-201-41/+89
|
* Fix the way '%32b' and other prefixed numbers are written.Jeroen van Rijn2024-05-201-11/+58
|
* remove extra newline in enumerated array hash fmtMatias Fernandez2024-05-181-1/+0
|
* Correct #soa RTTI usagegingerBill2024-05-161-1/+1
|
* Amend `fmt` documentationFeoramund2024-05-091-15/+18
|
* Refactor `wprintf`Feoramund2024-05-091-191/+156
| | | | | | | | | | | | | | | | | | | | | | - Extracts common code between C and Python-like syntax into its own sub-procedures. - Fixes Python-like syntax from treating `}` as a verb. - Makes C-like syntax treat ' ' as a missing verb. - Fixes EXTRA arguments being formatted with options that were previously set, instead using default options now. - Makes error messaging more consistent between C and Python-like syntax. - Requires argument index to be specified immediately before the verb in C-like syntax, per the documentation, instead of after `%` _or_ before the verb. - Tracks argument usage through a `bit_set`, allowing for reporting of unused arguments even when reordered. - Moves exit for C-like syntax if next byte is `%` to beginning of block instead of needlessly trying to parse through all options. - Pops next unused argument for unspecified formatters like `%i` or `{}`, instead of taking the argument after the last one used. - Fixes unspecified precision `%.f` from not setting precision to zero, per the documentation.
* Combine adjacent `sbprint*`/`to_string` callsFeoramund2024-04-281-12/+6
| | | | The `sbprint*` procs already return a string conversion.
* Require results for non-buffered `print` procsFeoramund2024-04-281-0/+12
|
* wasm: add the `fprint` procedures to `fmt`Laytan Laats2024-04-281-0/+51
| | | | This makes the `log` package work on wasm
* Fix printing of big endian integers in a `bit_field`gingerBill2024-04-271-1/+4
|
* Add printfln and eprintfln functions to fmt_js.odinDamian Tarnawski2024-04-211-0/+4
|
* Merge pull request #3447 from matias-eduardo/fix-soa-hash-formattinggingerBill2024-04-191-2/+19
|\ | | | | fix #soa '%#v' formatting
| * fix #soa '%#v' formattingMatias Fernandez2024-04-171-2/+19
| |
* | Do not print column of a runtime.Source_Code_Location if the `column == 0`gingerBill2024-04-191-4/+8
|/
* Fix #3407gingerBill2024-04-101-1/+1
|
* Add `#row_major matrix[R, C]T`gingerBill2024-03-191-2/+10
| | | | | As well as `#column_major matrix[R, C]T` as an alias for just `matrix[R, C]T`. This is because some libraries require a row_major internal layout but still want to be used with row or major oriented vectors.
* Minor change to spacing when printing a mapgingerBill2024-03-081-3/+3
|
* Improve formatting for `%#` on `map`sgingerBill2024-03-071-5/+24
|
* Replace `b` with `_` as it is not neededgingerBill2024-03-071-1/+1
|
* Begin work on `%w` - 'w'rite as valid Odin literalsgingerBill2024-03-071-170/+217
|