-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
Add support for extra Unix shebangs #1163
Add support for extra Unix shebangs #1163
Conversation
standard/Parser.hs
Outdated
@@ -1918,7 +1918,10 @@ nonEmptyListLiteral = do | |||
return (NonEmptyList (e0 :| es)) | |||
|
|||
shebang :: Parser () | |||
shebang = do "#!"; many notEndOfLine; endOfLine; return () | |||
shebang = do |
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.
Instead of changing the implementation of shebang
, I'd suggest changing the implementation of completeExpression
from optional shebang
to many shebang
. The reason I suggest this is because it would more closely correspond to the ABNF grammar
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.
That also looks much simpler
@@ -1,2 +1,3 @@ | |||
#!/usr/bin/env -S dhall text --file | |||
#! extra bang |
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.
Also, rather than change this test, I'd suggest adding a new test for the nix-shell
example that motivated this change
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.
Done, thanks for the review!
This change enables using nix-shell multiline shebangs in dhall files.
This change fixes the scripts path in the CONTRIBUTING.md file.
647ced0
to
55f60b1
Compare
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.
👍
Co-authored-by: Basile Henry <bjm.henry@gmail.com>
This change enables using nix-shell multiline shebangs in dhall files.