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

Assorted fixes #48

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open

Assorted fixes #48

wants to merge 61 commits into from

Conversation

asiekierka
Copy link

The source for all of these fixes is the "OpenComputers" Minecraft mod, which utilized LuaJ as one of its Lua engines for years - specifically: https://github.com/MightyPirates/OC-LuaJ ; their main goal was to remove disparities between real Lua 5.2 and LuaJ.

Most of my work in this pertains to ensuring the code still compiles in J2ME, as well as splitting up the large commits into smaller ones. Feel free to only merge some of these fixes, if some are not applicable to LuaJ.

asiekierka and others added 14 commits August 11, 2019 11:47
Added PAIRS and IPAIRS constants to LuaValue
Merged pairs and ipairs into one class with a dynamic constructor, this
is similar to Lua's pairsmeta function.
Check for and call it's specific metamethod if it's available.
Fix string.format's floating point implementation

Disable space if explicitPlus is set
Disable leftAdjust and zeroPad if no width is specified
precision gets set to zero if only a dot is specified

Add support for %a/A, Lua can use these and Java happens to support it
Fixes lengthAsUtf8, encodeToUtf8, and isValidUtf8 to support UTF-8's
4-byte sequences or UTF-16's surrogate pairs properly.
Invalid surrogate pairs are converted to '?' as Java's converter does
@@ -21,6 +21,8 @@
******************************************************************************/
package org.luaj.vm2;

import jdk.nashorn.internal.objects.Global;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not needed and breaks compilation.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, sorry!

@asiekierka
Copy link
Author

Updated to latest upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants