@@ -306,16 +306,22 @@ tests = [
306
306
" f(a).g(b)" => " (call (. (call f a) (quote g)) b)"
307
307
" \$ A.@x" => " (macrocall (. (\$ A) (quote @x)))"
308
308
309
+ # non-errors in space sensitive contexts
310
+ " [f (x)]" => " (hcat f x)"
311
+ " [f x]" => " (hcat f x)"
309
312
# space separated macro calls
310
313
" @foo a b" => " (macrocall @foo a b)"
311
314
" @foo (x)" => " (macrocall @foo x)"
312
315
" @foo (x,y)" => " (macrocall @foo (tuple x y))"
313
316
" A.@foo a b" => " (macrocall (. A (quote @foo)) a b)"
314
317
" @A.foo a b" => " (macrocall (. A (quote @foo)) a b)"
315
318
" [@foo x]" => " (vect (macrocall @foo x))"
319
+ " [@foo]" => " (vect (macrocall @foo))"
316
320
" @var\" #\" a" => " (macrocall (var @#) a)" => Expr (:macrocall , Symbol (" @#" ), LineNumberNode (1 ), :a )
317
321
" A.@x y" => " (macrocall (. A (quote @x)) y)"
318
322
" 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)"
319
325
# Macro names
320
326
" @! x" => " (macrocall @! x)"
321
327
" @.. x" => " (macrocall @.. x)"
@@ -329,9 +335,6 @@ tests = [
329
335
" @doc x\n\n y" => " (macrocall @doc x)"
330
336
" @doc x\n end" => " (macrocall @doc x)"
331
337
332
- # non-errors in space sensitive contexts
333
- " [f (x)]" => " (hcat f x)"
334
- " [f x]" => " (hcat f x)"
335
338
# calls with brackets
336
339
" f(a,b)" => " (call f a b)"
337
340
" f(a=1; b=2)" => " (call f (= a 1) (parameters (= b 2)))" =>
@@ -941,26 +944,9 @@ parseall_test_specs = [
941
944
end
942
945
end
943
946
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)"
964
950
end
965
951
966
952
@testset " Trivia attachment" begin
0 commit comments