Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix argument type #5695
fix argument type #5695
Changes from 3 commits
ec43c5b
0e18566
c51b9ea
cb785c7
31a5cc4
a78474b
fce8067
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 think this might work (so you can pass
nu -c [ 'a' '-b' '--c' ]
, for example), but intstead ofparse_full_cell_path()
, I'd useparse_list_expression()
.I'm not sure why this conditional was there in the first place since it's already checked above. Maybe @jntrnr knows?
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.
Thank you :-)
parse_list_expression
is explicit and better.+1 for the not sure...
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 think the parens were originally so that you can do stuff like:
I think we still want to support this. If we bring in support for the string arrays, that should probably be a separate thing.
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.
@jntrnr Isn't the subexpression checked on the line 293 though?
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.
hmmm, that 293 line looks odd. Are we really checking for
(
as the start and then callingparse_dollar_expr
? Does this cause any bugs in the current system?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.
parse_dollar_expr
goes toparse_full_cell_path
which checks for(
. So to me it seems this line is a duplicate.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 wonder if
parse_dollar_expr
just needs to be called something different now if it's doing more than parsing dollar expressions 😅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.
Yeah, it doesn't seem very accurate anymore :-D. But I guess we can maybe rename it and leave the
[
check for the list parsing?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.
Hmm... should I change to something like this to make the logic more explicit?
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.
If you look at the
parse_dollar_expr
code it's actually parsing more than a dollar expression, so the original condition should be preserved. It's just a matter of adding for[...]
.