glsl-token-assignments

2.0.2 • Public • Published

glsl-token-assignments

experimental

Take an array of GLSL tokens and determine which tokens are either assignments or variable declarations.

Usage

NPM

assignments(tokens)

Takes an array of GLSL tokens from glsl-tokenizer and sets the following boolean values for each ident token, i.e. any variable names:

token.assignment

If the value of the variable is being changed here.

token.declaration

If a new variable is being defined here for this scope.

token.structMember

If this token is specifying a new struct member, e.g.:

struct X {
  float member1;
  float member2;
};

The tokens array will be modified in-place.

License

MIT. See LICENSE.md for details.

Package Sidebar

Install

npm i glsl-token-assignments

Weekly Downloads

286,679

Version

2.0.2

License

MIT

Last publish

Collaborators

  • hughsk
  • mikolalysenko
  • mattdesl
  • chrisdickinson
  • yoshuawuyts
  • mikkoh
  • rezaali
  • tatumcreative
  • wwwtyro
  • thibauts
  • bpostlethwaite
  • dfcreative
  • erkaman
  • gre
  • rreusser
  • vorg
  • archmoj
  • dy