shaderkit 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -894,7 +894,7 @@ function tokenize(code, index = 0) {
894
894
  tokens.push({ type: "float", value });
895
895
  else
896
896
  tokens.push({ type: "int", value });
897
- } else if (isAlpha(char)) {
897
+ } else if (isIdent(char)) {
898
898
  while (isIdent(code.charCodeAt(index)))
899
899
  value += code[index++];
900
900
  if (isBool(value))
package/dist/index.mjs CHANGED
@@ -892,7 +892,7 @@ function tokenize(code, index = 0) {
892
892
  tokens.push({ type: "float", value });
893
893
  else
894
894
  tokens.push({ type: "int", value });
895
- } else if (isAlpha(char)) {
895
+ } else if (isIdent(char)) {
896
896
  while (isIdent(code.charCodeAt(index)))
897
897
  value += code[index++];
898
898
  if (isBool(value))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shaderkit",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Tools and IntelliSense for GLSL and WGSL.",
5
5
  "keywords": [
6
6
  "shaders",
package/src/tokenizer.ts CHANGED
@@ -57,7 +57,7 @@ export function tokenize(code: string, index: number = 0): Token[] {
57
57
  while (isNumber(code.charCodeAt(index))) value += code[index++]
58
58
  if (isFloat(value)) tokens.push({ type: 'float', value })
59
59
  else tokens.push({ type: 'int', value })
60
- } else if (isAlpha(char)) {
60
+ } else if (isIdent(char)) {
61
61
  while (isIdent(code.charCodeAt(index))) value += code[index++]
62
62
  if (isBool(value)) tokens.push({ type: 'bool', value })
63
63
  else if (KEYWORDS.includes(isMacro(prev) ? String.fromCharCode(prev) + value : value))