{"_id":"glsl-token-scope","_rev":"28-db337bbf057497a37a0f9c2415cb10c5","name":"glsl-token-scope","dist-tags":{"latest":"1.1.2"},"versions":{"1.0.0":{"name":"glsl-token-scope","version":"1.0.0","keywords":["ecosystem:stackgl","glsl","tokens","syntax"],"author":{"url":"http://hughsk.io/","name":"Hugh Kennedy","email":"hughskennedy@gmail.com"},"license":"MIT","_id":"glsl-token-scope@1.0.0","maintainers":[{"name":"hughsk","email":"hughskennedy@gmail.com"}],"homepage":"https://github.com/stackgl/glsl-token-scope","bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"dist":{"shasum":"5796b523ee085d105561712fb0e405737d8b7e65","tarball":"https://registry.npmjs.org/glsl-token-scope/-/glsl-token-scope-1.0.0.tgz","integrity":"sha512-mDkJXJSbvD9JFPFHVgNbmWfTvDNg7aHZdrH2xMjcOmb7WsxJQ9peGrhRLn1ZNBZQ81oREFQWiiD/IJQaGt4L8Q==","signatures":[{"sig":"MEYCIQCTMDhpx6zadmXrrk2FPoF8Mrzccux6d52AxPQ/HuZ/ZQIhAPId9wvyY51rvOlNCSsqLdezz3YfTwB3r2yW9ZmQZPNk","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"5796b523ee085d105561712fb0e405737d8b7e65","gitHead":"c2fab8cbce78fbbc7bcdf25ce73d6c0f7cf314a2","scripts":{"test":"node test | tap-spec","start":"node test/eyeball"},"_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"repository":{"url":"git://github.com/stackgl/glsl-token-scope.git","type":"git"},"_npmVersion":"2.1.10","description":"Infer the scope of each token in an array of GLSL tokens","directories":{},"_nodeVersion":"0.10.28","dependencies":{},"devDependencies":{"tape":"^3.0.3","chalk":"^0.5.1","tap-spec":"^2.1.1","glsl-tokenizer":"git://github.com/stackgl/glsl-tokenizer#2.0.0","glsl-token-depth":"^1.0.0"}},"1.0.1":{"name":"glsl-token-scope","version":"1.0.1","keywords":["ecosystem:stackgl","glsl","tokens","syntax"],"author":{"url":"http://hughsk.io/","name":"Hugh Kennedy","email":"hughskennedy@gmail.com"},"license":"MIT","_id":"glsl-token-scope@1.0.1","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"}],"homepage":"https://github.com/stackgl/glsl-token-scope","bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"dist":{"shasum":"cb3eb54eacace953e4907017b7ad6a25896acb7d","tarball":"https://registry.npmjs.org/glsl-token-scope/-/glsl-token-scope-1.0.1.tgz","integrity":"sha512-EerX/ajIT3BWoYu6TCuwF05ePizJWZmdpIfSM/uw/IMPz8yiVHOtWBG5Fgxuovh6MBzNqj19UkicA+Behxa/pQ==","signatures":[{"sig":"MEUCIE42320KM4bg/rVZelY9xQq45xwu+BiY3cxV43MzS93zAiEAoWR/jQpXPSMyNFv2WX2TwuIqHOGavkfW7lLLWXkcWkQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"cb3eb54eacace953e4907017b7ad6a25896acb7d","gitHead":"43455f279e2a481e8a1902c2207b6e5d9a8cb24e","scripts":{"test":"node test | tap-spec","start":"node test/eyeball"},"_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"repository":{"url":"git://github.com/stackgl/glsl-token-scope.git","type":"git"},"_npmVersion":"2.1.10","description":"Infer the scope of each token in an array of GLSL tokens","directories":{},"_nodeVersion":"0.10.28","dependencies":{},"devDependencies":{"tape":"^3.0.3","chalk":"^0.5.1","tap-spec":"^2.1.1","glsl-tokenizer":"git://github.com/stackgl/glsl-tokenizer#2.0.0","glsl-token-depth":"^1.0.0"}},"1.1.0":{"name":"glsl-token-scope","version":"1.1.0","keywords":["ecosystem:stackgl","glsl","tokens","syntax"],"author":{"url":"http://hughsk.io/","name":"Hugh Kennedy","email":"hughskennedy@gmail.com"},"license":"MIT","_id":"glsl-token-scope@1.1.0","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"}],"homepage":"https://github.com/stackgl/glsl-token-scope","bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"dist":{"shasum":"eb3329d42b801a99001b6bc36607a24c01db367b","tarball":"https://registry.npmjs.org/glsl-token-scope/-/glsl-token-scope-1.1.0.tgz","integrity":"sha512-inX4C77aOMcWjik7hJ2RNwd7yCRsBTy4LJat26fPRIYKQKJnVHdMPPS8HMoOGvY5gKx5MRxvkUKO7EBba+5AaA==","signatures":[{"sig":"MEYCIQDT9x24c2ZVRwn0YhnyZ2kmJLuQQ4/B/NI0ya8vTpX6OQIhAOkTyIu+MQyZ5xTpfw7pfeUub7t4kQsEEYUXrUO0aKkF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"eb3329d42b801a99001b6bc36607a24c01db367b","gitHead":"40091df9c58ac7a1337dbc328c26f6f24df37d81","scripts":{"test":"node test | tap-spec","start":"node test/eyeball"},"_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"repository":{"url":"git://github.com/stackgl/glsl-token-scope.git","type":"git"},"_npmVersion":"2.1.16","description":"Infer the scope of each token in an array of GLSL tokens","directories":{},"_nodeVersion":"0.10.28","dependencies":{},"devDependencies":{"tape":"^3.0.3","chalk":"^0.5.1","tap-spec":"^2.1.1","glsl-tokenizer":"git://github.com/stackgl/glsl-tokenizer#2.0.0","glsl-token-depth":"^1.1.0"}},"1.1.1":{"name":"glsl-token-scope","version":"1.1.1","keywords":["ecosystem:stackgl","glsl","tokens","syntax"],"author":{"url":"http://hughsk.io/","name":"Hugh Kennedy","email":"hughskennedy@gmail.com"},"license":"MIT","_id":"glsl-token-scope@1.1.1","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"}],"homepage":"https://github.com/stackgl/glsl-token-scope","bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"dist":{"shasum":"1a131f76d272fde4cd4bc53122976a4577d4fd77","tarball":"https://registry.npmjs.org/glsl-token-scope/-/glsl-token-scope-1.1.1.tgz","integrity":"sha512-YPgfp3AnIfNET08mNDa2LSGDDtkrii/wZk83vIVc90jD/zv8EnsUd6a+FVlFfJpsiAgjrBggQPVOoS7p6QmkZQ==","signatures":[{"sig":"MEUCIHAJkUM5FfJGDT0XGmHg3jH0Zqxj1XWIFh8uFqFbLQ/1AiEA1bvV68z7rbJmeJYvWVxqkIF4cNeK+WPIWkKWLZ6nhAw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"1a131f76d272fde4cd4bc53122976a4577d4fd77","gitHead":"9bf176524d8f82b2d1a277a2c7a5b33a064516c9","scripts":{"test":"node test | tap-spec","start":"node test/eyeball"},"_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"repository":{"url":"git://github.com/stackgl/glsl-token-scope.git","type":"git"},"_npmVersion":"2.5.0","description":"Infer the scope of each token in an array of GLSL tokens","directories":{},"_nodeVersion":"0.10.36","dependencies":{},"devDependencies":{"tape":"^3.0.3","chalk":"^0.5.1","tap-spec":"^2.1.1","glsl-tokenizer":"^2.0.0","glsl-token-depth":"^1.1.0"}},"1.1.2":{"name":"glsl-token-scope","version":"1.1.2","keywords":["ecosystem:stackgl","glsl","tokens","syntax"],"author":{"url":"http://hughsk.io/","name":"Hugh Kennedy","email":"hughskennedy@gmail.com"},"license":"MIT","_id":"glsl-token-scope@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"}],"homepage":"https://github.com/stackgl/glsl-token-scope","bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"dist":{"shasum":"a1728e78df24444f9cb93fd18ef0f75503a643b1","tarball":"https://registry.npmjs.org/glsl-token-scope/-/glsl-token-scope-1.1.2.tgz","integrity":"sha512-YKyOMk1B/tz9BwYUdfDoHvMIYTGtVv2vbDSLh94PT4+f87z21FVdou1KNKgF+nECBTo0fJ20dpm0B1vZB1Q03A==","signatures":[{"sig":"MEUCIQDWVVihhItOTVz86rlguaEIQLfOUm2mPNg98k4txrM+mAIgShs6I25a/B4mEF9NceBoK8HTZvhGRMZTzHO5cS/X2Ww=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"a1728e78df24444f9cb93fd18ef0f75503a643b1","gitHead":"2e52bed634d3187cad03487da3dd5cd92ee3f2ab","scripts":{"test":"node test | tap-spec","start":"node test/eyeball"},"_npmUser":{"name":"hughsk","email":"hughskennedy@gmail.com"},"repository":{"url":"git://github.com/stackgl/glsl-token-scope.git","type":"git"},"_npmVersion":"2.14.7","description":"Infer the scope of each token in an array of GLSL tokens","directories":{},"_nodeVersion":"4.2.2","dependencies":{},"devDependencies":{"tape":"^3.0.3","chalk":"^0.5.1","tap-spec":"^2.1.1","glsl-tokenizer":"^2.0.0","glsl-token-depth":"^1.1.0"}}},"time":{"created":"2014-12-14T21:29:03.519Z","modified":"2024-12-29T00:47:21.427Z","1.0.0":"2014-12-14T21:29:03.519Z","1.0.1":"2014-12-14T21:47:45.088Z","1.1.0":"2015-01-04T22:34:39.164Z","1.1.1":"2015-03-06T23:42:39.876Z","1.1.2":"2015-12-07T12:09:24.773Z"},"bugs":{"url":"https://github.com/stackgl/glsl-token-scope/issues"},"author":{"url":"http://hughsk.io/","name":"Hugh Kennedy","email":"hughskennedy@gmail.com"},"license":"MIT","homepage":"https://github.com/stackgl/glsl-token-scope","keywords":["ecosystem:stackgl","glsl","tokens","syntax"],"repository":{"url":"git://github.com/stackgl/glsl-token-scope.git","type":"git"},"description":"Infer the scope of each token in an array of GLSL tokens","maintainers":[{"email":"hughskennedy@gmail.com","name":"hughsk"},{"email":"mikolalysenko@gmail.com","name":"mikolalysenko"},{"email":"dave.des@gmail.com","name":"mattdesl"},{"email":"chris@neversaw.us","name":"chrisdickinson"},{"email":"javascript@yosh.is","name":"yoshuawuyts"},{"email":"me@mikkoh.com","name":"mikkoh"},{"email":"tatum.creative@gmail.com","name":"tatumcreative"},{"email":"wwwtyro@gmail.com","name":"wwwtyro"},{"email":"thibaut.seguy@gmail.com","name":"thibauts"},{"email":"post.ben.here@gmail.com","name":"bpostlethwaite"},{"email":"df.creative@gmail.com","name":"dfcreative"},{"email":"arnebackeric@gmail.com","name":"erkaman"},{"email":"renaudeau.gaetan@gmail.com","name":"gre"},{"email":"rsreusser@gmail.com","name":"rreusser"},{"email":"marcin.ignac@gmail.com","name":"vorg"},{"email":"arch.mojtaba.samimi@gmail.com","name":"archmoj"}],"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","readmeFilename":"README.md"}