mirror of
https://github.com/leafo/moonscript.git
synced 2024-11-22 02:44:23 +00:00
LUA=lua5.1 as default, and detect luarocks and LUA_{C,}PATH
This commit is contained in:
parent
db523926d3
commit
0d330c8416
25
Makefile
25
Makefile
@ -1,3 +1,18 @@
|
||||
LUA ?= lua5.1
|
||||
LUAROCKS ?= luarocks
|
||||
|
||||
ifneq ($(LUA),lua)
|
||||
LUA_VERSION = $(shell echo $(LUA) | sed -e "s/lua\(.*\)/\1/")
|
||||
LUAROCKS = luarocks-$(LUA_VERSION)
|
||||
LUA_PATH_MAKE = $(shell echo "${LUA_PATH}" | sed -e "s/[0-9]\.[0-9]/$(LUA_VERSION)/g")
|
||||
LUA_CPATH_MAKE = $(shell echo "${LUA_CPATH}" | sed -e "s/[0-9]\.[0-9]/$(LUA_VERSION)/g")
|
||||
endif
|
||||
|
||||
ifeq ($(LUA),luajit)
|
||||
LUAROCKS = luarocks-5.1
|
||||
endif
|
||||
|
||||
|
||||
.PHONY: test local compile watch lint test_safe
|
||||
|
||||
test:
|
||||
@ -7,15 +22,15 @@ test_safe:
|
||||
busted -p "_spec.lua$$"
|
||||
|
||||
local: compile
|
||||
luarocks make --local moonscript-dev-1.rockspec
|
||||
LUA_PATH=$(LUA_PATH_MAKE) LUA_CPATH=$(LUA_CPATH_MAKE) $(LUAROCKS) make --local moonscript-dev-1.rockspec
|
||||
|
||||
global:
|
||||
sudo luarocks make moonscript-dev-1.rockspec
|
||||
sudo LUA_PATH=$(LUA_PATH_MAKE) LUA_CPATH=$(LUA_CPATH_MAKE) $(LUAROCKS) make moonscript-dev-1.rockspec
|
||||
|
||||
compile:
|
||||
lua bin/moonc moon/ moonscript/
|
||||
compile: init
|
||||
LUA_PATH=$(LUA_PATH_MAKE) LUA_CPATH=$(LUA_CPATH_MAKE) $(LUA) bin/moonc moon/ moonscript/
|
||||
echo "#!/usr/bin/env lua" > bin/moon
|
||||
lua bin/moonc -p bin/moon.moon >> bin/moon
|
||||
$(LUA) bin/moonc -p bin/moon.moon >> bin/moon
|
||||
echo "-- vim: set filetype=lua:" >> bin/moon
|
||||
|
||||
watch:
|
||||
|
@ -291,7 +291,7 @@ build_grammar = wrap_env debug_grammar, (root) ->
|
||||
op"*" + op"^" +
|
||||
Ct(NameList) * (sym"=" * Ct(ExpListLow))^-1) / mark"export"
|
||||
|
||||
KeyValue: (sym":" * -SomeSpace * Name * lpeg.Cp()) / self_assign + Ct((KeyName + sym"[" * Exp * sym"]" + DoubleString + SingleString) * symx":" * (Exp + TableBlock + SpaceBreak^1 * Exp))
|
||||
KeyValue: (sym":" * -SomeSpace * Name * lpeg.Cp!) / self_assign + Ct((KeyName + sym"[" * Exp * sym"]" + DoubleString + SingleString) * symx":" * (Exp + TableBlock + SpaceBreak^1 * Exp))
|
||||
KeyValueList: KeyValue * (sym"," * KeyValue)^0
|
||||
KeyValueLine: CheckIndent * KeyValueList * sym","^-1
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user