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

Add support for shebangs #236

Merged
merged 6 commits into from
Feb 11, 2025
Merged

Add support for shebangs #236

merged 6 commits into from
Feb 11, 2025

Conversation

bpiel
Copy link
Contributor

@bpiel bpiel commented Feb 5, 2025

Closes #232

clojure.core=> #! hello
nil
clojure.core=> (+ 1 1) #! addition
2

From the issue:

We just need to add a ! case following # which then reuses the comment code (pull it into a fn named build_comment).

The code I ended up writing for shebang, while heavily inspired by the existing comment code, ended up being different in a few places throughout the code, such that it didn't seem appropriate to me to try to reuse a common function. Let me know if I'm missing something and should change my approach.

compiler+runtime/test/cpp/jank/read/lex.cpp Show resolved Hide resolved
compiler+runtime/src/cpp/jank/read/lex.cpp Outdated Show resolved Hide resolved
compiler+runtime/test/cpp/jank/read/lex.cpp Show resolved Hide resolved
@jeaye jeaye merged commit 56f1417 into jank-lang:main Feb 11, 2025
7 checks passed
@jeaye
Copy link
Member

jeaye commented Feb 11, 2025

Great work, Bill!

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.

Add support for shebangs
2 participants