Skip to content

Commit

Permalink
Fix logical-not typo, add relevant tokens to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
willheslam authored and dy committed Jul 9, 2024
1 parent a7e0185 commit 466c234
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/operators.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ function processOperation(left, right, operator) {
if (right == 0) opResult = left;
}
// !a, ~a
else if (operator == '~' || operator == '~') {
else if (operator == '!' || operator == '~') {
opResult = operator + right
}
else if (operator == '*') {
Expand Down
5 changes: 5 additions & 0 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ var source = `
xy.xy *= uv.yx;
gl_Position = vec4(position.yx / 2.0, 0, 1);
gl_FragColor[0] = gl_FragCoord[0] / gl_Position.length();
bool foo = true;
bool bar = !foo == false && ~foo || foo;
return;
}
Expand Down Expand Up @@ -67,6 +70,8 @@ var result = `
xy = new Float32Array([xy[0] * uv[1], xy[1] * uv[0]]);
(gl_Position[0] = position[1] / 2.0, gl_Position[1] = position[0] / 2.0, gl_Position[2] = 0, gl_Position[3] = 1, gl_Position);
gl_FragColor[0] = gl_FragCoord[0] / 4;
var foo = true;
var bar = (!foo == false) && (~foo || foo);
return;
};
Expand Down

0 comments on commit 466c234

Please sign in to comment.