mirror of
				https://github.com/flynx/Course-JavaScript.git
				synced 2025-10-30 19:40:09 +00:00 
			
		
		
		
	block terminator not yet working...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									a34636cdd8
								
							
						
					
					
						commit
						c956cd231b
					
				| @ -106,19 +106,20 @@ var PRE_NAMESPACE = { | |||||||
| 	// XXX use the real reader...
 | 	// XXX use the real reader...
 | ||||||
| 	// block...
 | 	// block...
 | ||||||
| 	// syntax: [ ... ]
 | 	// syntax: [ ... ]
 | ||||||
| 	// NOTE: we can also terminate several blocks with a single ]]
 |  | ||||||
| 	'[': function(context){ | 	'[': function(context){ | ||||||
| 		var block = [] | 		var block = [] | ||||||
| 		var code = context.code | 		var code = context.code | ||||||
| 		var cur = code.splice(0, 1)[0] | 		var cur = code.splice(0, 1)[0] | ||||||
| 		while(cur != ']' && cur != ']]' && code.length > 0){ | 		//while(cur != ']' && cur != ']]' && code.length > 0){
 | ||||||
|  | 		while(cur != ']' && code.length > 0){ | ||||||
| 			if(cur == '['){ | 			if(cur == '['){ | ||||||
| 				cur = this['['](context) | 				cur = this['['](context) | ||||||
| 			} | 			} | ||||||
| 			block.push(cur) | 			block.push(cur) | ||||||
| 			cur = code.splice(0, 1)[0] | 			cur = code.splice(0, 1)[0] | ||||||
| 		} | 		} | ||||||
| 		if(code.length == 0 && cur != ']' && cur != ']]'){ | 		//if(code.length == 0 && cur != ']' && cur != ']]'){
 | ||||||
|  | 		if(code.length == 0 && cur != ']'){ | ||||||
| 			console.error('Did not find expected "]".') | 			console.error('Did not find expected "]".') | ||||||
| 		}  | 		}  | ||||||
| 		return block | 		return block | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user