larry babby and threejs for glsl

This commit is contained in:
Sam
2024-06-24 21:24:00 +12:00
parent 87d5dc634d
commit 907ebae4c0
6474 changed files with 1279596 additions and 8 deletions

View File

@@ -0,0 +1,9 @@
node_modules
*.log
.DS_Store
bundle.js
test
test.js
demo
example
!.gitignore

View File

@@ -0,0 +1,12 @@
The MIT License (MIT)
=====================
Copyright (c) 2014 [stackgl](http://github.com/stackgl/) contributors
*stackgl contributors listed at <https://github.com/stackgl/contributing/blob/master/CONTRIBUTING.md#contributors>*
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,45 @@
# glsl-token-properties
[![experimental](http://badges.github.io/stability-badges/dist/experimental.svg)](http://github.com/badges/stability-badges)
Takes an array of GLSL tokens and determines whether or not they're a property
of another identifier.
## Usage
[![NPM](https://nodei.co/npm/glsl-token-properties.png)](https://nodei.co/npm/glsl-token-properties/)
### `properties(tokens)`
Takes an array of GLSL `tokens` from
[`glsl-tokenizer`](http://github.com/stackgl/glsl-tokenizer) and sets a
`property` boolean for whether or not the token is a property.
``` javascript
var tokenizer = require('glsl-tokenizer/string')
var properties = require('glsl-token-properties')
var src = 'some.value[2];'
var tokens = tokenizer(src)
// determine which tokens are properties
properties(tokens)
tokens[0].data // "some"
tokens[0].property // false
tokens[2].data // "value"
tokens[2].property // true
tokens[4].data // "2"
tokens[4].property // false
```
## See Also
* [glsl-tokenizer](http://github.com/stackgl/glsl-tokenizer)
* [glsl-token-scope](http://github.com/stackgl/glsl-token-scope)
* [glsl-token-depth](http://github.com/stackgl/glsl-token-depth)
* [glsl-token-assignments](http://github.com/stackgl/glsl-token-assignments)
## License
MIT. See [LICENSE.md](http://github.com/stackgl/glsl-token-properties/blob/master/LICENSE.md) for details.

View File

@@ -0,0 +1,20 @@
module.exports = properties
function properties(tokens) {
for (var i = 0; i < tokens.length; i++) {
var token = tokens[i]
token.property = false
if (token.type !== 'ident') continue
var j = i
while (tokens[--j] && tokens[j].type === 'whitespace');
if (!tokens[j]) continue
if (tokens[j].type !== 'operator') continue
if (tokens[j].data !== '.') continue
token.property = true
}
return tokens
}

View File

@@ -0,0 +1,37 @@
{
"name": "glsl-token-properties",
"version": "1.0.1",
"description": "Takes an array of GLSL tokens and determines whether or not they're a property of another identifier",
"main": "index.js",
"license": "MIT",
"scripts": {
"test": "npm run test:node && npm run test:browser",
"test:node": "node test | tap-spec",
"test:browser": "browserify test | tap-closer | smokestack | tap-spec"
},
"author": {
"name": "Hugh Kennedy",
"email": "hughskennedy@gmail.com",
"url": "http://hughsk.io/"
},
"dependencies": {},
"devDependencies": {
"browserify": "^8.0.3",
"glsl-tokenizer": "^2.0.0",
"smokestack": "^3.0.0",
"tap-closer": "^1.0.0",
"tap-spec": "^2.1.2",
"tape": "^3.0.3"
},
"repository": {
"type": "git",
"url": "git://github.com/stackgl/glsl-token-properties.git"
},
"keywords": [
"ecosystem:stackgl"
],
"homepage": "https://github.com/stackgl/glsl-token-properties",
"bugs": {
"url": "https://github.com/stackgl/glsl-token-properties/issues"
}
}