@@ -306,16 +306,22 @@ tests = [
306306 " f(a).g(b)" => " (call (. (call f a) (quote g)) b)"
307307 " \$ A.@x" => " (macrocall (. (\$ A) (quote @x)))"
308308
309+ # non-errors in space sensitive contexts
310+ " [f (x)]" => " (hcat f x)"
311+ " [f x]" => " (hcat f x)"
309312 # space separated macro calls
310313 " @foo a b" => " (macrocall @foo a b)"
311314 " @foo (x)" => " (macrocall @foo x)"
312315 " @foo (x,y)" => " (macrocall @foo (tuple x y))"
313316 " A.@foo a b" => " (macrocall (. A (quote @foo)) a b)"
314317 " @A.foo a b" => " (macrocall (. A (quote @foo)) a b)"
315318 " [@foo x]" => " (vect (macrocall @foo x))"
319+ " [@foo]" => " (vect (macrocall @foo))"
316320 " @var\" #\" a" => " (macrocall (var @#) a)" => Expr (:macrocall , Symbol (" @#" ), LineNumberNode (1 ), :a )
317321 " A.@x y" => " (macrocall (. A (quote @x)) y)"
318322 " A.@var\" #\" a" => " (macrocall (. A (quote (var @#))) a)" => Expr (:macrocall , Expr (:., :A , QuoteNode (Symbol (" @#" ))), LineNumberNode (1 ), :a )
323+ " @+x y" => " (macrocall @+ x y)"
324+ " [email protected] " => " (macrocall (. A (quote @.)) x)" 319325 # Macro names
320326 " @! x" => " (macrocall @! x)"
321327 " @.. x" => " (macrocall @.. x)"
@@ -329,9 +335,6 @@ tests = [
329335 " @doc x\n\n y" => " (macrocall @doc x)"
330336 " @doc x\n end" => " (macrocall @doc x)"
331337
332- # non-errors in space sensitive contexts
333- " [f (x)]" => " (hcat f x)"
334- " [f x]" => " (hcat f x)"
335338 # calls with brackets
336339 " f(a,b)" => " (call f a b)"
337340 " f(a=1; b=2)" => " (call f (= a 1) (parameters (= b 2)))" =>
@@ -941,26 +944,9 @@ parseall_test_specs = [
941944 end
942945end
943946
944- # Known bugs / incompatibilities
945- broken_tests = [
946- JuliaSyntax. parse_atom => [
947- """ var""\" x""\" """ => " x"
948- # Operator-named macros without spaces
949- " @!x" => " (macrocall @! x)"
950- " @..x" => " (macrocall @.. x)"
951- " @.x" => " (macrocall @__dot__ x)"
952- ]
953- ]
954-
955- @testset " Broken $production " for (production, test_specs) in broken_tests
956- @testset " $(repr (input)) " for (input,output) in test_specs
957- if ! (input isa AbstractString)
958- opts,input = input
959- else
960- opts = NamedTuple ()
961- end
962- @test_broken parse_to_sexpr_str (production, input; opts... ) == output
963- end
947+ @testset " Broken tests" begin
948+ # Technically broken. But do we even want this behavior?
949+ @test_broken parse_to_sexpr_str (JuliaSyntax. parse_eq, " var\"\"\" x\"\"\" " ) == " (var x)"
964950end
965951
966952@testset " Trivia attachment" begin
0 commit comments