gingerBill
0e91c8368c
Add allocator parameters to fmt.caprint*
2024-07-24 09:01:41 +01:00
Laytan Laats
d4d910bcfc
fmt: fix optional_len or use_nul_termination being used by both array and elems
...
```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}`
2024-07-15 18:51:18 +02:00
gingerBill
399c3ab067
Reduce the size of runtime.Type_Info
2024-07-14 21:37:35 +01:00
gingerBill
8642d719f0
Imply #no_capture to all variadic parameters
2024-07-14 12:19:47 +01:00
gingerBill
edc793d7c1
Add #no_capture args: ..T to reuse the backing array stack memory
2024-07-14 11:39:05 +01:00
gingerBill
fc9c995dc4
Fix fmt for code compilation bug with any
2024-07-08 16:39:13 +01:00
gingerBill
e296d6fb90
Fix loads of indentation issues with mixing spaces and tabs
2024-06-29 19:50:51 +01:00
gingerBill
5413a8b744
Even more style fixes
2024-06-29 19:11:36 +01:00
Karl Zylinski
4e2d12c540
Added fmt.ctprint
2024-06-25 22:32:20 +02:00
Matias Fernandez
4baf101f15
Handle empty structs in fmt with hash
2024-06-14 05:36:23 -04:00
Jeroen van Rijn
3d4e23d741
Add example of a custom formatter.
2024-06-13 11:33:37 +02:00
Feoramund
0c9f487783
Fix and document %w verb for core:fmt
2024-06-12 20:35:50 -04:00
Feoramund
61c481bd81
Fix %p pointers not printing leading 0x
2024-06-07 15:27:43 -04:00
Laytan Laats
8455e159f5
improve orca target
2024-06-05 20:57:39 +02:00
Feoramund
eb93779f63
Fix duplicate sign printing of complex and quaternion types
...
Negative zero wasn't being detected (so it would appear as `+-0`), and
`+Inf` was appearing as `++Inf` when imaginary.
2024-06-03 19:51:17 -04:00
gingerBill
f600562ca5
Improve fmt parsing of struct field tags
2024-05-20 14:45:49 +01:00
Jeroen van Rijn
e0d3d68ce5
Fix the way '%32b' and other prefixed numbers are written.
2024-05-20 14:42:13 +02:00
Matias Fernandez
a9629679ed
remove extra newline in enumerated array hash fmt
2024-05-18 23:24:05 -04:00
gingerBill
7cf62f00c3
Correct #soa RTTI usage
2024-05-16 16:30:45 +01:00
Feoramund
11180e36ae
Amend fmt documentation
2024-05-09 19:38:44 -04:00
Feoramund
5e149d2cae
Refactor wprintf
...
- 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.
2024-05-09 19:28:04 -04:00
Feoramund
700f9c94bd
Combine adjacent sbprint*/to_string calls
...
The `sbprint*` procs already return a string conversion.
2024-04-28 17:18:46 -04:00
Feoramund
c712de0cd0
Require results for non-buffered print procs
2024-04-28 17:17:01 -04:00
Laytan Laats
cc5faecced
wasm: add the fprint procedures to fmt
...
This makes the `log` package work on wasm
2024-04-28 16:10:04 +02:00
gingerBill
c752d0b541
Fix printing of big endian integers in a bit_field
2024-04-27 09:16:18 +01:00
Damian Tarnawski
2a70faca14
Add printfln and eprintfln functions to fmt_js.odin
2024-04-21 22:37:04 +02:00
gingerBill
d84b29866f
Merge pull request #3447 from matias-eduardo/fix-soa-hash-formatting
...
fix #soa '%#v' formatting
2024-04-19 14:05:15 +01:00
gingerBill
059175de3b
Do not print column of a runtime.Source_Code_Location if the column == 0
2024-04-19 13:32:55 +01:00
Matias Fernandez
e296b050ee
fix #soa '%#v' formatting
2024-04-17 22:54:30 -04:00
gingerBill
abd5fc606c
Fix #3407
2024-04-10 14:12:41 +01:00
gingerBill
a750fc0ba6
Add #row_major matrix[R, C]T
...
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.
2024-03-19 21:05:23 +00:00
gingerBill
0f83ab466f
Minor change to spacing when printing a map
2024-03-08 13:20:27 +00:00
gingerBill
5ff6a25bdc
Improve formatting for %# on maps
2024-03-07 13:45:52 +00:00
gingerBill
b6b8e640f5
Replace b with _ as it is not needed
2024-03-07 13:41:54 +00:00
gingerBill
573402c97e
Begin work on %w - 'w'rite as valid Odin literals
2024-03-07 13:39:44 +00:00
gingerBill
0a5c85f8e3
Merge pull request #3207 from Tetralux/printfln
...
Add `fmt.*printfln`
2024-02-29 14:04:38 +00:00
gingerBill
5c5b78cbbe
Improve bit_field printing
2024-02-22 19:48:44 +00:00
gingerBill
54515af8cc
Add field tags to bit_field
2024-02-22 19:41:48 +00:00
gingerBill
5a84a08225
Add general support for bit_fields
2024-02-22 17:24:42 +00:00
gingerBill
a4b8c1ea17
Begin work adding bit_field
2024-02-22 15:55:54 +00:00
gingerBill
8472338bfa
Add reflect.enum_name_from_value and reflect.enum_name_from_value_any
2024-02-21 12:43:09 +00:00
Tetralux
b1e608bfba
[fmt] Add *printfln()
...
Adds the following procedures, which just call through to the `printf` versions, with `newline = true`; a new parameter
also added in this commit.
In all cases, `wprintf` is the one that ultimately writes the newline, if requested.
- printfln
- fprintfln
- eprintfln
- aprintfln
- tprintfln
- bprintfln
- caprintfln
- ctprintfln
- sbprintfln
- wprintfln
2024-02-18 16:14:59 +00:00
gingerBill
539cec7496
Move Tracking_Allocator to its own file.
2024-02-01 13:01:38 +00:00
gingerBill
3e7e779abf
Replace core:* to base:* where appropriate
2024-01-28 22:18:51 +00:00
gingerBill
9a9625f885
Fix #3053
2024-01-26 13:04:47 +00:00
Dragos Popescu
90d1f9ab27
Removed return value of assertf. assertf now correctly responds to -disable-assert. Added log.assert and log.assertf. All asserts now do the @cold trick, first added to builtin.assert
2024-01-23 20:56:13 +02:00
Jeroen van Rijn
89084befb0
Remove unnecessary []byte -> []byte conversion.
2023-12-30 21:59:33 +01:00
gingerBill
55f3e99f63
Fix %g in fmt, and make %v default to %g for floats
2023-12-21 17:05:24 +00:00
Yawning Angel
29c80c238d
core: Fixed build constraints
...
Multiple constraints on the same line are combined with logical OR,
while combining multiple negated constraints needs to be done with
logical AND (each constraint on a separate line).
2023-12-17 23:02:46 +09:00
Laytan Laats
e2cecafa66
allow integer verbs in fmt_bit_set
2023-11-07 21:09:42 +01:00