Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Cobalt to support and use Lua 5.2 #50

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1d67e30
Added (preliminary) Lua 5.2 environment support
MCJack123 Mar 13, 2021
c1ddfdc
Implemented support for Lua 5.2 bytecode
MCJack123 Mar 26, 2021
0449528
Made most things work again
MCJack123 Mar 30, 2021
29a7573
Lua 5.2 bytecode works properly now
MCJack123 Mar 31, 2021
9fb8a9d
Added 5.2 bytecode generation
MCJack123 Mar 31, 2021
af40c7a
Added goto statement & labels
MCJack123 Apr 1, 2021
3f7109e
Added tail call hook
MCJack123 Apr 1, 2021
07d89d4
Added official Lua 5.2 goto tests
MCJack123 Apr 1, 2021
da4a305
Fixed 'return;', made goto context-sensitive
MCJack123 Apr 1, 2021
51a4053
Fixed goto-as-name when made the object of assignment
MCJack123 Apr 1, 2021
1dfb12c
Added uservalues, removed environments
MCJack123 Apr 1, 2021
32b5f6b
Fixed most of the tests
MCJack123 Apr 1, 2021
b572f47
Removed Lua 5.1 compiler, fixed Print a bit
MCJack123 Apr 5, 2021
3903aa0
Removed environments from threads, fixed a few tests
MCJack123 Apr 6, 2021
52b7a3b
Fixed some more tests
MCJack123 Apr 6, 2021
c502538
Fixed all tests
MCJack123 Apr 7, 2021
66a1274
Re-added bytecode tests
MCJack123 Apr 7, 2021
af31081
Removed debug prints
MCJack123 Apr 7, 2021
6dfde63
Fixed LOADK/EXTRAARG not being emitted
MCJack123 Apr 7, 2021
7fc02b9
Merge branch 'SquidDev:master' into lua52-environments
MCJack123 Jul 14, 2021
6c772e4
Merge branch 'SquidDev:master' into lua52-environments
MCJack123 Jul 19, 2021
246daa2
Merge branch 'SquidDev:master' into lua52-environments
MCJack123 Nov 21, 2021
19ca424
Allow arguments to xpcall
MCJack123 Nov 21, 2021
484ae62
Added separator argument to string.rep
MCJack123 Dec 1, 2021
614801e
Bumped version
MCJack123 Dec 16, 2021
b9a8435
Changed behavior of blockGoto
MCJack123 Dec 16, 2021
5a58bdb
Fixed string.unpack not throwing on unfinished zstr
MCJack123 Apr 9, 2022
d8f3d20
Merge branch 'SquidDev:master' into lua52-environments
MCJack123 Apr 30, 2022
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
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Cobalt [![Current build status](https://github.com/SquidDev/Cobalt/workflows/Build/badge.svg)](https://github.com/SquidDev/Cobalt/actions "Current build status")

## What?
Cobalt is a fork of LuaJ 2.0 (Lua 5.1) with many features of LuaJ 3.0 backported.
Cobalt is a fork of LuaJ 2.0 (Lua 5.1) + Lua 5.2 with many features of LuaJ 3.0 backported.

It allows multiple Lua instances to be run at once, with no shared metatables.

## Why?
LuaJ 2.0 had too many bugs, mostly minor but annoying. Cobalt is an attempt to slim down LuaJ (only the JSE will be supported) and fix most of the bugs.

## But Lua 5.1 is outdated!
## But Lua 5.2 is outdated!
I am considering having a separate Lua 5.3 branch but that is not an immediate priority right now.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = 'org.squiddev'
version = '0.5.5'
version = '0.6.0'

java {
toolchain {
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/squiddev/cobalt/ErrorFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.squiddev.cobalt.debug.DebugFrame;
import org.squiddev.cobalt.debug.DebugHandler;
import org.squiddev.cobalt.debug.DebugHelpers;
import org.squiddev.cobalt.debug.DebugHelpers52;

/**
* Factory class for errors
Expand Down Expand Up @@ -106,7 +107,7 @@ public static LuaError operandError(LuaState state, LuaValue operand, String ver
DebugFrame info = DebugHandler.getDebugState(state).getStack();
if (info != null && info.closure != null) {
if (stack < info.closure.getPrototype().maxstacksize) {
kind = DebugHelpers.getObjectName(info, stack);
kind = info.closure.getPrototype().isLua52 ? DebugHelpers52.getObjectName(info, stack) : DebugHelpers.getObjectName(info, stack);
}
}
}
Expand Down
Loading