{"name":"glsl-token-depth","version":"1.1.2","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":"^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":"c8b38fd924033076208fdb57dc34dc773be6a319","_id":"glsl-token-depth@1.1.2","_shasum":"23c5e30ee2bd255884b4a28bc850b8f791e95d84","_from":".","_npmVersion":"2.5.0","_nodeVersion":"0.10.36","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"substack","email":"mail@substack.net"}],"dist":{"shasum":"23c5e30ee2bd255884b4a28bc850b8f791e95d84","tarball":"http://registry-npm.ywwl.com/glsl-token-depth/download/glsl-token-depth-1.1.2.tgz","integrity":"sha512-eQnIBLc7vFf8axF9aoi/xW37LSWd2hCQr/3sZui8aBJnksq9C7zMeUYHVJWMhFzXrBU7fgIqni4EhXVW4/krpg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAWwaHg54f3dYSmTVU9mUNtR1zhQa6M8t6byRjzRK3jzAiA4n2EvwQ7iaov5fIKVVYb+gPi1dudZEpbT3P+Jjfj9ig=="}],"size":2201,"noattachment":false,"key":"/glsl-token-depth/-/glsl-token-depth-1.1.2.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":1426103753403,"_cnpm_publish_time":1426103753403,"dist-tags":{"latest":"1.1.2"}}