Socket
Socket
Sign inDemoInstall

glsl-token-defines

Package Overview
Dependencies
8
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

glsl-token-defines

Retrieve the values defined with preprocessor statements in a selection of GLSL tokens


Version published
Maintainers
1
Weekly downloads
276,624
increased by1.84%

Weekly downloads

Readme

Source

glsl-token-defines

experimental

Retrieve the values defined with preprocessor statements in a selection of GLSL tokens.

Doesn't handle full function-style macros for the time being. Patches welcome!

Usage

NPM

defs = defines(tokens)

Where tokens is an array of tokens produced by glsl-tokenizer.

Returns an dictionary object where keys are the name of the defined variable, and values are the values of the defined variable. If a variable is not assigned a value, this will be an empty string.

For example, the following:

#define PI 3.14
#define TAU (PI*2.)
#define VEC vec3(1.)
#define EMPTY

Would yield:

{
  PI: '3.14',
  TAU: '(PI*2.)',
  VEC: 'vec3(1.)',
  EMPTY: ''
}

Contributing

See stackgl/contributing for details.

License

MIT. See LICENSE.md for details.

Keywords

FAQs

Last updated on 11 Mar 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc