summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibCpp/Lexer.cpp4
-rw-r--r--Userland/Libraries/LibCpp/Lexer.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibCpp/Lexer.cpp b/Userland/Libraries/LibCpp/Lexer.cpp
index d3703db829..56ab1afd6c 100644
--- a/Userland/Libraries/LibCpp/Lexer.cpp
+++ b/Userland/Libraries/LibCpp/Lexer.cpp
@@ -12,8 +12,10 @@
namespace Cpp {
-Lexer::Lexer(StringView const& input)
+Lexer::Lexer(StringView const& input, size_t start_line)
: m_input(input)
+ , m_previous_position { start_line, 0 }
+ , m_position { start_line, 0 }
{
}
diff --git a/Userland/Libraries/LibCpp/Lexer.h b/Userland/Libraries/LibCpp/Lexer.h
index 1f8c1d8a93..bbee2bbf9f 100644
--- a/Userland/Libraries/LibCpp/Lexer.h
+++ b/Userland/Libraries/LibCpp/Lexer.h
@@ -14,7 +14,7 @@ namespace Cpp {
class Lexer {
public:
- Lexer(StringView const&);
+ explicit Lexer(StringView const&, size_t start_line = 0);
Vector<Token> lex();