mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:57:35 +00:00
LibCpp: Access Cpp::Token members via getter functions
This commit is contained in:
parent
d0b4f9cc0e
commit
5cd1c69b96
5 changed files with 56 additions and 53 deletions
|
@ -232,11 +232,7 @@ Vector<Token> Lexer::lex()
|
|||
Position token_start_position;
|
||||
|
||||
auto emit_token = [&](auto type) {
|
||||
Token token;
|
||||
token.m_type = type;
|
||||
token.m_start = m_position;
|
||||
token.m_end = m_position;
|
||||
tokens.append(token);
|
||||
tokens.empend(type, m_position, m_position);
|
||||
consume();
|
||||
};
|
||||
|
||||
|
@ -245,11 +241,7 @@ Vector<Token> Lexer::lex()
|
|||
token_start_position = m_position;
|
||||
};
|
||||
auto commit_token = [&](auto type) {
|
||||
Token token;
|
||||
token.m_type = type;
|
||||
token.m_start = token_start_position;
|
||||
token.m_end = m_previous_position;
|
||||
tokens.append(token);
|
||||
tokens.empend(type, token_start_position, m_previous_position);
|
||||
};
|
||||
|
||||
auto emit_token_equals = [&](auto type, auto equals_type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue