Add binary compares, some unary ops, fix binary arithmetic, add plain for loop.
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
#!/bin/bash
|
||||
LUA_HOME=/cygdrive/c/programs/lua5.1
|
||||
for x in test1 test2 test3 test4
|
||||
TESTS="test1 test2 test3 test4 test5"
|
||||
#TESTS="test5"
|
||||
for x in $TESTS
|
||||
do
|
||||
echo compiling $x
|
||||
${LUA_HOME}/luac5.1.exe -l -o ${x}.luac ${x}.lua
|
||||
${LUA_HOME}/lua5.1.exe ${x}.luac
|
||||
done
|
||||
|
||||
17
src/test/res/test5.lua
Normal file
17
src/test/res/test5.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
i = 777
|
||||
while i<780 do
|
||||
print(i)
|
||||
i = i+1
|
||||
end
|
||||
|
||||
a,b = 0,1
|
||||
while true do -- infinite loop
|
||||
print( b )
|
||||
a,b = b,a+b
|
||||
if a>10 then break end -- exit the loop if the condition is true
|
||||
end
|
||||
|
||||
for count = 336,330,-2 do print(count) end -- numerical iteration
|
||||
|
||||
-- for key,value in pairs({a=10, 3.14159265358, c="banana"}) do print(key, value) end
|
||||
BIN
src/test/res/test5.luac
Normal file
BIN
src/test/res/test5.luac
Normal file
Binary file not shown.
Reference in New Issue
Block a user