Merge pull request #102 from z7zmey/issue-101
fix constant string fail "{\"
			
			
This commit is contained in:
		
						commit
						7ad2a2c24f
					
				
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -120,9 +120,10 @@ func (lex *Lexer) Lex(lval Lval) int { | |||||||
|                 | "\n" @constant_string_new_line   -> double_qoute |                 | "\n" @constant_string_new_line   -> double_qoute | ||||||
|             ), |             ), | ||||||
|             double_qoute_nondollar: ( |             double_qoute_nondollar: ( | ||||||
|                 (any - [$"\r\n])                   -> double_qoute |                 (any - [\\$"\r\n])                 -> double_qoute | ||||||
|                 | "\r" @constant_string_new_line   -> double_qoute |                 | "\r" @constant_string_new_line   -> double_qoute | ||||||
|                 | "\n" @constant_string_new_line   -> double_qoute |                 | "\n" @constant_string_new_line   -> double_qoute | ||||||
|  |                 | "\\"                             -> double_qoute_any | ||||||
|                 | '"'                              -> final |                 | '"'                              -> final | ||||||
|             ), |             ), | ||||||
|             double_qoute_nonvarname: ( |             double_qoute_nonvarname: ( | ||||||
|  | |||||||
| @ -496,6 +496,7 @@ func TestConstantStrings(t *testing.T) { | |||||||
| 		"{" | 		"{" | ||||||
| 		"{a" | 		"{a" | ||||||
| 		"\{$" | 		"\{$" | ||||||
|  | 		"{\"" | ||||||
| 	` | 	` | ||||||
| 
 | 
 | ||||||
| 	expected := []string{ | 	expected := []string{ | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user