UNPKG

@thi.ng/shader-ast

Version:

DSL to define shader code in TypeScript and cross-compile to GLSL, JS and other targets

17 lines (16 loc) 269 B
import { assert } from "@thi.ng/errors/assert"; const assign = (l, r) => { assert( l.tag !== "swizzle" || l.val.tag === "sym", "can't assign to non-symbol swizzle" ); return { tag: "assign", type: l.type, l, r }; }; export { assign };