mirror of
https://github.com/leafo/moonscript.git
synced 2024-12-24 01:04:21 +00:00
make it choice /usr/bin/lua, not lua5.1
This commit is contained in:
parent
9e98affc1d
commit
db523926d3
4
Makefile
4
Makefile
@ -13,9 +13,9 @@ global:
|
|||||||
sudo luarocks make moonscript-dev-1.rockspec
|
sudo luarocks make moonscript-dev-1.rockspec
|
||||||
|
|
||||||
compile:
|
compile:
|
||||||
lua5.1 bin/moonc moon/ moonscript/
|
lua bin/moonc moon/ moonscript/
|
||||||
echo "#!/usr/bin/env lua" > bin/moon
|
echo "#!/usr/bin/env lua" > bin/moon
|
||||||
lua5.1 bin/moonc -p bin/moon.moon >> bin/moon
|
lua bin/moonc -p bin/moon.moon >> bin/moon
|
||||||
echo "-- vim: set filetype=lua:" >> bin/moon
|
echo "-- vim: set filetype=lua:" >> bin/moon
|
||||||
|
|
||||||
watch:
|
watch:
|
||||||
|
@ -41,7 +41,7 @@ debug = setmetatable {
|
|||||||
|
|
||||||
-- run a function with scope injected before its function environment
|
-- run a function with scope injected before its function environment
|
||||||
run_with_scope = (fn, scope, ...) ->
|
run_with_scope = (fn, scope, ...) ->
|
||||||
old_env = getfenv fn
|
old_env = util.getfenv fn
|
||||||
env = setmetatable {}, {
|
env = setmetatable {}, {
|
||||||
__index: (name) =>
|
__index: (name) =>
|
||||||
val = scope[name]
|
val = scope[name]
|
||||||
@ -50,7 +50,7 @@ run_with_scope = (fn, scope, ...) ->
|
|||||||
else
|
else
|
||||||
old_env[name]
|
old_env[name]
|
||||||
}
|
}
|
||||||
setfenv fn, env
|
util.setfenv fn, env
|
||||||
fn ...
|
fn ...
|
||||||
|
|
||||||
-- wrap obj such that calls to methods do not need a reference to self
|
-- wrap obj such that calls to methods do not need a reference to self
|
||||||
|
Loading…
Reference in New Issue
Block a user