Skip to content

Commit

Permalink
Bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
SquidDev committed Mar 15, 2016
1 parent bd191bd commit 300ef76
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'java'
apply plugin: 'maven-publish'

group = 'org.squiddev'
version = '0.1.2'
version = '0.1.3'

targetCompatibility = sourceCompatibility = 1.6
compileTestJava.sourceCompatibility = compileTestJava.targetCompatibility = 1.8
Expand Down
18 changes: 10 additions & 8 deletions src/main/java/org/squiddev/cobalt/OperationHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,18 @@ public static boolean eq(LuaState state, LuaValue left, LuaValue right) {

//region Unary

public static LuaValue length(LuaState state, LuaValue value) {
return length(state, value, -1);
}

/**
* Length operator: return lua length of object including metatag processing
*
* @param state The current lua state
* @param value The value to ge the length of
* @return length as defined by the lua # operator or metatag processing result
* @throws LuaError if {@code value} is not a table or string, and has no {@link Constants#LEN} metatag
*/
public static LuaValue length(LuaState state, LuaValue value) {
return length(state, value, -1);
}

public static LuaValue length(LuaState state, LuaValue value, int stack) {
switch (value.type()) {
case Constants.TTABLE:
Expand All @@ -316,17 +317,18 @@ public static LuaValue length(LuaState state, LuaValue value, int stack) {
}
}

public static LuaValue neg(LuaState state, LuaValue value) {
return neg(state, value, -1);
}

/**
* Unary minus: return negative value {@code (-this)} as defined by lua unary minus operator
*
* @param state The current lua state
* @param value Value to get the minus of
* @return numeric inverse as {@link LuaNumber} if numeric, or metatag processing result if {@link Constants#UNM} metatag is defined
* @throws LuaError if {@code value} is not a table or string, and has no {@link Constants#UNM} metatag
*/
public static LuaValue neg(LuaState state, LuaValue value) {
return neg(state, value, -1);
}

public static LuaValue neg(LuaState state, LuaValue value, int stack) {
int tValue = value.type();
if (tValue == Constants.TNUMBER) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* to the correct function within the library.
*
* Since lua functions can be called with too few or too many arguments,
* and there are overloaded {@link LuaValue#call(LuaState)} functions with varying
* and there are overloaded {@link LuaFunction#call(LuaState)} functions with varying
* number of arguments, a Java function exposed in lua needs to handle the
* argument fixup when a function is called with a number of arguments
* differs from that expected.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
* Abstract base class for Java function implementations that take one argument and
* return one value.
*
* Subclasses need only implement {@link LuaValue#call(LuaState, LuaValue)} to complete this class,
* Subclasses need only implement {@link LuaFunction#call(LuaState, LuaValue)} to complete this class,
* simplifying development.
* All other uses of {@link LuaValue#call(LuaState)}, {@link LuaValue#invoke(LuaState, Varargs)},etc,
* All other uses of {@link LuaFunction#call(LuaState)}, {@link LuaFunction#invoke(LuaState, Varargs)},etc,
* are routed through this method by this class,
* dropping or extending arguments with {@code nil} values as required.
*
Expand All @@ -47,7 +47,7 @@
*
* See {@link LibFunction} for more information on implementation libraries and library functions.
*
* @see LuaValue#call(LuaState, LuaValue)
* @see LuaFunction#call(LuaState, LuaValue)
* @see LibFunction
* @see ZeroArgFunction
* @see TwoArgFunction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
* Abstract base class for Java function implementations that take two arguments and
* return one value.
*
* Subclasses need only implement {@link LuaValue#call(LuaState, LuaValue, LuaValue, LuaValue)} to complete this class,
* Subclasses need only implement {@link LuaFunction#call(LuaState, LuaValue, LuaValue, LuaValue)} to complete this class,
* simplifying development.
* All other uses of {@link LuaValue#call(LuaState)}, {@link LuaValue#invoke(LuaState, Varargs)},etc,
* All other uses of {@link LuaFunction#call(LuaState)}, {@link LuaFunction#invoke(LuaState, Varargs)},etc,
* are routed through this method by this class,
* dropping or extending arguments with {@code nil} values as required.
*
Expand All @@ -48,7 +48,7 @@
*
* See {@link LibFunction} for more information on implementation libraries and library functions.
*
* @see LuaValue#call(LuaState, LuaValue, LuaValue, LuaValue)
* @see LuaFunction#call(LuaState, LuaValue, LuaValue, LuaValue)
* @see LibFunction
* @see ZeroArgFunction
* @see OneArgFunction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
* Abstract base class for Java function implementations that take two arguments and
* return one value.
*
* Subclasses need only implement {@link LuaValue#call(LuaState, LuaValue, LuaValue)} to complete this class,
* Subclasses need only implement {@link LuaFunction#call(LuaState, LuaValue, LuaValue)} to complete this class,
* simplifying development.
* All other uses of {@link LuaValue#call(LuaState)}, {@link LuaValue#invoke(LuaState, Varargs)},etc,
* All other uses of {@link LuaFunction#call(LuaState)}, {@link LuaFunction#invoke(LuaState, Varargs)},etc,
* are routed through this method by this class,
* dropping or extending arguments with {@code nil} values as required.
*
Expand All @@ -48,7 +48,7 @@
*
* See {@link LibFunction} for more information on implementation libraries and library functions.
*
* @see LuaValue#call(LuaState, LuaValue, LuaValue)
* @see LuaFunction#call(LuaState, LuaValue, LuaValue)
* @see LibFunction
* @see ZeroArgFunction
* @see OneArgFunction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
* Abstract base class for Java function implementations that takes varaiable arguments and
* returns multiple return values.
*
* Subclasses need only implement {@link LuaValue#invoke(LuaState, Varargs)} to complete this class,
* Subclasses need only implement {@link LuaFunction#invoke(LuaState, Varargs)} to complete this class,
* simplifying development.
* All other uses of {@link LuaValue#call(LuaState, LuaValue)}, {@link LuaValue#invoke(LuaState, Varargs)},etc,
* All other uses of {@link LuaFunction#call(LuaState, LuaValue)}, {@link LuaFunction#invoke(LuaState, Varargs)},etc,
* are routed through this method by this class,
* converting arguments to {@link Varargs} and
* dropping or extending return values with {@code nil} values as required.
Expand All @@ -44,7 +44,7 @@
*
* See {@link LibFunction} for more information on implementation libraries and library functions.
*
* @see LuaValue#invoke(LuaState, Varargs)
* @see LuaFunction#invoke(LuaState, Varargs)
* @see LibFunction
* @see ZeroArgFunction
* @see OneArgFunction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
* Abstract base class for Java function implementations that take no arguments and
* return one value.
*
* Subclasses need only implement {@link LuaValue#call(LuaState)} to complete this class,
* Subclasses need only implement {@link LuaFunction#call(LuaState)} to complete this class,
* simplifying development.
* All other uses of {@link LuaValue#call(LuaState, LuaValue)}, {@link LuaValue#invoke(LuaState, Varargs)},etc,
* All other uses of {@link LuaFunction#call(LuaState, LuaValue)}, {@link LuaFunction#invoke(LuaState, Varargs)},etc,
* are routed through this method by this class.
*
* If one or more arguments are required, or variable argument or variable return values,
Expand All @@ -44,7 +44,7 @@
*
* See {@link LibFunction} for more information on implementation libraries and library functions.
*
* @see LuaValue#call(LuaState)
* @see LuaFunction#call(LuaState)
* @see LibFunction
* @see OneArgFunction
* @see TwoArgFunction
Expand Down

0 comments on commit 300ef76

Please sign in to comment.