Skip to content

Commit

Permalink
Use @show_name, @show_special for parent show methods
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Apr 16, 2024
1 parent 23c3759 commit edac3ab
Show file tree
Hide file tree
Showing 24 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/arb/Complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ function Base.show(io::IO, z::ComplexFieldElem)
end

function show(io::IO, x::ComplexField)
# deliberately no @show_name or @show_special here as this is a singleton type
if get(io, :supercompact, false)
print(io, LowercaseOff(), "CC")
else
Expand Down
1 change: 1 addition & 0 deletions src/arb/Real.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ function expressify(x::RealFieldElem; context = nothing)
end

function show(io::IO, x::RealField)
# deliberately no @show_name or @show_special here as this is a singleton type
if get(io, :supercompact, false)
print(io, LowercaseOff(), "RR")
else
Expand Down
2 changes: 2 additions & 0 deletions src/arb/acb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ function Base.show(io::IO, z::AcbFieldElem)
end

function show(io::IO, x::AcbField)
@show_name(io, x)
@show_special(io, x)
print(io, "Complex Field with ")
print(io, precision(x))
print(io, " bits of precision and error bounds")
Expand Down
2 changes: 2 additions & 0 deletions src/arb/acb_poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ end
###############################################################################

function show(io::IO, x::AcbPolyRing)
@show_name(io, x)
@show_special(io, x)

Check warning on line 77 in src/arb/acb_poly.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/acb_poly.jl#L76-L77

Added lines #L76 - L77 were not covered by tests
print(io, "Univariate Polynomial Ring in ")
print(io, var(x))
print(io, " over ")
Expand Down
2 changes: 2 additions & 0 deletions src/arb/arb.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ function expressify(x::ArbFieldElem; context = nothing)
end

function show(io::IO, x::ArbField)
@show_name(io, x)
@show_special(io, x)
print(io, "Real Field with ")
print(io, precision(x))
print(io, " bits of precision and error bounds")
Expand Down
2 changes: 2 additions & 0 deletions src/arb/arb_poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ end
###############################################################################

function show(io::IO, x::ArbPolyRing)
@show_name(io, x)
@show_special(io, x)

Check warning on line 77 in src/arb/arb_poly.jl

View check run for this annotation

Codecov / codecov/patch

src/arb/arb_poly.jl#L76-L77

Added lines #L76 - L77 were not covered by tests
print(io, "Univariate Polynomial Ring in ")
print(io, var(x))
print(io, " over ")
Expand Down
2 changes: 2 additions & 0 deletions src/calcium/ca.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ canonical_unit(a::CalciumFieldElem) = a
###############################################################################

function show(io::IO, C::CalciumField)
@show_name(io, C)
@show_special(io, C)
if C.extended
print(io, "Exact complex field (extended)")
else
Expand Down
1 change: 1 addition & 0 deletions src/calcium/qqbar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ function native_string(x::QQBarFieldElem)
end

function show(io::IO, F::QQBarField)
# deliberately no @show_name or @show_special here as this is a singleton type
if get(io, :supercompact, false)
io = pretty(io)
print(io, LowercaseOff(), "QQBar")
Expand Down
2 changes: 2 additions & 0 deletions src/flint/flint_puiseux_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ function show(io::IO, p::FlintPuiseuxSeriesRing)
end

function show(io::IO, p::FlintPuiseuxSeriesField)
@show_name(io, p)
@show_special(io, p)

Check warning on line 245 in src/flint/flint_puiseux_series.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/flint_puiseux_series.jl#L244-L245

Added lines #L244 - L245 were not covered by tests
if get(io, :supercompact, false)
print(io, "Puiseux series field")
else
Expand Down
1 change: 1 addition & 0 deletions src/flint/fmpq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ function show(io::IO, ::MIME"text/plain", a::QQField)
end

function show(io::IO, a::QQField)
# deliberately no @show_name or @show_special here as this is a singleton type
if get(io, :supercompact, false)
# no nested printing
print(pretty(io), LowercaseOff(), "QQ")
Expand Down
1 change: 1 addition & 0 deletions src/flint/fmpz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ string(x::ZZRingElem) = dec(x)
show(io::IO, x::ZZRingElem) = print(io, string(x))

function show(io::IO, a::ZZRing)
# deliberately no @show_name or @show_special here as this is a singleton type
if get(io, :supercompact, false)
# no nested printing
print(pretty(io), LowercaseOff(), "ZZ")
Expand Down
2 changes: 2 additions & 0 deletions src/flint/fmpz_abs_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ end
###############################################################################

function show(io::IO, a::ZZAbsPowerSeriesRing)
@show_name(io, a)
@show_special(io, a)

Check warning on line 163 in src/flint/fmpz_abs_series.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/fmpz_abs_series.jl#L162-L163

Added lines #L162 - L163 were not covered by tests
print(io, "Univariate power series ring in ", var(a), " over ")
show(io, base_ring(a))
end
Expand Down
2 changes: 2 additions & 0 deletions src/flint/fmpz_laurent_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,8 @@ function show(io::IO, a::ZZLaurentSeriesRingElem)
end

function show(io::IO, p::ZZLaurentSeriesRing)
@show_name(io, p)
@show_special(io, p)
if get(io, :supercompact, false)
print(io, "Laurent series ring")
else
Expand Down
2 changes: 2 additions & 0 deletions src/flint/fmpz_mod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ end
###############################################################################

function show(io::IO, R::ZZModRing)
@show_name(io, R)
@show_special(io, R)

Check warning on line 99 in src/flint/fmpz_mod.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/fmpz_mod.jl#L98-L99

Added lines #L98 - L99 were not covered by tests
if get(io, :supercompact, false)
# no nested printing
io = pretty(io)
Expand Down
2 changes: 2 additions & 0 deletions src/flint/fq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ end
show(io::IO, a::FqPolyRepFieldElem) = print(io, AbstractAlgebra.obj_to_string(a, context = io))

function show(io::IO, a::FqPolyRepField)
@show_name(io, a)
@show_special(io, a)
if get(io, :supercompact, false)
# no nested printing
io = pretty(io)
Expand Down
2 changes: 2 additions & 0 deletions src/flint/fq_default.jl
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ end
show(io::IO, a::FqFieldElem) = print(io, AbstractAlgebra.obj_to_string(a, context = io))

function show(io::IO, a::FqField)
@show_name(io, a)
@show_special(io, a)
io = pretty(io)
if is_absolute(a)
deg = degree(a)
Expand Down
2 changes: 2 additions & 0 deletions src/flint/fq_nmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ end
show(io::IO, a::fqPolyRepFieldElem) = print(io, AbstractAlgebra.obj_to_string(a, context = io))

function show(io::IO, a::fqPolyRepField)
@show_name(io, a)
@show_special(io, a)
if get(io, :supercompact, false)
# no nested printing
io = pretty(io)
Expand Down
2 changes: 2 additions & 0 deletions src/flint/gfp_elem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ end
###############################################################################

function show(io::IO, a::fpField)
@show_name(io, a)
@show_special(io, a)
if get(io, :supercompact, false)
# no nested printing
io = pretty(io)
Expand Down
2 changes: 2 additions & 0 deletions src/flint/gfp_fmpz_elem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ canonical_unit(x::FpFieldElem) = x
###############################################################################

function show(io::IO, a::FpField)
@show_name(io, a)
@show_special(io, a)
if get(io, :supercompact, false)
# no nested printing
io = pretty(io)
Expand Down
2 changes: 2 additions & 0 deletions src/flint/nmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ end
###############################################################################

function show(io::IO, R::zzModRing)
@show_name(io, R)
@show_special(io, R)
if get(io, :supercompact, false)
# no nested printing
io = pretty(io)
Expand Down
2 changes: 2 additions & 0 deletions src/flint/padic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ function show(io::IO, a::PadicFieldElem)
end

function show(io::IO, R::PadicField)
@show_name(io, R)
@show_special(io, R)

Check warning on line 262 in src/flint/padic.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/padic.jl#L261-L262

Added lines #L261 - L262 were not covered by tests
if get(io, :supercompact, false)
io = pretty(io)
print(io, LowercaseOff(), "QQ_$(prime(R))")
Expand Down
2 changes: 2 additions & 0 deletions src/flint/qadic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ function show(io::IO, a::QadicFieldElem)
end

function show(io::IO, R::QadicField)
@show_name(io, R)
@show_special(io, R)

Check warning on line 251 in src/flint/qadic.jl

View check run for this annotation

Codecov / codecov/patch

src/flint/qadic.jl#L250-L251

Added lines #L250 - L251 were not covered by tests
if get(io, :supercompact, false)
io = pretty(io)
print(io, LowercaseOff(), "QQ_$(prime(R))^$(degree(R))")
Expand Down
1 change: 1 addition & 0 deletions src/gaussiannumbers/QQi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function Base.show(io::IO, a::QQiFieldElem)
end

function Base.show(io::IO, a::QQiField)
# deliberately no @show_name or @show_special here as this is a singleton type
if get(io, :supercompact, false)
io = pretty(io)
print(io, LowercaseOff(), "QQ[im]")
Expand Down
1 change: 1 addition & 0 deletions src/gaussiannumbers/ZZi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function Base.show(io::IO, a::ZZiRingElem)
end

function Base.show(io::IO, a::ZZiRing)
# deliberately no @show_name or @show_special here as this is a singleton type
if get(io, :supercompact, false)
io = pretty(io)
print(io, LowercaseOff(), "ZZ[im]")
Expand Down

0 comments on commit edac3ab

Please sign in to comment.