Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Lua/CodeAnalysis/Syntax/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,7 @@ bool TryParseExpression(ref SyntaxTokenEnumerator enumerator, OperatorPrecedence
return false;
}

// nested table access & function call
RECURSIVE:
RECURSIVE: // Nested table access & function call.
enumerator.SkipEoL();

var nextType = enumerator.GetNext().Type;
Expand Down
2 changes: 1 addition & 1 deletion src/Lua/LuaState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ internal void CloseUpValues(int frameBase)

public void Dispose()
{
if(CoreData == null) return;
if (CoreData == null) return;
if (CoreData.CallStack.Count != 0)
{
throw new InvalidOperationException("This state is running! Call stack is not empty!!");
Expand Down
2 changes: 1 addition & 1 deletion src/Lua/LuaStateExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public static ValueTask<int> CallAsync(this LuaState state, int funcIndex, Cance
{
return LuaVirtualMachine.Call(state, funcIndex, funcIndex, cancellationToken);
}

public static ValueTask<int> CallAsync(this LuaState state, int funcIndex, int returnBase, CancellationToken cancellationToken = default)
{
return LuaVirtualMachine.Call(state, funcIndex, returnBase, cancellationToken);
Expand Down
2 changes: 1 addition & 1 deletion src/Lua/Standard/BasicLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public async ValueTask<int> IPairs(LuaFunctionExecutionContext context, Cancella
var arg0 = context.GetArgument(0);

// If table has a metamethod __ipairs, calls it with table as argument and returns the first three results from the call.
if (context.State.GlobalState.TryGetMetatable(arg0,out var metaTable) && metaTable.TryGetValue(Metamethods.IPairs, out var metamethod))
if (context.State.GlobalState.TryGetMetatable(arg0, out var metaTable) && metaTable.TryGetValue(Metamethods.IPairs, out var metamethod))
{
var stack = context.State.Stack;
var top = stack.Count;
Expand Down
2 changes: 1 addition & 1 deletion tests/Lua.Tests/LexerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void Test_If_Else()
public void Test_ManyComments()
{
var builder = new StringBuilder();

for (int i = 0; i < 1000; i++)
{
builder.AppendLine("--");
Expand Down
3 changes: 1 addition & 2 deletions tests/Lua.Tests/LuaObjectTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public async Task<double> Len()
await Task.Delay(1);
return x + y;
}

[LuaMetamethod(LuaObjectMetamethod.Unm)]
public LuaTestObj Unm()
{
Expand Down Expand Up @@ -315,6 +315,5 @@ function testLen(obj)
var objUnm = results[1].Read<LuaTestObj>();
Assert.That(objUnm.X, Is.EqualTo(-1));
Assert.That(objUnm.Y, Is.EqualTo(-2));

}
}