-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
scanner: disallow shebang outside of *.vsh files #21029
scanner: disallow shebang outside of *.vsh files #21029
Conversation
why? |
Good question. Could be better to keep it valid it for .v files and treat it as a shebang is in script files. Recognized as shebang when it's at the beginning of the file. Currently this compiles. Which got me into this PR. module main
type Bar = string
fn main() {
#!/usr/bin/env -S v
dump('abc')
} |
In case |
I think it should be valid, only on the first line, no matter the extension. |
Note that you can: #!/usr/bin/env -S v -raw-vsh-tmp-prefix tmp run
dump('abc') Save this file as just |
You can also skip the
|
With the new changes a shebang that's not on the first line is disallowed. Shebangs are not recognized when it has empty lines beforehand.
Currently results in:
With the changes it would be:
The new error will stop |
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.
Excellent work.
No description provided.