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.
|
|
4 years ago | |
|---|---|---|
| .. | ||
| LICENSE.md | 4 years ago | |
| README.md | 4 years ago | |
| index.js | 4 years ago | |
| package.json | 4 years ago | |
README.md
glsl-token-inject-block
Injects a "block" of GLSL tokens into a shader, after any #version, #extension and precision statements. This will pad the new tokens with the necessary amount of newlines (but no more).
This module ignores token line, column and position.
Example
Your source:
var tokenizer = require('glsl-tokenizer')
var inject = require('glsl-token-inject-block')
var stringify = require('glsl-token-string')
var tokens = tokenizer(shaderInput)
var newToken = {
type: 'preprocessor',
data: '#define FOOBAR'
}
var source = stringify(inject(tokens, newToken))
console.log(source)
The following shader input:
// some comment
#version 300 es
#extension SOME_EXTENSION : enable
void main() {}
Results in the following injected define:
// some comment
#version 300 es
#extension SOME_EXTENSION : enable
#define FOOBAR
void main() {}
Usage
tokens = inject(tokens, newTokens)
For the given shader source (tokens), injects newTokens into them, assuming the new tokens are a "block" of code that should be placed on its own line.
newTokens can be a single token object, or an array of token objects.
Modifies tokens in place and returns it.
License
MIT, see LICENSE.md for details.
