|
1 | 1 | @testset "Hooks for Core integration" begin
|
2 | 2 | @testset "whitespace parsing" begin
|
3 |
| - @test JuliaSyntax.core_parser_hook("", "somefile", 0, :statement) == Core.svec(nothing, 0) |
4 |
| - @test JuliaSyntax.core_parser_hook("", "somefile", 0, :statement) == Core.svec(nothing, 0) |
| 3 | + @test JuliaSyntax._core_parser_hook("", "somefile", 1, 0, :statement) == Core.svec(nothing, 0) |
| 4 | + @test JuliaSyntax._core_parser_hook("", "somefile", 1, 0, :statement) == Core.svec(nothing, 0) |
5 | 5 |
|
6 |
| - @test JuliaSyntax.core_parser_hook(" ", "somefile", 2, :statement) == Core.svec(nothing,2) |
7 |
| - @test JuliaSyntax.core_parser_hook(" #==# ", "somefile", 6, :statement) == Core.svec(nothing,6) |
| 6 | + @test JuliaSyntax._core_parser_hook(" ", "somefile", 1, 2, :statement) == Core.svec(nothing,2) |
| 7 | + @test JuliaSyntax._core_parser_hook(" #==# ", "somefile", 1, 6, :statement) == Core.svec(nothing,6) |
8 | 8 |
|
9 |
| - @test JuliaSyntax.core_parser_hook(" x \n", "somefile", 0, :statement) == Core.svec(:x,4) |
10 |
| - @test JuliaSyntax.core_parser_hook(" x \n", "somefile", 0, :atom) == Core.svec(:x,2) |
| 9 | + @test JuliaSyntax._core_parser_hook(" x \n", "somefile", 1, 0, :statement) == Core.svec(:x,4) |
| 10 | + @test JuliaSyntax._core_parser_hook(" x \n", "somefile", 1, 0, :atom) == Core.svec(:x,2) |
11 | 11 | end
|
12 | 12 |
|
13 | 13 | @testset "filename is used" begin
|
14 |
| - ex = JuliaSyntax.core_parser_hook("@a", "somefile", 0, :statement)[1] |
| 14 | + ex = JuliaSyntax._core_parser_hook("@a", "somefile", 1, 0, :statement)[1] |
15 | 15 | @test Meta.isexpr(ex, :macrocall)
|
16 | 16 | @test ex.args[2] == LineNumberNode(1, "somefile")
|
17 | 17 | end
|
|
95 | 95 | end
|
96 | 96 | end
|
97 | 97 | JuliaSyntax.enable_in_core!(false)
|
| 98 | + |
| 99 | + # Should not throw |
| 100 | + @test JuliaSyntax._core_parser_hook("+=", "somefile", 1, 0, :statement)[1] isa Expr |
98 | 101 | end
|
99 | 102 | end
|
0 commit comments