function findAll(re, string) {
      if (!re.global) throw "Can't findAll non-global regexp";
      var match, all = [];
      while (match = re.exec(string)) {
        all.push(match);
      };
      return all;
    }
Parse a snippet of GLSL code so it can be composed into a shader.

Must contain a single function with in/out parameters, returning void.