Exemple #1
0
 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;
     }
 }
Exemple #2
0
 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);
 }
Exemple #3
0
 private void readNext()
 {
     next = tokens.MoveNext() ? tokens.Current : null;
 }