{"name":"glsl-token-depth","version":"1.1.1","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":"3874714a464608a30aec69672e58e00ff53a3745","_id":"glsl-token-depth@1.1.1","_shasum":"105b9b1ef8a016e5d2b43c1618c7bfb0179bedaa","_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":"105b9b1ef8a016e5d2b43c1618c7bfb0179bedaa","tarball":"http://registry-npm.ywwl.com/glsl-token-depth/download/glsl-token-depth-1.1.1.tgz","integrity":"sha512-TUBSafOYA5FGDejKuKt4+D/HKf7hYKecEKxaOyBAJIsGLj5L2Ke1UU1kupw+4qVE5ahFdPkiXJF95Mexog3L/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICGsmbNdqLqTE1K3AclbUoe7XbnkVD1jrLdn0sBBcMUbAiEAjoZaJHZKSpOvBGx8wWrEX3FbTHLd/vcUWq7m/XNXwkU="}],"size":2196,"noattachment":false,"key":"/glsl-token-depth/-/glsl-token-depth-1.1.1.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":1425685577352,"_cnpm_publish_time":1425685577352,"dist-tags":{"latest":"1.1.2"}}