animate/webGl/my-threejs-test/node_modules/glsl-token-properties
Sam 907ebae4c0 larry babby and threejs for glsl 2024-06-24 21:24:00 +12:00
..
.npmignore larry babby and threejs for glsl 2024-06-24 21:24:00 +12:00
LICENSE.md larry babby and threejs for glsl 2024-06-24 21:24:00 +12:00
README.md larry babby and threejs for glsl 2024-06-24 21:24:00 +12:00
index.js larry babby and threejs for glsl 2024-06-24 21:24:00 +12:00
package.json larry babby and threejs for glsl 2024-06-24 21:24:00 +12:00

README.md

glsl-token-properties

experimental

Takes an array of GLSL tokens and determines whether or not they're a property of another identifier.

Usage

NPM

properties(tokens)

Takes an array of GLSL tokens from glsl-tokenizer and sets a property boolean for whether or not the token is a property.

var tokenizer  = require('glsl-tokenizer/string')
var properties = require('glsl-token-properties')

var src = 'some.value[2];'
var tokens = tokenizer(src)

// determine which tokens are properties
properties(tokens)

tokens[0].data     // "some"
tokens[0].property // false
tokens[2].data     // "value"
tokens[2].property // true
tokens[4].data     // "2"
tokens[4].property // false

See Also

License

MIT. See LICENSE.md for details.