Skip to content

Commit 1077bc4

Browse files
authored
Patch REPL documentation for symbols ending with '=' (#35277)
1 parent 1b228ff commit 1077bc4

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

stdlib/REPL/src/docview.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ function lookup_doc(ex)
208208
end
209209
if isa(ex, Symbol) && Base.isoperator(ex)
210210
str = string(ex)
211-
if endswith(str, "=")
211+
if endswith(str, "=") && Base.operator_precedence(ex) == Base.prec_assignment
212212
op = str[1:end-1]
213213
return Markdown.parse("`x $op= y` is a synonym for `x = x $op y`")
214214
elseif startswith(str, ".")

stdlib/REPL/test/repl.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,9 +1043,14 @@ for line in ["′", "abstract", "type"]
10431043
sprint(show, help_result(line)::Union{Markdown.MD,Nothing}))
10441044
end
10451045

1046+
# PR 35154
10461047
@test occursin("|=", sprint(show, help_result("|=")))
10471048
@test occursin("broadcast", sprint(show, help_result(".=")))
10481049

1050+
# PR 35277
1051+
@test occursin("identical", sprint(show, help_result("===")))
1052+
@test occursin("broadcast", sprint(show, help_result(".<=")))
1053+
10491054
# Issue #25930
10501055

10511056
# Brief and extended docs (issue #25930)

0 commit comments

Comments
 (0)