-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Teach InteractiveUtils how to read ncat
AST
#45399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Teach InteractiveUtils how to read ncat
AST
#45399
Conversation
Well, that was a lot of work for an underwhelming result 😆 They all have the same entry point, so they all look like this:
The LLVM and assembly are more interesting
|
ncat
ASTncat
AST
Might be good to get this out of the way and into 1.11, if there are no objections. @KristofferC |
This should probably make it in at some point, right? |
Yes, merge it? Or are test failures real (and making this overlooked, rerun them?)? It seems like a false alarm on apple but not sure about the other, then REPL related (only on 32-bit, strange). |
They both seem to be timeouts? The REPL error in the Linux 32-bit runner also occurs in 32-bit Windows CI but doesn't make it fail, so I think it's unrelated. I'll see if it's a known issue. |
It's happening in other recent PRs: https://buildkite.com/julialang/julia-master/builds/51387/steps/canvas?sid=0199e85c-6990-43c3-bed9-f157220cbb02 |
I get this:
would it be possible to add a test case or two? maybe with |
if x.head === :nrow | ||
extract_elements.(x.args[2:end]) | ||
elseif x.head === :row | ||
is_row_first = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for is_row_first
to work correctly here, it relies on extract_elements.(args)
to evaluate left-to-right ? that seems fragile (and definitely confusing)
map(esc, xs)...), kws...) | ||
else | ||
shape = get_shape(args, true, d) | ||
is_balanced = sum(map((x, y) -> sum(map(z -> z - y, x)), shape[2:end], first.(shape[2:end]))) == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if I understand this yet. so given rows of length 2, 1, 3
that would be "balanced" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are three method paths from the ncat AST:
- Fully specified count of concat arguments at all levels, as a tuple of tuples of ints; the "shape" form
- When the number of concat arguments within each dimension are the same, it is "balanced" and simplified to a tuple of ints counting the concat arguments along each dimension; the "dims" form
- When there's only one dimension, it's simplified to an int indicating which dimension to concat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Balanced: [a b c;;; d e f]
Not balanced: [a b c;;; d e]
Seems that this commit in master, but not 1.12, broke it: c3e7b1b I'll have to adjust. |
Will resolve #43294