diff mbox series

[030/125] gccrs: parser: Add peek(n) method to parser

Message ID 20240801145809.366388-32-arthur.cohen@embecosm.com
State New
Headers show
Series [001/125] Rust: Make 'tree'-level 'MAIN_NAME_P' work | expand

Commit Message

Arthur Cohen Aug. 1, 2024, 2:56 p.m. UTC
gcc/rust/ChangeLog:

	* parse/rust-parse.h: New method.
---
 gcc/rust/parse/rust-parse.h | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/gcc/rust/parse/rust-parse.h b/gcc/rust/parse/rust-parse.h
index 1614d19e4a5..8c8bf96eb8d 100644
--- a/gcc/rust/parse/rust-parse.h
+++ b/gcc/rust/parse/rust-parse.h
@@ -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.