glsl-token-defines

WebJar for glsl-token-defines

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

glsl-token-defines
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

glsl-token-defines
WebJar for glsl-token-defines
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/glslify/glsl-token-defines

Download glsl-token-defines

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/glsl-token-defines/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>glsl-token-defines</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/glsl-token-defines/
implementation 'org.webjars.npm:glsl-token-defines:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/glsl-token-defines/
implementation ("org.webjars.npm:glsl-token-defines:1.0.0")
'org.webjars.npm:glsl-token-defines:jar:1.0.0'
<dependency org="org.webjars.npm" name="glsl-token-defines" rev="1.0.0">
  <artifact name="glsl-token-defines" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='glsl-token-defines', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "glsl-token-defines" % "1.0.0"
[org.webjars.npm/glsl-token-defines "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : glsl-tokenizer jar [2.0.0,3)

Project Modules

There are no modules declared in this project.

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.

org.webjars.npm

Versions

Version
1.0.0