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.
 
 
 
 
StackGenVis/frontend/node_modules/glsl-inject-defines/string.js

30 lines
645 B

var tokenize = require('glsl-tokenizer')
var stringify = require('glsl-token-string')
var inject = require('glsl-token-inject-block')
module.exports = function glslInjectDefine (source, defines) {
if (!defines) {
return source
}
var keys = Object.keys(defines)
if (keys.length === 0) {
return source
}
var tokens = tokenize(source)
for (var i=keys.length-1; i>=0; i--) {
var key = keys[i]
var val = String(defines[key])
if (val) { // allow empty value
val = ' ' + val
}
inject(tokens, {
type: 'preprocessor',
data: '#define ' + key + val
})
}
return stringify(tokens)
}