webit.script.core.LoopInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webit-script Show documentation
Show all versions of webit-script Show documentation
a template-like script and engine, all writen with Java.
The newest version!
// Copyright (c) 2013-2014, Webit Team. All Rights Reserved.
package webit.script.core;
/**
*
* @author Zqq
*/
public class LoopInfo {
public static final int BREAK = 1;
public static final int CONTINUE = 2;
public static final int RETURN = 3;
public final int type;
public final int label;
public final int line;
public final int column;
public LoopInfo(int type, int label, int line, int column) {
this.type = type;
this.label = label;
this.line = line;
this.column = column;
}
public boolean matchLabel(int label) {
return this.label == 0 || this.label == label;
}
@Override
public String toString() {
int myType = this.type;
return (myType == BREAK ? "break"
: myType == CONTINUE ? "continue"
: myType == RETURN ? "return"
: "null") + "{" + "label=" + label + ", line=" + line + ", column=" + column + '}';
}
}