synchronize method

void synchronize()

Implementation

void synchronize() {
  advance();
  while (!isAtEnd()) {
    if (previous().type == TokenType.semicolon) return;
    switch (peek().type) {
      case TokenType.tartVar:
      case TokenType.tartFor:
      case TokenType.tartIf:
      case TokenType.tartWhile:
      case TokenType.tartReturn:
        return;
      default:
    }
    advance();
  }
}