Skip to content

Commit 9e4c8e1

Browse files
committed
Update operators
1 parent c85adf5 commit 9e4c8e1

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

.vscode/settings.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
"editor.formatOnSave": true,
1414
"editor.formatOnPaste": true,
1515
"editor.formatOnSaveMode": "file",
16-
"mayank1513.trello-kanban.Workspace.filePath": ".tkb"
16+
"mayank1513.trello-kanban.Workspace.filePath": ".tkb",
17+
"[glsl]": {
18+
"editor.defaultFormatter": "raczzalan.webgl-glsl-editor"
19+
}
1720
}

lib/__tests__/shaders/render-vert.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ precision mediump float;
44
in vec2 p;
55

66
void main() {
7-
gl_PointSize = 1.0;
8-
gl_Position = vec4(p, 0.0, 1.0);
7+
gl_PointSize = 1.f;
8+
gl_Position = vec4(p, 0.f, 1.f);
99
}

lib/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ export const webglPlugin: () => Plugin = () => ({
1818
.replace(/\/\*.*\*\//gm, "")
1919
// remove line comments
2020
.replace(/\/\/.*/g, "")
21-
// remove white spaces around =
22-
.replace(/ [=+*-/] /g, m => m.trim())
21+
// remove white spaces around operators
22+
.replace(/ ([=+*-/%><&^|]|[=!><+*-/]=|&&|\|\||\^\^) /g, m => m.trim())
2323
.split("\n")
2424
.map(line => line.trim())
2525
.filter(Boolean);
26-
const contents = `export default \`${lines[0]}\n${lines.slice(1).join("")}\``;
27-
return { contents, loader: "ts" };
26+
const contents = `${lines[0]}\n${lines.slice(1).join("")}`;
27+
return { contents, loader: "text" };
2828
});
2929
},
3030
});

0 commit comments

Comments
 (0)