Fix preprocessor not processing ifdef

This commit is contained in:
Jonas Herzig
2018-03-15 22:17:51 +01:00
parent 221991bf2c
commit 31a9e4eaf6

View File

@@ -65,7 +65,10 @@ static def convertSource(Map<String, String> kws, Map<String, Integer> vars, Lis
}
}
} else if (trimmed.startsWith(kws.ifdef)) {
ifStack.push(null)
def result = vars.containsKey(trimmed.substring(kws.ifdef.length()))
ifStack.push(result)
indentStack.push(getIndent(line))
active &= result
} else if (trimmed.startsWith(kws.endif)) {
if (ifStack.isEmpty()) {
throw new ParserException("Unexpected endif in line $n of $fileName")