Skip to content

Conversation

@PallHaraldsson
Copy link
Contributor

Fixes #46189

@IanButterworth IanButterworth added the needs tests Unit tests are required for this change label Apr 1, 2025
@PallHaraldsson
Copy link
Contributor Author

PallHaraldsson commented Apr 1, 2025

I debugged this myself and fixed, but DeepSeek AI got me these tests (they were seemingly all correct, I however slightly shortened them), and have now added them (in right even more shorted format not as shown here):

@testset "REPL semicolon detection with transpose" begin
    @test REPL.ends_with_semicolon("W';") == true
    @test REPL.ends_with_semicolon("W'; # comment") == true
    @test REPL.ends_with_semicolon("W'") == false
    @test REPL.ends_with_semicolon("x'") == false
    @test REPL.ends_with_semicolon("'a'") == false
end

I didn't think AI would manage a fix, and it suggested in another line (I believe this is false, but on the path to correct):

# Adjusted regex to avoid matching transpose operator '
            i = findnext(r"\"(?!\"\")|\"\"\"|(?<![A-Za-z0-9_)\]\}])'|`(?!``)|```|#(?!=)|#=", code, pos)

xal-0 added a commit to xal-0/julia that referenced this pull request May 8, 2025
Removes yet another ad-hoc lexer from the REPL and replaces it with JuliaSyntax.

Fixes JuliaLang#46189, with tests taken from JuliaLang#57974.

Co-authored-by: Páll Haraldsson <Pall.Haraldsson@gmail.com>
oscardssmith pushed a commit that referenced this pull request May 9, 2025
Removes yet another ad-hoc lexer from the REPL and replaces it with
JuliaSyntax.

Fixes #46189, with tests taken from (and superseding) #57974.

Co-authored-by: Páll Haraldsson <Pall.Haraldsson@gmail.com>
@xal-0
Copy link
Member

xal-0 commented May 9, 2025

Closing in favour of #58364. Thanks for writing the tests!

@xal-0 xal-0 closed this May 9, 2025
charleskawczynski pushed a commit to charleskawczynski/julia that referenced this pull request May 12, 2025
…aLang#58364)

Removes yet another ad-hoc lexer from the REPL and replaces it with
JuliaSyntax.

Fixes JuliaLang#46189, with tests taken from (and superseding) JuliaLang#57974.

Co-authored-by: Páll Haraldsson <Pall.Haraldsson@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs tests Unit tests are required for this change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

REPL.ends_with_semicolon broken on adjoint operator with comment

3 participants