Enhance shebang handling in REPL and source code execution to preserve line numbers

This commit is contained in:
2025-10-09 16:35:22 +01:00
parent 27dfa57a5d
commit cf19a6ec5d
2 changed files with 54 additions and 8 deletions

21
new_proj.luash Normal file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env luash
-- Environment variables (clean syntax)
print("Hello " .. $USER .. "!")
-- Variable assignment
$MY_VAR = "some value"
-- Shell commands with backticks
files = `ls -la`
current_dir = `pwd`
-- Interactive commands
!ls
-- The power of Lua + shell
if `test -f README.md` ~= "" then
lines = `wc -l < README.md`
print("README has " .. lines .. " lines")
end