Ignore pragma indentation

This commit is contained in:
Ricardo Matias
2020-03-09 11:00:05 +01:00
parent f4f02ffdbe
commit 45a8dfc55d
2 changed files with 2 additions and 2 deletions

View File

@@ -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]

View File

@@ -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)