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()
|
importTree = mutableSetOf()
|
||||||
|
|
||||||
return source.split("\n").map { line ->
|
return source.split("\n").map { line ->
|
||||||
if (line.startsWith(PRAGMA_IDENTIFIER)) {
|
if (line.trimStart().startsWith(PRAGMA_IDENTIFIER)) {
|
||||||
Regex(IMPORT_PATT).find(line)?.let {
|
Regex(IMPORT_PATT).find(line)?.let {
|
||||||
if (it.groupValues.size > 1) {
|
if (it.groupValues.size > 1) {
|
||||||
val functionName = it.groupValues[1]
|
val functionName = it.groupValues[1]
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ object TestGlslify : Spek({
|
|||||||
|
|
||||||
describe("should download shader with just the module's name") {
|
describe("should download shader with just the module's name") {
|
||||||
val shader = """#version 330
|
val shader = """#version 330
|
||||||
#pragma glslify: luma = require(glsl-luma)
|
#pragma glslify: luma = require(glsl-luma)
|
||||||
"""
|
"""
|
||||||
val processed = preprocessGlslify(shader, glslifyPath = glslifyPath)
|
val processed = preprocessGlslify(shader, glslifyPath = glslifyPath)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user