]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
parser: Add peek(n) method to parser
authorArthur Cohen <arthur.cohen@embecosm.com>
Mon, 19 Feb 2024 19:41:50 +0000 (20:41 +0100)
committerCohenArthur <arthur.cohen@embecosm.com>
Fri, 1 Mar 2024 15:42:36 +0000 (15:42 +0000)
gcc/rust/ChangeLog:

* parse/rust-parse.h: New method.

gcc/rust/parse/rust-parse.h

index 1614d19e4a5b4bc192530c32be34f80afdd26487..8c8bf96eb8d072e46d3c60d016e0e2dbfee9caa2 100644 (file)
@@ -725,6 +725,7 @@ public:
   const ManagedTokenSource &get_token_source () const { return lexer; }
 
   const_TokenPtr peek_current_token () { return lexer.peek_token (0); }
+  const_TokenPtr peek (int n) { return lexer.peek_token (n); }
 
 private:
   // The token source (usually lexer) associated with the parser.