{"_id":"glsl-token-scope","_rev":"443957","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":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"chrisdickinson","email":"chris@neversaw.us"},{"name":"substack","email":"substack@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"time":{"modified":"2024-06-19T00:14:01.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","tarball":"http://registry-npm.ywwl.com/glsl-token-scope/download/glsl-token-scope-1.1.2.tgz","integrity":"sha512-YKyOMk1B/tz9BwYUdfDoHvMIYTGtVv2vbDSLh94PT4+f87z21FVdou1KNKgF+nECBTo0fJ20dpm0B1vZB1Q03A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWVVihhItOTVz86rlguaEIQLfOUm2mPNg98k4txrM+mAIgShs6I25a/B4mEF9NceBoK8HTZvhGRMZTzHO5cS/X2Ww="}],"size":2193,"noattachment":false,"key":"/glsl-token-scope/-/glsl-token-scope-1.1.2.tgz"},"maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"chrisdickinson","email":"chris@neversaw.us"},{"name":"substack","email":"substack@gmail.com"},{"name":"thibauts","email":"thibaut.seguy@gmail.com"},{"name":"yoshuawuyts","email":"i@yoshuawuyts.com"}],"directories":{},"publish_time":1449490164773,"_cnpm_publish_time":1449490164773},"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":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"chrisdickinson","email":"chris@neversaw.us"},{"name":"substack","email":"mail@substack.net"}],"dist":{"shasum":"1a131f76d272fde4cd4bc53122976a4577d4fd77","tarball":"http://registry-npm.ywwl.com/glsl-token-scope/download/glsl-token-scope-1.1.1.tgz","integrity":"sha512-YPgfp3AnIfNET08mNDa2LSGDDtkrii/wZk83vIVc90jD/zv8EnsUd6a+FVlFfJpsiAgjrBggQPVOoS7p6QmkZQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHAJkUM5FfJGDT0XGmHg3jH0Zqxj1XWIFh8uFqFbLQ/1AiEA1bvV68z7rbJmeJYvWVxqkIF4cNeK+WPIWkKWLZ6nhAw="}],"size":2189,"noattachment":false,"key":"/glsl-token-scope/-/glsl-token-scope-1.1.1.tgz"},"directories":{},"publish_time":1425685359876,"_cnpm_publish_time":1425685359876},"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":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"chrisdickinson","email":"chris@neversaw.us"}],"dist":{"shasum":"eb3329d42b801a99001b6bc36607a24c01db367b","tarball":"http://registry-npm.ywwl.com/glsl-token-scope/download/glsl-token-scope-1.1.0.tgz","integrity":"sha512-inX4C77aOMcWjik7hJ2RNwd7yCRsBTy4LJat26fPRIYKQKJnVHdMPPS8HMoOGvY5gKx5MRxvkUKO7EBba+5AaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDT9x24c2ZVRwn0YhnyZ2kmJLuQQ4/B/NI0ya8vTpX6OQIhAOkTyIu+MQyZ5xTpfw7pfeUub7t4kQsEEYUXrUO0aKkF"}],"size":2190,"noattachment":false,"key":"/glsl-token-scope/-/glsl-token-scope-1.1.0.tgz"},"directories":{},"publish_time":1420410879164,"_cnpm_publish_time":1420410879164},"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":"hughsk","email":"hughskennedy@gmail.com"},{"name":"mattdesl","email":"dave.des@gmail.com"},{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},{"name":"chrisdickinson","email":"chris@neversaw.us"}],"dist":{"shasum":"cb3eb54eacace953e4907017b7ad6a25896acb7d","tarball":"http://registry-npm.ywwl.com/glsl-token-scope/download/glsl-token-scope-1.0.1.tgz","integrity":"sha512-EerX/ajIT3BWoYu6TCuwF05ePizJWZmdpIfSM/uw/IMPz8yiVHOtWBG5Fgxuovh6MBzNqj19UkicA+Behxa/pQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE42320KM4bg/rVZelY9xQq45xwu+BiY3cxV43MzS93zAiEAoWR/jQpXPSMyNFv2WX2TwuIqHOGavkfW7lLLWXkcWkQ="}],"size":2184,"noattachment":false,"key":"/glsl-token-scope/-/glsl-token-scope-1.0.1.tgz"},"directories":{},"publish_time":1418593665088,"_cnpm_publish_time":1418593665088},"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":"hughsk","email":"hughskennedy@gmail.com"}],"dist":{"shasum":"5796b523ee085d105561712fb0e405737d8b7e65","tarball":"http://registry-npm.ywwl.com/glsl-token-scope/download/glsl-token-scope-1.0.0.tgz","integrity":"sha512-mDkJXJSbvD9JFPFHVgNbmWfTvDNg7aHZdrH2xMjcOmb7WsxJQ9peGrhRLn1ZNBZQ81oREFQWiiD/IJQaGt4L8Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTMDhpx6zadmXrrk2FPoF8Mrzccux6d52AxPQ/HuZ/ZQIhAPId9wvyY51rvOlNCSsqLdezz3YfTwB3r2yW9ZmQZPNk"}],"size":2133,"noattachment":false,"key":"/glsl-token-scope/-/glsl-token-scope-1.0.0.tgz"},"directories":{},"publish_time":1418592543519,"_cnpm_publish_time":1418592543519}},"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"}