-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from kindlich/master
Continue statement | Array<->List cast | ReturnsSelf
- Loading branch information
Showing
10 changed files
with
245 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 26 additions & 26 deletions
52
src/main/java/stanhebben/zenscript/statements/StatementBreak.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
package stanhebben.zenscript.statements; | ||
|
||
import org.objectweb.asm.Label; | ||
import stanhebben.zenscript.compiler.IEnvironmentMethod; | ||
import stanhebben.zenscript.util.ZenPosition; | ||
|
||
public class StatementBreak extends Statement { | ||
|
||
private Label exit; | ||
|
||
public StatementBreak(ZenPosition position) { | ||
super(position); | ||
} | ||
|
||
public void setExit(Label exit) { | ||
this.exit = exit; | ||
} | ||
|
||
@Override | ||
public void compile(IEnvironmentMethod environment) { | ||
if(exit != null) | ||
environment.getOutput().goTo(exit); | ||
else | ||
environment.error(getPosition(), "Skipping break statement as it has no proper label. Only use breaks in loops!"); | ||
} | ||
} | ||
package stanhebben.zenscript.statements; | ||
|
||
import org.objectweb.asm.Label; | ||
import stanhebben.zenscript.compiler.IEnvironmentMethod; | ||
import stanhebben.zenscript.util.ZenPosition; | ||
|
||
public class StatementBreak extends Statement { | ||
|
||
private Label exit; | ||
|
||
public StatementBreak(ZenPosition position) { | ||
super(position); | ||
} | ||
|
||
public void setExit(Label exit) { | ||
this.exit = exit; | ||
} | ||
|
||
@Override | ||
public void compile(IEnvironmentMethod environment) { | ||
if(exit != null) | ||
environment.getOutput().goTo(exit); | ||
else | ||
environment.error(getPosition(), "Skipping break statement as it has no proper label. Only use breaks in loops!"); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/stanhebben/zenscript/statements/StatementContinue.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package stanhebben.zenscript.statements; | ||
|
||
import org.objectweb.asm.Label; | ||
import stanhebben.zenscript.compiler.IEnvironmentMethod; | ||
import stanhebben.zenscript.util.ZenPosition; | ||
|
||
public class StatementContinue extends Statement { | ||
|
||
private Label exit; | ||
|
||
public StatementContinue(ZenPosition position) { | ||
super(position); | ||
} | ||
|
||
public void setExit(Label exit) { | ||
this.exit = exit; | ||
} | ||
|
||
@Override | ||
public void compile(IEnvironmentMethod environment) { | ||
if(exit != null) | ||
environment.getOutput().goTo(exit); | ||
else | ||
environment.error(getPosition(), "Skipping continue statement as it has no proper label. Only use them in loops!"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.