1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00

LanguageServers/Cpp: Support jumping to declaration of preprocessor

.. definitions.
This commit is contained in:
Itamar 2021-03-13 10:37:23 +02:00 committed by Andreas Kling
parent 7bf6eca9d8
commit 8688259ed9
8 changed files with 43 additions and 10 deletions

View file

@ -31,8 +31,9 @@
#include <ctype.h>
namespace Cpp {
Preprocessor::Preprocessor(const StringView& program)
: m_program(program)
Preprocessor::Preprocessor(const String& filename, const StringView& program)
: m_filename(filename)
, m_program(program)
{
m_lines = m_program.split_view('\n', true);
}
@ -107,6 +108,7 @@ void Preprocessor::handle_preprocessor_line(const StringView& line)
consume_whitespace();
DefinedValue value;
value.filename = m_filename;
value.line = m_line_index;
auto string_value = lexer.consume_all();