Commit 090331a
Improvements to static-show (#239)
* static-show: improve accuracy of some printings (JuliaLang#52799)
- Show strings with escaping, rather than trying to output the text
unmodified.
- Show symbols with the same formatting as Strings
- Avoid accidentally defining a broken Core.show method for NamedTuple
* Make more types jl_static_show unambiguously (JuliaLang#58512)
Makes more types survive `jl_static_show` unambiguously:
- Symbols
- Symbols printed in the `:var"foo"` form use raw string escaping,
fixing `:var"a\b"`, `:var"a\\"`, `:var"$a"`, etc.
- Symbols that require parens use parens (`:(=)`, ...)
- Signed integers: Except for `Int`, signed integers print like
`Int8(1)`.
- Floats: floats are printed in a naive but reversible (TODO: double
check) way. `Inf(16|32|)` and `NaN(16|32|)` are printed, and
`Float16`/`Float32` print the type (`Float32(1.5)`). `Float64`s are
printed with a trailing `.0` if it is necessary to disambiguate from
`Int`.
Fixes JuliaLang#52677,
JuliaLang#58484 (comment),
JuliaLang#58484 (comment),
and the specific case mentioned in JuliaLang#58484. Improves the situation for
round-trip (inexhaustive list):
- Non-canonical NaNs
- BFloat16
- User-defined primitive types. This one is tricky, because they can
have a size different from any type we have literals for.
* Use `julia__gnu_h2f_ieee` instead of `julia_half_to_float`
`julia_half_to_float` came in with an LLVM version upgrade after
v1.10.
---------
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
Co-authored-by: Sam Schweigel <33556084+xal-0@users.noreply.github.com>1 parent 010d301 commit 090331a
File tree
10 files changed
+272
-87
lines changed- base
- src
- flisp
- support
- stdlib/InteractiveUtils/test
- test
10 files changed
+272
-87
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
202 | | - | |
| 200 | + | |
| 201 | + | |
203 | 202 | | |
204 | 203 | | |
205 | 204 | | |
| |||
233 | 232 | | |
234 | 233 | | |
235 | 234 | | |
| 235 | + | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1744 | 1744 | | |
1745 | 1745 | | |
1746 | 1746 | | |
1747 | | - | |
| 1747 | + | |
1748 | 1748 | | |
1749 | 1749 | | |
1750 | 1750 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
978 | 978 | | |
979 | 979 | | |
980 | 980 | | |
981 | | - | |
| 981 | + | |
982 | 982 | | |
983 | 983 | | |
984 | 984 | | |
| |||
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
990 | | - | |
| 990 | + | |
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
| |||
996 | 996 | | |
997 | 997 | | |
998 | 998 | | |
999 | | - | |
| 999 | + | |
1000 | 1000 | | |
1001 | 1001 | | |
1002 | 1002 | | |
| |||
1005 | 1005 | | |
1006 | 1006 | | |
1007 | 1007 | | |
1008 | | - | |
| 1008 | + | |
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
| |||
1014 | 1014 | | |
1015 | 1015 | | |
1016 | 1016 | | |
1017 | | - | |
| 1017 | + | |
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
| 521 | + | |
522 | 522 | | |
523 | 523 | | |
524 | 524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1961 | 1961 | | |
1962 | 1962 | | |
1963 | 1963 | | |
1964 | | - | |
1965 | | - | |
1966 | | - | |
1967 | | - | |
1968 | | - | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
1969 | 1969 | | |
1970 | 1970 | | |
1971 | 1971 | | |
| |||
0 commit comments