mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 14:32:46 +00:00 
			
		
		
		
	IPCCompiler: Nicer error message for invalid template spelling
This commit is contained in:
		
							parent
							
								
									d4b0e64825
								
							
						
					
					
						commit
						3be7d393b6
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		|  | @ -135,6 +135,11 @@ Vector<Endpoint> parse(ByteBuffer const& file_contents) | |||
|             // FIXME: This is not entirely correct. Types can have spaces, for example `HashMap<int, DeprecatedString>`.
 | ||||
|             //        Maybe we should use LibCpp::Parser for parsing types.
 | ||||
|             parameter.type = lexer.consume_until([](char ch) { return isspace(ch); }); | ||||
|             if (parameter.type.ends_with(',')) { | ||||
|                 warnln("Parameter type '{}' looks invalid!", parameter.type); | ||||
|                 warnln("Note that templates must not include spaces."); | ||||
|                 VERIFY_NOT_REACHED(); | ||||
|             } | ||||
|             VERIFY(!lexer.is_eof()); | ||||
|             consume_whitespace(); | ||||
|             parameter.name = lexer.consume_until([](char ch) { return isspace(ch) || ch == ',' || ch == ')'; }); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ben Wiederhake
						Ben Wiederhake