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.
44 lines
1.1 KiB
44 lines
1.1 KiB
# glsl-token-depth
|
|
|
|
[](http://github.com/badges/stability-badges)
|
|
|
|
Determine the scope depth of an array of GLSL tokens.
|
|
|
|
Useful for inferring the scope of variables in a GLSL shader without having
|
|
to fully parse the source.
|
|
|
|
## Usage
|
|
|
|
[](https://nodei.co/npm/glsl-token-depth/)
|
|
|
|
### `depth(tokens)`
|
|
|
|
Where `tokens` is an array of tokens returned from
|
|
[`glsl-tokenizer`](http://github.com/stackgl/glsl-tokenizer). Each token will
|
|
be modified in-place, and given a `depth` property.
|
|
|
|
``` javascript
|
|
var tokenize = require('glsl-tokenizer/string')
|
|
var depth = require('glsl-token-depth')
|
|
var fs = require('fs')
|
|
|
|
var src = fs.readFileSync('shader.frag', 'utf8')
|
|
var tokens = tokenize(src)
|
|
|
|
depth(tokens)
|
|
|
|
tokens[0].depth // 0
|
|
tokens[1].depth // 0
|
|
tokens[2].depth // 0
|
|
tokens[3].depth // 0
|
|
tokens[4].depth // 1
|
|
// ...
|
|
```
|
|
|
|
## See Also
|
|
|
|
* [stackgl/glsl-tokenizer](http://github.com/stackgl/glsl-tokenizer)
|
|
|
|
## License
|
|
|
|
MIT. See [LICENSE.md](http://github.com/stackgl/glsl-token-depth/blob/master/LICENSE.md) for details.
|
|
|