Don't return negative numbers from the flex tokenizer
Fixes #1374. Closes #2129.
This commit is contained in:
		
							parent
							
								
									f3c85f9eb3
								
							
						
					
					
						commit
						1ad19232c4
					
				
					 2 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -209,7 +209,11 @@ or          { return OR_KW; }
 | 
				
			||||||
\#[^\r\n]*    /* single-line comments */
 | 
					\#[^\r\n]*    /* single-line comments */
 | 
				
			||||||
\/\*([^*]|\*+[^*/])*\*+\/  /* long comments */
 | 
					\/\*([^*]|\*+[^*/])*\*+\/  /* long comments */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{ANY}           return yytext[0];
 | 
					{ANY}       {
 | 
				
			||||||
 | 
					              /* Don't return a negative number, as this will cause
 | 
				
			||||||
 | 
					                 Bison to stop parsing without an error. */
 | 
				
			||||||
 | 
					              return (unsigned char) yytext[0];
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								tests/lang/parse-fail-uft8.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								tests/lang/parse-fail-uft8.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1 @@
 | 
				
			||||||
 | 
					123 é 4
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue