Вынесен метод jumpLabel
This commit is contained in:
parent
3432fb3ab2
commit
4fddf04f07
@ -78,6 +78,12 @@ public final class Parser {
|
||||
this.position = position;
|
||||
next();
|
||||
}
|
||||
|
||||
public void jumpLabel(String label) {
|
||||
if (labels.containsKey(label)) {
|
||||
position = labels.get(label);
|
||||
}
|
||||
}
|
||||
|
||||
public void next() {
|
||||
// Команды разделяются на терминальные и нетерминальные.
|
||||
@ -410,9 +416,7 @@ public final class Parser {
|
||||
|
||||
private boolean jump() {
|
||||
final String labelName = consume(TokenType.WORD).getText();
|
||||
if (labels.containsKey(labelName)) {
|
||||
position = labels.get(labelName);
|
||||
}
|
||||
jumpLabel(labelName);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user