Skip to content

Commit

Permalink
Fix infix_op_call predicat
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed May 26, 2024
1 parent 0db3c54 commit a0ba874
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/chisel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ end
function is_assignment(node::JuliaSyntax.GreenNode)
return JuliaSyntax.is_prec_assignment(node)
end
function is_infix_op_call(node::JuliaSyntax.GreenNode)
return JuliaSyntax.kind(node) === K"call" &&
JuliaSyntax.is_infix_op_call(node)
end
function is_comparison_leaf(node::JuliaSyntax.GreenNode)
return is_leaf(node) && JuliaSyntax.is_prec_comparison(node)
end
Expand Down
2 changes: 1 addition & 1 deletion src/runestone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ end
# This pass handles spaces around infix operator calls and comparison chains
function spaces_around_operators(ctx::Context, node::JuliaSyntax.GreenNode)
if !(
JuliaSyntax.is_infix_op_call(node) ||
is_infix_op_call(node) ||
(JuliaSyntax.kind(node) === K"comparison" && !JuliaSyntax.is_trivia(node))
)
return nothing
Expand Down

0 comments on commit a0ba874

Please sign in to comment.