private void readNext() { try { next = tokens.MoveNext() ? tokens.Current : null; } catch (Exception) { // If an exception is encountered scanning, // re-initialize the enumerator (as soon as MoveNext // throws an exception the previous enumerator // appears to switch to 'EOF'). // This is to support recovery from typos in the REPL. initTokens(s.Recover()); throw; } }
public bool Equals(Token other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.type, type) && Equals(other.contents, contents); }
private void readNext() { next = tokens.MoveNext() ? tokens.Current : null; }