mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-15 14:02:20 +00:00
LibCpp: Support initializing the lexer with a "start line"
This commit is contained in:
parent
5fda8a6c36
commit
bf7262681e
Notes:
sideshowbarker
2024-07-18 07:18:19 +09:00
Author: https://github.com/itamar8910
Commit: bf7262681e
Pull-request: https://github.com/SerenityOS/serenity/pull/9230
Reviewed-by: https://github.com/alimpfard
2 changed files with 4 additions and 2 deletions
|
@ -12,8 +12,10 @@
|
||||||
|
|
||||||
namespace Cpp {
|
namespace Cpp {
|
||||||
|
|
||||||
Lexer::Lexer(StringView const& input)
|
Lexer::Lexer(StringView const& input, size_t start_line)
|
||||||
: m_input(input)
|
: m_input(input)
|
||||||
|
, m_previous_position { start_line, 0 }
|
||||||
|
, m_position { start_line, 0 }
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace Cpp {
|
||||||
|
|
||||||
class Lexer {
|
class Lexer {
|
||||||
public:
|
public:
|
||||||
Lexer(StringView const&);
|
explicit Lexer(StringView const&, size_t start_line = 0);
|
||||||
|
|
||||||
Vector<Token> lex();
|
Vector<Token> lex();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue