FluxML / FluxML/MacroTools.jl

sourcewalk introduces blocks

Open
#123 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
320
Forks
84
PR merge metrics
No merged PRs in 30d

Description

### MWE:
```
using MacroTools
using MacroTools: textwalk

code = """
Rule(x -> -sin(x))
Rule(x -> 1 + tan(x)^2)
""";

after = textwalk(code) do expr
@capture(expr, Rule(v_)) && return v
return expr
end

println(after)
```

### Output:
```
(x->begin
-(sin(x))
end)
(x->begin
1 + tan(x) ^ 2
end)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the MWE in the issue and tracing the textwalk/sourcewalk path in MacroTools. Compare the transformed expressions with the reported output; done means the walk no longer introduces the unexpected begin blocks while preserving the intended expression structure.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.