Skip to content

Conversation

@davydog187
Copy link
Contributor

Summary

Adds support for Unix shebang (#!) on the first line of Lua files.

Implementation

  • Automatically strips first line if it starts with #!
  • Matches standard Lua 5.3 behavior
  • Only applies to first line (subsequent # characters are errors)

Tests

✅ New test in lexer_test.exs:

  • Shebang on first line is ignored
  • Shebang on other lines causes error

Test Results

mix test
1085 tests, 0 failures, 30 skipped

Impact

Unblocks all.lua from Lua 5.3 test suite which uses #!/usr/bin/env lua.

Dave Lucia added 3 commits February 10, 2026 19:54
Support Unix shebang (#!) on first line of Lua files.
The first line starting with #! is automatically stripped
before tokenization, matching standard Lua behavior.

Test added to lexer_test.exs.
All tests passing (1085 tests, 0 failures)
More idiomatic Elixir - String.split handles Unicode properly
and is what developers expect.
List.last() doesn't handle edge case of shebang-only file correctly.
Case statement properly returns empty string when no code follows shebang.
@davydog187 davydog187 merged commit 82c41b1 into main Feb 11, 2026
2 checks passed
@davydog187 davydog187 deleted the add-shebang-support branch February 11, 2026 04:00
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.

1 participant