-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,129 changed files
with
1,712 additions
and
1,103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
local t = {} | ||
for i = 1, 600 do | ||
t[i] = i | ||
end | ||
|
||
local script = "array(" .. table.concat(t, ",") .. ")" | ||
|
||
local o1, o2, o3 = debug.gethook() | ||
|
||
debug.sethook(error, "", 1e6) | ||
|
||
local _, code_ok, compiled = pcall(E2Lib.compileScript, script) | ||
|
||
debug.sethook(o1, o2, o3) | ||
|
||
assert(code_ok, "Took too long to compile!") | ||
|
||
debug.sethook(error, "", 1e6) | ||
|
||
local ok = pcall(compiled) | ||
|
||
debug.sethook(o1, o2, o3) | ||
|
||
assert(ok, "Took too long to run!") |
3 changes: 3 additions & 0 deletions
3
data/expression2/tests/compiler/parser/restrictions/fn_function.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## SHOULD_FAIL:COMPILE | ||
|
||
function function() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## SHOULD_PASS:COMPILE | ||
|
||
function function retfn() { | ||
return function() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## SHOULD_PASS:EXECUTE | ||
|
||
changed(ang()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
## SHOULD_PASS:EXECUTE | ||
|
||
Ran = 0 | ||
|
||
for(I = 1, 1) { | ||
switch (0xDEADBEEF) { | ||
default, | ||
break # Shouldn't break out of loop | ||
} | ||
|
||
Ran = 1 | ||
} | ||
|
||
assert(Ran) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
## SHOULD_PASS:EXECUTE | ||
|
||
@strict | ||
|
||
# == 1 x 2 | ||
# opcounter 1 x 2 | ||
# assert 2 x 2 | ||
# string:upper 1 | ||
# max(nn) 1 | ||
# <literal> 0.125 x 7 | ||
# soundDuration 5000 | ||
|
||
"":upper() | ||
max(1, 2) | ||
|
||
assert( opcounter() == 5021 ) | ||
|
||
function number:usermethod() {} | ||
|
||
1:usermethod() # + 5 | ||
|
||
assert( opcounter() == 5021 ) | ||
|
||
function userfunction() {} | ||
|
||
userfunction() # + 5 | ||
|
||
soundDuration("") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## SHOULD_PASS:EXECUTE | ||
|
||
assert( isinf(_INF) ) | ||
assert( !isfinite(_INF) ) | ||
|
||
assert( isnan(0/0) ) | ||
|
||
assert( _E == e() ) | ||
assert( _INF == inf() ) | ||
assert( _PI == pi() ) | ||
|
||
assert( _INF:toString(2) == "inf" ) | ||
assert( (2^2000):toString(2) == "inf" ) | ||
assert( 0b11110101:toString(2) == "11110101" ) | ||
|
||
assert( mod(1, 2) == 1 % 2 ) | ||
assert( mod(-5, 2) != -5 % 2 ) | ||
|
||
assert( round(1.235, 2) == 1.24 ) | ||
|
||
assert( round(frac(5.3), 1) == 0.3 ) | ||
assert( round(frac(-5.3), 1) == -0.3 ) | ||
|
||
assert( abs(-5) == 5 ) | ||
|
||
assert( floor(0.6) == 0 ) | ||
assert( ceil(0.1) == 1 ) | ||
|
||
assert( round(0.1) == 0 ) | ||
assert( round(0.6) == 1 ) | ||
|
||
assert( log2(2) == 1 ) | ||
assert( log2(5) == (ln(5) / ln(2)) ) | ||
assert( log(5, 2) == (ln(5) / ln(2)) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
## SHOULD_PASS:EXECUTE | ||
|
||
local Quat = quat() | ||
|
||
Quat[1] = 77 | ||
|
||
assert(Quat[1] == 77) | ||
assert(Quat:real() == 77) | ||
|
||
assert(Quat[2] == 0) | ||
assert(Quat:i() == 0) | ||
|
||
assert(Quat[3] == 0) | ||
assert(Quat:j() == 0) | ||
|
||
assert(Quat[4] == 0) | ||
assert(Quat:k() == 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.