refactored and reworked functions in scarpet
This commit is contained in:
1 parent
3feb7bffbb
commit
95b85928f9
17 files changed
+362
-220
No files matched your search
@@ -0,0 +1,13 @@
|
||||
package carpet.script.exception;
|
||||
|
||||
import carpet.script.value.Value;
|
||||
|
||||
/* Exception thrown to terminate execution mid expression (aka return statement) */
|
||||
public class ExitStatement extends RuntimeException
|
||||
{
|
||||
public Value retval;
|
||||
public ExitStatement(Value value)
|
||||
{
|
||||
retval = value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package carpet.script.exception;
|
||||
|
||||
import carpet.script.value.Value;
|
||||
|
||||
public class ReturnStatement extends ExitStatement
|
||||
{
|
||||
|
||||
public ReturnStatement(Value value)
|
||||
{
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package carpet.script.exception;
|
||||
|
||||
import carpet.script.value.Value;
|
||||
|
||||
public class ThrowStatement extends ExitStatement
|
||||
{
|
||||
public ThrowStatement(Value value)
|
||||
{
|
||||
super(value);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user