-
Notifications
You must be signed in to change notification settings - Fork 59
feat(iota): allow // comments in iota client ptb commands
#9435
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: develop
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 6 Skipped Deployments
|
|
✅ Vercel Preview Deployment is ready! |
Co-authored-by: Thibault Martinez <[email protected]>
|
✅ Vercel Preview Deployment is ready! |
crates/iota/src/client_ptb/lexer.rs
Outdated
| self.buf = ""; | ||
| } | ||
|
|
||
| /// Skip comment tokens until we hit a command (starts with --) or EOF. |
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.
Maybe I misunderstand but shouldn't we skip until an EOL? Otherwise we can run a commented command?
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.
Hm good point, the problem is we can't detect end of lines in the parser since the shell removes this information before
What we could do is to ignore -- if it comes directly after //, but if we have an empty line, so just // \ and then a command again, it would also ignore this command
DaughterOfMars
left a comment
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.
tbh I'm not sure I see the utility here
Explaining what happens in a PTB could be useful and also commenting out part of a PTB for testing different combinations |
The problem I see is that this doesn't allow you to write a shell file and then copy paste it into the command line because of the comments having a different format. So this allows you to write commands instead in, what, a |
|
✅ Vercel Preview Deployment is ready! |
Description of change
Allow
//comments iniota client ptbcommands, the comments must be finished with\to continue with the commands. This is a limitation of bash/zsh and also the reason why#can't be used, as the parts afterwards wouldn't be visible to theiota client ptbcommand.This allows
Links to any relevant issues
Fixes #9432
How the change has been tested
Release Notes
//comment support iniota client ptbcommands