{"name":"glsl-token-depth","version":"1.1.0","description":"Determine the scope depth of an array of GLSL tokens","main":"index.js","license":"MIT","scripts":{"test":"node test | tap-spec"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"dependencies":{},"devDependencies":{"chalk":"^0.5.1","glsl-tokenizer":"git://github.com/stackgl/glsl-tokenizer#2.0.0","tap-spec":"^2.1.1","tape":"^3.0.3"},"repository":{"type":"git","url":"git://github.com/stackgl/glsl-token-depth.git"},"keywords":["ecosystem:stackgl","tokens","glsl","syntax"],"homepage":"https://github.com/stackgl/glsl-token-depth","bugs":{"url":"https://github.com/stackgl/glsl-token-depth/issues"},"gitHead":"681b16c1fe0d651566442018960336c959d13295","_id":"glsl-token-depth@1.1.0","_shasum":"394b34862911d8224c31da320efefd03fb5d634c","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.10.28","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"dist":{"shasum":"394b34862911d8224c31da320efefd03fb5d634c","tarball":"http://registry-npm.ywwl.com/glsl-token-depth/download/glsl-token-depth-1.1.0.tgz","integrity":"sha512-TazQrfTQQkjTGuBv+JU8kJA0/7HOefAmhcZaYI1l6CEzm7UV+G0FfGooqv5XwE2S4CZKkwt0hNQ9YuN3a5mhkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIECJdZvZ4aIn5/pyxGxuYBUBmCQPfJ/gPqT9CT4igK81AiBSx5hT9lkhfMUE/O3P/cOMvnLvmMYSBEcj/PZ1RtxzxQ=="}],"size":2207,"noattachment":false,"key":"/glsl-token-depth/-/glsl-token-depth-1.1.0.tgz"},"directories":{},"readme":"# glsl-token-depth\n\n[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)\n\nDetermine the scope depth of an array of GLSL tokens.\n\nUseful for inferring the scope of variables in a GLSL shader without having\nto fully parse the source.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/glsl-token-depth.png)](https://nodei.co/npm/glsl-token-depth/)\n\n### `depth(tokens)`\n\nWhere `tokens` is an array of tokens returned from\n[`glsl-tokenizer`](http://github.com/stackgl/glsl-tokenizer). Each token will\nbe modified in-place, and given a `depth` property.\n\n``` javascript\nvar tokenize = require('glsl-tokenizer/string')\nvar depth    = require('glsl-token-depth')\nvar fs       = require('fs')\n\nvar src = fs.readFileSync('shader.frag', 'utf8')\nvar tokens = tokenize(src)\n\ndepth(tokens)\n\ntokens[0].depth // 0\ntokens[1].depth // 0\ntokens[2].depth // 0\ntokens[3].depth // 0\ntokens[4].depth // 1\n// ...\n```\n\n## See Also\n\n* [stackgl/glsl-tokenizer](http://github.com/stackgl/glsl-tokenizer)\n\n## License\n\nMIT. See [LICENSE.md](http://github.com/stackgl/glsl-token-depth/blob/master/LICENSE.md) for details.\n","publish_time":1420410791248,"_cnpm_publish_time":1420410791248,"dist-tags":{"latest":"1.1.2"}}