mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:27:43 +00:00
LibCpp: Store filename in ASTNodes
As part of the position information, we now also store the filename the ASTNode belongs to.
This commit is contained in:
parent
c4139be461
commit
d3ff82ba80
5 changed files with 86 additions and 73 deletions
|
@ -38,9 +38,10 @@
|
|||
|
||||
namespace Cpp {
|
||||
|
||||
Parser::Parser(const StringView& program)
|
||||
Parser::Parser(const StringView& program, const String& filename)
|
||||
: m_program(program)
|
||||
, m_lines(m_program.split_view("\n", true))
|
||||
, m_filename(filename)
|
||||
{
|
||||
Lexer lexer(m_program);
|
||||
for (auto& token : lexer.lex()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue