StackGenVis: Alignment of Data, Algorithms, and Models for Stacking Ensemble Learning Using Performance Metrics
				https://doi.org/10.1109/TVCG.2020.3030352
			
			
		
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							30 lines
						
					
					
						
							664 B
						
					
					
				
			
		
		
	
	
							30 lines
						
					
					
						
							664 B
						
					
					
				| module.exports = tokenScope
 | |
| 
 | |
| function tokenScope(tokens) {
 | |
|   var stack  = [0]
 | |
|   var inc    = stack[0]
 | |
|   var ldepth = 0
 | |
| 
 | |
|   if (!tokens || !tokens.length) return tokens
 | |
|   if (!('depth' in tokens[0])) {
 | |
|     throw new Error('glsl-token-scope: No scope depth defined on tokens! Use glsl-token-depth on these tokens first')
 | |
|   }
 | |
| 
 | |
|   for (var i = 0; i < tokens.length; i++) {
 | |
|     var token = tokens[i]
 | |
|     var depth = token.depth
 | |
| 
 | |
|     if (depth > ldepth) {
 | |
|       stack.push(++inc)
 | |
|     } else
 | |
|     if (depth < ldepth) {
 | |
|       stack.splice(-1, 1)
 | |
|     }
 | |
| 
 | |
|     token.scope = stack[stack.length - 1]
 | |
|     token.stack = stack.slice()
 | |
|     ldepth = token.depth
 | |
|   }
 | |
| 
 | |
|   return tokens
 | |
| }
 | |
| 
 |