mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-10-31 11:42:30 +00:00 
			
		
		
		
	fixed parsing of constant with comment between size and value
This commit is contained in:
		
							parent
							
								
									1c81ab49e7
								
							
						
					
					
						commit
						ee8ad72fd9
					
				
					 2 changed files with 14 additions and 0 deletions
				
			
		|  | @ -1140,6 +1140,13 @@ basic_expr: | ||||||
| 		delete $1; | 		delete $1; | ||||||
| 		delete $2; | 		delete $2; | ||||||
| 	} | | 	} | | ||||||
|  | 	TOK_CONST TOK_CONST { | ||||||
|  | 		$$ = const2ast(*$1 + *$2, case_type_stack.size() == 0 ? 0 : case_type_stack.back()); | ||||||
|  | 		if ($$ == NULL || (*$2)[0] != '\'') | ||||||
|  | 			log_error("Value conversion failed: `%s%s'\n", $1->c_str(), $2->c_str()); | ||||||
|  | 		delete $1; | ||||||
|  | 		delete $2; | ||||||
|  | 	} | | ||||||
| 	TOK_CONST { | 	TOK_CONST { | ||||||
| 		$$ = const2ast(*$1, case_type_stack.size() == 0 ? 0 : case_type_stack.back()); | 		$$ = const2ast(*$1, case_type_stack.size() == 0 ? 0 : case_type_stack.back()); | ||||||
| 		if ($$ == NULL) | 		if ($$ == NULL) | ||||||
|  |  | ||||||
|  | @ -235,3 +235,10 @@ always @* begin | ||||||
| end | end | ||||||
| 
 | 
 | ||||||
| endmodule | endmodule | ||||||
|  | 
 | ||||||
|  | `define SIZE 4 // comment supported in this part | ||||||
|  | module test ( din_a, dout_a ); | ||||||
|  | input [`SIZE-1:0] din_a; | ||||||
|  | output [`SIZE-1:0] dout_a; | ||||||
|  | assign dout_a = din_a | `SIZE'ha; | ||||||
|  | endmodule | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue