Skip to content
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

Made shebangs be ignored #1509

Closed
wants to merge 1 commit into from
Closed

Made shebangs be ignored #1509

wants to merge 1 commit into from

Conversation

ellipse12
Copy link
Contributor

shebangs are now treated as comments. This allows single file scripts to be made using the compile-run command.
Example:

#!/bin/c3c compile-run
import std::io;
fn int main(String args)
{
    io::printn("Hello, World!");
    return 0;
}

It does not make # into comments only #!

@lerno
Copy link
Collaborator

lerno commented Oct 1, 2024

I've thought about that feature, but decided not to include it.

@sa-tasche
Copy link

Also for files in folder scripts?

@lerno
Copy link
Collaborator

lerno commented Oct 1, 2024

How do you mean?

@ellipse12
Copy link
Contributor Author

@lerno Sorry I didn't realize you had already thought about it, do you mind sharing your reservations?

@lerno
Copy link
Collaborator

lerno commented Oct 1, 2024

Originally #! was smart, because comments started with # in many scripting languages. I know D adds this, but I feel it would be something that would be too unix-y to properly be in the language.

@ellipse12
Copy link
Contributor Author

Oh ok that makes sense, though I might keep it in my own fork if that's ok, I see myself using it fairly often.

@ellipse12 ellipse12 closed this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants