Merge pull request #45 from ricardomatias/glslify-fix
Ignore pragma indentation
This commit is contained in:
@@ -31,7 +31,7 @@ fun preprocessGlslify(source: String, glslifyPath: String = "src/main/resources/
|
||||
importTree = mutableSetOf()
|
||||
|
||||
return source.split("\n").map { line ->
|
||||
if (line.startsWith(PRAGMA_IDENTIFIER)) {
|
||||
if (line.trimStart().startsWith(PRAGMA_IDENTIFIER)) {
|
||||
Regex(IMPORT_PATT).find(line)?.let {
|
||||
if (it.groupValues.size > 1) {
|
||||
val functionName = it.groupValues[1]
|
||||
|
||||
@@ -20,7 +20,7 @@ object TestGlslify : Spek({
|
||||
|
||||
describe("should download shader with just the module's name") {
|
||||
val shader = """#version 330
|
||||
#pragma glslify: luma = require(glsl-luma)
|
||||
#pragma glslify: luma = require(glsl-luma)
|
||||
"""
|
||||
val processed = preprocessGlslify(shader, glslifyPath = glslifyPath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user