From 9c61fed37cdbec8ac4f7aa25d46a982a39f8f5a8 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Thu, 16 Feb 2023 09:49:21 +0330 Subject: [PATCH] AK: Add an input() accessor to GenericLexer It's sometimes useful to get the input from the lexer instead of wiring it all the way down to where it's needed. --- AK/GenericLexer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/AK/GenericLexer.h b/AK/GenericLexer.h index ee9a95e787..508c4df3a2 100644 --- a/AK/GenericLexer.h +++ b/AK/GenericLexer.h @@ -22,6 +22,7 @@ public: constexpr size_t tell_remaining() const { return m_input.length() - m_index; } StringView remaining() const { return m_input.substring_view(m_index); } + StringView input() const { return m_input; } constexpr bool is_eof() const { return m_index >= m_input.length(); }