Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/REPL/src/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,7 @@ answer_color(r::StreamREPL) = r.answer_color
input_color(r::LineEditREPL) = r.envcolors ? Base.input_color() : r.input_color
input_color(r::StreamREPL) = r.input_color

let matchend = Dict("\"" => r"\"", "\"\"\"" => r"\"\"\"", "'" => r"'",
let matchend = Dict("\"" => r"\"", "\"\"\"" => r"\"\"\"", "[^ =<>≠≤≥(]'" => r"'",
"`" => r"`", "```" => r"```", "#" => r"$"m, "#=" => r"=#|#=")
global _rm_strings_and_comments
function _rm_strings_and_comments(code::Union{String,SubString{String}})
Expand Down
7 changes: 7 additions & 0 deletions stdlib/REPL/test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,13 @@ let ends_with_semicolon = REPL.ends_with_semicolon
@test ends_with_semicolon("f()= 1;")
# the next result does not matter because this is not legal syntax
@test_nowarn ends_with_semicolon("1; #=# 2")

# https://github.com/JuliaLang/julia/pull/57974 @testset "REPL semicolon detection with transpose" begin
@test ends_with_semicolon("W';") == true
@test ends_with_semicolon("W'; # comment")
@test !ends_with_semicolon("W'")
@test !ends_with_semicolon("x'")
@test !ends_with_semicolon("'a'")
end

# PR #20794, TTYTerminal with other kinds of streams
Expand Down
Loading