Add skeleton for string library calls.

This commit is contained in:
James Roseborough
2007-09-18 01:00:36 +00:00
parent 5efda81b17
commit 952a2f9f16
6 changed files with 379 additions and 42 deletions

View File

@@ -146,4 +146,11 @@ public interface VM {
* must be on the top of the stack.
*/
public void lua_error();
/**
* Raises an error. The message is pushed onto the stack and used as the error message.
* It also adds at the beginning of the message the file name and the line number where
* the error occurred, if this information is available.
*/
public void luaL_error(String message);
}

View File

@@ -7,7 +7,6 @@ import java.util.StringTokenizer;
import lua.CallInfo;
import lua.StackState;
import lua.io.LocVars;
import lua.value.LValue;
public class DebugStackState extends StackState implements DebugRequestListener {
@@ -18,7 +17,6 @@ public class DebugStackState extends StackState implements DebugRequestListener
private int lastline = -1;
public DebugStackState() {
StackState.debugHooksEnabled = true;
}
// debug hooks

View File

@@ -342,4 +342,8 @@ public class LString extends LValue {
System.arraycopy( a, 0, newbytes, 0, Math.min( newSize, a.length ) );
return newbytes;
}
public int luaByte(int index) {
return m_bytes[m_offset + index];
}
}