mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-03 21:09:12 +00:00 
			
		
		
		
	Fixed comment parsing in Pass::call()
This commit is contained in:
		
							parent
							
								
									7d843adef9
								
							
						
					
					
						commit
						33e25394b4
					
				
					 1 changed files with 8 additions and 3 deletions
				
			
		| 
						 | 
					@ -150,7 +150,7 @@ void Pass::call(RTLIL::Design *design, std::string command)
 | 
				
			||||||
	std::string cmd_buf = command;
 | 
						std::string cmd_buf = command;
 | 
				
			||||||
	std::string tok = next_token(cmd_buf, " \t\r\n");
 | 
						std::string tok = next_token(cmd_buf, " \t\r\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (tok.empty() || tok[0] == '#')
 | 
						if (tok.empty())
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (tok[0] == '!') {
 | 
						if (tok[0] == '!') {
 | 
				
			||||||
| 
						 | 
					@ -166,8 +166,13 @@ void Pass::call(RTLIL::Design *design, std::string command)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	while (!tok.empty()) {
 | 
						while (!tok.empty()) {
 | 
				
			||||||
		if (tok == "#")
 | 
							if (tok == "#") {
 | 
				
			||||||
			break;
 | 
								int stop;
 | 
				
			||||||
 | 
								for (stop = 0; stop < GetSize(cmd_buf); stop++)
 | 
				
			||||||
 | 
									if (cmd_buf[stop] == '\r' || cmd_buf[stop] == '\n')
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
								cmd_buf = cmd_buf.substr(stop);
 | 
				
			||||||
 | 
							} else
 | 
				
			||||||
		if (tok.back() == ';') {
 | 
							if (tok.back() == ';') {
 | 
				
			||||||
			int num_semikolon = 0;
 | 
								int num_semikolon = 0;
 | 
				
			||||||
			while (!tok.empty() && tok.back() == ';')
 | 
								while (!tok.empty() && tok.back() == ';')
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue