Skip to content

Commit

Permalink
Add tests for macrocall sig
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Jul 25, 2024
1 parent ad110b9 commit 31e8ef8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,10 @@ tests = [
# body
"function f() \n a \n b end" => "(function (call f) (block a b))"
"function f() end" => "(function (call f) (block))"
# Macrocall as sig
((v=v"1.12",), "function @callmemacro(a::Int) \n 1 \n end") => "(function (macrocall-p @callmemacro (::-i a Int)) (block 1))"
((v=v"1.12",), "function @callmemacro(a::T, b::T) where T <: Int64\n3\nend") => "(function (where (macrocall-p @callmemacro (::-i a T) (::-i b T)) (<: T Int64)) (block 3))"
((v=v"1.12",), "function @callmemacro(a::Int, b::Int, c::Int)::Float64\n4\nend") => "(function (::-i (macrocall-p @callmemacro (::-i a Int) (::-i b Int) (::-i c Int)) Float64) (block 4))"
# Errors
"function" => "(function (error (error)) (block (error)) (error-t))"
],
Expand Down Expand Up @@ -963,6 +967,9 @@ tests = [
"public[7] = 5" => "(= (ref public 7) 5)"
"public() = 6" => "(= (call public) 6)"
]),
JuliaSyntax.parse_stmts => [
((v = v"1.12",), "@callmemacro(b::Float64) = 2") => "(= (macrocall-p @callmemacro (::-i b Float64)) 2)"
],
JuliaSyntax.parse_docstring => [
""" "notdoc" ] """ => "(string \"notdoc\")"
""" "notdoc" \n] """ => "(string \"notdoc\")"
Expand Down

0 comments on commit 31e8ef8

Please sign in to comment.