Skip to content

Instantly share code, notes, and snippets.

#![feature(test)]
extern crate crossbeam_epoch;
extern crate test;
#[cfg(test)]
mod bench {
use crossbeam_epoch::{Owned, Scope, pin};
use std::thread;
use test::{Bencher, black_box};
@Vtec234
Vtec234 / glsl_parser.cpp
Last active December 27, 2015 18:10
GLSL Parser
void DataParser::parseGLSL(std::vector<std::string> const& source, ShaderSource& parseTo) {
std::vector<size_t> preprocLines;
std::regex const map_rgx("\\s*#map\\s+\\w+(?=\\s*\\n)");
std::regex const unif_rgx("uniform\\s+\\w+\\s+\\w+(?=\\s*;)");
std::regex const block_rgx("uniform\\s+\\w+(?=\\s*(\\{|\\n))");
for (size_t i_line = 0; i_line < source.size() - 1; ++i_line) {
std::string line = source[i_line];
std::string lineBelow = source[i_line + 1];