Beispiel #1
0
 private Token Expect(TokenKind kind)
 {
     if (this.NextNthIs(0, kind))
     {
         var token = this.tokens[this.index];
         this.Advance();
         return(token);
     }
     else
     {
         this.ErrorBeforeCurrent("expected " + kind.Name());
         throw new ParseException();
     }
 }