mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibCpp: Add lexer option to ignore whitespace tokens
This commit is contained in:
parent
06e47ce7aa
commit
c7d3a7789c
2 changed files with 8 additions and 0 deletions
|
@ -18,6 +18,8 @@ public:
|
|||
|
||||
Vector<Token> lex();
|
||||
|
||||
void set_ignore_whitespace(bool value) { m_options.ignore_whitespace = value; }
|
||||
|
||||
private:
|
||||
char peek(size_t offset = 0) const;
|
||||
char consume();
|
||||
|
@ -26,6 +28,10 @@ private:
|
|||
size_t m_index { 0 };
|
||||
Position m_previous_position { 0, 0 };
|
||||
Position m_position { 0, 0 };
|
||||
|
||||
struct Options {
|
||||
bool ignore_whitespace { false };
|
||||
} m_options;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue