-
Notifications
You must be signed in to change notification settings - Fork 217
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
Support comments in mlr -s
files
#1343
Comments
Oh, thanks! 😀 I suggest rewriting the title to something like "allow comments in regular miller scripts (loaded with mlr -s)" or similar.. |
Oops I thought I did -- didn't push 'save' or something -- thank you! |
mlr put -f
) but not in "normal" miller scripts (i.e. loaded with mlr -s
). In regular miller scripts only the first line can have a #
to allow shebangs, but using the #
anywhere else leads to an error. 😕mlr -s
files
@janxkoci here's the catch: Namely, if the script file is like
-- which is admittedly a corner-case -- then a naïvely coded replace of I think the best option (most often correct) will be for |
Wait, doesn't the parser treat code in quotes differently? Or in the parentheses for names with special characters - I thought special treatment was the whole point of those 😳 |
@janxkoci yes the DSL parser definitely treats code in quotes differently. But the comment-stripping here has to be before the DSL parser is invoked. It's a big of a chicken-and-egg situationj ... |
Handling these two
would (if I understand correctly) require re-implementing a shell parser in Miller ... |
No worries, and you can even close it, if it's implemented. I mostly don't have such problem with field names anyway, or I can just re-label them. I was just surprised that the parser works like this, that's all.. 🤷 |
Originally posted by @janxkoci in #1154 (comment)
The text was updated successfully, but these errors were encountered: