mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:22:45 +00:00 
			
		
		
		
	CppLexer: Add token type for "*="
This commit is contained in:
		
							parent
							
								
									b09b8d99f2
								
							
						
					
					
						commit
						5a36d8acb8
					
				
					 2 changed files with 13 additions and 1 deletions
				
			
		|  | @ -243,6 +243,17 @@ Vector<CppToken> CppLexer::lex() | |||
|         tokens.append(token); | ||||
|     }; | ||||
| 
 | ||||
|     auto emit_token_equals = [&](auto type, auto equals_type) { | ||||
|         if (peek(1) == '=') { | ||||
|             begin_token(); | ||||
|             consume(); | ||||
|             consume(); | ||||
|             commit_token(equals_type); | ||||
|             return; | ||||
|         } | ||||
|         emit_token(type); | ||||
|     }; | ||||
| 
 | ||||
|     auto match_escape_sequence = [&]() -> size_t { | ||||
|         switch (peek(1)) { | ||||
|         case '\'': | ||||
|  | @ -336,7 +347,7 @@ Vector<CppToken> CppLexer::lex() | |||
|             continue; | ||||
|         } | ||||
|         if (ch == '*') { | ||||
|             emit_token(CppToken::Type::Asterisk); | ||||
|             emit_token_equals(CppToken::Type::Asterisk, CppToken::Type::AsteriskEquals); | ||||
|             continue; | ||||
|         } | ||||
|         if (ch == ';') { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nico Weber
						Nico Weber