More work on nesting
This commit is contained in:
@@ -83,13 +83,37 @@ return table[1][1][2]
|
||||
{
|
||||
const string input = @"
|
||||
table = {
|
||||
function() test
|
||||
function test()
|
||||
return 100
|
||||
end
|
||||
end,
|
||||
val = 400,
|
||||
another = 10_000,
|
||||
}
|
||||
return table[""test""]()
|
||||
";
|
||||
var script = new Script(input);
|
||||
Assert.Empty(script.Diagnostics.Messages);
|
||||
var evaluated = script.Evaluate<long>();
|
||||
Assert.Empty(script.Diagnostics.Messages);
|
||||
Assert.Equal(100, evaluated);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DumbassTableFunctionNesting()
|
||||
{
|
||||
const string input = @"
|
||||
table = {
|
||||
function func()
|
||||
return function func()
|
||||
return {
|
||||
function func()
|
||||
return 100
|
||||
end
|
||||
}
|
||||
end
|
||||
end,
|
||||
}
|
||||
return table[""func""]()()[1]()
|
||||
";
|
||||
var script = new Script(input);
|
||||
Assert.Empty(script.Diagnostics.Messages);
|
||||
|
||||
Reference in New Issue
Block a user