Skip to content

Commit 4a4007d

Browse files
committed
Add exponential form test
1 parent f9fef4f commit 4a4007d

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ GLSL.prototype.transforms = {
11251125

11261126
//if special format - parse it as int, else - return unchanged
11271127
var result = /^[0-9][xob]/.test(node.data) ? Number(node.data) : node.data
1128-
1128+
console.log(node, result)
11291129
//guess type - as far in js any number tends to be a float, give priority to it
11301130
//in order to avoid unnecessary types alignment
11311131
var type

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"dependencies": {
77
"array-flatten": "^2.0.0",
88
"glsl-parser": "^2.0.1",
9-
"glsl-tokenizer": "^2.1.4",
9+
"glsl-tokenizer": "^2.1.5",
1010
"inherits": "^2.0.1",
1111
"prepr": "^1.1.2",
1212
"xtend": "^4.0.1"

readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
_glsl-transpiler_ transforms [glsl](https://www.opengl.org/documentation/glsl/) source to optimized js code. It converts vectors and matrices to arrays, expands swizzles, applies expressions optimizations and provides stdlib for environment compatibility.
1+
# glsl-transpiler
2+
3+
Transforms [glsl](https://www.opengl.org/documentation/glsl/) source to optimized js code. It converts vectors and matrices to arrays, expands swizzles, applies expressions optimizations and provides stdlib for environment compatibility.
24

35
## Usage
46

test/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,14 @@ test('Episodes', function () {
317317
[a[2][2], a[2][3]] = [2.0, 2.0]
318318
`))
319319
})
320+
321+
test(`const float E = 2.7182817459106445e+0;`, function () {
322+
var compile = GLSL();
323+
324+
assert.equal(clean(compile(this.title)), clean(`
325+
var E = 2.7182817459106445e+0;
326+
`))
327+
})
320328
});
321329

322330

0 commit comments

Comments
 (0)