mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	const2ast: fix for consistency with previous diagnostics behavior
This commit is contained in:
		
							parent
							
								
									99ab73424d
								
							
						
					
					
						commit
						642e041f77
					
				
					 2 changed files with 2 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -44,21 +44,12 @@ YOSYS_NAMESPACE_BEGIN
 | 
			
		|||
using namespace AST;
 | 
			
		||||
using namespace VERILOG_FRONTEND;
 | 
			
		||||
 | 
			
		||||
std::string ConstParser::fmt_maybe_loc(std::string msg) {
 | 
			
		||||
	std::string s;
 | 
			
		||||
 | 
			
		||||
	s += stringf("%s:%d:", loc.begin.filename->c_str(), loc.begin.line);
 | 
			
		||||
 | 
			
		||||
	s += msg;
 | 
			
		||||
	return s;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ConstParser::log_maybe_loc_error(std::string msg) {
 | 
			
		||||
	log_error("%s", fmt_maybe_loc(msg).c_str());
 | 
			
		||||
	log_file_error(*loc.begin.filename, loc.begin.line, "%s", msg.c_str());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ConstParser::log_maybe_loc_warn(std::string msg) {
 | 
			
		||||
	log_warning("%s", fmt_maybe_loc(msg).c_str());
 | 
			
		||||
	log_file_warning(*loc.begin.filename, loc.begin.line, "%s", msg.c_str());
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// divide an arbitrary length decimal number by two and return the rest
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,7 +43,6 @@ namespace VERILOG_FRONTEND
 | 
			
		|||
	struct ConstParser {
 | 
			
		||||
		AST::AstSrcLocType loc;
 | 
			
		||||
	private:
 | 
			
		||||
		std::string fmt_maybe_loc(std::string msg);
 | 
			
		||||
		void log_maybe_loc_error(std::string msg);
 | 
			
		||||
		void log_maybe_loc_warn(std::string msg);
 | 
			
		||||
		// divide an arbitrary length decimal number by two and return the rest
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue