Skip to content

Move SyntaxGraph/SyntaxTree from JuliaLowering to JuliaSyntax#60370

Merged
topolarity merged 6 commits intoJuliaLang:masterfrom
mlechu:est-1-shuffle
Dec 12, 2025
Merged

Move SyntaxGraph/SyntaxTree from JuliaLowering to JuliaSyntax#60370
topolarity merged 6 commits intoJuliaLang:masterfrom
mlechu:est-1-shuffle

Conversation

@mlechu
Copy link
Copy Markdown
Member

@mlechu mlechu commented Dec 11, 2025

This is purely a code movement PR. @c42f has noted that SyntaxTree may eventually replace SyntaxNode and should be part of JuliaSyntax. Doing this code movement before #59870 would have been a mess, though, since the API to SyntaxTree is still under development.

Easiest to review commit-by-commit. Summary of changes:

  • Move syntax_graph.jl and associated tests to JuliaSyntax, including parts of ast.jl that are necessary to construct trees (needed for parsing to SyntaxTree) and excluding anything that needs to know about lowering Kinds or Bindings
  • Update docstrings and file names to clarify the difference between the trees. Mention that SyntaxTree is unstable/JuliaLowering-only for now.

- Move `SyntaxTree`->`Expr` hacks to compat.jl
- Move `@SyntaxTree` to utils.jl
- Move `Base.show(::SyntaxTree)` to utils.jl (odd, but currently depends on
     lowering-only `Kind`s)
- Move AST creation utilities from ast.jl to syntax_graph.jl.  There's no good
     way of creating a parsed SyntaxTree otherwise.
Copy link
Copy Markdown
Member

@topolarity topolarity left a comment

Choose a reason for hiding this comment

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

Looks good to me. Basically no code changes, so easy review 👍

This feels like the right direction to go, but I'll give @c42f a chance to chime in about her thoughts before merging

@topolarity
Copy link
Copy Markdown
Member

Already essentially passed all CI (there was spurious error on Windows), so merging this as-is.

@topolarity topolarity merged commit f40b117 into JuliaLang:master Dec 12, 2025
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants