Open XDUqinian opened 11 months ago
#define CASE(ch, tok) \ case ch: formToken(token, BufferPtr + 1, tok); break CASE('+', Token::plus); CASE('-', Token::minus); CASE('*', Token::star); CASE('/', Token::slash); CASE('(', Token::Token::l_paren); CASE(')', Token::Token::r_paren); CASE(':', Token::Token::colon); CASE(',', Token::Token::comma); #undef CASE
This is the code in the Lexer::next function in the lexer.cpp in Chapter 03. I want to know why Token::Token::op is used, is the code repeated?
Lexer::next
lexer.cpp
Token::Token::op
This is the code in the
Lexer::next
function in thelexer.cpp
in Chapter 03. I want to know whyToken::Token::op
is used, is the code repeated?