{"_id":"glsl-token-scope","_rev":"404063","name":"glsl-token-scope","description":"Infer the scope of each token in an array of GLSL tokens","dist-tags":{"latest":"1.1.2"},"maintainers":[{"name":"archmoj","email":"arch.mojtaba.samimi@gmail.com"},{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"erkaman","email":"arnebackeric@gmail.com"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikkoh","email":"me@mikkoh.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"rezaali","email":"syed.reza.ali@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"vorg","email":"marcin.ignac@gmail.com"},{"name":"wwwtyro","email":"wwwtyro@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"time":{"modified":"2021-08-04T04:42:37.000Z","created":"2014-12-14T21:29:03.519Z","1.1.2":"2015-12-07T12:09:24.773Z","1.1.1":"2015-03-06T23:42:39.876Z","1.1.0":"2015-01-04T22:34:39.164Z","1.0.1":"2014-12-14T21:47:45.088Z","1.0.0":"2014-12-14T21:29:03.519Z"},"users":{},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"repository":{"type":"git","url":"git://github.com/stackgl/glsl-token-scope.git"},"versions":{"1.1.2":{"name":"glsl-token-scope","version":"1.1.2","description":"Infer the scope of each token in an array of GLSL tokens","main":"index.js","license":"MIT","scripts":{"test":"node test | tap-spec","start":"node test/eyeball"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"dependencies":{},"devDependencies":{"chalk":"^0.5.1","glsl-token-depth":"^1.1.0","glsl-tokenizer":"^2.0.0","tap-spec":"^2.1.1","tape":"^3.0.3"},"repository":{"type":"git","url":"git://github.com/stackgl/glsl-token-scope.git"},"keywords":["ecosystem:stackgl","glsl","tokens","syntax"],"homepage":"https://github.com/stackgl/glsl-token-scope","bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"gitHead":"2e52bed634d3187cad03487da3dd5cd92ee3f2ab","_id":"glsl-token-scope@1.1.2","_shasum":"a1728e78df24444f9cb93fd18ef0f75503a643b1","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.2","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"dist":{"shasum":"a1728e78df24444f9cb93fd18ef0f75503a643b1","size":2193,"noattachment":false,"key":"/glsl-token-scope/-/glsl-token-scope-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/glsl-token-scope/download/glsl-token-scope-1.1.2.tgz"},"maintainers":[{"name":"archmoj","email":"arch.mojtaba.samimi@gmail.com"},{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"erkaman","email":"arnebackeric@gmail.com"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikkoh","email":"me@mikkoh.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"rezaali","email":"syed.reza.ali@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"vorg","email":"marcin.ignac@gmail.com"},{"name":"wwwtyro","email":"wwwtyro@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"directories":{},"publish_time":1449490164773,"_cnpm_publish_time":1449490164773,"_hasShrinkwrap":false},"1.1.1":{"name":"glsl-token-scope","version":"1.1.1","description":"Infer the scope of each token in an array of GLSL tokens","main":"index.js","license":"MIT","scripts":{"test":"node test | tap-spec","start":"node test/eyeball"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"dependencies":{},"devDependencies":{"chalk":"^0.5.1","glsl-token-depth":"^1.1.0","glsl-tokenizer":"^2.0.0","tap-spec":"^2.1.1","tape":"^3.0.3"},"repository":{"type":"git","url":"git://github.com/stackgl/glsl-token-scope.git"},"keywords":["ecosystem:stackgl","glsl","tokens","syntax"],"homepage":"https://github.com/stackgl/glsl-token-scope","bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"gitHead":"9bf176524d8f82b2d1a277a2c7a5b33a064516c9","_id":"glsl-token-scope@1.1.1","_shasum":"1a131f76d272fde4cd4bc53122976a4577d4fd77","_from":".","_npmVersion":"2.5.0","_nodeVersion":"0.10.36","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"archmoj","email":"arch.mojtaba.samimi@gmail.com"},{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"erkaman","email":"arnebackeric@gmail.com"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikkoh","email":"me@mikkoh.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"rezaali","email":"syed.reza.ali@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"vorg","email":"marcin.ignac@gmail.com"},{"name":"wwwtyro","email":"wwwtyro@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"dist":{"shasum":"1a131f76d272fde4cd4bc53122976a4577d4fd77","size":2189,"noattachment":false,"key":"/glsl-token-scope/-/glsl-token-scope-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/glsl-token-scope/download/glsl-token-scope-1.1.1.tgz"},"directories":{},"publish_time":1425685359876,"_cnpm_publish_time":1425685359876,"_hasShrinkwrap":false},"1.1.0":{"name":"glsl-token-scope","version":"1.1.0","description":"Infer the scope of each token in an array of GLSL tokens","main":"index.js","license":"MIT","scripts":{"test":"node test | tap-spec","start":"node test/eyeball"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"dependencies":{},"devDependencies":{"chalk":"^0.5.1","glsl-token-depth":"^1.1.0","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-scope.git"},"keywords":["ecosystem:stackgl","glsl","tokens","syntax"],"homepage":"https://github.com/stackgl/glsl-token-scope","bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"gitHead":"40091df9c58ac7a1337dbc328c26f6f24df37d81","_id":"glsl-token-scope@1.1.0","_shasum":"eb3329d42b801a99001b6bc36607a24c01db367b","_from":".","_npmVersion":"2.1.16","_nodeVersion":"0.10.28","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"archmoj","email":"arch.mojtaba.samimi@gmail.com"},{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"erkaman","email":"arnebackeric@gmail.com"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikkoh","email":"me@mikkoh.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"rezaali","email":"syed.reza.ali@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"vorg","email":"marcin.ignac@gmail.com"},{"name":"wwwtyro","email":"wwwtyro@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"dist":{"shasum":"eb3329d42b801a99001b6bc36607a24c01db367b","size":2190,"noattachment":false,"key":"/glsl-token-scope/-/glsl-token-scope-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/glsl-token-scope/download/glsl-token-scope-1.1.0.tgz"},"directories":{},"publish_time":1420410879164,"_cnpm_publish_time":1420410879164,"_hasShrinkwrap":false},"1.0.1":{"name":"glsl-token-scope","version":"1.0.1","description":"Infer the scope of each token in an array of GLSL tokens","main":"index.js","license":"MIT","scripts":{"test":"node test | tap-spec","start":"node test/eyeball"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"dependencies":{},"devDependencies":{"chalk":"^0.5.1","glsl-token-depth":"^1.0.0","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-scope.git"},"keywords":["ecosystem:stackgl","glsl","tokens","syntax"],"homepage":"https://github.com/stackgl/glsl-token-scope","bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"gitHead":"43455f279e2a481e8a1902c2207b6e5d9a8cb24e","_id":"glsl-token-scope@1.0.1","_shasum":"cb3eb54eacace953e4907017b7ad6a25896acb7d","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.10.28","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"archmoj","email":"arch.mojtaba.samimi@gmail.com"},{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"erkaman","email":"arnebackeric@gmail.com"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikkoh","email":"me@mikkoh.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"rezaali","email":"syed.reza.ali@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"vorg","email":"marcin.ignac@gmail.com"},{"name":"wwwtyro","email":"wwwtyro@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"dist":{"shasum":"cb3eb54eacace953e4907017b7ad6a25896acb7d","size":2184,"noattachment":false,"key":"/glsl-token-scope/-/glsl-token-scope-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/glsl-token-scope/download/glsl-token-scope-1.0.1.tgz"},"directories":{},"publish_time":1418593665088,"_cnpm_publish_time":1418593665088,"_hasShrinkwrap":false},"1.0.0":{"name":"glsl-token-scope","version":"1.0.0","description":"Infer the scope of each token in an array of GLSL tokens","main":"index.js","license":"MIT","scripts":{"test":"node test | tap-spec","start":"node test/eyeball"},"author":{"name":"Hugh Kennedy","email":"hughskennedy@gmail.com","url":"http://hughsk.io/"},"dependencies":{},"devDependencies":{"chalk":"^0.5.1","glsl-token-depth":"^1.0.0","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-scope.git"},"keywords":["ecosystem:stackgl","glsl","tokens","syntax"],"homepage":"https://github.com/stackgl/glsl-token-scope","bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"gitHead":"c2fab8cbce78fbbc7bcdf25ce73d6c0f7cf314a2","_id":"glsl-token-scope@1.0.0","_shasum":"5796b523ee085d105561712fb0e405737d8b7e65","_from":".","_npmVersion":"2.1.10","_nodeVersion":"0.10.28","_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"maintainers":[{"name":"archmoj","email":"arch.mojtaba.samimi@gmail.com"},{"name":"bpostlethwaite","email":"post.ben.here@gmail.com"},{"name":"dfcreative","email":"df.creative@gmail.com"},{"name":"dy","email":"155263213@qq.com"},{"name":"erkaman","email":"arnebackeric@gmail.com"},{"name":"gre","email":"renaudeau.gaetan@gmail.com"},{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikkoh","email":"me@mikkoh.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"rezaali","email":"syed.reza.ali@gmail.com"},{"name":"rreusser","email":"rsreusser@gmail.com"},{"name":"tatumcreative","email":"tatum.creative@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"vorg","email":"marcin.ignac@gmail.com"},{"name":"wwwtyro","email":"wwwtyro@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"dist":{"shasum":"5796b523ee085d105561712fb0e405737d8b7e65","size":2133,"noattachment":false,"key":"/glsl-token-scope/-/glsl-token-scope-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/glsl-token-scope/download/glsl-token-scope-1.0.0.tgz"},"directories":{},"publish_time":1418592543519,"_cnpm_publish_time":1418592543519,"_hasShrinkwrap":false}},"readme":"# glsl-token-scope\n\n[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)\n\nInfer the scope of each token in an array of GLSL tokens.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/glsl-token-scope.png)](https://nodei.co/npm/glsl-token-scope/)\n\n### `scope(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 `scope` and `stack` properties.\n\n`token.scope` is a unique number for the token's current scope.\n\n`token.stack` is an array containing the scopes available to the current token.\n\nNote that you must first determine the scope depth of each token using\n[`glsl-token-depth`](http://github.com/stackgl/glsl-token-depth)\n\n``` javascript\nvar tokenize = require('glsl-tokenizer/string')\nvar depth    = require('glsl-token-depth')\nvar scope    = require('glsl-token-scope')\nvar fs       = require('fs')\n\nvar src = fs.readFileSync('shader.frag', 'utf8')\nvar tokens = tokenize(src)\n\ndepth(tokens)\nscope(tokens)\n\ntokens[0].scope // 0\ntokens[1].scope // 0\ntokens[2].scope // 1\ntokens[3].scope // 1\ntokens[4].scope // 0\ntokens[5].scope // 2\n// ...\n\ntokens[0].stack // [0]\ntokens[1].stack // [0]\ntokens[2].stack // [0, 1]\ntokens[3].stack // [0, 1]\ntokens[4].stack // [0]\ntokens[5].stack // [0, 2]\n// ...\n```\n\n## See Also\n\n* [stackgl/glsl-tokenizer](http://github.com/stackgl/glsl-tokenizer)\n* [stackgl/glsl-token-depth](http://github.com/stackgl/glsl-token-depth)\n\n## License\n\nMIT. See [LICENSE.md](http://github.com/stackgl/glsl-token-scope/blob/master/LICENSE.md) for details.\n","_attachments":{},"homepage":"https://github.com/stackgl/glsl-token-scope","bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"license":"MIT"}