diff --git a/public_html/js/Parser.js b/public_html/js/Parser.js
index 3f25d87..3ddb286 100644
--- a/public_html/js/Parser.js
+++ b/public_html/js/Parser.js
@@ -19,6 +19,12 @@ Parser.prototype.getInstance = function () {
return this;
};
+Parser.prototype.jumpLabel = function (label) {
+ if (label in this.labels) {
+ this.position = this.labels[label];
+ }
+};
+
Parser.prototype.next = function () {
this.lastPosition = this.position;
@@ -63,7 +69,7 @@ Parser.prototype.statement = function() {
if (this.match(token, TokenType.SHOW)) return this.show();
if (this.match(token, TokenType.HIDE)) return this.hide();
-// if (this.match(token, TokenType.JUMP)) return this.jump();
+ if (this.match(token, TokenType.JUMP)) return this.jump();
// if (this.match(token, TokenType.IF)) return this.ifStatement();
/*if (this.lookMatch(1, TokenType.COLON)) {
@@ -317,6 +323,12 @@ Parser.prototype.playAmbience = function() {
return false;
};
+Parser.prototype.jump = function() {
+ var labelName = this.consume(TokenType.WORD).getText();
+ this.jumpLabel(labelName);
+ return false;
+};
+
Parser.prototype.expression = function() {
return this.orTest();
};