Skip to content

Conversation

@IanButterworth
Copy link
Member

Fixes #60202

julia> function zip_missing(::Tuple{}, longer)
		      map(function (second_one)
		          (missing, second_one)
		      end, longer)
		  end
zip_missing (generic function with 1 method)

Written by Claude

@IanButterworth IanButterworth added the parser Language parsing and surface syntax label Nov 24, 2025
@Keno
Copy link
Member

Keno commented Nov 24, 2025

Just for reference, @KristofferC just touched this code in JuliaLang/JuliaSyntax.jl#580

@topolarity topolarity requested review from c42f and mlechu November 24, 2025 14:06
"macro \$f() end" => "(macro (call (\$ f)) (block))"
"macro (\$f)() end" => "(macro (call (parens (\$ f))) (block))"
"function (x) body end"=> "(function (tuple-p x) (block body))"
"function (x)\n body\nend"=> "(function (tuple-p x) (block body))"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also insert a involving explicitly a tuple () as the body?

E.g. near line 622-628, where in JuliaLang/JuliaSyntax.jl#580 this test was inserted:

        "function (\n        f\n        )() end" =>  "(function (call (parens f)) (block))"

well now we want to test something like this (not sure if I got it quite right)

        "function (\n        x\n        )\n() end" =>  "(function (tuple-p x) (block (tuple-p)))"

Because for me, on master, this parses:

function(y)
  body
end

but this does not:

function(y)
  ()
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parser Language parsing and surface syntax

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parsing anonymous function fails on 1.14

3 participants