mirror of
				https://github.com/flynx/Slang.git
				synced 2025-10-31 11:30:13 +00:00 
			
		
		
		
	tweaking...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									5252724ab2
								
							
						
					
					
						commit
						0da65957fd
					
				| @ -90,22 +90,23 @@ var SPLITTER = RegExp([ | |||||||
| 
 | 
 | ||||||
| // helpers...
 | // helpers...
 | ||||||
| // XXX should these skip quoted ends?
 | // XXX should these skip quoted ends?
 | ||||||
| var collectUntil = function(end){ | var collect = function(start, end){ | ||||||
| 	return function(context){ | 	return function(context){ | ||||||
| 		var res = ['--'] | 		var res = start ? [start] : [] | ||||||
| 		var code = context.code | 		var code = context.code | ||||||
| 		var cur = code.shift() | 		var cur = code.shift() | ||||||
| 		res.push(cur) | 		res.push(cur) | ||||||
| 		while(cur != end && code.length > 0){ | 		while(cur != end && code.length > 0){ | ||||||
| 			cur = code.splice(0, 1)[0] | 			cur = code.shift() | ||||||
| 			res.push(cur) | 			res.push(cur) | ||||||
| 		} | 		} | ||||||
| 		return res | 		return res | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
| var dropUntil = function(end){ | var drop = function(start, end){ | ||||||
| 	var collector = collectUntil(end) | 	var collector = collect(start, end) | ||||||
| 	return function(context){ collector(context) } | 	//return function(context){ collector(context) }
 | ||||||
|  | 	return function(context){ console.log('XXX', collector(context).join(' ')) } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @ -117,8 +118,8 @@ var PRE_NAMESPACE = { | |||||||
| 	// drop everything until '\n'
 | 	// drop everything until '\n'
 | ||||||
| 	//
 | 	//
 | ||||||
| 	// NOTE: this depends on explicit '\n' words...
 | 	// NOTE: this depends on explicit '\n' words...
 | ||||||
| 	'--': dropUntil('\n'), | 	//'--': drop('--', '\n'),
 | ||||||
| 	//'(': dropUntil(')'),
 | 	'(': drop('(', ')'), | ||||||
| 	 | 	 | ||||||
| 	// XXX use the real reader...
 | 	// XXX use the real reader...
 | ||||||
| 	// block...
 | 	// block...
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user